diff --git a/code/game/machinery/scan_gate.dm b/code/game/machinery/scan_gate.dm
index 0ed85b1a3673..fcae3dee926f 100644
--- a/code/game/machinery/scan_gate.dm
+++ b/code/game/machinery/scan_gate.dm
@@ -7,6 +7,17 @@
#define SCANGATE_SPECIES "Species"
#define SCANGATE_NUTRITION "Nutrition"
+#define SCANGATE_HUMAN "human"
+#define SCANGATE_LIZARD "lizard"
+#define SCANGATE_FELINID "felinid"
+#define SCANGATE_FLY "fly"
+#define SCANGATE_PLASMAMAN "plasma"
+#define SCANGATE_MOTH "moth"
+#define SCANGATE_JELLY "jelly"
+#define SCANGATE_POD "pod"
+#define SCANGATE_GOLEM "golem"
+#define SCANGATE_ZOMBIE "zombie"
+
/obj/machinery/scanner_gate
name = "scanner gate"
desc = "A gate able to perform mid-depth scans on any organisms who pass under it."
@@ -21,8 +32,8 @@
var/locked = FALSE
var/scangate_mode = SCANGATE_NONE
var/disease_threshold = DISEASE_SEVERITY_MINOR
- var/nanite_cloud = 0
- var/datum/species/detect_species = /datum/species/human
+ var/nanite_cloud = 1
+ var/detect_species = SCANGATE_HUMAN
var/reverse = FALSE //If true, signals if the scan returns false
var/detect_nutrition = NUTRITION_LEVEL_FAT
@@ -106,9 +117,29 @@
if(SCANGATE_SPECIES)
if(ishuman(M))
var/mob/living/carbon/human/H = M
- if(is_species(H, detect_species))
+ var/datum/species/scan_species = /datum/species/human
+ switch(detect_species)
+ if(SCANGATE_LIZARD)
+ scan_species = /datum/species/lizard
+ if(SCANGATE_FLY)
+ scan_species = /datum/species/fly
+ if(SCANGATE_FELINID)
+ scan_species = /datum/species/human/felinid
+ if(SCANGATE_PLASMAMAN)
+ scan_species = /datum/species/plasmaman
+ if(SCANGATE_MOTH)
+ scan_species = /datum/species/moth
+ if(SCANGATE_JELLY)
+ scan_species = /datum/species/jelly
+ if(SCANGATE_POD)
+ scan_species = /datum/species/pod
+ if(SCANGATE_GOLEM)
+ scan_species = /datum/species/golem
+ if(SCANGATE_ZOMBIE)
+ scan_species = /datum/species/zombie
+ if(is_species(H, scan_species))
beep = TRUE
- if(detect_species == /datum/species/zombie) //Can detect dormant zombies
+ if(detect_species == SCANGATE_ZOMBIE) //Can detect dormant zombies
if(H.getorganslot(ORGAN_SLOT_ZOMBIE))
beep = TRUE
if(SCANGATE_GUNS)
@@ -144,19 +175,21 @@
return FALSE
return ..()
-/obj/machinery/scanner_gate/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
- SStgui.try_update_ui(user, src, ui_key, ui, force_open)
+/obj/machinery/scanner_gate/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
+ datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
+ ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "scanner_gate", name, 600, 400, master_ui, state)
ui.open()
/obj/machinery/scanner_gate/ui_data()
var/list/data = list()
+ data["locked"] = locked
data["scan_mode"] = scangate_mode
data["reverse"] = reverse
data["nanite_cloud"] = nanite_cloud
data["disease_threshold"] = disease_threshold
- data["target_species"] = initial(detect_species.name)
+ data["target_species"] = detect_species
data["target_nutrition"] = detect_nutrition
return data
@@ -165,77 +198,36 @@
return
switch(action)
if("set_mode")
- var/new_mode = input("Choose the scan mode","Scan Mode") as null|anything in list(SCANGATE_NONE,
- SCANGATE_MINDSHIELD,
- SCANGATE_NANITES,
- SCANGATE_DISEASE,
- SCANGATE_GUNS,
- SCANGATE_WANTED,
- SCANGATE_SPECIES,
- SCANGATE_NUTRITION)
- if(new_mode)
- scangate_mode = new_mode
+ var/new_mode = params["new_mode"]
+ scangate_mode = new_mode
. = TRUE
if("toggle_reverse")
reverse = !reverse
. = TRUE
+ if("toggle_lock")
+ if(allowed(usr))
+ locked = !locked
+ . = TRUE
if("set_disease_threshold")
- var/new_threshold = input("Set disease threshold","Scan Mode") as null|anything in list(DISEASE_SEVERITY_POSITIVE,
- DISEASE_SEVERITY_NONTHREAT,
- DISEASE_SEVERITY_MINOR,
- DISEASE_SEVERITY_MEDIUM,
- DISEASE_SEVERITY_HARMFUL,
- DISEASE_SEVERITY_DANGEROUS,
- DISEASE_SEVERITY_BIOHAZARD)
- if(new_threshold)
- disease_threshold = new_threshold
+ var/new_threshold = params["new_threshold"]
+ disease_threshold = new_threshold
. = TRUE
if("set_nanite_cloud")
- var/new_cloud = input("Set target nanite cloud","Scan Mode", nanite_cloud) as null|num
- if(!isnull(new_cloud))
- nanite_cloud = CLAMP(round(new_cloud, 1), 1, 100)
+ var/new_cloud = text2num(params["new_cloud"])
+ nanite_cloud = CLAMP(round(new_cloud, 1), 1, 100)
. = TRUE
//Some species are not scannable, like abductors (too unknown), androids (too artificial) or skeletons (too magic)
if("set_target_species")
- var/new_species = input("Set target species","Scan Mode") as null|anything in list("Human",
- "Lizardperson",
- "Gorillaperson", // yogs -- gorilla people
- "Flyperson",
- "Plasmaman",
- "Mothmen",
- "Jellyperson",
- "Podperson",
- "Golem",
- "Zombie")
- if(new_species)
- switch(new_species)
- if("Human")
- detect_species = /datum/species/human
- if("Lizardperson")
- detect_species = /datum/species/lizard
- // yogs start -- gorilla people
- if("Gorillaperson")
- detect_species = /datum/species/gorilla
- // yogs end
- if("Flyperson")
- detect_species = /datum/species/fly
- if("Plasmaman")
- detect_species = /datum/species/plasmaman
- if("Mothmen")
- detect_species = /datum/species/moth
- if("Jellyperson")
- detect_species = /datum/species/jelly
- if("Podperson")
- detect_species = /datum/species/pod
- if("Golem")
- detect_species = /datum/species/golem
- if("Zombie")
- detect_species = /datum/species/zombie
+ var/new_species = params["new_species"]
+ detect_species = new_species
. = TRUE
if("set_target_nutrition")
- var/new_nutrition = input("Set target nutrition level","Scan Mode") as null|anything in list("Starving",
- "Obese")
- if(new_nutrition)
+ var/new_nutrition = params["new_nutrition"]
+ var/nutrition_list = list(
+ "Starving",
+ "Obese"
+ )
+ if(new_nutrition && new_nutrition in nutrition_list)
switch(new_nutrition)
if("Starving")
detect_nutrition = NUTRITION_LEVEL_STARVING
@@ -251,3 +243,14 @@
#undef SCANGATE_WANTED
#undef SCANGATE_SPECIES
#undef SCANGATE_NUTRITION
+
+#undef SCANGATE_HUMAN
+#undef SCANGATE_LIZARD
+#undef SCANGATE_FELINID
+#undef SCANGATE_FLY
+#undef SCANGATE_PLASMAMAN
+#undef SCANGATE_MOTH
+#undef SCANGATE_JELLY
+#undef SCANGATE_POD
+#undef SCANGATE_GOLEM
+#undef SCANGATE_ZOMBIE
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index 594f7bb23688..b21f37c3bdad 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -220,40 +220,33 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
return
return ..()
-/obj/machinery/gravity_generator/main/ui_interact(mob/user)
- if(stat & BROKEN)
- return
- var/dat = "Gravity Generator Breaker: "
- if(breaker)
- dat += "ON OFF"
- else
- dat += "ON OFF "
-
- dat += "
Generator Status: