mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-22 16:12:19 +00:00
* Replace SSingulo with SScalamity; processing cleanup
- SScalamity now handles blobs as well as singularity-types.
- Processing subtypes have been simplified to not require a stop_processing definition.
* this is probably important
* Remove cascade disabling SSgarbage
* Fixed a bug where dust() did not qdel the target mob
* Misc fixes
* Fix decals surviving break-to-plating
* Subsystem flag tweaks
* Apparently subsystems are new'd before config is.
* Fix paper icons
* Speculative fix for insane lag
* Better machinery stat
* Make organs not use SSoverlay
* Misc bugfixes & tweaks
* Nightmode fixes
* Changelog for SMC
* Port /tg/'s improved MC crash handling
* Add some more SS Recover() procs
* supply_controller -> SScargo
* More New() -> Initialize()
* pAI and robot construction overlays
* Fix cargo unit tests
* Merge the DMM Suite's atom/New() into atoms_init
* Lighting pre-baking
* Lighting initialization logging
* Fix some bad SS init orders
* Fix SSlighting logging; rename Processes to MC
* Speculative fix for insane GC lag
* Prebaked openturf/icon_smooth & fix lighting prebake
* SS init status; SSatoms LATEQDEL
* Fix bug with MC init stat panel
* Fix parallax
* Misc
* Ignore SS_NO_DISPLAY during init
* apparently this is important
* REEEEEE
* Image GC fixes; broadcaster radio-new sanity
* RCON Cleanup
* Move pAI recruiter into subsystem
* Move global solars list into sun subsystem
* Make chickens not use a global
* Demote SSdisposals to SS_BACKGROUND; garbage-debug cleanup
* Speed up space init a little
* Fix bad timer flags on floor drying
* Subsystem panic-restart verb for mins
* Explosion speedup
* Minor subsystem & MC logging tweaks
* SSopenturf improvements
* Make pipenet actually initialize (whoops)
* Minor tweaks
* Implement lighting rounding
* comments are hard okay
* Minor lattice tweaks
* Fix some timer issues & better closet init
* Timer sanity
* Request console tweaks + Storage init sanity
* Minor SSmachiner RCON improvements
* Further reduce world-start timer count
* Standardize subsystem logging
* Garbage hard delete profiling from /tg/
* Timer hang detection & recovery
* Log machines that sleep in process() and fuck up SSmachinery
* Fix an issue with external airlocks sleeping in process()
* Failsafe logging
* Minor tweaks
* Revert "Request console tweaks + Storage init sanity"
This reverts commit 98d3579e35.
* Re-implement RC changes
* Fix SQL FT saving
* Fix SSmachinery sleep in disposals
* Minor SS tweaks
* Paper fixes
* Blood drying fixes
* Merge gameticker and SSticker
* Minor global list init cleanup
* Lagcheck biogenerator & bags
* Tweak SScargo init order; RIG Initialize()
* Caching tweaks
* Remove rogue comma
* Initialize fixes
* Lighting destroy cleanup
* Fix emagging airlocks
* Initial SSicon implementation
* Tweaks & Fixes
* Fire + Air alarm queued icon updates
* Overlays + Queued icon cleanup
* Runtime & background fixes
* Kill some meaningless set statements
* Kill some image qdels
* Bump up lighting rounding val
* Fix adv. scanner destroy runtimes
* Remove unneeded icon update limiting
* Move icon smoothing into helpers
* Show a warning if DM 510 compiles without memory leak hack enabled
* Re-organize subsystems & MC defines a little
* Airlock SFX
* Log of Changes
* Make SSicon_update disable itself when not doing anything
* Fix respawn verb runtime when used early in server-init
* Add more information to MC's stat_entry()
* Replace direct refernces to gcDestroyed with QDEL* macros
* plant_controller -> SSplants
* More plant tweaks
* Add more humor to changelog
* Move parallax globals into SSparallax
* Lighting responsiveness tweaks
* Fix parallax init order & better MC init panel stat
* Make mobs GC
* More overlays + Remove intercom spawn()
* SSfast_process; make pinpointers not use spawn-recursion to process
Also made the SM Cascade beach process with SSprocessing instead of a spawn loop.
* Update changelog
* Mob GC tweaks
* Del() cleanup
* Fix insomniac ZAS connection edges
* Minor pAI cleanup
* Convert more things to SSoverlay; fix duplicated overlay in field gens
* SM Bluespace turf tweaks
* Update SSgarbage debug globals list
* Human-type qdel tweaks
* Subsystem suspension; stat_entry improvements
* SQL Statistics cleanup
* Fix runtimes with ambrosia
* More disable() -> suspend(); fix nightmode again
* Human qdel fix; minor tweaks
* Update turbolift to work with StonedMC
* Make lifts use timers instead of a subsystem
* Make SSassets start earlier
* Convert the radio controller into a subsystem
* Fix some missing CHECK_TICKs in asteroid generation
* MC stat tweaks; make shouldnt_see a typecache
* Kill some redundant debug-controller entries
* radio_controller -> SSradio
* Better SSgarbage hard-del logging from /tg/ upstream
* Logging tweaks + GELF
* Misc client caching improvements
* Slime SSoverlay
* Oven icon fixes
* Implant fixes
- Death implants will no longer spam Common on death of user.
- Death implants should handle a deleted user better.
* Holder tweaks + Welding tool Initialize()
* Fix some bad subsystem logging
* Fix suit cooling units spawning without cells
* Starlight tweaks
* Gibber infinite gib fix
* More SSoverlay stuff
* Make crates use CUT_OVERLAY_IN
* Make SSarrivals suspend instead of disable
* Make openturf use split/phased tick checks
* Speculative fix for unwet timer runtimes
* Blood overlay tweaks/fixes
* Update crusher to play nice with SMC + SSoverlay
* Openturf improvements and fixes
* Minor turbolift tweaks
* Lighting performance improvements + ChangeTurf tweaks
* this is probably important
* Fix wall weld noises on changeturf
* More ChangeTurf tweaks
* Explosion tweaks
* Pre-game lobby tweaks
* Openturf tweaks
* Prevent admins from starting the game before init finishes
* Fix Travis
* Kill an unused var
* Fix ChangeTurf runtimes on openturfs
* Fixes
* Browser datum fixes, asset caching
* Update changelog
* Changelog
* Lobby tweaks
* Ticker tweaks; kill ticker var
* Further lobby tweaks
* Cascade tweaks
* air_master -> SSair
* Reduce overhead from radio autosay
* alarm_manager -> SSalarm
* bomb_processor -> SSexplosives
* corp_regs -> SSlaw
* ZAS overlay fixes
* Small wall icon optimization
* Fix effects master
* Assembly tweaks
* Megavend fixes
* Shuttle fixes
* Camera alert performance improvements
* Fix some world.log spam from lighting overlays
* Fix some Initialize() procs
* Openspace responsiveness tweaks
* Make HE pipes animate through openturfs
* Kill a spawn
583 lines
17 KiB
Plaintext
583 lines
17 KiB
Plaintext
var/list/forbidden_varedit_object_types = list(
|
|
/datum/admins, //Admins editing their own admin-power object? Yup, sounds like a good idea.
|
|
/datum/controller/subsystem/statistics, //Prevents people messing with feedback gathering
|
|
/datum/feedback_variable, //Prevents people messing with feedback gathering
|
|
/datum/discord_bot //Nope.jpg. Stop it.
|
|
)
|
|
|
|
var/list/VVlocked = list("vars", "holder", "client", "virus", "viruses", "cuffed", "last_eaten", "unlock_content", "bound_x", "bound_y", "step_x", "step_y", "force_ending")
|
|
var/list/VVicon_edit_lock = list("icon", "icon_state", "overlays", "underlays")
|
|
var/list/VVckey_edit = list("key", "ckey")
|
|
|
|
/*
|
|
/client/proc/cmd_modify_object_variables(obj/O as obj|mob|turf|area in world) // Acceptable 'in world', as VV would be incredibly hampered otherwise
|
|
set category = "Debug"
|
|
set name = "Edit Variables"
|
|
set desc="(target) Edit a target item's variables"
|
|
src.modify_variables(O)
|
|
feedback_add_details("admin_verb","EDITV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
|
*/
|
|
|
|
/client/proc/mod_list_add_ass() //haha
|
|
|
|
var/class = "text"
|
|
if(src.holder && src.holder.marked_datum)
|
|
class = input("What kind of variable?","Variable Type") as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default","marked datum ([holder.marked_datum.type])")
|
|
else
|
|
class = input("What kind of variable?","Variable Type") as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default")
|
|
|
|
if(!class)
|
|
return
|
|
|
|
if(holder.marked_datum && class == "marked datum ([holder.marked_datum.type])")
|
|
class = "marked datum"
|
|
|
|
var/var_value = null
|
|
|
|
switch(class)
|
|
|
|
if("text")
|
|
var_value = input("Enter new text:","Text") as null|text
|
|
|
|
if("num")
|
|
var_value = input("Enter new number:","Num") as null|num
|
|
|
|
if("type")
|
|
var_value = input("Enter type:","Type") as null|anything in typesof(/obj,/mob,/area,/turf)
|
|
|
|
if("reference")
|
|
var_value = input("Select reference:","Reference") as null|mob|obj|turf|area in world
|
|
|
|
if("mob reference")
|
|
var_value = input("Select reference:","Reference") as null|mob in world
|
|
|
|
if("file")
|
|
var_value = input("Pick file:","File") as null|file
|
|
|
|
if("icon")
|
|
var_value = input("Pick icon:","Icon") as null|icon
|
|
|
|
if("marked datum")
|
|
var_value = holder.marked_datum
|
|
|
|
if(!var_value) return
|
|
|
|
return var_value
|
|
|
|
|
|
/client/proc/mod_list_add(var/list/L, atom/O, original_name, objectvar)
|
|
|
|
var/class = "text"
|
|
if(src.holder && src.holder.marked_datum)
|
|
class = input("What kind of variable?","Variable Type") as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default","marked datum ([holder.marked_datum.type])")
|
|
else
|
|
class = input("What kind of variable?","Variable Type") as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default")
|
|
|
|
if(!class)
|
|
return
|
|
|
|
if(holder.marked_datum && class == "marked datum ([holder.marked_datum.type])")
|
|
class = "marked datum"
|
|
|
|
var/var_value = null
|
|
|
|
switch(class)
|
|
|
|
if("text")
|
|
var_value = input("Enter new text:","Text") as text
|
|
|
|
if("num")
|
|
var_value = input("Enter new number:","Num") as num
|
|
|
|
if("type")
|
|
var_value = input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf)
|
|
|
|
if("reference")
|
|
var_value = input("Select reference:","Reference") as mob|obj|turf|area in world
|
|
|
|
if("mob reference")
|
|
var_value = input("Select reference:","Reference") as mob in world
|
|
|
|
if("file")
|
|
var_value = input("Pick file:","File") as file
|
|
|
|
if("icon")
|
|
var_value = input("Pick icon:","Icon") as icon
|
|
|
|
if("marked datum")
|
|
var_value = holder.marked_datum
|
|
|
|
if(!var_value) return
|
|
|
|
switch(alert("Would you like to associate a var with the list entry?",,"Yes","No"))
|
|
if("Yes")
|
|
L += var_value
|
|
L[var_value] = mod_list_add_ass() //haha
|
|
if("No")
|
|
L += var_value
|
|
world.log << "### ListVarEdit by [src]: [O.type] [objectvar]: ADDED=[var_value]"
|
|
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: ADDED=[var_value]",admin_key=key_name(src))
|
|
message_admins("[key_name_admin(src)] modified [original_name]'s [objectvar]: ADDED=[var_value]")
|
|
|
|
/client/proc/mod_list(var/list/L, atom/O, original_name, objectvar)
|
|
if(!check_rights(R_VAREDIT|R_DEV)) return
|
|
if(!istype(L,/list)) src << "Not a List."
|
|
|
|
if(L.len > 1000)
|
|
var/confirm = alert(src, "The list you're trying to edit is very long, continuing may crash the server.", "Warning", "Continue", "Abort")
|
|
if(confirm != "Continue")
|
|
return
|
|
|
|
var/assoc = 0
|
|
if(L.len > 0)
|
|
var/a = L[1]
|
|
if(istext(a) && L[a] != null)
|
|
assoc = 1 //This is pretty weak test but i can't think of anything else
|
|
usr << "List appears to be associative."
|
|
|
|
var/list/names = null
|
|
if(!assoc)
|
|
names = sortList(L)
|
|
|
|
var/variable
|
|
var/assoc_key
|
|
if(assoc)
|
|
variable = input("Which var?","Var") as null|anything in L + "(ADD VAR)"
|
|
else
|
|
variable = input("Which var?","Var") as null|anything in names + "(ADD VAR)"
|
|
|
|
if(variable == "(ADD VAR)")
|
|
mod_list_add(L, O, original_name, objectvar)
|
|
return
|
|
|
|
if(assoc)
|
|
assoc_key = variable
|
|
variable = L[assoc_key]
|
|
|
|
if(!assoc && !variable || assoc && !assoc_key)
|
|
return
|
|
|
|
var/default
|
|
|
|
var/dir
|
|
|
|
if(variable in VVlocked)
|
|
if(!check_rights(R_DEBUG|R_DEV)) return
|
|
if(variable in VVckey_edit)
|
|
if(!check_rights(R_SPAWN|R_DEBUG|R_DEV)) return
|
|
if(variable in VVicon_edit_lock)
|
|
if(!check_rights(R_FUN|R_DEBUG|R_DEV)) return
|
|
|
|
if(isnull(variable))
|
|
usr << "Unable to determine variable type."
|
|
|
|
else if(isnum(variable))
|
|
usr << "Variable appears to be <b>NUM</b>."
|
|
default = "num"
|
|
dir = 1
|
|
|
|
else if(istext(variable))
|
|
usr << "Variable appears to be <b>TEXT</b>."
|
|
default = "text"
|
|
|
|
else if(isloc(variable))
|
|
usr << "Variable appears to be <b>REFERENCE</b>."
|
|
default = "reference"
|
|
|
|
else if(isicon(variable))
|
|
usr << "Variable appears to be <b>ICON</b>."
|
|
variable = "\icon[variable]"
|
|
default = "icon"
|
|
|
|
else if(istype(variable,/atom) || istype(variable,/datum))
|
|
usr << "Variable appears to be <b>TYPE</b>."
|
|
default = "type"
|
|
|
|
else if(istype(variable,/list))
|
|
usr << "Variable appears to be <b>LIST</b>."
|
|
default = "list"
|
|
|
|
else if(istype(variable,/client))
|
|
usr << "Variable appears to be <b>CLIENT</b>."
|
|
default = "cancel"
|
|
|
|
else
|
|
usr << "Variable appears to be <b>FILE</b>."
|
|
default = "file"
|
|
|
|
usr << "Variable contains: [variable]"
|
|
if(dir)
|
|
switch(variable)
|
|
if(1)
|
|
dir = "NORTH"
|
|
if(2)
|
|
dir = "SOUTH"
|
|
if(4)
|
|
dir = "EAST"
|
|
if(8)
|
|
dir = "WEST"
|
|
if(5)
|
|
dir = "NORTHEAST"
|
|
if(6)
|
|
dir = "SOUTHEAST"
|
|
if(9)
|
|
dir = "NORTHWEST"
|
|
if(10)
|
|
dir = "SOUTHWEST"
|
|
else
|
|
dir = null
|
|
|
|
if(dir)
|
|
usr << "If a direction, direction is: [dir]"
|
|
|
|
var/class = "text"
|
|
if(src.holder && src.holder.marked_datum)
|
|
class = input("What kind of variable?","Variable Type",default) as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default","marked datum ([holder.marked_datum.type])", "DELETE FROM LIST")
|
|
else
|
|
class = input("What kind of variable?","Variable Type",default) as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default", "DELETE FROM LIST")
|
|
|
|
if(!class)
|
|
return
|
|
|
|
if(holder.marked_datum && class == "marked datum ([holder.marked_datum.type])")
|
|
class = "marked datum"
|
|
|
|
var/original_var
|
|
if(assoc)
|
|
original_var = L[assoc_key]
|
|
else
|
|
original_var = L[L.Find(variable)]
|
|
|
|
var/new_var
|
|
switch(class) //Spits a runtime error if you try to modify an entry in the contents list. Dunno how to fix it, yet.
|
|
|
|
if("list")
|
|
mod_list(variable, O, original_name, objectvar)
|
|
|
|
if("restore to default")
|
|
new_var = initial(variable)
|
|
if(assoc)
|
|
L[assoc_key] = new_var
|
|
else
|
|
L[L.Find(variable)] = new_var
|
|
|
|
if("edit referenced object")
|
|
modify_variables(variable)
|
|
|
|
if("DELETE FROM LIST")
|
|
world.log << "### ListVarEdit by [src]: [O.type] [objectvar]: REMOVED=[html_encode("[variable]")]"
|
|
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: REMOVED=[variable]",admin_key=key_name(src))
|
|
message_admins("[key_name_admin(src)] modified [original_name]'s [objectvar]: REMOVED=[variable]")
|
|
L -= variable
|
|
return
|
|
|
|
if("text")
|
|
new_var = input("Enter new text:","Text") as text
|
|
if(assoc)
|
|
L[assoc_key] = new_var
|
|
else
|
|
L[L.Find(variable)] = new_var
|
|
|
|
if("num")
|
|
new_var = input("Enter new number:","Num") as num
|
|
if(assoc)
|
|
L[assoc_key] = new_var
|
|
else
|
|
L[L.Find(variable)] = new_var
|
|
|
|
if("type")
|
|
new_var = input("Enter type:","Type") in typesof(/obj,/mob,/area,/turf)
|
|
if(assoc)
|
|
L[assoc_key] = new_var
|
|
else
|
|
L[L.Find(variable)] = new_var
|
|
|
|
if("reference")
|
|
new_var = input("Select reference:","Reference") as mob|obj|turf|area in world
|
|
if(assoc)
|
|
L[assoc_key] = new_var
|
|
else
|
|
L[L.Find(variable)] = new_var
|
|
|
|
if("mob reference")
|
|
new_var = input("Select reference:","Reference") as mob in world
|
|
if(assoc)
|
|
L[assoc_key] = new_var
|
|
else
|
|
L[L.Find(variable)] = new_var
|
|
|
|
if("file")
|
|
new_var = input("Pick file:","File") as file
|
|
if(assoc)
|
|
L[assoc_key] = new_var
|
|
else
|
|
L[L.Find(variable)] = new_var
|
|
|
|
if("icon")
|
|
new_var = input("Pick icon:","Icon") as icon
|
|
if(assoc)
|
|
L[assoc_key] = new_var
|
|
else
|
|
L[L.Find(variable)] = new_var
|
|
|
|
if("marked datum")
|
|
new_var = holder.marked_datum
|
|
if(assoc)
|
|
L[assoc_key] = new_var
|
|
else
|
|
L[L.Find(variable)] = new_var
|
|
|
|
world.log << "### ListVarEdit by [src]: [O.type] [objectvar]: [original_var]=[new_var]"
|
|
log_admin("[key_name(src)] modified [original_name]'s [objectvar]: [original_var]=[new_var]",admin_key=key_name(src))
|
|
message_admins("[key_name_admin(src)] modified [original_name]'s varlist [objectvar]: [original_var]=[new_var]")
|
|
|
|
/client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0)
|
|
if(!check_rights(R_VAREDIT|R_DEV)) return
|
|
|
|
for(var/p in forbidden_varedit_object_types)
|
|
if( istype(O,p) )
|
|
usr << "<span class='danger'>It is forbidden to edit this object's variables.</span>"
|
|
return
|
|
|
|
if(istype(O, /client) && (param_var_name == "ckey" || param_var_name == "key"))
|
|
usr << "<span class='danger'>You cannot edit ckeys on client objects.</span>"
|
|
return
|
|
|
|
var/class
|
|
var/variable
|
|
var/var_value
|
|
|
|
if(param_var_name)
|
|
if(!param_var_name in O.vars)
|
|
src << "A variable with this name ([param_var_name]) doesn't exist in this atom ([O])"
|
|
return
|
|
|
|
if(param_var_name in VVlocked)
|
|
if(!check_rights(R_DEBUG|R_DEV)) return
|
|
if(param_var_name in VVckey_edit)
|
|
if(!check_rights(R_SPAWN|R_DEBUG|R_DEV)) return
|
|
if(param_var_name in VVicon_edit_lock)
|
|
if(!check_rights(R_FUN|R_DEBUG|R_DEV)) return
|
|
|
|
variable = param_var_name
|
|
|
|
var_value = O.vars[variable]
|
|
|
|
if(autodetect_class)
|
|
if(isnull(var_value))
|
|
usr << "Unable to determine variable type."
|
|
class = null
|
|
autodetect_class = null
|
|
else if(isnum(var_value))
|
|
usr << "Variable appears to be <b>NUM</b>."
|
|
class = "num"
|
|
dir = 1
|
|
|
|
else if(istext(var_value))
|
|
usr << "Variable appears to be <b>TEXT</b>."
|
|
class = "text"
|
|
|
|
else if(isloc(var_value))
|
|
usr << "Variable appears to be <b>REFERENCE</b>."
|
|
class = "reference"
|
|
|
|
else if(isicon(var_value))
|
|
usr << "Variable appears to be <b>ICON</b>."
|
|
var_value = "\icon[var_value]"
|
|
class = "icon"
|
|
|
|
else if(istype(var_value,/atom) || istype(var_value,/datum))
|
|
usr << "Variable appears to be <b>TYPE</b>."
|
|
class = "type"
|
|
|
|
else if(istype(var_value,/list))
|
|
usr << "Variable appears to be <b>LIST</b>."
|
|
class = "list"
|
|
|
|
else if(istype(var_value,/client))
|
|
usr << "Variable appears to be <b>CLIENT</b>."
|
|
class = "cancel"
|
|
|
|
else
|
|
usr << "Variable appears to be <b>FILE</b>."
|
|
class = "file"
|
|
|
|
else
|
|
|
|
var/list/names = list()
|
|
for (var/V in O.vars)
|
|
names += V
|
|
|
|
names = sortList(names)
|
|
|
|
variable = input("Which var?","Var") as null|anything in names
|
|
if(!variable) return
|
|
var_value = O.vars[variable]
|
|
|
|
if(variable in VVlocked)
|
|
if(!check_rights(R_DEBUG|R_DEV)) return
|
|
if(variable in VVckey_edit)
|
|
if(!check_rights(R_SPAWN|R_DEBUG|R_DEV)) return
|
|
if(variable in VVicon_edit_lock)
|
|
if(!check_rights(R_FUN|R_DEBUG|R_DEV)) return
|
|
|
|
if(!autodetect_class)
|
|
|
|
var/dir
|
|
var/default
|
|
if(isnull(var_value))
|
|
usr << "Unable to determine variable type."
|
|
|
|
else if(isnum(var_value))
|
|
usr << "Variable appears to be <b>NUM</b>."
|
|
default = "num"
|
|
dir = 1
|
|
|
|
else if(istext(var_value))
|
|
usr << "Variable appears to be <b>TEXT</b>."
|
|
default = "text"
|
|
|
|
else if(isloc(var_value))
|
|
usr << "Variable appears to be <b>REFERENCE</b>."
|
|
default = "reference"
|
|
|
|
else if(isicon(var_value))
|
|
usr << "Variable appears to be <b>ICON</b>."
|
|
var_value = "\icon[var_value]"
|
|
default = "icon"
|
|
|
|
else if(istype(var_value,/atom) || istype(var_value,/datum))
|
|
usr << "Variable appears to be <b>TYPE</b>."
|
|
default = "type"
|
|
|
|
else if(istype(var_value,/list))
|
|
usr << "Variable appears to be <b>LIST</b>."
|
|
default = "list"
|
|
|
|
else if(istype(var_value,/client))
|
|
usr << "Variable appears to be <b>CLIENT</b>."
|
|
default = "cancel"
|
|
|
|
else
|
|
usr << "Variable appears to be <b>FILE</b>."
|
|
default = "file"
|
|
|
|
usr << "Variable contains: [var_value]"
|
|
if(dir)
|
|
switch(var_value)
|
|
if(1)
|
|
dir = "NORTH"
|
|
if(2)
|
|
dir = "SOUTH"
|
|
if(4)
|
|
dir = "EAST"
|
|
if(8)
|
|
dir = "WEST"
|
|
if(5)
|
|
dir = "NORTHEAST"
|
|
if(6)
|
|
dir = "SOUTHEAST"
|
|
if(9)
|
|
dir = "NORTHWEST"
|
|
if(10)
|
|
dir = "SOUTHWEST"
|
|
else
|
|
dir = null
|
|
if(dir)
|
|
usr << "If a direction, direction is: [dir]"
|
|
|
|
if(src.holder && src.holder.marked_datum)
|
|
class = input("What kind of variable?","Variable Type",default) as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default","marked datum ([holder.marked_datum.type])")
|
|
else
|
|
class = input("What kind of variable?","Variable Type",default) as null|anything in list("text",
|
|
"num","type","reference","mob reference", "icon","file","list","edit referenced object","restore to default")
|
|
|
|
if(!class)
|
|
return
|
|
|
|
var/original_name
|
|
|
|
if (!istype(O, /atom))
|
|
original_name = "\ref[O] ([O])"
|
|
else
|
|
original_name = O:name
|
|
|
|
if(holder.marked_datum && class == "marked datum ([holder.marked_datum.type])")
|
|
class = "marked datum"
|
|
|
|
switch(class)
|
|
|
|
if("list")
|
|
mod_list(O.vars[variable], O, original_name, variable)
|
|
return
|
|
|
|
if("restore to default")
|
|
O.vars[variable] = initial(O.vars[variable])
|
|
|
|
if("edit referenced object")
|
|
return .(O.vars[variable])
|
|
|
|
if("text")
|
|
var/var_new = input("Enter new text:","Text",O.vars[variable]) as null|text
|
|
if(var_new==null) return
|
|
O.vars[variable] = var_new
|
|
|
|
if("num")
|
|
if(variable=="light_range")
|
|
var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num
|
|
if(var_new == null) return
|
|
O.set_light(var_new)
|
|
else if(variable=="stat")
|
|
var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num
|
|
if(var_new == null) return
|
|
if((O.vars[variable] == 2) && (var_new < 2))//Bringing the dead back to life
|
|
dead_mob_list -= O
|
|
living_mob_list += O
|
|
if((O.vars[variable] < 2) && (var_new == 2))//Kill he
|
|
living_mob_list -= O
|
|
dead_mob_list += O
|
|
O.vars[variable] = var_new
|
|
else
|
|
var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num
|
|
if(var_new==null) return
|
|
O.vars[variable] = var_new
|
|
|
|
if("type")
|
|
var/var_new = input("Enter type:","Type",O.vars[variable]) as null|anything in typesof(/obj,/mob,/area,/turf)
|
|
if(var_new==null) return
|
|
O.vars[variable] = var_new
|
|
|
|
if("reference")
|
|
var/var_new = input("Select reference:","Reference",O.vars[variable]) as null|mob|obj|turf|area in world
|
|
if(var_new==null) return
|
|
O.vars[variable] = var_new
|
|
|
|
if("mob reference")
|
|
var/var_new = input("Select reference:","Reference",O.vars[variable]) as null|mob in world
|
|
if(var_new==null) return
|
|
O.vars[variable] = var_new
|
|
|
|
if("file")
|
|
var/var_new = input("Pick file:","File",O.vars[variable]) as null|file
|
|
if(var_new==null) return
|
|
O.vars[variable] = var_new
|
|
|
|
if("icon")
|
|
var/var_new = input("Pick icon:","Icon",O.vars[variable]) as null|icon
|
|
if(var_new==null) return
|
|
O.vars[variable] = var_new
|
|
|
|
if("marked datum")
|
|
O.vars[variable] = holder.marked_datum
|
|
|
|
world.log << "### VarEdit by [src]: [O.type] [variable]=[html_encode("[O.vars[variable]]")]"
|
|
log_admin("[key_name(src)] modified [original_name]'s [variable] to [O.vars[variable]]",admin_key=key_name(src))
|
|
message_admins("[key_name_admin(src)] modified [original_name]'s [variable] to [O.vars[variable]]")
|