mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-05 23:11:52 +00:00
* SDQL2 update * fix that verb * cl * fix that * toworld * this is pointless * update info * siiiiick.. * vv edit update * fix that * fix editing vars * fix VV * discord protection --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
58 lines
1.1 KiB
Plaintext
58 lines
1.1 KiB
Plaintext
/datum/feedback_variable
|
|
var/variable
|
|
var/value
|
|
var/details
|
|
|
|
GENERAL_PROTECT_DATUM(/datum/feedback_variable)
|
|
|
|
/datum/feedback_variable/New(var/param_variable,var/param_value = 0)
|
|
variable = param_variable
|
|
value = param_value
|
|
|
|
/datum/feedback_variable/proc/inc(var/num = 1)
|
|
if(isnum(value))
|
|
value += num
|
|
else
|
|
value = text2num(value)
|
|
if(isnum(value))
|
|
value += num
|
|
else
|
|
value = num
|
|
|
|
/datum/feedback_variable/proc/dec(var/num = 1)
|
|
if(isnum(value))
|
|
value -= num
|
|
else
|
|
value = text2num(value)
|
|
if(isnum(value))
|
|
value -= num
|
|
else
|
|
value = -num
|
|
|
|
/datum/feedback_variable/proc/set_value(var/num)
|
|
if(isnum(num))
|
|
value = num
|
|
|
|
/datum/feedback_variable/proc/get_value()
|
|
return value
|
|
|
|
/datum/feedback_variable/proc/get_variable()
|
|
return variable
|
|
|
|
/datum/feedback_variable/proc/set_details(var/text)
|
|
if(istext(text))
|
|
details = text
|
|
|
|
/datum/feedback_variable/proc/add_details(var/text)
|
|
if(istext(text))
|
|
if(!details)
|
|
details = text
|
|
else
|
|
details += " [text]"
|
|
|
|
/datum/feedback_variable/proc/get_details()
|
|
return details
|
|
|
|
/datum/feedback_variable/proc/get_parsed()
|
|
return list(variable,value,details)
|