Zezombye / overpy

High-level language for the Overwatch Workshop with support for compilation and decompilation.
GNU General Public License v3.0
175 stars 24 forks source link

How to set min/max value for workshop settings? #199

Closed nathan130200 closed 3 years ago

nathan130200 commented 3 years ago

When i use createWorkshopSetting this allow only set default value, but has no Min/Max value for Integer/Float types. When i scroll a little bit, this happen: image

#!define getSetting(Name, Type, DefaultValue) createWorkshopSetting(Type, "Combat Hud", Name, DefaultValue)

rule "Global settings":
    combatHudTimeout = getSetting("Target lock timeout", float, 10)
    combatHudDelay = getSetting("Target lock delay", float, 1.25)

Also don't have specific functions to create that.

This give to me a big float range: Workshop Setting Real(Custom String("Combat Hud", Null, Null, Null), Custom String("Target lock delay", Null, Null, Null), 1.25, -999999999999, 999999999999)

Maybe is better separate functions, or create an optional param for int/float types when need min/max, and thrown error if bool is present and user try set min/max (because obviously have only true and false)

Zezombye commented 3 years ago

Right, this is in the wiki (https://github.com/Zezombye/overpy/wiki/Functions#workshop-settings) but I will put it in the argument description as it is more convenient.

As a general rule, you can decompile a function from overwatch, if you don't know how to represent a specific syntax :)

nathan130200 commented 3 years ago

Oh thank you, i've not see in Wiki. I only see in intellisense hover text. Also i forgot the decompile feature sorry 😂

Zezombye commented 3 years ago

Keeping open as I want to add this to the intellisense.

Zezombye commented 3 years ago

Done in 6.1.3, thanks for reporting!