Global variable wrappers (#25325)

* Add the system for managed global variables

* Travis ban old globals

* So you CAN inline proccall, that's neat

* Fix that

* master.dm

* Remove the hack procs

* Move InitGlobals to the proper spot

* configuration.dm

* Fix the missing pre-slash

* clockcult.dm

* This is probably for the best

* Doy

* Fix shit

* Rest of the DEFINES tree

* Fix

* Use global. for access

* Update find_references_in_globals

Always hated that proc

Whoever made it must've bee a r e a l idiot...

* __HELPERS tree

* Move global initialization to master.

Fix the declaration

* database.dm

* Dat newline

* I said DECLARATIVE order!

* Here's something you can chew on @Iamgoofball

* game_modes.dm

* Fix this

* genetics.dm

* flavor_misc.dm

* More stuff

* Do it mso's way. Keep the controllers as global

* Make master actually see it

* Fix

* Finish _globalvars/lists

* Finish the rest of the _globalvars tree

* This is weird

* Migrate the controllers

* SLOTH -> GLOB

* Lighting globals

* round_start_time -> ticker

* PAI card list -> pai SS

* record_id_num -> static

* Diseases list -> SSdisease

* More disease globals to the SS

* More disease stuff

* Emote list

* Better and better

* Bluh

* So much stuff

* Ahh

* Wires

* dview

* station_areas

* Teleportlocs

* blood_splatter_icons

* Stuff and such

* More stuff

* RAD IO

* More stuff and such

* Blob shit

* Changeling stuff

* Add "Balance" to changelogs

* Balance for changelog compiler + Auto Tagging

* Update the PR template

* hivemind_bank

* Bip

* sacrificed

* Good shit

* Better define

* More cult shit

* Devil shit

* Gang shit

* > borers

Fix shit

* Rename the define

* Nuke

* Objectives

* Sandbox

* Multiverse sword

* Announce systems

* Stuff and such

* TC con

* Airlock

* doppllllerrrrrr

* holopads

* Shut up byond you inconsistent fuck

* Sneaky fuck

* Burp

* Bip

* Fixnshit

* Port without regard

* askdlfjs;

* asdfjasoidojfi

* Protected globals and more

* SO MANY

* ajsimkvahsaoisd

* akfdsiaopwimfeoiwafaw

* gsdfigjosidjfgiosdg

* AHHHHHHHHHHHHHHHHHHHHHHH!!!!!

* facerolll

* ASDFASDFASDF

* Removes the unused parts of dmm_suite

* WIP

* Fix quote

* asdfjauwfnkjs

* afwlunhskjfda

* asfjlaiwuefhaf

* SO CLOSE

* wwwweeeeeewwwww

* agdgmoewranwg

* HOLY MOTHER OF FUCK AND THATS JUST HALF THE JOB?!?

* Fix syntax errors

* 100 errors

* Another 100

* So many...

* Ugh

* More shit

* kilme

* Stuuuuuufffff

* ajrgmrlshio;djfa;sdkl

* jkbhkhjbmjvjmh

* soi soi soi

* butt

* TODAY WE LEARNED THAT GLOBAL AND STATIC ARE THE EXACT SAME FUCKING THING

* lllllllllllllllllllllllllllllllllllllllllll

* afsdijfiawhnflnjhnwsdfs

* yugykihlugk,kj

* time to go

* STUFFF!!!

* AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!

* ngoaijdjlfkamsdlkf

* Break time

* aufjsdklfalsjfi

* CONTROL KAY AND PRAY

* IT COMPILEELEELELAKLJFKLDAFJLKFDJLADKJHFLJKAJGAHIEJALDFJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

* Goteem

* Fix testing mode

* This does not belong in this PR

* Convert it to a controller

* Eh, fuck this option

* Revert controllerization Ill do it some other time

* Fix

* Working controllerization

* FOR THE LOVE OF CHRIST PROTECT THE LOGS

* Protect admins and deadmins

* Use the inbuilt proc
This commit is contained in:
Cyberboss
2017-04-06 23:26:13 -06:00
committed by duncathan salt
parent e550f019b0
commit 9e1ef0ffe2
825 changed files with 5425 additions and 6057 deletions
+67 -68
View File
@@ -4,12 +4,12 @@
if(!check_rights(R_DEBUG))
return
if(Debug2)
Debug2 = 0
if(GLOB.Debug2)
GLOB.Debug2 = 0
message_admins("[key_name(src)] toggled debugging off.")
log_admin("[key_name(src)] toggled debugging off.")
else
Debug2 = 1
GLOB.Debug2 = 1
message_admins("[key_name(src)] toggled debugging on.")
log_admin("[key_name(src)] toggled debugging on.")
@@ -171,13 +171,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
var/t = ""
for(var/id in env_gases)
if(id in hardcoded_gases || env_gases[id][MOLES])
if(id in GLOB.hardcoded_gases || env_gases[id][MOLES])
t+= "[env_gases[id][GAS_META][META_GAS_NAME]] : [env_gases[id][MOLES]]\n"
to_chat(usr, t)
feedback_add_details("admin_verb","ASL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_robotize(mob/M in mob_list)
/client/proc/cmd_admin_robotize(mob/M in GLOB.mob_list)
set category = "Fun"
set name = "Make Robot"
@@ -193,7 +193,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
else
alert("Invalid mob")
/client/proc/cmd_admin_blobize(mob/M in mob_list)
/client/proc/cmd_admin_blobize(mob/M in GLOB.mob_list)
set category = "Fun"
set name = "Make Blob"
@@ -211,7 +211,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
alert("Invalid mob")
/client/proc/cmd_admin_animalize(mob/M in mob_list)
/client/proc/cmd_admin_animalize(mob/M in GLOB.mob_list)
set category = "Fun"
set name = "Make Simple Animal"
@@ -232,13 +232,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.Animalize()
/client/proc/makepAI(turf/T in mob_list)
/client/proc/makepAI(turf/T in GLOB.mob_list)
set category = "Fun"
set name = "Make pAI"
set desc = "Specify a location to spawn a pAI device, then specify a key to play that pAI"
var/list/available = list()
for(var/mob/C in mob_list)
for(var/mob/C in GLOB.mob_list)
if(C.key)
available.Add(C)
var/mob/choice = input("Choose a player to play the pAI", "Spawn pAI") in available
@@ -259,7 +259,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
SSpai.candidates.Remove(candidate)
feedback_add_details("admin_verb","MPAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_alienize(mob/M in mob_list)
/client/proc/cmd_admin_alienize(mob/M in GLOB.mob_list)
set category = "Fun"
set name = "Make Alien"
@@ -276,7 +276,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
else
alert("Invalid mob")
/client/proc/cmd_admin_slimeize(mob/M in mob_list)
/client/proc/cmd_admin_slimeize(mob/M in GLOB.mob_list)
set category = "Fun"
set name = "Make slime"
@@ -293,40 +293,39 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
else
alert("Invalid mob")
var/list/TYPES_SHORTCUTS = list(
/obj/effect/decal/cleanable = "CLEANABLE",
/obj/item/device/radio/headset = "HEADSET",
/obj/item/clothing/head/helmet/space = "SPESSHELMET",
/obj/item/weapon/book/manual = "MANUAL",
/obj/item/weapon/reagent_containers/food/drinks = "DRINK", //longest paths comes first
/obj/item/weapon/reagent_containers/food = "FOOD",
/obj/item/weapon/reagent_containers = "REAGENT_CONTAINERS",
/obj/item/weapon = "WEAPON",
/obj/machinery/atmospherics = "ATMOS_MECH",
/obj/machinery/portable_atmospherics = "PORT_ATMOS",
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack = "MECHA_MISSILE_RACK",
/obj/item/mecha_parts/mecha_equipment = "MECHA_EQUIP",
/obj/item/organ = "ORGAN",
/obj/item = "ITEM",
/obj/machinery = "MACHINERY",
/obj/effect = "EFFECT",
/obj = "O",
/datum = "D",
/turf/open = "OPEN",
/turf/closed = "CLOSED",
/turf = "T",
/mob/living/carbon = "CARBON",
/mob/living/simple_animal = "SIMPLE",
/mob/living = "LIVING",
/mob = "M"
)
/proc/make_types_fancy(var/list/types)
if (ispath(types))
types = list(types)
. = list()
for(var/type in types)
var/typename = "[type]"
var/static/list/TYPES_SHORTCUTS = list(
/obj/effect/decal/cleanable = "CLEANABLE",
/obj/item/device/radio/headset = "HEADSET",
/obj/item/clothing/head/helmet/space = "SPESSHELMET",
/obj/item/weapon/book/manual = "MANUAL",
/obj/item/weapon/reagent_containers/food/drinks = "DRINK", //longest paths comes first
/obj/item/weapon/reagent_containers/food = "FOOD",
/obj/item/weapon/reagent_containers = "REAGENT_CONTAINERS",
/obj/item/weapon = "WEAPON",
/obj/machinery/atmospherics = "ATMOS_MECH",
/obj/machinery/portable_atmospherics = "PORT_ATMOS",
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack = "MECHA_MISSILE_RACK",
/obj/item/mecha_parts/mecha_equipment = "MECHA_EQUIP",
/obj/item/organ = "ORGAN",
/obj/item = "ITEM",
/obj/machinery = "MACHINERY",
/obj/effect = "EFFECT",
/obj = "O",
/datum = "D",
/turf/open = "OPEN",
/turf/closed = "CLOSED",
/turf = "T",
/mob/living/carbon = "CARBON",
/mob/living/simple_animal = "SIMPLE",
/mob/living = "LIVING",
/mob = "M"
)
for (var/tn in TYPES_SHORTCUTS)
if (copytext(typename,1, length("[tn]/")+1)=="[tn]/" /*findtextEx(typename,"[tn]/",1,2)*/ )
typename = TYPES_SHORTCUTS[tn]+copytext(typename,length("[tn]/"))
@@ -388,7 +387,7 @@ var/list/TYPES_SHORTCUTS = list(
message_admins("[key_name_admin(src)] has remade the powernets. makepowernets() called.", 0)
feedback_add_details("admin_verb","MPWN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_grantfullaccess(mob/M in mob_list)
/client/proc/cmd_admin_grantfullaccess(mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Grant Full Access"
@@ -428,7 +427,7 @@ var/list/TYPES_SHORTCUTS = list(
log_admin("[key_name(src)] has granted [M.key] full access.")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] has granted [M.key] full access.</span>")
/client/proc/cmd_assume_direct_control(mob/M in mob_list)
/client/proc/cmd_assume_direct_control(mob/M in GLOB.mob_list)
set category = "Admin"
set name = "Assume direct control"
set desc = "Direct intervention"
@@ -464,37 +463,37 @@ var/list/TYPES_SHORTCUTS = list(
if(!(A.type in areas_all))
areas_all.Add(A.type)
for(var/obj/machinery/power/apc/APC in apcs_list)
for(var/obj/machinery/power/apc/APC in GLOB.apcs_list)
var/area/A = get_area(APC)
if(!(A.type in areas_with_APC))
areas_with_APC.Add(A.type)
for(var/obj/machinery/airalarm/AA in machines)
for(var/obj/machinery/airalarm/AA in GLOB.machines)
var/area/A = get_area(AA)
if(!(A.type in areas_with_air_alarm))
areas_with_air_alarm.Add(A.type)
for(var/obj/machinery/requests_console/RC in machines)
for(var/obj/machinery/requests_console/RC in GLOB.machines)
var/area/A = get_area(RC)
if(!(A.type in areas_with_RC))
areas_with_RC.Add(A.type)
for(var/obj/machinery/light/L in machines)
for(var/obj/machinery/light/L in GLOB.machines)
var/area/A = get_area(L)
if(!(A.type in areas_with_light))
areas_with_light.Add(A.type)
for(var/obj/machinery/light_switch/LS in machines)
for(var/obj/machinery/light_switch/LS in GLOB.machines)
var/area/A = get_area(LS)
if(!(A.type in areas_with_LS))
areas_with_LS.Add(A.type)
for(var/obj/item/device/radio/intercom/I in machines)
for(var/obj/item/device/radio/intercom/I in GLOB.machines)
var/area/A = get_area(I)
if(!(A.type in areas_with_intercom))
areas_with_intercom.Add(A.type)
for(var/obj/machinery/camera/C in machines)
for(var/obj/machinery/camera/C in GLOB.machines)
var/area/A = get_area(C)
if(!(A.type in areas_with_camera))
areas_with_camera.Add(A.type)
@@ -535,7 +534,7 @@ var/list/TYPES_SHORTCUTS = list(
for(var/areatype in areas_without_camera)
to_chat(world, "* [areatype]")
/client/proc/cmd_admin_dress(mob/living/carbon/human/M in mob_list)
/client/proc/cmd_admin_dress(mob/living/carbon/human/M in GLOB.mob_list)
set category = "Fun"
set name = "Select equipment"
if(!ishuman(M))
@@ -573,7 +572,7 @@ var/list/TYPES_SHORTCUTS = list(
var/datum/outfit/custom = null
if (dresscode == "Custom")
var/list/custom_names = list()
for(var/datum/outfit/D in custom_outfits)
for(var/datum/outfit/D in GLOB.custom_outfits)
custom_names[D.name] = D
var/selected_name = input("Select outfit", "Robust quick dress shop") as null|anything in custom_names
custom = custom_names[selected_name]
@@ -607,11 +606,11 @@ var/list/TYPES_SHORTCUTS = list(
if(alert("Are you sure? This will start up the engine. Should only be used during debug!",,"Yes","No") != "Yes")
return
for(var/obj/machinery/power/emitter/E in machines)
for(var/obj/machinery/power/emitter/E in GLOB.machines)
if(E.anchored)
E.active = 1
for(var/obj/machinery/field/generator/F in machines)
for(var/obj/machinery/field/generator/F in GLOB.machines)
if(F.active == 0)
F.active = 1
F.state = 2
@@ -622,7 +621,7 @@ var/list/TYPES_SHORTCUTS = list(
F.update_icon()
spawn(30)
for(var/obj/machinery/the_singularitygen/G in machines)
for(var/obj/machinery/the_singularitygen/G in GLOB.machines)
if(G.anchored)
var/obj/singularity/S = new /obj/singularity(get_turf(G), 50)
// qdel(G)
@@ -639,7 +638,7 @@ var/list/TYPES_SHORTCUTS = list(
//S.dissipate_track = 0
//S.dissipate_strength = 10
for(var/obj/machinery/power/rad_collector/Rad in machines)
for(var/obj/machinery/power/rad_collector/Rad in GLOB.machines)
if(Rad.anchored)
if(!Rad.loaded_tank)
var/obj/item/weapon/tank/internals/plasma/Plasma = new/obj/item/weapon/tank/internals/plasma(Rad)
@@ -652,7 +651,7 @@ var/list/TYPES_SHORTCUTS = list(
if(!Rad.active)
Rad.toggle_power()
for(var/obj/machinery/power/smes/SMES in machines)
for(var/obj/machinery/power/smes/SMES in GLOB.machines)
if(SMES.anchored)
SMES.input_attempt = 1
@@ -663,19 +662,19 @@ var/list/TYPES_SHORTCUTS = list(
switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients"))
if("Players")
to_chat(usr, jointext(player_list,","))
to_chat(usr, jointext(GLOB.player_list,","))
if("Admins")
to_chat(usr, jointext(admins,","))
to_chat(usr, jointext(GLOB.admins,","))
if("Mobs")
to_chat(usr, jointext(mob_list,","))
to_chat(usr, jointext(GLOB.mob_list,","))
if("Living Mobs")
to_chat(usr, jointext(living_mob_list,","))
to_chat(usr, jointext(GLOB.living_mob_list,","))
if("Dead Mobs")
to_chat(usr, jointext(dead_mob_list,","))
to_chat(usr, jointext(GLOB.dead_mob_list,","))
if("Clients")
to_chat(usr, jointext(clients,","))
to_chat(usr, jointext(GLOB.clients,","))
if("Joined Clients")
to_chat(usr, jointext(joined_player_list,","))
to_chat(usr, jointext(GLOB.joined_player_list,","))
/client/proc/cmd_display_del_log()
set category = "Debug"
@@ -703,7 +702,7 @@ var/list/TYPES_SHORTCUTS = list(
if(!holder)
return
debug_variables(huds[i])
debug_variables(GLOB.huds[i])
/client/proc/jump_to_ruin()
set category = "Debug"
@@ -712,7 +711,7 @@ var/list/TYPES_SHORTCUTS = list(
if(!holder)
return
var/list/names = list()
for(var/i in ruin_landmarks)
for(var/i in GLOB.ruin_landmarks)
var/obj/effect/landmark/ruin/ruin_landmark = i
var/datum/map_template/ruin/template = ruin_landmark.ruin_template
@@ -757,11 +756,11 @@ var/list/TYPES_SHORTCUTS = list(
if(!holder)
return
global.medals_enabled = !global.medals_enabled
GLOB.medals_enabled = !GLOB.medals_enabled
message_admins("<span class='adminnotice'>[key_name_admin(src)] [global.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.</span>")
message_admins("<span class='adminnotice'>[key_name_admin(src)] [GLOB.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.</span>")
feedback_add_details("admin_verb","TMH") // If...
log_admin("[key_name(src)] [global.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.")
log_admin("[key_name(src)] [GLOB.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.")
/client/proc/view_runtimes()
set category = "Debug"
@@ -771,7 +770,7 @@ var/list/TYPES_SHORTCUTS = list(
if(!holder)
return
error_cache.show_to(src)
GLOB.error_cache.show_to(src)
/client/proc/pump_random_event()
set category = "Debug"