diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm index 00e2f9d5dc5..dae46487906 100644 --- a/code/ATMOSPHERICS/components/omni_devices/filter.dm +++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm @@ -181,7 +181,9 @@ if("switch_filter") if(!configuring || use_power) return - var/new_filter = input(usr,"Select filter mode:","Change filter",params["mode"]) in list("None", "Oxygen", "Nitrogen", "Carbon Dioxide", "Phoron", "Nitrous Oxide") + var/new_filter = tgui_input_list(usr, "Select filter mode:", "Change filter", list("None", "Oxygen", "Nitrogen", "Carbon Dioxide", "Phoron", "Nitrous Oxide")) + if(!new_filter) + return switch_filter(dir_flag(params["dir"]), mode_return_switch(new_filter)) . = TRUE diff --git a/code/ZAS/Diagnostic.dm b/code/ZAS/Diagnostic.dm index 7166b42dc6f..fba24568028 100644 --- a/code/ZAS/Diagnostic.dm +++ b/code/ZAS/Diagnostic.dm @@ -50,7 +50,7 @@ "Down" = DOWN,\ #endif "N/A" = null) - var/direction = input("What direction do you wish to test?","Set direction") as null|anything in direction_list + var/direction = tgui_input_list(usr, "What direction do you wish to test?","Set direction", direction_list) if(!direction) return diff --git a/code/ZAS/Variable Settings.dm b/code/ZAS/Variable Settings.dm index f88e4816afa..067fc6d1d8e 100644 --- a/code/ZAS/Variable Settings.dm +++ b/code/ZAS/Variable Settings.dm @@ -96,7 +96,6 @@ var/global/vs_control/vsc = new settings -= "plc" /vs_control/proc/ChangeSettingsDialog(mob/user,list/L) - //var/which = input(user,"Choose a setting:") in L var/dat = "" for(var/ch in L) if(findtextEx(ch,"_RANDOM") || findtextEx(ch,"_DESC") || findtextEx(ch,"_METHOD") || findtextEx(ch,"_NAME")) continue @@ -150,7 +149,7 @@ var/global/vs_control/vsc = new if("Numeric") newvar = input(user,"Enter a number:","Settings",newvar) as num if("Bit Flag") - var/flag = input(user,"Toggle which bit?","Settings") in bitflags + var/flag = tgui_input_list(user,"Toggle which bit?","Settings", bitflags) flag = text2num(flag) if(newvar & flag) newvar &= ~flag @@ -194,7 +193,7 @@ var/global/vs_control/vsc = new /vs_control/proc/SetDefault(var/mob/user) var/list/setting_choices = list("Phoron - Standard", "Phoron - Low Hazard", "Phoron - High Hazard", "Phoron - Oh Shit!",\ "ZAS - Normal", "ZAS - Forgiving", "ZAS - Dangerous", "ZAS - Hellish", "ZAS/Phoron - Initial") - var/def = input(user, "Which of these presets should be used?") as null|anything in setting_choices + var/def = tgui_input_list(user, "Which of these presets should be used?", "Setting Choice", setting_choices) if(!def) return switch(def) diff --git a/code/__defines/_planes+layers.dm b/code/__defines/_planes+layers.dm index 639724eca25..62214097887 100644 --- a/code/__defines/_planes+layers.dm +++ b/code/__defines/_planes+layers.dm @@ -49,11 +49,10 @@ What is the naming convention for planes or layers? #define PLANE_LOOKINGGLASS -78 // For the Looking Glass holodecks #define PLANE_LOOKINGGLASS_IMG -77 // For the Looking Glass holodecks -// OPENSPACE_PLANE reserves all planes between OPENSPACE_PLANE_START and OPENSPACE_PLANE_END inclusive -#define OPENSPACE_PLANE -75 // /turf/simulated/open will use OPENSPACE_PLANE + z (Valid z's being 2 thru 27) //VOREStation Edit -#define OPENSPACE_PLANE_START -73 -#define OPENSPACE_PLANE_END -48 //VOREStation Edit -#define OVER_OPENSPACE_PLANE -47 //VOREStation Edit + +#define OPENSPACE_PLANE -51 // Has to be lower than turfs + #define OPENSPACE_LAYER 600 // Above every other layer +#define OPENSPACE_BACKDROP_PLANE -50 // Black square has to be above openspace turfs // Turf Planes #define PLATING_PLANE -44 // Plating @@ -70,8 +69,11 @@ What is the naming convention for planes or layers? #define WATER_LAYER 3.0 // Layer for water overlays. #define ABOVE_TURF_LAYER 3.1 // Snow and wallmounted/floormounted equipment #define DECAL_PLANE -44 // Permanent decals + #define DECAL_LAYER 10 #define DIRTY_PLANE -43 // Nonpermanent decals + #define DIRTY_LAYER 11 #define BLOOD_PLANE -42 // Blood is really dirty, but we can do special stuff if we separate it + #define BLOOD_DECAL_LAYER 12 // Obj planes #define OBJ_PLANE -35 diff --git a/code/__defines/dcs/signals.dm b/code/__defines/dcs/signals.dm index 9ca46ce7e83..3561178d6be 100644 --- a/code/__defines/dcs/signals.dm +++ b/code/__defines/dcs/signals.dm @@ -218,7 +218,9 @@ #define COMSIG_TURF_CHANGE "turf_change" ///from base of atom/has_gravity(): (atom/asker, list/forced_gravities) #define COMSIG_TURF_HAS_GRAVITY "turf_has_gravity" -///from base of turf/New(): (turf/source, direction) +///from base of turf/multiz_turf_del(): (turf/source, direction) +#define COMSIG_TURF_MULTIZ_DEL "turf_multiz_del" +///from base of turf/multiz_turf_new: (turf/source, direction) #define COMSIG_TURF_MULTIZ_NEW "turf_multiz_new" // /atom/movable signals diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index 9e198dabefd..1aab1c82e47 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -467,4 +467,13 @@ GLOBAL_LIST_INIT(all_volume_channels, list( #define DOCK_ATTEMPT_TIMEOUT 200 //how long in ticks we wait before assuming the docking controller is broken or blown up. #define SMES_TGUI_INPUT 1 -#define SMES_TGUI_OUTPUT 2 \ No newline at end of file +#define SMES_TGUI_OUTPUT 2 + +#define TRAIT_SORT_NORMAL 1 +#define TRAIT_SORT_BODYTYPE 2 +#define TRAIT_SORT_SPECIES 3 + +#define SPECIES_SORT_NORMAL 1 +#define SPECIES_SORT_WHITELISTED 2 +#define SPECIES_SORT_RESTRICTED 3 +#define SPECIES_SORT_CUSTOM 4 diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index b70001cbd61..19ff35c86be 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -379,38 +379,39 @@ #define VIS_LIGHTING 2 #define VIS_O_LIGHT 3 #define VIS_EMISSIVE 4 +#define VIS_OPENSPACE 5 -#define VIS_GHOSTS 5 -#define VIS_AI_EYE 6 +#define VIS_GHOSTS 6 +#define VIS_AI_EYE 7 -#define VIS_CH_STATUS 7 -#define VIS_CH_HEALTH 8 -#define VIS_CH_LIFE 9 -#define VIS_CH_ID 10 -#define VIS_CH_WANTED 11 -#define VIS_CH_IMPLOYAL 12 -#define VIS_CH_IMPTRACK 13 -#define VIS_CH_IMPCHEM 14 -#define VIS_CH_SPECIAL 15 -#define VIS_CH_STATUS_OOC 16 +#define VIS_CH_STATUS 8 +#define VIS_CH_HEALTH 9 +#define VIS_CH_LIFE 10 +#define VIS_CH_ID 11 +#define VIS_CH_WANTED 12 +#define VIS_CH_IMPLOYAL 13 +#define VIS_CH_IMPTRACK 14 +#define VIS_CH_IMPCHEM 15 +#define VIS_CH_SPECIAL 16 +#define VIS_CH_STATUS_OOC 17 -#define VIS_ADMIN1 17 -#define VIS_ADMIN2 18 -#define VIS_ADMIN3 19 +#define VIS_ADMIN1 18 +#define VIS_ADMIN2 19 +#define VIS_ADMIN3 20 -#define VIS_MESONS 20 +#define VIS_MESONS 21 -#define VIS_TURFS 21 -#define VIS_OBJS 22 -#define VIS_MOBS 23 +#define VIS_TURFS 22 +#define VIS_OBJS 23 +#define VIS_MOBS 24 -#define VIS_BUILDMODE 24 +#define VIS_BUILDMODE 25 -#define VIS_CLOAKED 25 +#define VIS_CLOAKED 26 -#define VIS_STATUS 26 +#define VIS_STATUS 27 -#define VIS_COUNT 26 //Must be highest number from above. +#define VIS_COUNT 27 //Must be highest number from above. //Some mob icon layering defines #define BODY_LAYER -100 diff --git a/code/__defines/mobs_vr.dm b/code/__defines/mobs_vr.dm index 116358e5779..be17f09c39f 100644 --- a/code/__defines/mobs_vr.dm +++ b/code/__defines/mobs_vr.dm @@ -1,13 +1,13 @@ #undef VIS_COUNT -#define VIS_CH_STATUS_R 27 -#define VIS_CH_HEALTH_VR 28 -#define VIS_CH_BACKUP 29 -#define VIS_CH_VANTAG 30 +#define VIS_CH_STATUS_R 28 +#define VIS_CH_HEALTH_VR 29 +#define VIS_CH_BACKUP 30 +#define VIS_CH_VANTAG 31 -#define VIS_AUGMENTED 31 +#define VIS_AUGMENTED 32 -#define VIS_COUNT 31 +#define VIS_COUNT 32 //Protean organs #define O_ORCH "orchestrator" diff --git a/code/__defines/subsystems.dm b/code/__defines/subsystems.dm index 9ad2af05047..2c9e6ee6a62 100644 --- a/code/__defines/subsystems.dm +++ b/code/__defines/subsystems.dm @@ -78,7 +78,6 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G #define INIT_ORDER_HOLOMAPS -5 #define INIT_ORDER_NIGHTSHIFT -6 #define INIT_ORDER_OVERLAY -7 -#define INIT_ORDER_OPENSPACE -10 #define INIT_ORDER_XENOARCH -20 #define INIT_ORDER_CIRCUIT -21 #define INIT_ORDER_AI -22 diff --git a/code/__defines/turfs.dm b/code/__defines/turfs.dm index cbcc45c1f51..679b83fa4a3 100644 --- a/code/__defines/turfs.dm +++ b/code/__defines/turfs.dm @@ -20,4 +20,5 @@ #define isDiagonal(x) (x == NORTHEAST || x == SOUTHEAST || x == NORTHWEST || x == SOUTHWEST) #define IS_OPAQUE_TURF(turf) (turf.directional_opacity == ALL_CARDINALS) +#define IS_OPAQUE_TURF_DIR(turf, dir) (turf.directional_opacity & dir) #define FOOTSTEP_SPRITE_AMT 2 diff --git a/code/_global_vars/lists/species.dm b/code/_global_vars/lists/species.dm index f35568b07ae..817f504f7fb 100644 --- a/code/_global_vars/lists/species.dm +++ b/code/_global_vars/lists/species.dm @@ -1,10 +1,9 @@ //Languages/species/whitelist. GLOBAL_LIST_EMPTY_TYPED(all_species, /datum/species) +GLOBAL_LIST_EMPTY_TYPED(whitelisted_species, /datum/species) // Species that require a whitelist check. +GLOBAL_LIST_EMPTY_TYPED(playable_species, /datum/species) // A list of ALL playable species, whitelisted, latejoin or otherwise. + GLOBAL_LIST_EMPTY_TYPED(all_languages, /datum/language) GLOBAL_LIST_INIT(language_name_conflicts, list()) GLOBAL_LIST_INIT(language_keys, list()) // Table of say codes for all languages GLOBAL_LIST_INIT(language_key_conflicts, list()) -GLOBAL_LIST_INIT(whitelisted_species, list(SPECIES_HUMAN)) // Species that require a whitelist check. -// VOREStation edit - include custom species -GLOBAL_LIST_INIT(playable_species, list(SPECIES_HUMAN, SPECIES_CUSTOM)) // A list of ALL playable species, whitelisted, latejoin or otherwise. -// VOREStation edit end \ No newline at end of file diff --git a/code/_helpers/_lists.dm b/code/_helpers/_lists.dm index 0d1a46b2ea6..d71897c466b 100644 --- a/code/_helpers/_lists.dm +++ b/code/_helpers/_lists.dm @@ -306,12 +306,6 @@ This actually tests if they have the same entries and values. for(var/i=1, i 0) + hear |= dview(above_range,Ab,INVISIBILITY_MAXIMUM) + Ab = GetAbove(Ab) for(var/thing in hear) - if(istype(thing, /obj)) //Can't use isobj() because /atom/movable returns true in that, and so lighting overlays would be included + if(istype(thing, /obj)) //Can't use isobj() because /atom/movable returns true in that objs += thing hearturfs |= get_turf(thing) if(ismob(thing)) diff --git a/code/_helpers/global_lists.dm b/code/_helpers/global_lists.dm index 232c523b653..a71515643b2 100644 --- a/code/_helpers/global_lists.dm +++ b/code/_helpers/global_lists.dm @@ -8,6 +8,7 @@ var/global/list/silicon_mob_list = list() //List of all silicon mobs, includin var/global/list/ai_list = list() //List of all AIs, including clientless var/global/list/living_mob_list = list() //List of all alive mobs, including clientless. Excludes /mob/new_player var/global/list/dead_mob_list = list() //List of all dead mobs, including clientless. Excludes /mob/new_player +var/global/list/observer_mob_list = list() //List of all /mob/observer/dead, including clientless. var/global/list/listening_objects = list() //List of all objects which care about receiving messages (communicators, radios, etc) var/global/list/cleanbot_reserved_turfs = list() //List of all turfs currently targeted by some cleanbot @@ -201,6 +202,12 @@ GLOBAL_LIST_EMPTY(mannequins) S.race_key = rkey //Used in mob icon caching. GLOB.all_species[S.name] = S + //Shakey shakey shake + sortTim(GLOB.all_species, /proc/cmp_species, associative = TRUE) + + //Split up the rest + for(var/speciesname in GLOB.all_species) + var/datum/species/S = GLOB.all_species[speciesname] if(!(S.spawn_flags & SPECIES_IS_RESTRICTED)) GLOB.playable_species += S.name if(S.spawn_flags & SPECIES_IS_WHITELISTED) diff --git a/code/_helpers/global_lists_vr.dm b/code/_helpers/global_lists_vr.dm index 4df7afe9b44..16622d1ee6a 100644 --- a/code/_helpers/global_lists_vr.dm +++ b/code/_helpers/global_lists_vr.dm @@ -509,19 +509,27 @@ var/global/list/remainless_species = list(SPECIES_PROMETHEAN, var/datum/trait/instance = new path() if(!instance.name) continue //A prototype or something - var/category = instance.category var/cost = instance.cost traits_costs[path] = cost all_traits[path] = instance + + // Shakey shakey shake + sortTim(all_traits, /proc/cmp_trait_datums_name, associative = TRUE) + + // Split 'em up + for(var/traitpath in all_traits) + var/datum/trait/T = all_traits[traitpath] + var/category = T.category switch(category) if(-INFINITY to -0.1) - negative_traits[path] = instance + negative_traits[traitpath] = T if(0) - neutral_traits[path] = instance - if(!(instance.custom_only)) - everyone_traits[path] = instance + neutral_traits[traitpath] = T + if(!(T.custom_only)) + everyone_traits[traitpath] = T if(0.1 to INFINITY) - positive_traits[path] = instance + positive_traits[traitpath] = T + // Weaver recipe stuff paths = typesof(/datum/weaver_recipe/structure) - /datum/weaver_recipe/structure diff --git a/code/_helpers/sorts/comparators.dm b/code/_helpers/sorts/comparators.dm index dc2419b0b06..c24267e6786 100644 --- a/code/_helpers/sorts/comparators.dm +++ b/code/_helpers/sorts/comparators.dm @@ -79,9 +79,19 @@ /proc/cmp_text_asc(a,b) return sorttext(b,a) +///Tracks are sorted by genre then by title inside that. /proc/cmp_media_track_asc(datum/track/A, datum/track/B) var/genre_sort = sorttext(B.genre || "Uncategorized", A.genre || "Uncategorized") return genre_sort || sorttext(B.title, A.title) +///Filters have a numerical priority. /proc/cmp_filter_data_priority(list/A, list/B) return A["priority"] - B["priority"] + +///Traits have sort they have defined on them to categorize themselves into groups. After that, alphabetical. +/proc/cmp_trait_datums_name(datum/trait/A, datum/trait/B) + return A.sort == B.sort ? sorttext("[B.name]","[A.name]") : A.sort - B.sort + +///Species have sort_hint they self-generate to hint themselves into groups. After that, alphabetical. +/proc/cmp_species(datum/species/A, datum/species/B) + return A.sort_hint == B.sort_hint ? sorttext("[B.name]","[A.name]") : A.sort_hint - B.sort_hint diff --git a/code/_helpers/turfs.dm b/code/_helpers/turfs.dm index 5a0a519743c..ffef7241722 100644 --- a/code/_helpers/turfs.dm +++ b/code/_helpers/turfs.dm @@ -156,10 +156,6 @@ if(z_level_change) // Same goes for mobs. M.onTransitZ(T.z, X.z) - if(istype(M, /mob/living)) - var/mob/living/LM = M - LM.check_shadow() // Need to check their Z-shadow, which is normally done in forceMove(). - if(shuttlework) var/turf/simulated/shuttle/SS = T SS.landed_holder.leave_turf(turftoleave) diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 319deaa777a..5540fe8e088 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -394,8 +394,9 @@ Turf and target are seperate in case you want to teleport some distance from a t borgs[name] = A if (borgs.len) - select = input("Unshackled borg signals detected:", "Borg selection", null, null) as null|anything in borgs - return borgs[select] + select = tgui_input_list(usr, "Unshackled borg signals detected:", "Borg selection", borgs) + if(select) + return borgs[select] //When a borg is activated, it can choose which AI it wants to be slaved to /proc/active_ais() @@ -421,7 +422,7 @@ Turf and target are seperate in case you want to teleport some distance from a t /proc/select_active_ai(var/mob/user) var/list/ais = active_ais() if(ais.len) - if(user) . = input(usr,"AI signals detected:", "AI selection") in ais + if(user) . = tgui_input_list(usr, "AI signals detected:", "AI selection", ais) else . = pick(ais) return . @@ -851,10 +852,6 @@ Turf and target are seperate in case you want to teleport some distance from a t if(z_level_change) // Same goes for mobs. M.onTransitZ(T.z, X.z) - if(istype(M, /mob/living)) - var/mob/living/LM = M - LM.check_shadow() // Need to check their Z-shadow, which is normally done in forceMove(). - if(shuttlework) var/turf/simulated/shuttle/SS = T SS.landed_holder.leave_turf() @@ -1489,7 +1486,7 @@ var/mob/dview/dview_mob = new /proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types()) if (value == FALSE) //nothing should be calling us with a number, so this is safe - value = input("Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text + value = input(usr, "Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text if (isnull(value)) return value = trim(value) @@ -1503,7 +1500,7 @@ var/mob/dview/dview_mob = new if(matches.len==1) chosen = matches[1] else - chosen = input("Select a type", "Pick Type", matches[1]) as null|anything in matches + chosen = tgui_input_list(usr, "Select a type", "Pick Type", matches) if(!chosen) return chosen = matches[chosen] diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 06b51def249..0c10066e580 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -494,13 +494,13 @@ if("Show Camera List") if(isAI(usr)) var/mob/living/silicon/ai/AI = usr - var/camera = input(AI) in AI.get_camera_list() + var/camera = tgui_input_list(AI, "Pick Camera:", "Camera Choice", AI.get_camera_list()) AI.ai_camera_list(camera) if("Track With Camera") if(isAI(usr)) var/mob/living/silicon/ai/AI = usr - var/target_name = input(AI) in AI.trackable_mobs() + var/target_name = tgui_input_list(AI, "Pick Mob:", "Mob Choice", AI.trackable_mobs()) AI.ai_camera_track(target_name) if("Toggle Camera Light") diff --git a/code/controllers/subsystems/game_master.dm b/code/controllers/subsystems/game_master.dm index ce7e8176c31..01ea0869356 100644 --- a/code/controllers/subsystems/game_master.dm +++ b/code/controllers/subsystems/game_master.dm @@ -125,7 +125,7 @@ SUBSYSTEM_DEF(game_master) /datum/controller/subsystem/game_master/proc/choose_game_master(mob/user) var/list/subtypes = subtypesof(/datum/game_master) - var/new_gm_path = input(user, "What kind of Game Master do you want?", "New Game Master", /datum/game_master/default) as null|anything in subtypes + var/new_gm_path = tgui_input_list(user, "What kind of Game Master do you want?", "New Game Master", subtypes) if(new_gm_path) log_and_message_admins("has swapped the current GM ([GM.type]) for a new GM ([new_gm_path]).") GM = new new_gm_path(src) diff --git a/code/controllers/subsystems/garbage.dm b/code/controllers/subsystems/garbage.dm index 5573b23ae83..9da198fdaff 100644 --- a/code/controllers/subsystems/garbage.dm +++ b/code/controllers/subsystems/garbage.dm @@ -362,7 +362,7 @@ SUBSYSTEM_DEF(garbage) return if(!skip_alert) - if(alert("Running this will lock everything up for about 5 minutes. Would you like to begin the search?", "Find References", "Yes", "No") == "No") + if(tgui_alert(usr, "Running this will lock everything up for about 5 minutes. Would you like to begin the search?", "Find References", list("Yes", "No")) == "No") running_find_references = null return diff --git a/code/controllers/subsystems/media_tracks.dm b/code/controllers/subsystems/media_tracks.dm index bb9e3d86377..53805bcbec2 100644 --- a/code/controllers/subsystems/media_tracks.dm +++ b/code/controllers/subsystems/media_tracks.dm @@ -129,7 +129,7 @@ SUBSYSTEM_DEF(media_tracks) if(isnull(genre)) // Cancel rather than empty string return - var/secret = alert(C, "Optional: Mark track as secret?", "Track Secret", "Yes", "Cancel", "No") + var/secret = tgui_alert(C, "Optional: Mark track as secret?", "Track Secret", list("Yes", "Cancel", "No")) if(secret == "Cancel") return else if(secret == "Yes") @@ -137,7 +137,7 @@ SUBSYSTEM_DEF(media_tracks) else secret = FALSE - var/lobby = alert(C, "Optional: Mark track as lobby music?", "Track Lobby", "Yes", "Cancel", "No") + var/lobby = tgui_alert(C, "Optional: Mark track as lobby music?", "Track Lobby", list("Yes", "Cancel", "No")) if(lobby == "Cancel") return else if(secret == "Yes") diff --git a/code/controllers/subsystems/open_space.dm b/code/controllers/subsystems/open_space.dm deleted file mode 100644 index 4e96dbfda44..00000000000 --- a/code/controllers/subsystems/open_space.dm +++ /dev/null @@ -1,107 +0,0 @@ -// -// Controller handling icon updates of open space turfs -// - -GLOBAL_VAR_INIT(open_space_initialised, FALSE) - -SUBSYSTEM_DEF(open_space) - name = "Open Space" - wait = 2 // 5 times per second. - init_order = INIT_ORDER_OPENSPACE - var/list/turfs_to_process = list() // List of turfs queued for update. - var/list/turfs_to_process_old = null // List of turfs currently being updated. - var/counter = 1 // Can't use .len because we need to iterate in order - var/static/image/over_OS_darkness // Image overlayed over the bottom turf with stuff in it. - -/datum/controller/subsystem/open_space/Initialize(timeofday) - over_OS_darkness = image('icons/turf/open_space.dmi', "black_open") - over_OS_darkness.plane = OVER_OPENSPACE_PLANE - over_OS_darkness.layer = MOB_LAYER - initialize_open_space() - // Pre-process open space turfs once before the round starts. - fire(FALSE, TRUE) - return ..() - -/datum/controller/subsystem/open_space/Recover() - flags |= SS_NO_INIT // Make extra sure we don't initialize twice. - . = ..() - -/datum/controller/subsystem/open_space/fire(resumed = 0, init_tick_checks = FALSE) - // We use a different list so any additions to the update lists during a delay from MC_TICK_CHECK - // don't cause things to be cut from the list without being updated. - - //If we're not resuming, this must mean it's a new iteration so we have to grab the turfs - if (!resumed) - src.counter = 1 - src.turfs_to_process_old = turfs_to_process - turfs_to_process = list() - - //cache for sanic speed (lists are references anyways) - var/list/turfs_to_process_old = src.turfs_to_process_old - var/counter = src.counter - while(counter <= turfs_to_process_old.len) - var/turf/T = turfs_to_process_old[counter] - counter += 1 - if(!QDELETED(T)) - update_turf(T) - if (init_tick_checks) - CHECK_TICK // Used during initialization processing - else if (MC_TICK_CHECK) - src.counter = counter // Save for when we're resumed - return // Used during normal MC processing. - -/datum/controller/subsystem/open_space/proc/update_turf(var/turf/T) - for(var/atom/movable/A in T) - A.fall() - T.update_icon() - -/datum/controller/subsystem/open_space/proc/add_turf(var/turf/T, var/recursive = 0) - ASSERT(isturf(T)) - // Check for multiple additions - // Pointless to process the same turf twice. But we need to push it to the end of the list - // because any turfs below it need to process first. - turfs_to_process -= T - turfs_to_process += T - if(recursive > 0) - var/turf/above = GetAbove(T) - if(above && isopenspace(above)) - add_turf(above, recursive) - -// Queue the initial updates of open space turfs when the game starts. This will lag! -/datum/controller/subsystem/open_space/proc/initialize_open_space() - // Do initial setup from bottom to top. - for(var/zlevel = 1 to world.maxz) - for(var/turf/simulated/open/T in block(locate(1, 1, zlevel), locate(world.maxx, world.maxy, zlevel))) - add_turf(T) - CHECK_TICK - GLOB.open_space_initialised = TRUE - -/datum/controller/subsystem/open_space/stat_entry(msg_prefix) - return ..("T [turfs_to_process.len]") - -/obj/update_icon() - . = ..() - if(GLOB.open_space_initialised && !invisibility && isturf(loc)) - var/turf/T = GetAbove(src) - if(isopenspace(T)) - // log_debug("[T] ([T.x],[T.y],[T.z]) queued for update for [src].update_icon()") - SSopen_space.add_turf(T, 1) - -// Ouch... this is painful. But is there any other way? -/* - No for now -/obj/New() - . = ..() - if(open_space_initialised && !invisibility) - var/turf/T = GetAbove(src) - if(isopenspace(T)) - // log_debug("[T] ([T.x],[T.y],[T.z]) queued for update for [src]New()") - OS_controller.add_turf(T, 1) -*/ - -// We probably should hook Destroy() If we can think of something more efficient, lets hear it. -/obj/Destroy() - if(GLOB.open_space_initialised && !invisibility && isturf(loc)) - var/turf/T = GetAbove(src) - if(isopenspace(T)) - SSopen_space.add_turf(T, 1) - . = ..() // Important that this be at the bottom, or we will have been moved to nullspace. diff --git a/code/controllers/subsystems/planets.dm b/code/controllers/subsystems/planets.dm index c9a4a2db43c..16fbe59d3a6 100644 --- a/code/controllers/subsystems/planets.dm +++ b/code/controllers/subsystems/planets.dm @@ -104,7 +104,7 @@ SUBSYSTEM_DEF(planets) /datum/controller/subsystem/planets/proc/updateSunlight(var/datum/planet/P) var/new_brightness = P.sun["brightness"] - P.sun_holder.update_brightness(new_brightness) + P.sun_holder.update_brightness(new_brightness, P.planet_floors) var/new_color = P.sun["color"] P.sun_holder.update_color(new_color) diff --git a/code/controllers/subsystems/supply.dm b/code/controllers/subsystems/supply.dm index 47a0e0e7bd4..04908f3f317 100644 --- a/code/controllers/subsystems/supply.dm +++ b/code/controllers/subsystems/supply.dm @@ -309,8 +309,8 @@ SUBSYSTEM_DEF(supply) // Will delete the specified order from the user-side list /datum/controller/subsystem/supply/proc/delete_order(var/datum/supply_order/O, var/mob/user) // Making sure they know what they're doing - if(alert(user, "Are you sure you want to delete this record? If it has been approved, cargo points will NOT be refunded!", "Delete Record","No","Yes") == "Yes") - if(alert(user, "Are you really sure? There is no way to recover the order once deleted.", "Delete Record", "No", "Yes") == "Yes") + if(tgui_alert(user, "Are you sure you want to delete this record? If it has been approved, cargo points will NOT be refunded!", "Delete Record",list("No","Yes")) == "Yes") + if(tgui_alert(user, "Are you really sure? There is no way to recover the order once deleted.", "Delete Record", list("No","Yes")) == "Yes") log_admin("[key_name(user)] has deleted supply order \ref[O] [O] from the user-side order history.") order_history -= O return @@ -353,8 +353,8 @@ SUBSYSTEM_DEF(supply) // Will delete the specified export receipt from the user-side list /datum/controller/subsystem/supply/proc/delete_export(var/datum/exported_crate/E, var/mob/user) // Making sure they know what they're doing - if(alert(user, "Are you sure you want to delete this record?", "Delete Record","No","Yes") == "Yes") - if(alert(user, "Are you really sure? There is no way to recover the receipt once deleted.", "Delete Record", "No", "Yes") == "Yes") + if(tgui_alert(user, "Are you sure you want to delete this record?", "Delete Record",list("No","Yes")) == "Yes") + if(tgui_alert(user, "Are you really sure? There is no way to recover the receipt once deleted.", "Delete Record", list("No","Yes")) == "Yes") log_admin("[key_name(user)] has deleted export receipt \ref[E] [E] from the user-side export history.") exported_crates -= E return diff --git a/code/controllers/subsystems/vote.dm b/code/controllers/subsystems/vote.dm index 210d97a2a23..3623acf26ce 100644 --- a/code/controllers/subsystems/vote.dm +++ b/code/controllers/subsystems/vote.dm @@ -352,7 +352,7 @@ SUBSYSTEM_DEF(vote) if("cancel") if(usr.client.holder) - if("Yes" == alert(usr, "You are about to cancel this vote. Are you sure?", "Cancel Vote", "No", "Yes")) + if("Yes" == tgui_alert(usr, "You are about to cancel this vote. Are you sure?", "Cancel Vote", list("No", "Yes"))) reset() if("toggle_restart") if(usr.client.holder) diff --git a/code/controllers/subsystems/webhooks.dm b/code/controllers/subsystems/webhooks.dm index 25252d30504..1e7a27924ff 100644 --- a/code/controllers/subsystems/webhooks.dm +++ b/code/controllers/subsystems/webhooks.dm @@ -82,7 +82,7 @@ SUBSYSTEM_DEF(webhooks) to_chat(usr, SPAN_WARNING("Webhook list is empty; either webhooks are disabled, webhooks aren't configured, or the subsystem hasn't initialized.")) return - var/choice = input(usr, "Select a webhook to ping.", "Ping Webhook") as null|anything in SSwebhooks.webhook_decls + var/choice = tgui_input_list(usr, "Select a webhook to ping.", "Ping Webhook", SSwebhooks.webhook_decls) if(choice && SSwebhooks.webhook_decls[choice]) var/decl/webhook/webhook = SSwebhooks.webhook_decls[choice] log_and_message_admins("has pinged webhook [choice].", usr) diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index 4a9c3b48a7c..7323d2cba2b 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -99,7 +99,7 @@ options["LEGACY: transfer_controller"] = transfer_controller options["LEGACY: gas_data"] = gas_data - var/pick = input(mob, "Choose a controller to debug/view variables of.", "VV controller:") as null|anything in options + var/pick = input(mob, "Choose a controller to debug/view variables of.", "VV controller:") as null|anything in options // Leaving as input() due to debug tool if(!pick) return var/datum/D = options[pick] diff --git a/code/datums/components/overlay_lighting.dm b/code/datums/components/overlay_lighting.dm index a037e7fab19..b6a812ce9ab 100644 --- a/code/datums/components/overlay_lighting.dm +++ b/code/datums/components/overlay_lighting.dm @@ -94,7 +94,6 @@ cone = new() cone_hint_x = movable_parent.light_cone_x_offset cone_hint_y = movable_parent.light_cone_y_offset - cone.transform = cone.transform.Translate(-32, -32) set_direction(movable_parent.dir) if(!isnull(_range)) movable_parent.set_light_range(_range) @@ -436,19 +435,52 @@ var/turf/lit_turf = t lit_turf.dynamic_lumcount -= difference -///Here we append the behavior associated to changing lum_power. +///Moves the light directional_atom that emits our "light" based on our position and our direction /datum/component/overlay_lighting/proc/cast_directional_light() var/final_distance = cast_range + //Lower the distance by 1 if we're not looking at a cardinal direction, and we're not a short cast if(final_distance > SHORT_CAST && !(ALL_CARDINALS & current_direction)) final_distance -= 1 var/turf/scanning = get_turf(current_holder) + + . = 0 for(var/i in 1 to final_distance) var/turf/next_turf = get_step(scanning, current_direction) - if(isnull(next_turf) || IS_OPAQUE_TURF(next_turf)) + if(isnull(next_turf) || IS_OPAQUE_TURF_DIR(next_turf, reverse_dir[current_direction])) break scanning = next_turf + .++ + directional_atom.forceMove(scanning) + directional_atom.face_light(GET_PARENT, dir2angle(current_direction), .) + +///Tries to place the directional light in a specific turf +/datum/component/overlay_lighting/proc/place_directional_light(turf/target) + var/final_distance = round(cast_range*2) + + //Lower the distance by 1 if we're not looking at a cardinal direction, and we're not a short cast + if(final_distance > SHORT_CAST && !(ALL_CARDINALS & get_dir(GET_PARENT, target))) + final_distance -= 1 + var/turf/scanning = get_turf(GET_PARENT) + + . = 0 + for(var/i in 1 to final_distance) + var/next_dir = get_dir(scanning, target) + var/turf/next_turf = get_step(scanning, next_dir) + if(isnull(next_turf) || IS_OPAQUE_TURF_DIR(next_turf, get_dir(scanning, next_turf))) + break + scanning = next_turf + .++ + + directional_atom.forceMove(scanning) + var/turf/Ts = get_turf(GET_PARENT) + var/turf/To = get_turf(GET_LIGHT_SOURCE) + + var/angle = Get_Angle(Ts, To) + + directional_atom.face_light(GET_PARENT, angle, .) + set_cone_direction(NORTH, angle) ///Called when current_holder changes loc. /datum/component/overlay_lighting/proc/on_holder_dir_change(atom/movable/source, olddir, newdir) @@ -460,14 +492,23 @@ SIGNAL_HANDLER set_direction(newdir) +///Sets the cone's direction for directional lighting +/datum/component/overlay_lighting/proc/set_cone_direction(dir, angle) + cone.reset_transform() + if(dir) + cone.set_dir(dir) + if(angle) + cone.transform = turn(cone.transform, angle) + cone.apply_standard_transform() + ///Sets a new direction for the directional cast, then updates luminosity -/datum/component/overlay_lighting/proc/set_direction(newdir) +/datum/component/overlay_lighting/proc/set_direction(newdir, skip_update) if(!newdir) return if(current_direction == newdir) return current_direction = newdir - cone.set_dir(newdir) + set_cone_direction(newdir) if(newdir & NORTH) cone.pixel_y = 16 @@ -476,8 +517,10 @@ else if(!isnull(cone_hint_y)) cone.pixel_y = cone_hint_y + directional_atom.pixel_y = cone_hint_y else cone.pixel_y = 0 + directional_atom.pixel_y = 0 if(newdir & EAST) cone.pixel_x = 16 @@ -487,12 +530,15 @@ if(!isnull(cone_hint_x)) if(newdir & NORTH) cone.pixel_x = -1*cone_hint_x + directional_atom.pixel_x = -1*cone_hint_x else cone.pixel_x = cone_hint_x + directional_atom.pixel_x = cone_hint_x else cone.pixel_x = 0 + directional_atom.pixel_x = 0 - if(overlay_lighting_flags & LIGHTING_ON) + if(!skip_update && (overlay_lighting_flags & LIGHTING_ON)) make_luminosity_update() /datum/component/overlay_lighting/proc/on_parent_crafted(datum/source, atom/movable/new_craft) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 7b09c83308c..75c3c64c7f2 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -42,7 +42,7 @@ var/client/C = value["value"] if (!C) return - var/prompt = alert("Do you want to grant [C] access to view this VV window? (they will not be able to edit or change anysrc nor open nested vv windows unless they themselves are an admin)", "Confirm", "Yes", "No") + var/prompt = tgui_alert(usr, "Do you want to grant [C] access to view this VV window? (they will not be able to edit or change anysrc nor open nested vv windows unless they themselves are an admin)", "Confirm", list("Yes", "No")) if (prompt != "Yes" || !usr.client) return message_admins("[key_name_admin(usr)] Showed [key_name_admin(C)] a VV window") @@ -68,7 +68,7 @@ names += componentsubtypes names += "---Elements---" names += sortTim(subtypesof(/datum/element), /proc/cmp_typepaths_asc) - var/result = input(usr, "Choose a component/element to add","better know what ur fuckin doin pal") as null|anything in names + var/result = input(usr, "Choose a component/element to add:", "Add Component/Element", names) if(!usr || !result || result == "---Components---" || result == "---Elements---") return if(QDELETED(src)) diff --git a/code/datums/elements/turf_transparency.dm b/code/datums/elements/turf_transparency.dm new file mode 100644 index 00000000000..e8808c58a07 --- /dev/null +++ b/code/datums/elements/turf_transparency.dm @@ -0,0 +1,84 @@ +/datum/element/turf_z_transparency + var/show_bottom_level = FALSE + +///This proc sets up the signals to handle updating viscontents when turfs above/below update. Handle plane and layer here too so that they don't cover other obs/turfs in Dream Maker +/datum/element/turf_z_transparency/Attach(datum/target, show_bottom_level = TRUE) + . = ..() + if(!isturf(target)) + return ELEMENT_INCOMPATIBLE + + var/turf/our_turf = target + + src.show_bottom_level = show_bottom_level + + our_turf.plane = OPENSPACE_PLANE + our_turf.layer = OPENSPACE_LAYER + + RegisterSignal(target, COMSIG_TURF_MULTIZ_DEL, .proc/on_multiz_turf_del, override = TRUE) + RegisterSignal(target, COMSIG_TURF_MULTIZ_NEW, .proc/on_multiz_turf_new, override = TRUE) + + update_multiz(our_turf, TRUE, TRUE) + +/datum/element/turf_z_transparency/Detach(datum/source) + . = ..() + var/turf/our_turf = source + our_turf.vis_contents.len = 0 + UnregisterSignal(our_turf, COMSIG_TURF_MULTIZ_DEL) + UnregisterSignal(our_turf, COMSIG_TURF_MULTIZ_NEW) + +///Updates the viscontents or underlays below this tile. +/datum/element/turf_z_transparency/proc/update_multiz(turf/our_turf, prune_on_fail = FALSE, init = FALSE) + var/turf/below_turf = GetBelow(our_turf) + if(!below_turf) + our_turf.vis_contents.len = 0 + if(!show_bottom_level(our_turf) && prune_on_fail) //If we cant show whats below, and we prune on fail, change the turf to plating as a fallback + our_turf.ChangeTurf(/turf/simulated/floor/plating) + return FALSE + if(init) + below_turf?.update_icon() // So the 'ceiling-less' overlay gets added. + our_turf.vis_contents += below_turf + + if(is_blocked_turf(our_turf)) //Show girders below closed turfs + var/mutable_appearance/girder_underlay = mutable_appearance('icons/obj/structures.dmi', "girder", layer = TURF_LAYER-0.01) + girder_underlay.appearance_flags = RESET_ALPHA | RESET_COLOR + our_turf.underlays += girder_underlay + var/mutable_appearance/plating_underlay = mutable_appearance('icons/turf/floors.dmi', "plating", layer = TURF_LAYER-0.02) + plating_underlay = RESET_ALPHA | RESET_COLOR + our_turf.underlays += plating_underlay + return TRUE + +/datum/element/turf_z_transparency/proc/on_multiz_turf_del(turf/our_turf, turf/below_turf, dir) + SIGNAL_HANDLER + + if(dir != DOWN) + return + + update_multiz(our_turf) + +/datum/element/turf_z_transparency/proc/on_multiz_turf_new(turf/our_turf, turf/below_turf, dir) + SIGNAL_HANDLER + + if(dir != DOWN) + return + + update_multiz(our_turf) + +///Called when there is no real turf below this turf +/datum/element/turf_z_transparency/proc/show_bottom_level(turf/our_turf) + if(!show_bottom_level) + return FALSE + var/turf/path = get_base_turf(our_turf.z) || /turf/space + if(!ispath(path)) + path = text2path(path) + if(!ispath(path)) + warning("Z-level [our_turf.z] has invalid baseturf '[get_base_turf(our_turf.z)]'") + path = /turf/space + + var/do_plane = ispath(path, /turf/space) ? SPACE_PLANE : null + var/do_state = ispath(path, /turf/space) ? "white" : initial(path.icon_state) + + var/mutable_appearance/underlay_appearance = mutable_appearance(initial(path.icon), do_state, layer = TURF_LAYER-0.02, plane = do_plane) + underlay_appearance.appearance_flags = RESET_ALPHA | RESET_COLOR + our_turf.underlays += underlay_appearance + + return TRUE \ No newline at end of file diff --git a/code/datums/ghost_query.dm b/code/datums/ghost_query.dm index f3a84d533de..d40ef7bab89 100644 --- a/code/datums/ghost_query.dm +++ b/code/datums/ghost_query.dm @@ -11,18 +11,13 @@ var/wait_time = 60 SECONDS // How long to wait until returning the list of candidates. var/cutoff_number = 0 // If above 0, when candidates list reaches this number, further potential candidates are rejected. +/// Begin the ghost asking /datum/ghost_query/proc/query() // First, ask all the ghosts who want to be asked. - for(var/mob/observer/dead/D in player_list) - if(!D.MayRespawn()) - continue // They can't respawn for whatever reason. - if(D.client) - if(be_special_flag && !(D.client.prefs.be_special & be_special_flag) ) - continue // They don't want to see the prompt. - for(var/ban in check_bans) - if(jobban_isbanned(D, ban)) - continue // They're banned from this role. - ask_question(D.client) + for(var/mob/observer/dead/D as anything in observer_mob_list) + if(evaluate_candidate(D)) + ask_question(D) + // Then wait awhile. while(!finished) sleep(1 SECOND) @@ -31,36 +26,73 @@ finished = TRUE // Prune the list after the wait, incase any candidates logged out. - for(var/mob/observer/dead/D in candidates) - if(!D.client || !D.key) - candidates.Remove(D) + for(var/mob/observer/dead/D as anything in candidates) + if(!evaluate_candidate(D)) + candidates -= D // Now we're done. finished = TRUE return candidates -/datum/ghost_query/proc/ask_question(var/client/C) - spawn(0) - if(!C) - return - window_flash(C) - if(query_sound) - SEND_SOUND(C, sound(query_sound)) - var/response = alert(C, question, "[role_name] request", "Yes", "No", "Never for this round") - if(response == "Yes") - response = alert(C, "Are you sure you want to play as a [role_name]?", "[role_name] request", "Yes", "No") // Protection from a misclick. - if(!C || !src) - return - if(response == "Yes") - if(finished || (cutoff_number && candidates.len >= cutoff_number) ) - to_chat(C, "Unfortunately, you were not fast enough, and there are no more available roles. Sorry.") - return - candidates.Add(C.mob) - if(cutoff_number && candidates.len >= cutoff_number) - finished = TRUE // Finish now if we're full. - else if(response == "Never for this round") +/// Test a candidate for allowance to join as this +/datum/ghost_query/proc/evaluate_candidate(mob/observer/dead/candidate) + if(!istype(candidate)) + return FALSE // Changed mobs or something who knows + if(!candidate.client) + return FALSE // No client to ask + if(!candidate.MayRespawn()) + return FALSE // They can't respawn for whatever reason. + if(be_special_flag && !(candidate.client.prefs.be_special & be_special_flag) ) + return FALSE // They don't want to see the prompt. + for(var/ban in check_bans) + if(jobban_isbanned(candidate, ban)) + return FALSE // They're banned from this role. + + return TRUE + +/// Send async alerts and ask for responses. Expects you to have tested D for client and type already +/datum/ghost_query/proc/ask_question(var/mob/observer/dead/D) + var/client/C = D.client + window_flash(C) + + if(query_sound) + SEND_SOUND(C, sound(query_sound)) + + tgui_alert_async(D, question, "[role_name] request", list("Yes", "No", "Never for this round"), CALLBACK(src, .proc/get_reply), wait_time SECONDS) + +/// Process an async alert response +/datum/ghost_query/proc/get_reply(response) + var/mob/observer/dead/D = usr + if(!D?.client) + return + + // Unhandled are "No" and "Nevermind" responses, which should just do nothing + + // This response is always fine, doesn't warrant retesting + switch(response) + if("Never for this round") if(be_special_flag) - C.prefs.be_special ^= be_special_flag + D.client.prefs.be_special ^= be_special_flag + to_chat(D, "You will not be prompted to join similar roles to [role_name] for the rest of this round. Note: If you save your character now, it will save this permanently.") + else + to_chat(D, "This type of ghost-joinable role doesn't have a role type flag associated with it, so I can't prevent future requests, sorry. Bug a dev!") + if("Yes") + if(!evaluate_candidate(D)) // Failed revalidation + to_chat(D, "Unfortunately, you no longer qualify for this role. Sorry.") + else if(finished) // Already finished candidate list + to_chat(D, "Unfortunately, you were not fast enough, and there are no more available roles. Sorry.") + else // Prompt a second time + tgui_alert_async(D, "Are you sure you want to play as a [role_name]?", "[role_name] request", list("I'm Sure", "Nevermind"), CALLBACK(src, .proc/get_reply), wait_time SECONDS) + + if("I'm Sure") + if(!evaluate_candidate(D)) // Failed revalidation + to_chat(D, "Unfortunately, you no longer qualify for this role. Sorry.") + else if(finished) // Already finished candidate list + to_chat(D, "Unfortunately, you were not fast enough, and there are no more available roles. Sorry.") + else // Accept their nomination + candidates.Add(D) + if(cutoff_number && candidates.len >= cutoff_number) + finished = TRUE // Finish now if we're full. // Normal things. /datum/ghost_query/promethean diff --git a/code/datums/locations/locations.dm b/code/datums/locations/locations.dm index 0081318eb05..a9cf9294fb2 100644 --- a/code/datums/locations/locations.dm +++ b/code/datums/locations/locations.dm @@ -30,47 +30,11 @@ var/global/datum/locations/milky_way/all_locations = new() /proc/choose_location_datum(client/user) var/datum/locations/choice = all_locations while(length(choice.contents) > 0) //For some reason it wouldn't let me do contents.len even when I defined it as a list. - var/specific = alert(user, "The location currently selected is [choice.name]. More specific options exist, would you like to pick a more specific location?", - "Choose location", "Yes", "No") + var/specific = tgui_alert(user, "The location currently selected is [choice.name]. More specific options exist, would you like to pick a more specific location?", "Choose location", list("Yes", "No")) if(specific == "Yes" && length(choice.contents) > 0) - choice = input(user, "Please choose a location.","Locations") as null|anything in choice.contents + choice = tgui_input_list(user, "Please choose a location.", "Locations", choice.contents) else break to_chat(user,choice.name) to_chat(user,choice.desc) return choice - -// var/datum/locations/choice = input(user, "Please choose a location.","Locations") as null|anything in all_locations -// if(choice && choice.contents.len > 0) - - -/* -/datum/locations/proc/show_contents() -// to_world("[src]\n[desc]") - for(var/datum/locations/a in contents) - to_world("[a]\n[a.parent ? "Located in [a.parent]\n" : ""][a.desc]") - a.show_contents() - to_world("\n") - -/datum/locations/proc/count_locations() - var/i = 0 - for(var/datum/locations/a in contents) - i = i + a.count_locations() - return i - -/client/verb/show_locations() - set name = "Show Locations" - set category = "Debug" - locations.show_contents() - -/client/verb/debug_locations() - set name = "Debug Locations" - set category = "Debug" - debug_variables(locations) - -/client/verb/count_locations() - set name = "Count Locations" - set category = "Debug" - var/location_number = locations.count_locations() - to_world(location_number) -*/ diff --git a/code/datums/managed_browsers/feedback_form.dm b/code/datums/managed_browsers/feedback_form.dm index 00755c7624b..b380018bea6 100644 --- a/code/datums/managed_browsers/feedback_form.dm +++ b/code/datums/managed_browsers/feedback_form.dm @@ -112,7 +112,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form) return if(href_list["feedback_choose_topic"]) - feedback_topic = input(my_client, "Choose the topic you want to submit your feedback under.", "Feedback Topic", feedback_topic) in config.sqlite_feedback_topics + feedback_topic = tgui_input_list(my_client, "Choose the topic you want to submit your feedback under.", "Feedback Topic", config.sqlite_feedback_topics) display() return @@ -129,7 +129,7 @@ GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form) to_chat(my_client, span("warning", "It appears you didn't write anything, or it was invalid.")) return - if(alert(my_client, "Are you sure you want to submit your feedback?", "Confirm Submission", "No", "Yes") == "Yes") + if(tgui_alert(my_client, "Are you sure you want to submit your feedback?", "Confirm Submission", list("No", "Yes")) == "Yes") var/author_text = my_client.ckey if(can_be_private() && feedback_hide_author) author_text = md5(my_client.ckey + SSsqlite.get_feedback_pepper()) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index de91fd48abc..a35c23cd6b4 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -122,7 +122,7 @@ /datum/mind/proc/edit_memory() if(!ticker || !ticker.mode) - alert("Not before round-start!", "Alert") + tgui_alert_async(usr, "Not before round-start!", "Alert") return var/out = "[name][(current&&(current.real_name!=name))?" (as [current.real_name])":""]
" @@ -220,7 +220,8 @@ if(!def_value)//If it's a custom objective, it will be an empty string. def_value = "custom" - var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "debrain", "protect", "prevent", "harm", "brig", "hijack", "escape", "survive", "steal", "download", "mercenary", "capture", "absorb", "custom") + var/list/choices = list("assassinate", "debrain", "protect", "prevent", "harm", "brig", "hijack", "escape", "survive", "steal", "download", "mercenary", "capture", "absorb", "custom") + var/new_obj_type = tgui_input_list(usr, "Select objective type:", "Objective type", choices, def_value) if (!new_obj_type) return var/datum/objective/new_objective = null @@ -242,7 +243,7 @@ if (objective&&(objective.type in objective_list) && objective.target) def_target = objective.target.current - var/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets + var/new_target = tgui_input_list(usr, "Select target:", "Objective target", possible_targets, def_target) if (!new_target) return var/objective_path = text2path("/datum/objective/[new_obj_type]") diff --git a/code/datums/uplink/announcements.dm b/code/datums/uplink/announcements.dm index e85541a55dc..f1db67a6474 100644 --- a/code/datums/uplink/announcements.dm +++ b/code/datums/uplink/announcements.dm @@ -16,10 +16,10 @@ item_cost = 20 /datum/uplink_item/abstract/announcements/fake_centcom/extra_args(var/mob/user) - var/title = sanitize(input("Enter your announcement title.", "Announcement Title") as null|text) + var/title = sanitize(input(usr, "Enter your announcement title.", "Announcement Title") as null|text) if(!title) return - var/message = sanitize(input("Enter your announcement message.", "Announcement Title") as null|text) + var/message = sanitize(input(usr, "Enter your announcement message.", "Announcement Title") as null|text) if(!message) return return list("title" = title, "message" = message) diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 72b808165a4..8272b7d39b4 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -8,12 +8,9 @@ return attack_hand(user) /obj/structure/signpost/attack_hand(mob/user as mob) - switch(alert("Travel back to ss13?",,"Yes","No")) - if("Yes") - if(user.z != src.z) return - user.forceMove(pick(latejoin)) - if("No") - return + if(tgui_alert(user, "Travel back to ss13?","Return?",list("Yes","No")) == "Yes") + if(user.z != src.z) return + user.forceMove(pick(latejoin)) /obj/effect/mark var/mark = "" diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index ef15cfb26f7..6da9e1cabfe 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -257,7 +257,7 @@ for (var/obj/machinery/camera/C in cameras) friendly_cameras.Add(C.c_tag) - var/target = input("Select the camera to observe", null) as null|anything in friendly_cameras + var/target = tgui_input_list(usr, "Select the camera to observe", "Select Camera", friendly_cameras) if (!target) return for (var/obj/machinery/camera/C in cameras) diff --git a/code/game/antagonist/antagonist_factions.dm b/code/game/antagonist/antagonist_factions.dm index 15191897ce8..6e18b57a3b2 100644 --- a/code/game/antagonist/antagonist_factions.dm +++ b/code/game/antagonist/antagonist_factions.dm @@ -34,7 +34,7 @@ message_admins("[src]([src.ckey]) attempted to convert [player.current].") player.rev_cooldown = world.time+100 - var/choice = alert(player.current,"Asked by [src]: Do you want to join the [faction.faction_descriptor]?","Join the [faction.faction_descriptor]?","No!","Yes!") + var/choice = tgui_alert(player.current, "Asked by [src]: Do you want to join the [faction.faction_descriptor]?", "Join the [faction.faction_descriptor]?", list("No!","Yes!")) if(choice == "Yes!" && faction.add_antagonist_mind(player, 0, faction.faction_role_text, faction.faction_welcome)) to_chat(src, "\The [player.current] joins the [faction.faction_descriptor]!") return diff --git a/code/game/antagonist/station/highlander.dm b/code/game/antagonist/station/highlander.dm index 708f047a57c..9b54383278b 100644 --- a/code/game/antagonist/station/highlander.dm +++ b/code/game/antagonist/station/highlander.dm @@ -56,7 +56,7 @@ var/datum/antagonist/highlander/highlanders /proc/only_one() if(!ticker) - alert("The game hasn't started yet!") + tgui_alert_async(usr,"The game hasn't started yet!") return for(var/mob/living/carbon/human/H in player_list) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 728859eee76..983e0ea56ee 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -63,6 +63,10 @@ moveToNullspace() + vis_contents.Cut() + for(var/atom/movable/A as anything in vis_locs) + A.vis_contents -= src + if(pulledby) pulledby.stop_pulling() diff --git a/code/game/base_turf.dm b/code/game/base_turf.dm index 92bf5c9f8d2..3f78c6fba48 100644 --- a/code/game/base_turf.dm +++ b/code/game/base_turf.dm @@ -19,11 +19,11 @@ if(!holder) return - var/choice = input("Which Z-level do you wish to set the base turf for?") as num|null + var/choice = input(usr, "Which Z-level do you wish to set the base turf for?") as num|null if(!choice) return - var/new_base_path = input("Please select a turf path (cancel to reset to /turf/space).") as null|anything in typesof(/turf) + var/new_base_path = tgui_input_list(usr, "Please select a turf path (cancel to reset to /turf/space).", "Set Base Turf", typesof(/turf)) if(!new_base_path) new_base_path = /turf/space using_map.base_turf_by_z["[choice]"] = new_base_path diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index f6d6695b191..54b1b4c1e0c 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -221,7 +221,7 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E var/list/victims = list() for(var/mob/living/carbon/C in oview(changeling.sting_range)) victims += C - var/mob/living/carbon/T = input(src, "Who will we sting?") as null|anything in victims + var/mob/living/carbon/T = tgui_input_list(src, "Who will we sting?", "Sting!", victims) if(!T) return diff --git a/code/game/gamemodes/changeling/powers/fake_death.dm b/code/game/gamemodes/changeling/powers/fake_death.dm index 65fce3cecf6..daa0b9e2467 100644 --- a/code/game/gamemodes/changeling/powers/fake_death.dm +++ b/code/game/gamemodes/changeling/powers/fake_death.dm @@ -22,7 +22,7 @@ to_chat(src, "We have no genomes, not even our own, and cannot regenerate.") return 0 - if(!C.stat && alert("Are we sure we wish to regenerate? We will appear to be dead while doing so.","Revival","Yes","No") == "No") + if(!C.stat && tgui_alert(src, "Are we sure we wish to regenerate? We will appear to be dead while doing so.","Revival",list("Yes","No")) == "No") return to_chat(C, "We will attempt to regenerate our form.") diff --git a/code/game/gamemodes/changeling/powers/hivemind.dm b/code/game/gamemodes/changeling/powers/hivemind.dm index 105de8f4f56..d07542875ae 100644 --- a/code/game/gamemodes/changeling/powers/hivemind.dm +++ b/code/game/gamemodes/changeling/powers/hivemind.dm @@ -37,7 +37,7 @@ var/list/datum/dna/hivemind_bank = list() to_chat(src, "The airwaves already have all of our DNA.") return - var/S = input("Select a DNA to channel: ", "Channel DNA", null) as null|anything in names + var/S = tgui_input_list(src, "Select a DNA to channel:", "Channel DNA", names) if(!S) return var/datum/absorbed_dna/chosen_dna = changeling.GetDNA(S) @@ -67,7 +67,7 @@ var/list/datum/dna/hivemind_bank = list() to_chat(src, "There's no new DNA to absorb from the air.") return - var/S = input("Select a DNA absorb from the air: ", "Absorb DNA", null) as null|anything in names + var/S = tgui_input_list(src, "Select a DNA to absorb:", "Absorb DNA", names) if(!S) return var/datum/absorbed_dna/chosen_dna = names[S] if(!chosen_dna) diff --git a/code/game/gamemodes/changeling/powers/lesser_form.dm b/code/game/gamemodes/changeling/powers/lesser_form.dm index ef82337d521..aa70756344b 100644 --- a/code/game/gamemodes/changeling/powers/lesser_form.dm +++ b/code/game/gamemodes/changeling/powers/lesser_form.dm @@ -46,7 +46,7 @@ for(var/datum/dna/DNA in changeling.absorbed_dna) names += "[DNA.real_name]" - var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names + var/S = tgui_input_list(src, "Select the target DNA:", "Target DNA", names) if(!S) return var/datum/dna/chosen_dna = changeling.GetDNA(S) diff --git a/code/game/gamemodes/changeling/powers/transform.dm b/code/game/gamemodes/changeling/powers/transform.dm index 6dd16061a12..535efbcac1e 100644 --- a/code/game/gamemodes/changeling/powers/transform.dm +++ b/code/game/gamemodes/changeling/powers/transform.dm @@ -21,7 +21,7 @@ for(var/datum/absorbed_dna/DNA in changeling.absorbed_dna) names += "[DNA.name]" - var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names + var/S = tgui_input_list(src, "Select the target DNA:", "Target DNA", names) if(!S) return var/datum/absorbed_dna/chosen_dna = changeling.GetDNA(S) diff --git a/code/game/gamemodes/changeling/powers/transform_sting.dm b/code/game/gamemodes/changeling/powers/transform_sting.dm index 1f6bc7b93dc..f831f9eb172 100644 --- a/code/game/gamemodes/changeling/powers/transform_sting.dm +++ b/code/game/gamemodes/changeling/powers/transform_sting.dm @@ -16,13 +16,11 @@ if(!changeling) return 0 - - var/list/names = list() for(var/datum/dna/DNA in changeling.absorbed_dna) names += "[DNA.real_name]" - var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names + var/S = tgui_input_list(src, "Select the target DNA:", "Target DNA", names) if(!S) return diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 4b095d2cd16..5a33a1d49a8 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -330,10 +330,10 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," return if (C>=26 + runedec + cult.current_antagonists.len) //including the useless rune at the secret room, shouldn't count against the limit of 25 runes - Urist - alert("The cloth of reality can't take that much of a strain. Remove some runes first!") + tgui_alert_async(user, "The cloth of reality can't take that much of a strain. Remove some runes first!") return else - switch(alert("You open the tome",,"Read it","Scribe a rune", "Cancel")) + switch(tgui_alert(user, "You open the tome", "Tome", list("Read it","Scribe a rune","Cancel"))) if("Cancel") return if("Read it") @@ -448,7 +448,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," if (!istype(user.loc,/turf)) to_chat(user, "You do not have enough space to write a proper rune.") var/list/runes = list("teleport", "itemport", "tome", "armor", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun") - r = input("Choose a rune to scribe", "Rune Scribing") in runes //not cancellable. + r = input(usr, "Choose a rune to scribe", "Rune Scribing") in runes // Remains input() for extreme blocking var/obj/effect/rune/R = new /obj/effect/rune if(istype(user, /mob/living/carbon/human)) var/mob/living/carbon/human/H = user @@ -461,7 +461,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") var/beacon if(usr) - beacon = input("Select the last rune", "Rune Scribing") in words + beacon = input(usr, "Select the last rune", "Rune Scribing") in words // Remains input() for extreme blocking R.word1=cultwords["travel"] R.word2=cultwords["self"] R.word3=beacon @@ -471,7 +471,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") var/beacon if(usr) - beacon = input("Select the last rune", "Rune Scribing") in words + beacon = input(usr, "Select the last rune", "Rune Scribing") in words // Remains input() for extreme blocking R.word1=cultwords["travel"] R.word2=cultwords["other"] R.word3=beacon diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 7526cecad53..fac7066de48 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -172,7 +172,7 @@ var/list/sacrificed = list() to_chat(target, "And you were able to force it out of your mind. You now know the truth, there's something horrible out there, stop it and its minions at all costs.") else spawn() - var/choice = alert(target,"Do you want to join the cult?","Submit to Nar'Sie","Resist","Submit") + var/choice = tgui_alert(target,"Do you want to join the cult?","Submit to Nar'Sie",list("Resist","Submit")) waiting_for_input[target] = 0 if(choice == "Submit") //choosing 'Resist' does nothing of course. cult.add_antagonist(target.mind) @@ -826,7 +826,7 @@ var/list/sacrificed = list() users+=C var/dam = round(15 / users.len) if(users.len>=3) - var/mob/living/carbon/cultist = input("Choose the one who you want to free", "Followers of Geometer") as null|anything in (cultists - users) + var/mob/living/carbon/cultist = tgui_input_list(user, "Choose the one who you want to free", "Followers of Geometer", (cultists - users)) if(!cultist) return fizzle() if (cultist == user) //just to be sure. @@ -872,7 +872,7 @@ var/list/sacrificed = list() if(iscultist(C) && !C.stat) users += C if(users.len>=3) - var/mob/living/carbon/cultist = input("Choose the one who you want to summon", "Followers of Geometer") as null|anything in (cultists - user) + var/mob/living/carbon/cultist = tgui_input_list(user, "Choose the one who you want to summon", "Followers of Geometer", (cultists - user)) if(!cultist) return fizzle() if (cultist == user) //just to be sure. diff --git a/code/game/gamemodes/cult/soulstone.dm b/code/game/gamemodes/cult/soulstone.dm index 9c430d124c3..3fbeb13a7f2 100644 --- a/code/game/gamemodes/cult/soulstone.dm +++ b/code/game/gamemodes/cult/soulstone.dm @@ -183,7 +183,7 @@ if(!A) to_chat(U, "Capture failed!: The soul stone is empty! Go kill someone!") return; - var/construct_class = input(U, "Please choose which type of construct you wish to create.") as null|anything in possible_constructs + var/construct_class = tgui_input_list(U, "Please choose which type of construct you wish to create.", "Construct Type", possible_constructs) switch(construct_class) if("Juggernaut") var/mob/living/simple_mob/construct/juggernaut/Z = new /mob/living/simple_mob/construct/juggernaut (get_turf(T.loc)) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index fa3dba92bc2..88efd6154e6 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -59,23 +59,23 @@ var/global/list/additional_antag_types = list() var/choice = "" switch(href_list["set"]) if("shuttle_delay") - choice = input("Enter a new shuttle delay multiplier") as num + choice = input(usr, "Enter a new shuttle delay multiplier") as num if(!choice || choice < 1 || choice > 20) return shuttle_delay = choice if("antag_scaling") - choice = input("Enter a new antagonist cap scaling coefficient.") as num + choice = input(usr, "Enter a new antagonist cap scaling coefficient.") as num if(isnull(choice) || choice < 0 || choice > 100) return antag_scaling_coeff = choice if("event_modifier_moderate") - choice = input("Enter a new moderate event time modifier.") as num + choice = input(usr, "Enter a new moderate event time modifier.") as num if(isnull(choice) || choice < 0 || choice > 100) return event_delay_mod_moderate = choice refresh_event_modifiers() if("event_modifier_severe") - choice = input("Enter a new moderate event time modifier.") as num + choice = input(usr, "Enter a new moderate event time modifier.") as num if(isnull(choice) || choice < 0 || choice > 100) return event_delay_mod_major = choice @@ -99,7 +99,7 @@ var/global/list/additional_antag_types = list() additional_antag_types -= antag.id message_admins("Admin [key_name_admin(usr)] removed [antag.role_text] template from game mode.") else if(href_list["add_antag_type"]) - var/choice = input("Which type do you wish to add?") as null|anything in all_antag_types + var/choice = tgui_input_list(usr, "Which type do you wish to add?", "Select Antag Type", all_antag_types) if(!choice) return var/datum/antagonist/antag = all_antag_types[choice] diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/HARDWARE.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/HARDWARE.dm index c9b76400d94..df2d223c6e4 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/HARDWARE.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/HARDWARE.dm @@ -23,7 +23,7 @@ user.bombing_core = 0 return - var/choice = alert("Really destroy core?", "Core self-destruct", "YES", "NO") + var/choice = tgui_alert(user, "Really destroy core?", "Core self-destruct", list("YES", "NO")) if(choice != "YES") return @@ -82,7 +82,7 @@ user.bombing_station = 0 return - var/choice = alert("Really destroy station?", "Station self-destruct", "YES", "NO") + var/choice = tgui_alert(user, "Really destroy station?", "Station self-destruct", list("YES", "NO")) if(choice != "YES") return if(!ability_prechecks(user, 0, 0)) diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm index 8c27df27322..677801f2c19 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/HELPERS.dm @@ -23,9 +23,8 @@ for(var/datum/malf_hardware/H in hardware_list) possible_choices += H.name - possible_choices += "CANCEL" - var/choice = input("Select desired hardware. You may only choose one hardware piece!: ") in possible_choices - if(choice == "CANCEL") + var/choice = tgui_input_list(user, "Select desired hardware. You may only choose one hardware piece!: ", "Hardware Choice", possible_choices) + if(!choice) return var/note = null @@ -47,7 +46,7 @@ error("Hardware without description: [C]") return - var/confirmation = alert("[note] - Is this what you want?", "Hardware selection", "Yes", "No") + var/confirmation = tgui_alert(user, "[note] - Is this what you want?", "Hardware selection", list("Yes", "No")) if(confirmation != "Yes") to_chat(user, "Selection cancelled. Use command again to select") return @@ -85,7 +84,7 @@ return var/datum/malf_research/res = user.research - var/datum/malf_research_ability/tar = input("Select your next research target") in res.available_abilities + var/datum/malf_research_ability/tar = tgui_input_list(user, "Select your next research target", "Select Research", res.available_abilities) if(!tar) return res.focus = tar diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm index aeb2439eeb0..e4db9a662d3 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm @@ -47,7 +47,7 @@ if(!ability_prechecks(user, price)) return - if (alert(user, "Really recall the shuttle?", "Recall Shuttle: ", "Yes", "No") != "Yes") + if (tgui_alert(user, "Really recall the shuttle?", "Recall Shuttle: ", list(list("Yes", "No"))) != "Yes") return if(!ability_pay(user, price)) @@ -95,14 +95,16 @@ return - var/targetname = input("Select unlock target: ") in robot_names + var/targetname = tgui_input_list(user, "Select unlock target:", "Unlock Target", robot_names) + if(!targetname) + return for(var/mob/living/silicon/robot/R in robots) if(targetname == R.name) target = R break if(target) - if(alert(user, "Really try to unlock cyborg [target.name]?", "Unlock Cyborg", "Yes", "No") != "Yes") + if(tgui_alert(user, "Really try to unlock cyborg [target.name]?", "Unlock Cyborg", list("Yes", "No")) != "Yes") return if(!ability_pay(user, price)) return @@ -153,7 +155,7 @@ return if(target) - if(alert(user, "Really try to hack cyborg [target.name]?", "Hack Cyborg", "Yes", "No") != "Yes") + if(tgui_alert(user, "Really try to hack cyborg [target.name]?", "Hack Cyborg", list("Yes", "No")) != "Yes") return if(!ability_pay(user, price)) return @@ -213,7 +215,7 @@ return if(target) - if(alert(user, "Really try to hack AI [target.name]?", "Hack AI", "Yes", "No") != "Yes") + if(tgui_alert(user, "Really try to hack AI [target.name]?", "Hack AI", list("Yes", "No")) != "Yes") return if(!ability_pay(user, price)) return @@ -248,7 +250,7 @@ to_chat(target, "SYSTEM LOG: User: Admin - Connection Lost. Changes Reverted.") return to_chat(user, "Hack succeeded. The AI is now under your exclusive control.") - to_chat(target, "SYSTEM LOG: System re¡3RT5§^#COMU@(#$)TED)@$") + to_chat(target, "SYSTEM LOG: System re�3RT5�^#COMU@(#$)TED)@$") for(var/i = 0, i < 5, i++) var/temptxt = pick("1101000100101001010001001001",\ "0101000100100100000100010010",\ diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm index 9d9bed799ac..40023f2cbee 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_manipulation.dm @@ -71,7 +71,7 @@ if(!ability_prechecks(user, price)) return - var/action = input("Select required action: ") in list("Reset", "Add X-Ray", "Add Motion Sensor", "Add EMP Shielding") + var/action = tgui_input_list(user, "Select required action:", "Hack Camera", list("Reset", "Add X-Ray", "Add Motion Sensor", "Add EMP Shielding")) if(!action || !target) return diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm index 03f74743804..d8229e1562a 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_networking.dm @@ -93,8 +93,8 @@ if(!ability_prechecks(user, price)) return - var/title = input("Select message title: ") - var/text = input("Select message text: ") + var/title = input(usr, "Select message title: ") + var/text = input(usr, "Select message text: ") if(!title || !text || !ability_pay(user, price)) to_chat(user, "Hack Aborted") return @@ -120,8 +120,8 @@ if(!ability_prechecks(user, price)) return - var/alert_target = input("Select new alert level:") in list("green", "yellow", "violet", "orange", "blue", "red", "delta", "CANCEL") - if(!alert_target || !ability_pay(user, price) || alert_target == "CANCEL") + var/alert_target = tgui_input_list(user, "Select new alert level:", "Alert Level", list("green", "yellow", "violet", "orange", "blue", "red", "delta")) + if(!alert_target || !ability_pay(user, price)) to_chat(user, "Hack Aborted") return @@ -140,7 +140,7 @@ set desc = "500 CPU - Begins hacking station's primary firewall, quickly overtaking remaining APC systems. When completed grants access to station's self-destruct mechanism. Network administrators will probably notice this." var/price = 500 var/mob/living/silicon/ai/user = usr - if (alert(user, "Begin system override? This cannot be stopped once started. The network administrators will probably notice this.", "System Override:", "Yes", "No") != "Yes") + if (tgui_alert(user, "Begin system override? This cannot be stopped once started. The network administrators will probably notice this.", "System Override:", list("Yes", "No")) != "Yes") return if (!ability_prechecks(user, price) || !ability_pay(user, price) || user.system_override) if(user.system_override) diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 62406c38774..22cf1f7290b 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -120,7 +120,7 @@ target=null location = null - switch(alert("Please select the mode you want to put the pinpointer in.", "Pinpointer Mode Select", "Location", "Disk Recovery", "Other Signature")) + switch(tgui_alert(usr, "Please select the mode you want to put the pinpointer in.", "Pinpointer Mode Select", list("Location", "Disk Recovery", "Other Signature"))) if("Location") mode = 1 @@ -145,12 +145,12 @@ if("Other Signature") mode = 2 - switch(alert("Search for item signature or DNA fragment?" , "Signature Mode Select" , "" , "Item" , "DNA")) + switch(tgui_alert(usr, "Search for item signature or DNA fragment?", "Signature Mode Select", list("Item", "DNA"))) if("Item") var/datum/objective/steal/itemlist itemlist = itemlist - var/targetitem = input("Select item to search for.", "Item Mode Select","") as null|anything in itemlist.possible_items + var/targetitem = tgui_input_list(usr, "Select item to search for.", "Item Mode Select", itemlist.possible_items) if(!targetitem) return target=locate(itemlist.possible_items[targetitem]) @@ -160,7 +160,7 @@ to_chat(usr, "You set the pinpointer to locate [targetitem]") if("DNA") - var/DNAstring = input("Input DNA string to search for." , "Please Enter String." , "") + var/DNAstring = input(usr, "Input DNA string to search for." , "Please Enter String." , "") if(!DNAstring) return for(var/mob/living/carbon/M in mob_list) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index a241b80256b..4c4c7e0da6b 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -473,15 +473,15 @@ var/global/list/all_objectives = list() /datum/objective/steal/proc/select_target() var/list/possible_items_all = possible_items+possible_items_special+"custom" - var/new_target = input("Select target:", "Objective target", steal_target) as null|anything in possible_items_all + var/new_target = tgui_input_list(usr, "Select target:", "Objective target", possible_items_all) if (!new_target) return if (new_target == "custom") - var/obj/item/custom_target = input("Select type:","Type") as null|anything in typesof(/obj/item) + var/obj/item/custom_target = tgui_input_list(usr, "Select type:", "Type", typesof(/obj/item)) if (!custom_target) return var/tmp_obj = new custom_target var/custom_name = tmp_obj:name qdel(tmp_obj) - custom_name = sanitize(input("Enter target name:", "Objective target", custom_name) as text|null) + custom_name = sanitize(input(usr, "Enter target name:", "Objective target", custom_name) as text|null) if (!custom_name) return target_name = custom_name steal_target = custom_target diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index cde2f9a2a2b..74f590a8486 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -101,15 +101,15 @@ mob hsb.req_access = list() var/accesses = get_all_accesses() for(var/A in accesses) - if(alert(usr, "Will this airlock require [get_access_desc(A)] access?", "Sandbox:", "Yes", "No") == "Yes") + if(tgui_alert(usr, "Will this airlock require [get_access_desc(A)] access?", "Sandbox:", list("Yes", "No")) == "Yes") LAZYADD(hsb.req_access, A) hsb.loc = usr.loc to_chat(usr, "Sandbox: Created an airlock.") if("hsbcanister") var/list/hsbcanisters = typesof(/obj/machinery/portable_atmospherics/canister/) - /obj/machinery/portable_atmospherics/canister/ - var/hsbcanister = input(usr, "Choose a canister to spawn.", "Sandbox:") in hsbcanisters + "Cancel" - if(!(hsbcanister == "Cancel")) + var/hsbcanister = tgui_input_list(usr, "Choose a canister to spawn:", "Sandbox", hsbcanisters) + if(hsbcanister) new hsbcanister(usr.loc) if("hsbfueltank") //var/obj/hsb = new/obj/weldfueltank @@ -146,6 +146,6 @@ mob continue selectable += O - var/hsbitem = input(usr, "Choose an object to spawn.", "Sandbox:") in selectable + "Cancel" - if(hsbitem != "Cancel") + var/hsbitem = tgui_input_list(usr, "Choose an object to spawn:", "Sandbox", selectable) + if(hsbitem) new hsbitem(usr.loc) diff --git a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm index 82138988b5e..a15fcd5b350 100644 --- a/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm +++ b/code/game/gamemodes/technomancer/devices/disposable_teleporter.dm @@ -31,7 +31,9 @@ to_chat(user, "\The [src] has ran out of uses, and is now useless to you!") return else - var/area_wanted = input(user, "Area to teleport to", "Teleportation") in teleportlocs + var/area_wanted = tgui_input_list(user, "Area to teleport to", "Teleportation", teleportlocs) + if(!area_wanted) + return var/area/A = teleportlocs[area_wanted] if(!A) return diff --git a/code/game/gamemodes/technomancer/spells/audible_deception.dm b/code/game/gamemodes/technomancer/spells/audible_deception.dm index fc67ba1ee3c..ebd8974305f 100644 --- a/code/game/gamemodes/technomancer/spells/audible_deception.dm +++ b/code/game/gamemodes/technomancer/spells/audible_deception.dm @@ -68,7 +68,7 @@ var/list/sound_options = available_sounds if(check_for_scepter()) sound_options["!!AIR HORN!!"] = 'sound/items/AirHorn.ogg' - var/new_sound = input("Select the sound you want to make.","Sounds") as null|anything in sound_options + var/new_sound = tgui_input_list(usr, "Select the sound you want to make.", "Sounds", sound_options) if(new_sound) selected_sound = sound_options[new_sound] diff --git a/code/game/gamemodes/technomancer/spells/control.dm b/code/game/gamemodes/technomancer/spells/control.dm index 0e0cf5eb205..3ca26b3b044 100644 --- a/code/game/gamemodes/technomancer/spells/control.dm +++ b/code/game/gamemodes/technomancer/spells/control.dm @@ -88,8 +88,7 @@ /obj/item/weapon/spell/control/on_use_cast(mob/living/user) if(controlled_mobs.len != 0) - var/choice = alert(user,"Would you like to release control of the entities you are controlling? They won't be friendly \ - to you anymore if you do this, so be careful.","Release Control?","No","Yes") + var/choice = tgui_alert(user,"Would you like to release control of the entities you are controlling? They won't be friendly to you anymore if you do this, so be careful.","Release Control?",list("No","Yes")) if(choice == "Yes") for(var/mob/living/L in controlled_mobs) deselect(L) diff --git a/code/game/gamemodes/technomancer/spells/illusion.dm b/code/game/gamemodes/technomancer/spells/illusion.dm index 5d626f7c479..dcadf53ffb1 100644 --- a/code/game/gamemodes/technomancer/spells/illusion.dm +++ b/code/game/gamemodes/technomancer/spells/illusion.dm @@ -44,7 +44,7 @@ /obj/item/weapon/spell/illusion/on_use_cast(mob/user) if(illusion) - var/choice = alert(user, "Would you like to have \the [illusion] speak, or do an emote?", "Illusion", "Speak","Emote","Cancel") + var/choice = tgui_alert(user, "Would you like to have \the [illusion] speak, or do an emote?", "Illusion", list("Speak","Emote","Cancel")) switch(choice) if("Cancel") return diff --git a/code/game/gamemodes/technomancer/spells/summon/summon.dm b/code/game/gamemodes/technomancer/spells/summon/summon.dm index c7c94c08692..3f39f7d9601 100644 --- a/code/game/gamemodes/technomancer/spells/summon/summon.dm +++ b/code/game/gamemodes/technomancer/spells/summon/summon.dm @@ -34,7 +34,7 @@ /obj/item/weapon/spell/summon/on_use_cast(mob/living/user) if(summon_options.len) - var/choice = input(user, "Choose a creature to kidnap from somewhere!", "Summon") as null|anything in summon_options + var/choice = tgui_input_list(user, "Choose a creature to kidnap from somewhere!", "Summon", summon_options) if(choice) summoned_mob_type = summon_options[choice] diff --git a/code/game/gamemodes/technomancer/spells/track.dm b/code/game/gamemodes/technomancer/spells/track.dm index ae342a46a12..461c4e83913 100644 --- a/code/game/gamemodes/technomancer/spells/track.dm +++ b/code/game/gamemodes/technomancer/spells/track.dm @@ -44,7 +44,7 @@ var/list/technomancer_belongings = list() if(L == user) continue mob_choices += L - var/choice = input(user,"Decide what or who to track.","Tracking") as null|anything in object_choices + mob_choices + var/choice = tgui_input_list(user, "Decide what or who to track.", "Tracking", (object_choices + mob_choices)) if(choice) tracked = choice tracking = 1 diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 46f6710aafb..73c15fd6677 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -326,7 +326,7 @@ if("ejectify") go_out() if("changestasis") - var/new_stasis = input("Levels deeper than 50% stasis level will render the patient unconscious.","Stasis Level") as null|anything in stasis_choices + var/new_stasis = tgui_input_list(usr, "Levels deeper than 50% stasis level will render the patient unconscious.","Stasis Level", stasis_choices) if(new_stasis) stasis_level = stasis_choices[new_stasis] if("auto_eject_dead_on") diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index 5d2deb079b6..8f223ed5492 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -30,6 +30,7 @@ icon = 'icons/obj/monitors_vr.dmi' //VOREStation Edit - Other icons icon_state = "alarm0" layer = ABOVE_WINDOW_LAYER + vis_flags = VIS_HIDE // They have an emissive that looks bad in openspace due to their wall-mounted nature anchored = 1 use_power = USE_POWER_IDLE idle_power_usage = 80 @@ -639,7 +640,7 @@ var/list/selected = TLV["temperature"] var/max_temperature = min(selected[3] - T0C, MAX_TEMPERATURE) var/min_temperature = max(selected[2] - T0C, MIN_TEMPERATURE) - var/input_temperature = input("What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C) as num|null + var/input_temperature = input(usr, "What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C) as num|null if(isnum(input_temperature)) if(input_temperature > max_temperature || input_temperature < min_temperature) to_chat(usr, "Temperature must be between [min_temperature]C and [max_temperature]C") @@ -693,7 +694,7 @@ var/env = params["env"] var/name = params["var"] - var/value = input("New [name] for [env]:", name, TLV[env][name]) as num|null + var/value = input(usr, "New [name] for [env]:", name, TLV[env][name]) as num|null if(!isnull(value) && !..()) if(value < 0) TLV[env][name] = -1 diff --git a/code/game/machinery/airconditioner_vr.dm b/code/game/machinery/airconditioner_vr.dm index 1aa25160858..4e9ce2d22bf 100644 --- a/code/game/machinery/airconditioner_vr.dm +++ b/code/game/machinery/airconditioner_vr.dm @@ -47,7 +47,7 @@ turn_off() return if(istype(I, /obj/item/device/multitool)) - var/new_temp = input("Input a new target temperature, in degrees C.","Target Temperature", 20) as num + var/new_temp = input(usr, "Input a new target temperature, in degrees C.","Target Temperature", 20) as num if(!Adjacent(user) || user.incapacitated()) return new_temp = convert_c2k(new_temp) diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index 8895844b008..83fd5943823 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -315,7 +315,7 @@ update_flag "\[Air\]" = "grey", \ "\[CAUTION\]" = "yellow", \ ) - var/label = input("Choose canister label", "Gas canister") as null|anything in colors + var/label = tgui_input_list(usr, "Choose canister label", "Gas canister", colors) if(label) canister_color = colors[label] icon_state = colors[label] @@ -332,7 +332,7 @@ update_flag pressure = 10*ONE_ATMOSPHERE . = TRUE else if(pressure == "input") - pressure = input("New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure) as num|null + pressure = input(usr, "New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure) as num|null if(!isnull(pressure) && !..()) . = TRUE else if(text2num(pressure) != null) diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm index 43cd3e0e2d5..b951a3c3964 100644 --- a/code/game/machinery/bioprinter.dm +++ b/code/game/machinery/bioprinter.dm @@ -132,7 +132,7 @@ return if(container) - var/response = alert(user, "What do you want to do?", "Bioprinter Menu", "Print Limbs", "Cancel") + var/response = tgui_alert(user, "What do you want to do?", list("Bioprinter Menu", "Print Limbs", "Cancel")) if(response == "Print Limbs") printing_menu(user) else @@ -149,7 +149,7 @@ if(anomalous_organs) possible_list |= anomalous_products - var/choice = input("What would you like to print?") as null|anything in possible_list + var/choice = tgui_input_list(usr, "What would you like to print?", "Print Choice", possible_list) if(!choice || printing || (stat & (BROKEN|NOPOWER))) return diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 17f82629d49..5cec5a5b42d 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -101,16 +101,16 @@ C.auto_turn() - C.replace_networks(uniquelist(tempnetwork)) + C.replace_networks(uniqueList(tempnetwork)) C.c_tag = input for(var/i = 5; i >= 0; i -= 1) - var/direct = input(user, "Direction?", "Assembling Camera", null) in list("LEAVE IT", "NORTH", "EAST", "SOUTH", "WEST" ) + var/direct = tgui_input_list(user, "Direction?", "Assembling Camera", list("NORTH", "EAST", "SOUTH", "WEST", "LEAVE IT")) if(direct != "LEAVE IT") C.dir = text2dir(direct) if(i != 0) - var/confirm = alert(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", "Yes", "No") + var/confirm = tgui_alert(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", list("Yes", "No")) if(confirm == "Yes") break return diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 397366c6c22..8e162b6d566 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -168,7 +168,7 @@ playsound(src, P.usesound, 50, 1) to_chat(user, "You connect the monitor.") if(!brain) - var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes" + var/open_for_latejoin = tgui_alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", list("Yes", "No")) == "Yes" var/obj/structure/AIcore/deactivated/D = new(loc) if(open_for_latejoin) empty_playable_ai_cores += D @@ -262,7 +262,7 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva for(var/obj/structure/AIcore/deactivated/D in all_deactivated_AI_cores) cores["[D] ([D.loc.loc])"] = D - var/id = input("Which core?", "Toggle AI Core Latejoin", null) as null|anything in cores + var/id = tgui_input_list(usr, "Which core?", "Toggle AI Core Latejoin", cores) if(!id) return var/obj/structure/AIcore/deactivated/D = cores[id] diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 14fae598ffc..059f0582431 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -1182,7 +1182,7 @@ // Have the customer punch in the PIN before checking if there's enough money. Prevents people from figuring out acct is // empty at high security levels if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2) - var/attempt_pin = input("Enter pin code", "Vendor transaction") as num + var/attempt_pin = input(usr, "Enter pin code", "Vendor transaction") as num customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2) if(!customer_account) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index 3473216a7bd..58565ead6e1 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -206,7 +206,7 @@ if(is_authenticated() && modify) var/t1 = params["assign_target"] if(t1 == "Custom") - var/temp_t = sanitize(input("Enter a custom job assignment.","Assignment"), 45) + var/temp_t = sanitize(input(usr, "Enter a custom job assignment.","Assignment"), 45) //let custom jobs function as an impromptu alt title, mainly for sechuds if(temp_t && modify) modify.assignment = temp_t diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm index 29925b20597..e23aa459bec 100644 --- a/code/game/machinery/computer/guestpass.dm +++ b/code/game/machinery/computer/guestpass.dm @@ -45,7 +45,7 @@ to_chat(user, "This guest pass is already deactivated!") return - var/confirm = alert("Do you really want to deactivate this guest pass? (you can't reactivate it)", "Confirm Deactivation", "Yes", "No") + var/confirm = tgui_alert(usr, "Do you really want to deactivate this guest pass? (you can't reactivate it)", "Confirm Deactivation", list("Yes", "No")) if(confirm == "Yes") //rip guest pass \The [user] deactivates \the [src].") @@ -82,6 +82,7 @@ desc = "Used to print temporary passes for people. Handy!" icon_state = "guest" layer = ABOVE_WINDOW_LAYER + vis_flags = VIS_HIDE // They have an emissive that looks bad in openspace due to their wall-mounted nature icon_keyboard = null icon_screen = "pass" density = 0 @@ -162,15 +163,15 @@ mode = params["mode"] if("giv_name") - var/nam = sanitizeName(input("Person pass is issued to", "Name", giv_name) as text|null) + var/nam = sanitizeName(input(usr, "Person pass is issued to", "Name", giv_name) as text|null) if(nam) giv_name = nam if("reason") - var/reas = sanitize(input("Reason why pass is issued", "Reason", reason) as text|null) + var/reas = sanitize(input(usr, "Reason why pass is issued", "Reason", reason) as text|null) if(reas) reason = reas if("duration") - var/dur = input("Duration (in minutes) during which pass is valid (up to 360 minutes).", "Duration") as num|null //VOREStation Edit + var/dur = input(usr, "Duration (in minutes) during which pass is valid (up to 360 minutes).", "Duration") as num|null //VOREStation Edit if(dur) if(dur > 0 && dur <= 360) //VOREStation Edit duration = dur diff --git a/code/game/machinery/computer/id_restorer_vr.dm b/code/game/machinery/computer/id_restorer_vr.dm index af7f9304f95..c9bbf49a273 100644 --- a/code/game/machinery/computer/id_restorer_vr.dm +++ b/code/game/machinery/computer/id_restorer_vr.dm @@ -37,7 +37,7 @@ to_chat(user, "No ID is inserted.") return - var/choice = alert(user,"What do you want to do?","[src]","Restore ID access","Eject ID","Cancel") + var/choice = tgui_alert(user,"What do you want to do?","[src]",list("Restore ID access","Eject ID","Cancel")) if(user.incapacitated() || (get_dist(src, user) > 1)) return switch(choice) diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 87b35e8cd03..b39e8513bfb 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -198,7 +198,7 @@ //Find a server if("find") if(message_servers && message_servers.len > 1) - linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers + linkedServer = tgui_input_list(usr,"Please select a server.", "Select a server.", message_servers) set_temp("NOTICE: Server selected.", "alert") else if(message_servers && message_servers.len > 0) linkedServer = message_servers[1] diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 0a57a5e4c53..309453ee290 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -220,8 +220,8 @@ var/mob/living/silicon/robot/R = locate(params["ref"]) if(!can_hack(usr, R)) return - var/choice = input("Really hack [R.name]? This cannot be undone.") in list("Yes", "No") - if(choice != "Yes") + var/choice = tgui_alert(usr, "Really hack [R.name]? This cannot be undone.", "Hack?", list("Yes", "No")) + if(choice == "No") return log_game("[key_name(usr)] emagged [key_name(R)] using robotic console!") message_admins("[key_name_admin(usr)] emagged [key_name_admin(R)] using robotic console!") diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index d3de10cba16..d4e58675493 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -28,7 +28,7 @@ to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ") return 0 - var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort") + var/choice = tgui_alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", list("Authorize", "Repeal", "Abort")) if(emergency_shuttle.location() && user.get_active_hand() != W) return 0 switch(choice) @@ -58,7 +58,7 @@ src.authorized = list( ) else if (istype(W, /obj/item/weapon/card/emag) && !emagged) - var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel") + var/choice = tgui_alert(user, "Would you like to launch the shuttle?", "Shuttle control", list("Launch", "Cancel")) if(!emagged && !emergency_shuttle.location() && user.get_active_hand() == W) switch(choice) diff --git a/code/game/machinery/computer/supply.dm b/code/game/machinery/computer/supply.dm index 6b9b0f7380d..e805e151bd5 100644 --- a/code/game/machinery/computer/supply.dm +++ b/code/game/machinery/computer/supply.dm @@ -169,7 +169,7 @@ "cost" = P.cost, "group" = P.group, "contraband" = P.contraband, - "manifest" = uniquelist(P.manifest), + "manifest" = uniqueList(P.manifest), "random" = P.num_contained, "ref" = "\ref[P]" ) @@ -201,7 +201,7 @@ var/list/payload = list( "name" = P.name, "cost" = P.cost, - "manifest" = uniquelist(P.manifest), + "manifest" = uniqueList(P.manifest), "ref" = "\ref[P]", "random" = P.num_contained, ) @@ -394,7 +394,7 @@ if(!(authorization & SUP_ACCEPT_ORDERS)) return FALSE var/list/L = E.contents[params["index"]] - var/field = alert(usr, "Select which field to edit", , "Name", "Quantity", "Value") + var/field = tgui_alert(usr, "Select which field to edit", "Field Choice", list("Name", "Quantity", "Value")) var/new_val = sanitize(input(usr, field, "Enter the new value for this field:", L[lowertext(field)]) as null|text) if(!new_val) diff --git a/code/game/machinery/computer3/computers/card.dm b/code/game/machinery/computer3/computers/card.dm index f9e43aaa7d7..d2f6074c784 100644 --- a/code/game/machinery/computer3/computers/card.dm +++ b/code/game/machinery/computer3/computers/card.dm @@ -305,7 +305,7 @@ if(auth) var/t1 = href_list["assign"] if(t1 == "Custom") - var/temp_t = sanitize(input("Enter a custom job assignment.","Assignment")) + var/temp_t = sanitize(input(usr, "Enter a custom job assignment.","Assignment")) if(temp_t) t1 = temp_t set_default_access(t1) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 3cd05e69b57..51d97df592d 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -664,7 +664,7 @@ var/willing = null //We don't want to allow people to be forced into despawning. if(M.client) - if(alert(M,"Would you like to enter long-term storage?",,"Yes","No") == "Yes") + if(tgui_alert(M,"Would you like to enter long-term storage?","Cryopod",list("Yes","No")) == "Yes") if(!M) return willing = 1 else diff --git a/code/game/machinery/deployable_vr.dm b/code/game/machinery/deployable_vr.dm index 2f2f2f6adfb..25fdd4ed60f 100644 --- a/code/game/machinery/deployable_vr.dm +++ b/code/game/machinery/deployable_vr.dm @@ -71,7 +71,7 @@ /obj/structure/barricade/cutout/attackby(var/obj/I, var/mob/user) if(is_type_in_list(I, painters)) - var/choice = input(user, "What would you like to paint the cutout as?", "Cutout Painting") as null|anything in cutout_types + var/choice = tgui_input_list(user, "What would you like to paint the cutout as?", "Cutout Painting", cutout_types) if(!choice || !Adjacent(user, src) || I != user.get_active_hand()) return TRUE if(do_after(user, 10 SECONDS, src)) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index e9585aa8121..d7617f53095 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -152,8 +152,8 @@ if(A.firedoors_closed) alarmed = 1 - var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\ - "\The [src]", "Yes, [density ? "open" : "close"]", "No") + var/answer = tgui_alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\ + "\The [src]", list("Yes, [density ? "open" : "close"]", "No")) if(answer == "No") return if(user.incapacitated() || (get_dist(src, user) > 1 && !issilicon(user))) diff --git a/code/game/machinery/fire_alarm.dm b/code/game/machinery/fire_alarm.dm index a1a22b80c89..6c5e6400d43 100644 --- a/code/game/machinery/fire_alarm.dm +++ b/code/game/machinery/fire_alarm.dm @@ -8,6 +8,7 @@ FIRE ALARM icon_state = "fire" layer = ABOVE_WINDOW_LAYER blocks_emissive = FALSE + vis_flags = VIS_HIDE // They have an emissive that looks bad in openspace due to their wall-mounted nature var/detecting = 1.0 var/working = 1.0 var/time = 10.0 diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm index d8a2b463e2c..c77dff55ecc 100644 --- a/code/game/machinery/floorlayer.dm +++ b/code/game/machinery/floorlayer.dm @@ -35,7 +35,7 @@ /obj/machinery/floorlayer/attackby(var/obj/item/W as obj, var/mob/user as mob) if(W.is_wrench()) - var/m = input("Choose work mode", "Mode") as null|anything in mode + var/m = tgui_input_list(usr, "Choose work mode", "Mode", mode) mode[m] = !mode[m] var/O = mode[m] user.visible_message("[usr] has set \the [src] [m] mode [!O?"off":"on"].", "You set \the [src] [m] mode [!O?"off":"on"].") @@ -51,7 +51,7 @@ if(!length(contents)) to_chat(user, "\The [src] is empty.") else - var/obj/item/stack/tile/E = input("Choose remove tile type.", "Tiles") as null|anything in contents + var/obj/item/stack/tile/E = tgui_input_list(usr, "Choose remove tile type.", "Tiles", contents) if(E) to_chat(user, "You remove the [E] from \the [src].") E.loc = src.loc @@ -59,7 +59,7 @@ return if(W.is_screwdriver()) - T = input("Choose tile type.", "Tiles") as null|anything in contents + T = tgui_input_list(usr, "Choose tile type.", "Tiles", contents) return ..() diff --git a/code/game/machinery/gear_dispenser.dm b/code/game/machinery/gear_dispenser.dm index 28a7e93d969..562c9906f47 100644 --- a/code/game/machinery/gear_dispenser.dm +++ b/code/game/machinery/gear_dispenser.dm @@ -188,7 +188,7 @@ var/list/dispenser_presets = list() dispenser_flags &= ~GD_BUSY return - var/choice = input("Select equipment to dispense.", "Equipment Dispenser") as null|anything in gear_list + var/choice = tgui_input_list(usr, "Select equipment to dispense.", "Equipment Dispenser", gear_list) if(!choice) dispenser_flags &= ~GD_BUSY diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 4c283cd3014..fa9ab86e546 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -54,7 +54,7 @@ var/const/HOLOPAD_MODE = RANGE_BASED /obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests. if(!istype(user)) return - if(alert(user,"Would you like to request an AI's presence?",,"Yes","No") == "Yes") + if(tgui_alert(user,"Would you like to request an AI's presence?","Request AI",list("Yes","No")) == "Yes") if(last_request + 200 < world.time) //don't spam the AI with requests you jerk! last_request = world.time to_chat(user, "You request an AI's presence.") @@ -223,7 +223,7 @@ Holographic project of everything else. var/icon/flat_icon = icon(getFlatIcon(src,0))//Need to make sure it's a new icon so the old one is not reused. flat_icon.ColorTone(rgb(125,180,225))//Let's make it bluish. flat_icon.ChangeOpacity(0.5)//Make it half transparent. - var/input = input("Select what icon state to use in effect.",,"") + var/input = input(usr, "Select what icon state to use in effect.",,"") if(input) var/icon/alpha_mask = new('icons/effects/effects.dmi', "[input]") flat_icon.AddAlphaMask(alpha_mask)//Finally, let's mix in a distortion effect. diff --git a/code/game/machinery/holoposter.dm b/code/game/machinery/holoposter.dm index a273cc1474e..7a71d9fc641 100644 --- a/code/game/machinery/holoposter.dm +++ b/code/game/machinery/holoposter.dm @@ -8,6 +8,7 @@ GLOBAL_LIST_EMPTY(holoposters) use_power = 1 idle_power_usage = 80 power_channel = ENVIRON + vis_flags = VIS_HIDE // They have an emissive that looks bad in openspace due to their wall-mounted nature var/icon_forced = FALSE var/examine_addon = "It appears to be powered off." var/mytimer @@ -84,7 +85,7 @@ GLOBAL_LIST_EMPTY(holoposters) return if (W.is_multitool()) playsound(src, 'sound/items/penclick.ogg', 60, 1) - icon_state = input("Available Posters", "Holographic Poster") as null|anything in postertypes + "random" + icon_state = tgui_input_list(usr, "Available Posters", "Holographic Poster", postertypes + "random") if(!Adjacent(user)) return if(icon_state == "random") diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index 89bd996dea9..44a80c44452 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -12,6 +12,7 @@ idle_power_usage = 10 power_channel = LIGHT blocks_emissive = FALSE + vis_flags = VIS_HIDE // They have an emissive that looks bad in openspace due to their wall-mounted nature var/on = 1 var/area/area = null var/otherarea = null diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 6d4453d1f22..6a92186ac50 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -150,7 +150,7 @@ Transponder Codes: