dstmodders / mod-sdk

[In development] Mod SDK for the game Don't Starve Together.
https://docs.dstmodders.com/sdk/
MIT License
6 stars 1 forks source link

Add minimap icons support #1

Open victorpopkov opened 3 years ago

victorpopkov commented 3 years ago

Is your feature request related to a problem? Please describe.

I'm always frustrated when it comes to minimap icons. Need to reinvent the wheel every time I need those in my mods. Either use the solution provided by Klei, or add your map overlay. The first one is limited and needs some workarounds to make them work properly. The 2nd one needs more work, but you'll get more control. The more or less good solution would be to use both methods and have everything from both worlds.

It's better to have this kind of functionality bundled within SDK to reuse.

Describe the solution you'd like

Something like that:

local icon = SDK.MiniMap.AddIcon({
    id = "your_id",
    image = "wilson",
    is_over_fog_of_war = false,
    is_proxy = false,
    name = "wilson",
    position = Vector3(-183.70, 0.00, -206.50),
    title = "Indicator",
})

SDK.MiniMap.UpdateIcon(icon, { image = "wendy" }) -- by reference
SDK.MiniMap.UpdateIcon("your_id", { is_over_fog_of_war = true }) -- by ID

Describe alternatives you've considered

If applicable, add a clear and concise description of any alternative solutions or features you've considered.

Additional context

If applicable, add any other context or screenshots about the feature request here.