ID:1483225
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
It will be nice to be able to set interface bars, buttons & inputs to set vars instead of calling verbs to set vars, like this:
mob/verb
Vol()//Bar as abjustable slider Command: Vol
src.vol = winget(src,"Vol","value")
Race(R as text)//Button set as Command: Race Human
set hidden = 1
src.race = R
Name(N as text)//Input set as Command: Name
src.name = N

Instead make it a build-in proc, like this:
setvar(Var,var)//Var = var to set, var = value for Var to be set to
if(exists(src.vars[Var])) src.vars[Var] = var//or how ever BYOND handles it
else world.log<<{"Undefined variable /mob/var/test"}

The Options tabs can look like this:




I think it'd be interesting to make "adjustable slider" bars pass their value to their command. I don't think there's a way to actually use adjustable slider bars without needing text2num(winget(src, bar, "value")) somewhere. Of course, this has nothing to do with the original request, but eh.
Bump
Wouldn't it be pretty easy to just pass the verb a reference of what you want to set?

SetValue "VarName" "ControlName" "ControlProperty"


mob/verb/SetValue(varname, ctlname, ctlproperty)
if(exists(src.vars[varname])) src.vars[varname] = winget(src,ctlname,ctlproperty)//or how ever BYOND handles it
else world.log<<{"Undefined variable /mob/var/[varname]"}


This would be more flexible, as you could have a button set a value from an input instead. Also, it should be secure against malicious users as you'll never allow them to pass the value in, you'll get it yourself.