Rename /datum/config_entry/var/value to config_entry_value (#34699)

This works around some vv-fu you can use to pass in a config_entry to a proc that reads the value var of some other datum. Byond is stupid enough to actually read it, so it must be uniquely named.
This commit is contained in:
Jordan Brown
2018-01-24 15:41:19 -06:00
committed by CitadelStationBot
parent 9652fc4127
commit 3b0a00d53c
8 changed files with 117 additions and 117 deletions
+18 -18
View File
@@ -6,7 +6,7 @@
/datum/config_entry
var/name //read-only, this is determined by the last portion of the derived entry type
var/value
var/config_entry_value
var/default //read-only, just set value directly
var/resident_file //the file which this was loaded from, if any
@@ -21,11 +21,11 @@
if(type == abstract_type)
CRASH("Abstract config entry [type] instatiated!")
name = lowertext(type2top(type))
if(islist(value))
var/list/L = value
if(islist(config_entry_value))
var/list/L = config_entry_value
default = L.Copy()
else
default = value
default = config_entry_value
/datum/config_entry/Destroy()
config.RemoveEntry(src)
@@ -80,7 +80,7 @@
temp = key_value
continue_check = temp
if(continue_check && ValidateListEntry(key_name, temp))
value[key_name] = temp
config_entry_value[key_name] = temp
return TRUE
return FALSE
@@ -88,7 +88,7 @@
return TRUE
/datum/config_entry/string
value = ""
config_entry_value = ""
abstract_type = /datum/config_entry/string
var/auto_trim = TRUE
@@ -98,11 +98,11 @@
/datum/config_entry/string/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
return FALSE
value = auto_trim ? trim(str_val) : str_val
config_entry_value = auto_trim ? trim(str_val) : str_val
return TRUE
/datum/config_entry/number
value = 0
config_entry_value = 0
abstract_type = /datum/config_entry/number
var/integer = TRUE
var/max_val = INFINITY
@@ -113,9 +113,9 @@
return FALSE
var/temp = text2num(trim(str_val))
if(!isnull(temp))
value = CLAMP(integer ? round(temp) : temp, min_val, max_val)
if(value != temp && !(datum_flags & DF_VAR_EDITED))
log_config("Changing [name] from [temp] to [value]!")
config_entry_value = CLAMP(integer ? round(temp) : temp, min_val, max_val)
if(config_entry_value != temp && !(datum_flags & DF_VAR_EDITED))
log_config("Changing [name] from [temp] to [config_entry_value]!")
return TRUE
return FALSE
@@ -124,18 +124,18 @@
return !(var_name in banned_edits) && ..()
/datum/config_entry/flag
value = FALSE
config_entry_value = FALSE
abstract_type = /datum/config_entry/flag
/datum/config_entry/flag/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
return FALSE
value = text2num(trim(str_val)) != 0
config_entry_value = text2num(trim(str_val)) != 0
return TRUE
/datum/config_entry/number_list
abstract_type = /datum/config_entry/number_list
value = list()
config_entry_value = list()
/datum/config_entry/number_list/ValidateAndSet(str_val)
if(!VASProcCallGuard(str_val))
@@ -150,12 +150,12 @@
new_list += temp
if(!new_list.len)
return FALSE
value = new_list
config_entry_value = new_list
return TRUE
/datum/config_entry/keyed_flag_list
abstract_type = /datum/config_entry/keyed_flag_list
value = list()
config_entry_value = list()
dupes_allowed = TRUE
/datum/config_entry/keyed_flag_list/ValidateAndSet(str_val)
@@ -165,7 +165,7 @@
/datum/config_entry/keyed_number_list
abstract_type = /datum/config_entry/keyed_number_list
value = list()
config_entry_value = list()
dupes_allowed = TRUE
var/splitter = " "
@@ -179,7 +179,7 @@
/datum/config_entry/keyed_string_list
abstract_type = /datum/config_entry/keyed_string_list
value = list()
config_entry_value = list()
dupes_allowed = TRUE
var/splitter = " "