Skip to content

Refactor: Add convars for defining markers#1892

Merged
thelindat merged 12 commits into
overextended:mainfrom
Maximus7474:add-convars-for-defining-markers
Mar 8, 2025
Merged

Refactor: Add convars for defining markers#1892
thelindat merged 12 commits into
overextended:mainfrom
Maximus7474:add-convars-for-defining-markers

Conversation

@Maximus7474

Copy link
Copy Markdown
Member

Implemented custom marker definitions for evidence/stash, drops, shops and crafting that are modifiable using convars.
Not convinced on the convar structure, will definetly be screwed up by people not knowing json string syntaxing.

Open for changes, improvements, don't mind if it doesn't get merged with V3 in the works.

Added Convars:

setr inventory:dropmarker {
    "type": 2,
    "colour": [150, 30, 30],
    "scale": [0.3, 0.2, 0.15]
}

setr inventory:shopmarker {
      "type": 29,
      "colour": [30, 150, 30],
      "scale": [0.5, 0.5, 0.5]
}

setr inventory:evidencemarker {
      "type": 2,
      "colour": [30, 30, 150],
      "scale": [0.3, 0.2, 0.15]
}

setr inventory:craftingmarker {
      "type": 2,
      "colour": [150, 150, 30],
      "scale": [0.3, 0.2, 0.15]
}

Same structure for all

@Maximus7474

Copy link
Copy Markdown
Member Author

If approved will add it to the documentation

@thelindat

Copy link
Copy Markdown
Member

I don't want more convars for people to fuck up the contents of. If you setup error handling for the json convars and ensure they fallback to working defaults (rather than setting the default convar value) then I can merge it.

@Maximus7474

Copy link
Copy Markdown
Member Author

Sure, Will do when able.

@Maximus7474

Copy link
Copy Markdown
Member Author

Would this approach satisfy ?

    client.shopmarker = json.decode(GetConvar('inventory:shopmarker', [[
        {
            "type": 29,
            "colour": [30, 150, 30],
            "scale": [0.5, 0.5, 0.5]
        }
    ]])) or fallbackmarker

With fallbackmarker being a basic lua table with the defintions.

@Maximus7474

Copy link
Copy Markdown
Member Author

It takes up a bit of space, but for those who don't want to customize it still gives different markers for each shop/stash/drop/crafting table

image

@thelindat thelindat merged commit b083800 into overextended:main Mar 8, 2025
@Maximus7474 Maximus7474 deleted the add-convars-for-defining-markers branch March 8, 2025 11:43
@Maximus7474

Copy link
Copy Markdown
Member Author

Will open a PR on docs to add them in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants