mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-18 18:46:24 +01:00
Merge branch 'kk-charpod' of https://github.com/KillianKirilenko/VOREStation into kk-charpod
This commit is contained in:
@@ -206,10 +206,10 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/binary/algae_farm/tgui_act(action, params)
|
||||
/obj/machinery/atmospherics/binary/algae_farm/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
switch(action)
|
||||
if("toggle")
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(user)
|
||||
if(!allowed(user))
|
||||
to_chat(user, span_warning("Access denied."))
|
||||
return
|
||||
@@ -235,7 +235,7 @@
|
||||
return data
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/tgui_act(action, params)
|
||||
/obj/machinery/atmospherics/binary/passive_gate/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -258,7 +258,7 @@
|
||||
if("max")
|
||||
target_pressure = max_pressure_setting
|
||||
if("set")
|
||||
var/new_pressure = tgui_input_number(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure Control",src.target_pressure,max_pressure_setting,0)
|
||||
var/new_pressure = tgui_input_number(ui.user,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure Control",src.target_pressure,max_pressure_setting,0)
|
||||
src.target_pressure = between(0, new_pressure, max_pressure_setting)
|
||||
|
||||
if("set_flow_rate")
|
||||
@@ -269,11 +269,11 @@
|
||||
if("max")
|
||||
set_flow_rate = air1.volume
|
||||
if("set")
|
||||
var/new_flow_rate = tgui_input_number(usr,"Enter new flow rate limit (0-[air1.volume]L/s)","Flow Rate Control",src.set_flow_rate,air1.volume,0)
|
||||
var/new_flow_rate = tgui_input_number(ui.user,"Enter new flow rate limit (0-[air1.volume]L/s)","Flow Rate Control",src.set_flow_rate,air1.volume,0)
|
||||
src.set_flow_rate = between(0, new_flow_rate, air1.volume)
|
||||
|
||||
update_icon()
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
if (!W.has_tool_quality(TOOL_WRENCH))
|
||||
|
||||
@@ -201,13 +201,13 @@ Thus, the two variables affect pump operation are set in New():
|
||||
/obj/machinery/atmospherics/binary/pump/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(user)
|
||||
if(!allowed(user))
|
||||
to_chat(user, span_warning("Access denied."))
|
||||
return
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/tgui_act(action, params)
|
||||
/obj/machinery/atmospherics/binary/pump/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -223,11 +223,11 @@ Thus, the two variables affect pump operation are set in New():
|
||||
if("max")
|
||||
target_pressure = max_pressure_setting
|
||||
if("set")
|
||||
var/new_pressure = tgui_input_number(usr,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure control",src.target_pressure,max_pressure_setting,0)
|
||||
var/new_pressure = tgui_input_number(ui.user,"Enter new output pressure (0-[max_pressure_setting]kPa)","Pressure control",src.target_pressure,max_pressure_setting,0)
|
||||
src.target_pressure = between(0, new_pressure, max_pressure_setting)
|
||||
. = TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/power_change()
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
else
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/omni/atmos_filter/tgui_act(action, params)
|
||||
/obj/machinery/atmospherics/omni/atmos_filter/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
if("set_flow_rate")
|
||||
if(!configuring || use_power)
|
||||
return
|
||||
var/new_flow_rate = tgui_input_number(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate,max_flow_rate,0)
|
||||
var/new_flow_rate = tgui_input_number(ui.user,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate,max_flow_rate,0)
|
||||
set_flow_rate = between(0, new_flow_rate, max_flow_rate)
|
||||
. = TRUE
|
||||
if("switch_mode")
|
||||
@@ -182,7 +182,7 @@
|
||||
if("switch_filter")
|
||||
if(!configuring || use_power)
|
||||
return
|
||||
var/new_filter = tgui_input_list(usr, "Select filter mode:", "Change filter", list("None", "Oxygen", "Nitrogen", "Carbon Dioxide", "Phoron", "Nitrous Oxide"))
|
||||
var/new_filter = tgui_input_list(ui.user, "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))
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/omni/mixer/tgui_act(action, params)
|
||||
/obj/machinery/atmospherics/omni/mixer/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
. = TRUE
|
||||
if(!configuring || use_power)
|
||||
return
|
||||
var/new_flow_rate = tgui_input_number(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate,max_flow_rate,0)
|
||||
var/new_flow_rate = tgui_input_number(ui.user,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",set_flow_rate,max_flow_rate,0)
|
||||
set_flow_rate = between(0, new_flow_rate, max_flow_rate)
|
||||
if("switch_mode")
|
||||
. = TRUE
|
||||
@@ -195,7 +195,7 @@
|
||||
. = TRUE
|
||||
if(!configuring || use_power)
|
||||
return
|
||||
change_concentration(dir_flag(params["dir"]))
|
||||
change_concentration(dir_flag(params["dir"]), ui.user)
|
||||
if("switch_conlock")
|
||||
. = TRUE
|
||||
if(!configuring || use_power)
|
||||
@@ -244,7 +244,7 @@
|
||||
update_ports()
|
||||
rebuild_mixing_inputs()
|
||||
|
||||
/obj/machinery/atmospherics/omni/mixer/proc/change_concentration(var/port = NORTH)
|
||||
/obj/machinery/atmospherics/omni/mixer/proc/change_concentration(var/port = NORTH, mob/user)
|
||||
tag_north_con = null
|
||||
tag_south_con = null
|
||||
tag_east_con = null
|
||||
@@ -266,7 +266,7 @@
|
||||
if(non_locked < 1)
|
||||
return
|
||||
|
||||
var/new_con = (tgui_input_number(usr,"Enter a new concentration (0-[round(remain_con * 100, 0.5)])%","Concentration control", min(remain_con, old_con)*100, round(remain_con * 100, 0.5), 0)) / 100
|
||||
var/new_con = (tgui_input_number(user,"Enter a new concentration (0-[round(remain_con * 100, 0.5)])%","Concentration control", min(remain_con, old_con)*100, round(remain_con * 100, 0.5), 0)) / 100
|
||||
|
||||
//cap it between 0 and the max remaining concentration
|
||||
new_con = between(0, new_con, remain_con)
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
if(..())
|
||||
return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.add_fingerprint(user)
|
||||
tgui_interact(user)
|
||||
return
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ GLOBAL_LIST_EMPTY(shutoff_valves)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/valve/shutoff/attack_hand(var/mob/user)
|
||||
src.add_fingerprint(usr)
|
||||
src.add_fingerprint(user)
|
||||
update_icon(1)
|
||||
close_on_leaks = !close_on_leaks
|
||||
to_chat(user, "You [close_on_leaks ? "enable" : "disable"] the automatic shutoff circuit.")
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/trinary/atmos_filter/tgui_act(action, params)
|
||||
/obj/machinery/atmospherics/trinary/atmos_filter/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
if(4)//removing N2O
|
||||
filtered_out += "nitrous_oxide"
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
update_icon()
|
||||
|
||||
//
|
||||
|
||||
@@ -100,11 +100,11 @@
|
||||
if(..())
|
||||
return
|
||||
tgui_interact(user)
|
||||
// src.add_fingerprint(usr)
|
||||
// src.add_fingerprint(user)
|
||||
// if(!src.allowed(user))
|
||||
// to_chat(user, span_warning("Access denied."))
|
||||
// return
|
||||
// usr.set_machine(src)
|
||||
// user.set_machine(src)
|
||||
// var/list/node_connects = get_node_connect_dirs()
|
||||
// var/dat = {span_bold("Power: ") + "<a href='?src=\ref[src];power=1'>[use_power?"On":"Off"]</a><br>
|
||||
// <b>Set Flow Rate Limit: </b>
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
src.add_fingerprint(user)
|
||||
update_icon(1)
|
||||
sleep(10)
|
||||
if (src.state)
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/tgui_act(action, params)
|
||||
/obj/machinery/atmospherics/unary/freezer/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
var/new_setting = between(0, text2num(params["value"]), 100)
|
||||
set_power_level(new_setting)
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/freezer/process()
|
||||
..()
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/unary/heater/tgui_act(action, params)
|
||||
/obj/machinery/atmospherics/unary/heater/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
var/new_setting = between(0, text2num(params["value"]), 100)
|
||||
set_power_level(new_setting)
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
//upgrading parts
|
||||
/obj/machinery/atmospherics/unary/heater/RefreshParts()
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/valve/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
src.add_fingerprint(user)
|
||||
update_icon(1)
|
||||
sleep(10)
|
||||
if (src.open)
|
||||
|
||||
+30
-4
@@ -18,6 +18,15 @@
|
||||
#define MC_AVG_FAST_UP_SLOW_DOWN(average, current) (average > current ? MC_AVERAGE_SLOW(average, current) : MC_AVERAGE_FAST(average, current))
|
||||
#define MC_AVG_SLOW_UP_FAST_DOWN(average, current) (average < current ? MC_AVERAGE_SLOW(average, current) : MC_AVERAGE_FAST(average, current))
|
||||
|
||||
///creates a running average of "things elapsed" per time period when you need to count via a smaller time period.
|
||||
///eg you want an average number of things happening per second but you measure the event every tick (50 milliseconds).
|
||||
///make sure both time intervals are in the same units. doesn't work if current_duration > total_duration or if total_duration == 0
|
||||
#define MC_AVG_OVER_TIME(average, current, total_duration, current_duration) ((((total_duration) - (current_duration)) / (total_duration)) * (average) + (current))
|
||||
|
||||
#define MC_AVG_MINUTES(average, current, current_duration) (MC_AVG_OVER_TIME(average, current, 1 MINUTES, current_duration))
|
||||
|
||||
#define MC_AVG_SECONDS(average, current, current_duration) (MC_AVG_OVER_TIME(average, current, 1 SECONDS, current_duration))
|
||||
|
||||
#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;}
|
||||
|
||||
#define START_PROCESSING(Processor, Datum) if (!(Datum.datum_flags & DF_ISPROCESSING)) {Datum.datum_flags |= DF_ISPROCESSING;Processor.processing += Datum}
|
||||
@@ -70,18 +79,35 @@
|
||||
|
||||
#define SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/##X);\
|
||||
/datum/controller/subsystem/##X/New(){\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
}\
|
||||
/datum/controller/subsystem/##X
|
||||
|
||||
#define TIMER_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/timer/##X);\
|
||||
/datum/controller/subsystem/timer/##X/New(){\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
}\
|
||||
/datum/controller/subsystem/timer/##X/fire() {..() /*just so it shows up on the profiler*/} \
|
||||
/datum/controller/subsystem/timer/##X
|
||||
|
||||
#define PROCESSING_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/processing/##X);\
|
||||
/datum/controller/subsystem/processing/##X/New(){\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
}\
|
||||
/datum/controller/subsystem/processing/##X/fire() {..() /*just so it shows up on the profiler*/} \
|
||||
/datum/controller/subsystem/processing/##X
|
||||
|
||||
#define VERB_MANAGER_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/verb_manager/##X);\
|
||||
/datum/controller/subsystem/verb_manager/##X/New(){\
|
||||
NEW_SS_GLOBAL(SS##X);\
|
||||
PreInit();\
|
||||
}\
|
||||
/datum/controller/subsystem/verb_manager/##X/fire() {..() /*just so it shows up on the profiler*/} \
|
||||
/datum/controller/subsystem/verb_manager/##X
|
||||
|
||||
// Boilerplate code for multi-step processors. See machines.dm for example use.
|
||||
#define INTERNAL_PROCESS_STEP(this_step, initial_step, proc_to_call, cost_var, next_step)\
|
||||
if(current_step == this_step || (initial_step && !resumed)) /* So we start at step 1 if not resumed.*/ {\
|
||||
|
||||
@@ -187,6 +187,10 @@ What is the naming convention for planes or layers?
|
||||
#define PLANE_PLAYER_HUD_ITEMS 96 //Separate layer with which to apply colorblindness
|
||||
#define PLANE_PLAYER_HUD_ABOVE 97 //Things above the player hud
|
||||
|
||||
#define RADIAL_BACKGROUND_LAYER 0
|
||||
///1000 is an unimportant number, it's just to normalize copied layers
|
||||
#define RADIAL_CONTENT_LAYER 1000
|
||||
|
||||
#define PLANE_ADMIN3 99 //Purely for shenanigans (above HUD)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
#define GLOBAL_PROC "some_magic_bullshit"
|
||||
|
||||
#define GLOBAL_PROC "some_magic_bullshit"
|
||||
/// A shorthand for the callback datum, [documented here](datum/callback.html)
|
||||
#define CALLBACK new /datum/callback
|
||||
|
||||
#define INVOKE_ASYNC world.ImmediateInvokeAsync
|
||||
|
||||
/// like CALLBACK but specifically for verb callbacks
|
||||
#define VERB_CALLBACK new /datum/callback/verb_callback
|
||||
|
||||
@@ -189,6 +189,8 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
|
||||
#define FIRE_PRIORITY_CHAT 400
|
||||
#define FIRE_PRIORITY_OVERLAYS 500
|
||||
#define FIRE_PRIORITY_TIMER 700
|
||||
#define FIRE_PRIORITY_SPEECH_CONTROLLER 900
|
||||
#define FIRE_PRIORITY_DELAYED_VERBS 950
|
||||
#define FIRE_PRIORITY_INPUT 1000 // This must always always be the max highest priority. Player input must never be lost.
|
||||
|
||||
/**
|
||||
|
||||
@@ -1 +1,49 @@
|
||||
#define MOB_WATER_LAYER 36
|
||||
// These are used as the layers for the icons, as well as indexes in a list that holds onto them.
|
||||
// Technically the layers used are all -100+layer to make them FLOAT_LAYER overlays.
|
||||
//Human Overlays Indexes/////////
|
||||
#define MUTATIONS_LAYER 1 //Mutations like fat, and lasereyes
|
||||
#define SKIN_LAYER 2 //Skin things added by a call on species
|
||||
#define BLOOD_LAYER 3 //Bloodied hands/feet/anything else
|
||||
#define BODYPARTS_LAYER 4 //Bodyparts layer
|
||||
#define MOB_DAM_LAYER 5 //Injury overlay sprites like open wounds
|
||||
#define SURGERY_LAYER 6 //Overlays for open surgical sites
|
||||
#define UNDERWEAR_LAYER 7 //Underwear/bras/etc
|
||||
#define TAIL_LOWER_LAYER 8 //Tail as viewed from the south
|
||||
#define WING_LOWER_LAYER 9 //Wings as viewed from the south
|
||||
#define SHOES_LAYER_ALT 10 //Shoe-slot item (when set to be under uniform via verb)
|
||||
#define UNIFORM_LAYER 11 //Uniform-slot item
|
||||
#define ID_LAYER 12 //ID-slot item
|
||||
#define SHOES_LAYER 13 //Shoe-slot item
|
||||
#define GLOVES_LAYER 14 //Glove-slot item
|
||||
#define BELT_LAYER 15 //Belt-slot item
|
||||
#define SUIT_LAYER 16 //Suit-slot item
|
||||
#define TAIL_UPPER_LAYER 17 //Some species have tails to render (As viewed from the N, E, or W)
|
||||
#define GLASSES_LAYER 18 //Eye-slot item
|
||||
#define BELT_LAYER_ALT 19 //Belt-slot item (when set to be above suit via verb)
|
||||
#define SUIT_STORE_LAYER 20 //Suit storage-slot item
|
||||
#define BACK_LAYER 21 //Back-slot item
|
||||
#define HAIR_LAYER 22 //The human's hair
|
||||
#define HAIR_ACCESSORY_LAYER 23 //Simply move this up a number if things are added.
|
||||
#define EARS_LAYER 24 //Both ear-slot items (combined image)
|
||||
#define EYES_LAYER 25 //Mob's eyes (used for glowing eyes)
|
||||
#define FACEMASK_LAYER 26 //Mask-slot item
|
||||
#define GLASSES_LAYER_ALT 27 //So some glasses can appear on top of hair and things
|
||||
#define HEAD_LAYER 28 //Head-slot item
|
||||
#define HANDCUFF_LAYER 29 //Handcuffs, if the human is handcuffed, in a secret inv slot
|
||||
#define LEGCUFF_LAYER 30 //Same as handcuffs, for legcuffs
|
||||
#define L_HAND_LAYER 31 //Left-hand item
|
||||
#define R_HAND_LAYER 32 //Right-hand item
|
||||
#define WING_LAYER 33 //Wings or protrusions over the suit.
|
||||
#define TAIL_UPPER_LAYER_ALT 34 //Modified tail-sprite layer. Tend to be larger.
|
||||
#define MODIFIER_EFFECTS_LAYER 35 //Effects drawn by modifiers
|
||||
#define FIRE_LAYER 36 //'Mob on fire' overlay layer
|
||||
#define MOB_WATER_LAYER 37
|
||||
#define TARGETED_LAYER 38 //'Aimed at' overlay layer
|
||||
#define VORE_BELLY_LAYER 39
|
||||
#define VORE_TAIL_LAYER 40
|
||||
|
||||
#define TOTAL_LAYERS 40 // <---- KEEP THIS UPDATED, should always equal the highest number here, used to initialize a list.
|
||||
|
||||
//These two are only used for gargoyles currently
|
||||
#define HUMAN_BODY_LAYERS list(MUTATIONS_LAYER, TAIL_LOWER_LAYER, WING_LOWER_LAYER, BODYPARTS_LAYER, SKIN_LAYER, BLOOD_LAYER, MOB_DAM_LAYER, TAIL_UPPER_LAYER, HAIR_LAYER, HAIR_ACCESSORY_LAYER, EYES_LAYER, WING_LAYER, VORE_BELLY_LAYER, VORE_TAIL_LAYER, TAIL_UPPER_LAYER_ALT)
|
||||
#define HUMAN_OTHER_LAYERS list(MODIFIER_EFFECTS_LAYER, FIRE_LAYER, MOB_WATER_LAYER, TARGETED_LAYER)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* verb queuing thresholds. remember that since verbs execute after SendMaps the player wont see the effects of the verbs on the game world
|
||||
* until SendMaps executes next tick, and then when that later update reaches them. thus most player input has a minimum latency of world.tick_lag + player ping.
|
||||
* however thats only for the visual effect of player input, when a verb processes the actual latency of game state changes or semantic latency is effectively 1/2 player ping,
|
||||
* unless that verb is queued for the next tick in which case its some number probably smaller than world.tick_lag.
|
||||
* so some verbs that represent player input are important enough that we only introduce semantic latency if we absolutely need to.
|
||||
* its for this reason why player clicks are handled in SSinput before even movement - semantic latency could cause someone to move out of range
|
||||
* when the verb finally processes but it was in range if the verb had processed immediately and overtimed.
|
||||
*/
|
||||
|
||||
///queuing tick_usage threshold for verbs that are high enough priority that they only queue if the server is overtiming.
|
||||
///ONLY use for critical verbs
|
||||
#define VERB_OVERTIME_QUEUE_THRESHOLD 100
|
||||
///queuing tick_usage threshold for verbs that need lower latency more than most verbs.
|
||||
#define VERB_HIGH_PRIORITY_QUEUE_THRESHOLD 95
|
||||
///default queuing tick_usage threshold for most verbs which can allow a small amount of latency to be processed in the next tick
|
||||
#define VERB_DEFAULT_QUEUE_THRESHOLD 85
|
||||
|
||||
///attempt to queue this verb process if the server is overloaded. evaluates to FALSE if queuing isnt necessary or if it failed.
|
||||
///_verification_args... are only necessary if the verb_manager subsystem youre using checks them in can_queue_verb()
|
||||
///if you put anything in _verification_args that ISNT explicitely put in the can_queue_verb() override of the subsystem youre using,
|
||||
///it will runtime.
|
||||
#define TRY_QUEUE_VERB(_verb_callback, _tick_check, _subsystem_to_use, _verification_args...) (_queue_verb(_verb_callback, _tick_check, _subsystem_to_use, _verification_args))
|
||||
///queue wrapper for TRY_QUEUE_VERB() when you want to call the proc if the server isnt overloaded enough to queue
|
||||
#define QUEUE_OR_CALL_VERB(_verb_callback, _tick_check, _subsystem_to_use, _verification_args...) \
|
||||
if(!TRY_QUEUE_VERB(_verb_callback, _tick_check, _subsystem_to_use, _verification_args)) {\
|
||||
_verb_callback:InvokeAsync() \
|
||||
};
|
||||
|
||||
//goes straight to SSverb_manager with default tick threshold
|
||||
#define DEFAULT_TRY_QUEUE_VERB(_verb_callback, _verification_args...) (TRY_QUEUE_VERB(_verb_callback, VERB_DEFAULT_QUEUE_THRESHOLD, null, _verification_args))
|
||||
#define DEFAULT_QUEUE_OR_CALL_VERB(_verb_callback, _verification_args...) QUEUE_OR_CALL_VERB(_verb_callback, VERB_DEFAULT_QUEUE_THRESHOLD, null, _verification_args)
|
||||
|
||||
//default tick threshold but nondefault subsystem
|
||||
#define TRY_QUEUE_VERB_FOR(_verb_callback, _subsystem_to_use, _verification_args...) (TRY_QUEUE_VERB(_verb_callback, VERB_DEFAULT_QUEUE_THRESHOLD, _subsystem_to_use, _verification_args))
|
||||
#define QUEUE_OR_CALL_VERB_FOR(_verb_callback, _subsystem_to_use, _verification_args...) QUEUE_OR_CALL_VERB(_verb_callback, VERB_DEFAULT_QUEUE_THRESHOLD, _subsystem_to_use, _verification_args)
|
||||
@@ -420,7 +420,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) . = tgui_input_list(usr, "AI signals detected:", "AI selection", ais)
|
||||
if(user) . = tgui_input_list(user, "AI signals detected:", "AI selection", ais)
|
||||
else . = pick(ais)
|
||||
return .
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
if(aiCamera && aiCamera.in_camera_mode)
|
||||
aiCamera.camera_mode_off()
|
||||
if(is_component_functioning("camera"))
|
||||
aiCamera.captureimage(A, usr)
|
||||
aiCamera.captureimage(A, src)
|
||||
else
|
||||
to_chat(src, span_userdanger("Your camera isn't functional."))
|
||||
return
|
||||
|
||||
@@ -396,7 +396,7 @@ var/list/global_huds = list(
|
||||
set hidden = 1
|
||||
|
||||
if(!hud_used)
|
||||
to_chat(usr, span_warning("This mob type does not use a HUD."))
|
||||
to_chat(src, span_warning("This mob type does not use a HUD."))
|
||||
return FALSE
|
||||
if(!client)
|
||||
return FALSE
|
||||
|
||||
+137
-38
@@ -3,33 +3,52 @@
|
||||
|
||||
GLOBAL_LIST_EMPTY(radial_menus)
|
||||
|
||||
// Ported from TG
|
||||
|
||||
/obj/screen/radial
|
||||
icon = 'icons/mob/radial.dmi'
|
||||
layer = LAYER_HUD_ABOVE
|
||||
plane = PLANE_PLAYER_HUD_ABOVE
|
||||
vis_flags = VIS_INHERIT_PLANE
|
||||
var/click_on_hover = FALSE
|
||||
var/datum/radial_menu/parent
|
||||
|
||||
/obj/screen/radial/proc/set_parent(new_value)
|
||||
if(parent)
|
||||
UnregisterSignal(parent, COMSIG_PARENT_QDELETING)
|
||||
parent = new_value
|
||||
if(parent)
|
||||
RegisterSignal(parent, COMSIG_PARENT_QDELETING, PROC_REF(handle_parent_del))
|
||||
|
||||
/obj/screen/radial/proc/handle_parent_del()
|
||||
SIGNAL_HANDLER
|
||||
set_parent(null)
|
||||
|
||||
/obj/screen/radial/slice
|
||||
icon_state = "radial_slice"
|
||||
var/choice
|
||||
var/next_page = FALSE
|
||||
var/tooltips = FALSE
|
||||
|
||||
/obj/screen/radial/Destroy()
|
||||
parent = null
|
||||
return ..()
|
||||
/obj/screen/radial/slice/set_parent(new_value)
|
||||
. = ..()
|
||||
if(parent)
|
||||
icon_state = parent.radial_slice_icon
|
||||
|
||||
/obj/screen/radial/slice/MouseEntered(location, control, params)
|
||||
. = ..()
|
||||
icon_state = "radial_slice_focus"
|
||||
if(next_page || !parent)
|
||||
icon_state = "radial_slice_focus"
|
||||
else
|
||||
icon_state = "[parent.radial_slice_icon]_focus"
|
||||
if(tooltips)
|
||||
openToolTip(usr, src, params, title = name)
|
||||
if (click_on_hover && !isnull(usr) && !isnull(parent))
|
||||
Click(location, control, params)
|
||||
|
||||
/obj/screen/radial/slice/MouseExited(location, control, params)
|
||||
. = ..()
|
||||
icon_state = "radial_slice"
|
||||
if(next_page || !parent)
|
||||
icon_state = "radial_slice"
|
||||
else
|
||||
icon_state = parent.radial_slice_icon
|
||||
if(tooltips)
|
||||
closeToolTip(usr)
|
||||
|
||||
@@ -38,7 +57,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
if(next_page)
|
||||
parent.next_page()
|
||||
else
|
||||
parent.element_chosen(choice,usr)
|
||||
parent.element_chosen(choice, usr, params)
|
||||
|
||||
/obj/screen/radial/center
|
||||
name = "Close Menu"
|
||||
@@ -57,9 +76,18 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
parent.finished = TRUE
|
||||
|
||||
/datum/radial_menu
|
||||
var/list/choices = list() //List of choice id's
|
||||
var/list/choices_icons = list() //choice_id -> icon
|
||||
var/list/choices_values = list() //choice_id -> choice
|
||||
/// List of choice IDs
|
||||
var/list/choices = list()
|
||||
|
||||
/// choice_id -> icon
|
||||
var/list/choices_icons = list()
|
||||
|
||||
/// choice_id -> choice
|
||||
var/list/choices_values = list()
|
||||
|
||||
/// choice_id -> /datum/radial_menu_choice
|
||||
var/list/choice_datums = list()
|
||||
|
||||
var/list/page_data = list() //list of choices per page
|
||||
|
||||
|
||||
@@ -87,6 +115,9 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
var/py_shift = 0
|
||||
var/entry_animation = TRUE
|
||||
|
||||
///A replacement icon state for the generic radial slice bg icon. Doesn't affect the next page nor the center buttons
|
||||
var/radial_slice_icon
|
||||
|
||||
//If we swap to vis_contens inventory these will need a redo
|
||||
/datum/radial_menu/proc/check_screen_border(mob/user)
|
||||
var/atom/movable/AM = anchor
|
||||
@@ -98,6 +129,8 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
else
|
||||
py_shift = 32
|
||||
restrict_to_dir(NORTH) //I was going to parse screen loc here but that's more effort than it's worth.
|
||||
else if(hudfix_method && AM.loc)
|
||||
anchor = get_atom_on_turf(anchor)
|
||||
|
||||
//Sets defaults
|
||||
//These assume 45 deg min_angle
|
||||
@@ -116,7 +149,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
starting_angle = 180
|
||||
ending_angle = 45
|
||||
|
||||
/datum/radial_menu/proc/setup_menu(use_tooltips)
|
||||
/datum/radial_menu/proc/setup_menu(use_tooltips, set_page = 1, click_on_hover = FALSE)
|
||||
if(ending_angle > starting_angle)
|
||||
zone = ending_angle - starting_angle
|
||||
else
|
||||
@@ -129,7 +162,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
for(var/i in 1 to elements_to_add) //Create all elements
|
||||
var/obj/screen/radial/slice/new_element = new /obj/screen/radial/slice
|
||||
new_element.tooltips = use_tooltips
|
||||
new_element.parent = src
|
||||
new_element.set_parent(src)
|
||||
elements += new_element
|
||||
|
||||
var/page = 1
|
||||
@@ -152,22 +185,31 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
|
||||
page_data[page] = current
|
||||
pages = page
|
||||
current_page = 1
|
||||
update_screen_objects(anim = entry_animation)
|
||||
current_page = clamp(set_page, 1, pages)
|
||||
update_screen_objects(entry_animation, click_on_hover)
|
||||
|
||||
/datum/radial_menu/proc/update_screen_objects(anim = FALSE)
|
||||
/datum/radial_menu/proc/update_screen_objects(anim = FALSE, click_on_hover = FALSE)
|
||||
var/list/page_choices = page_data[current_page]
|
||||
var/angle_per_element = round(zone / page_choices.len)
|
||||
for(var/i in 1 to elements.len)
|
||||
var/obj/screen/radial/E = elements[i]
|
||||
var/obj/screen/radial/element = elements[i]
|
||||
var/angle = WRAP(starting_angle + (i - 1) * angle_per_element,0,360)
|
||||
if(i > page_choices.len)
|
||||
HideElement(E)
|
||||
HideElement(element)
|
||||
element.click_on_hover = FALSE
|
||||
else
|
||||
SetElement(E,page_choices[i],angle,anim = anim,anim_order = i)
|
||||
SetElement(element,page_choices[i],angle,anim = anim,anim_order = i)
|
||||
// Only activate click on hover after the animation plays
|
||||
if (!click_on_hover)
|
||||
continue
|
||||
if (anim)
|
||||
addtimer(VARSET_CALLBACK(element, click_on_hover, TRUE), i * 0.5)
|
||||
else
|
||||
element.click_on_hover = TRUE
|
||||
|
||||
/datum/radial_menu/proc/HideElement(obj/screen/radial/slice/E)
|
||||
E.cut_overlays()
|
||||
E.vis_contents.Cut()
|
||||
E.alpha = 0
|
||||
E.name = "None"
|
||||
E.maptext = null
|
||||
@@ -194,13 +236,22 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
E.alpha = 255
|
||||
E.mouse_opacity = MOUSE_OPACITY_ICON
|
||||
E.cut_overlays()
|
||||
E.vis_contents.Cut()
|
||||
if(choice_id == NEXT_PAGE_ID)
|
||||
E.name = "Next Page"
|
||||
E.next_page = TRUE
|
||||
E.icon_state = "radial_slice" // Resets the bg icon state to the default for next page buttons.
|
||||
E.add_overlay("radial_next")
|
||||
else
|
||||
if(istext(choices_values[choice_id]))
|
||||
//This isn't granted to exist, so use the ?. operator for conditionals that use it.
|
||||
var/datum/radial_menu_choice/choice_datum = choice_datums[choice_id]
|
||||
if(choice_datum?.name)
|
||||
E.name = choice_datum.name
|
||||
else if(istext(choices_values[choice_id]))
|
||||
E.name = choices_values[choice_id]
|
||||
else if(ispath(choices_values[choice_id],/atom))
|
||||
var/atom/A = choices_values[choice_id]
|
||||
E.name = initial(A.name)
|
||||
else
|
||||
var/atom/movable/AM = choices_values[choice_id] //Movables only
|
||||
E.name = AM.name
|
||||
@@ -209,15 +260,21 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
E.next_page = FALSE
|
||||
if(choices_icons[choice_id])
|
||||
E.add_overlay(choices_icons[choice_id])
|
||||
if (choice_datum?.info)
|
||||
var/obj/effect/abstract/info/info_button = new(E, choice_datum.info)
|
||||
info_button.plane = PLANE_PLAYER_HUD_ABOVE
|
||||
info_button.layer = RADIAL_CONTENT_LAYER
|
||||
E.vis_contents += info_button
|
||||
|
||||
/datum/radial_menu/New()
|
||||
close_button = new
|
||||
close_button.parent = src
|
||||
close_button.set_parent(src)
|
||||
|
||||
/datum/radial_menu/proc/Reset()
|
||||
choices.Cut()
|
||||
choices_icons.Cut()
|
||||
choices_values.Cut()
|
||||
choice_datums.Cut()
|
||||
current_page = 1
|
||||
|
||||
/datum/radial_menu/proc/element_chosen(choice_id,mob/user)
|
||||
@@ -226,7 +283,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
/datum/radial_menu/proc/get_next_id()
|
||||
return "c_[choices.len]"
|
||||
|
||||
/datum/radial_menu/proc/set_choices(list/new_choices, use_tooltips)
|
||||
/datum/radial_menu/proc/set_choices(list/new_choices, use_tooltips, click_on_hover = FALSE, set_page = 1)
|
||||
if(choices.len)
|
||||
Reset()
|
||||
for(var/E in new_choices)
|
||||
@@ -237,13 +294,20 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
var/I = extract_image(new_choices[E])
|
||||
if(I)
|
||||
choices_icons[id] = I
|
||||
setup_menu(use_tooltips)
|
||||
|
||||
if (istype(new_choices[E], /datum/radial_menu_choice))
|
||||
choice_datums[id] = new_choices[E]
|
||||
setup_menu(use_tooltips, set_page, click_on_hover)
|
||||
|
||||
/datum/radial_menu/proc/extract_image(E)
|
||||
var/mutable_appearance/MA = new /mutable_appearance(E)
|
||||
/datum/radial_menu/proc/extract_image(to_extract_from)
|
||||
if (istype(to_extract_from, /datum/radial_menu_choice))
|
||||
var/datum/radial_menu_choice/choice = to_extract_from
|
||||
to_extract_from = choice.image
|
||||
|
||||
var/mutable_appearance/MA = new /mutable_appearance(to_extract_from)
|
||||
if(MA)
|
||||
MA.layer = LAYER_HUD_ABOVE
|
||||
MA.plane = PLANE_PLAYER_HUD_ABOVE
|
||||
MA.layer = RADIAL_CONTENT_LAYER
|
||||
MA.appearance_flags |= RESET_TRANSFORM
|
||||
return MA
|
||||
|
||||
@@ -253,15 +317,16 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
current_page = WRAP(current_page + 1,1,pages+1)
|
||||
update_screen_objects()
|
||||
|
||||
/datum/radial_menu/proc/show_to(mob/M)
|
||||
/datum/radial_menu/proc/show_to(mob/M, offset_x = 0, offset_y = 0)
|
||||
if(current_user)
|
||||
hide()
|
||||
if(!M.client || !anchor)
|
||||
return
|
||||
current_user = M.client
|
||||
//Blank
|
||||
menu_holder = image(icon='icons/effects/effects.dmi',loc=anchor,icon_state="nothing",layer = LAYER_HUD_ABOVE)
|
||||
menu_holder.appearance_flags |= KEEP_APART
|
||||
menu_holder = image(icon='icons/effects/effects.dmi',loc=anchor,icon_state="nothing", layer = RADIAL_BACKGROUND_LAYER, pixel_x = offset_x, pixel_y = offset_y)
|
||||
menu_holder.plane = PLANE_PLAYER_HUD_ABOVE
|
||||
menu_holder.appearance_flags |= KEEP_APART|RESET_ALPHA|RESET_COLOR|RESET_TRANSFORM
|
||||
menu_holder.vis_contents += elements + close_button
|
||||
current_user.images += menu_holder
|
||||
|
||||
@@ -283,9 +348,7 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
/datum/radial_menu/Destroy()
|
||||
Reset()
|
||||
hide()
|
||||
QDEL_LIST_NULL(elements)
|
||||
QDEL_NULL(close_button)
|
||||
QDEL_NULL(custom_check_callback)
|
||||
custom_check_callback = null
|
||||
. = ..()
|
||||
|
||||
/*
|
||||
@@ -293,30 +356,66 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
Choices should be a list where list keys are movables or text used for element names and return value
|
||||
and list values are movables/icons/images used for element icons
|
||||
*/
|
||||
/proc/show_radial_menu(mob/user, atom/anchor, list/choices, uniqueid, radius, datum/callback/custom_check, require_near = FALSE, tooltips = FALSE)
|
||||
/proc/show_radial_menu(mob/user, atom/anchor, list/choices, uniqueid, radius, datum/callback/custom_check, require_near = FALSE, tooltips = FALSE, no_repeat_close = FALSE, radial_slice_icon = "radial_slice", autopick_single_option = TRUE, entry_animation = TRUE, click_on_hover = FALSE, user_space = FALSE)
|
||||
if(!user || !anchor || !length(choices))
|
||||
return
|
||||
|
||||
if(length(choices)==1 && autopick_single_option)
|
||||
return choices[1]
|
||||
|
||||
if(!uniqueid)
|
||||
uniqueid = "defmenu_[REF(user)]_[REF(anchor)]"
|
||||
|
||||
if(GLOB.radial_menus[uniqueid])
|
||||
if(!no_repeat_close)
|
||||
var/datum/radial_menu/menu = GLOB.radial_menus[uniqueid]
|
||||
menu.finished = TRUE
|
||||
return
|
||||
|
||||
var/datum/radial_menu/menu = new
|
||||
menu.entry_animation = entry_animation
|
||||
GLOB.radial_menus[uniqueid] = menu
|
||||
if(radius)
|
||||
menu.radius = radius
|
||||
if(istype(custom_check))
|
||||
menu.custom_check_callback = custom_check
|
||||
menu.anchor = anchor
|
||||
menu.anchor = user_space ? user : anchor
|
||||
menu.radial_slice_icon = radial_slice_icon
|
||||
menu.check_screen_border(user) //Do what's needed to make it look good near borders or on hud
|
||||
menu.set_choices(choices, tooltips)
|
||||
menu.show_to(user)
|
||||
menu.set_choices(choices, tooltips, click_on_hover)
|
||||
var/offset_x = 0
|
||||
var/offset_y = 0
|
||||
if (user_space)
|
||||
var/turf/user_turf = get_turf(user)
|
||||
var/turf/anchor_turf = get_turf(anchor)
|
||||
offset_x = (anchor_turf.x - user_turf.x) * ICON_SIZE_X + anchor.pixel_x - user.pixel_x
|
||||
offset_y = (anchor_turf.y - user_turf.y) * ICON_SIZE_Y + anchor.pixel_y - user.pixel_y
|
||||
menu.show_to(user, offset_x, offset_y)
|
||||
menu.wait(user, anchor, require_near)
|
||||
var/answer = menu.selected_choice
|
||||
QDEL_NULL(menu)
|
||||
qdel(menu)
|
||||
GLOB.radial_menus -= uniqueid
|
||||
if(require_near && !in_range(anchor, user))
|
||||
return
|
||||
if(istype(custom_check))
|
||||
if(!custom_check.Invoke())
|
||||
return
|
||||
return answer
|
||||
|
||||
/// Can be provided to choices in radial menus if you want to provide more information
|
||||
/datum/radial_menu_choice
|
||||
/// Required -- what to display for this button
|
||||
var/image
|
||||
|
||||
/// If provided, this will be the name the radial slice hud button. This has priority over everything else.
|
||||
var/name
|
||||
|
||||
/// If provided, will display an info button that will put this text in your chat
|
||||
var/info
|
||||
|
||||
/datum/radial_menu_choice/Destroy(force)
|
||||
. = ..()
|
||||
QDEL_NULL(image)
|
||||
|
||||
#undef NEXT_PAGE_ID
|
||||
#undef DEFAULT_CHECK_DELAY
|
||||
|
||||
@@ -282,11 +282,11 @@ var/obj/screen/robot_inventory
|
||||
//r.client.screen += robot_inventory //"store" icon
|
||||
|
||||
if(!r.module)
|
||||
to_chat(usr, span_danger("No module selected"))
|
||||
to_chat(r, span_danger("No module selected"))
|
||||
return
|
||||
|
||||
if(!r.module.modules)
|
||||
to_chat(usr, span_danger("Selected module has no modules to select"))
|
||||
to_chat(r, span_danger("Selected module has no modules to select"))
|
||||
return
|
||||
|
||||
if(!r.robot_modules_background)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,64 +0,0 @@
|
||||
//
|
||||
// Lets read our settings from the configuration file on startup too!
|
||||
//
|
||||
|
||||
/datum/configuration
|
||||
var/static/time_off = FALSE
|
||||
var/static/pto_job_change = FALSE
|
||||
var/static/limit_interns = -1 //Unlimited by default
|
||||
var/static/limit_visitors = -1 //Unlimited by default
|
||||
var/static/pto_cap = 100 //Hours
|
||||
var/static/require_flavor = FALSE
|
||||
var/static/ipqualityscore_apikey //API key for ipqualityscore.com
|
||||
var/static/use_playtime_restriction_for_jobs = FALSE
|
||||
|
||||
/hook/startup/proc/read_vs_config()
|
||||
var/list/Lines = file2list("config/config.txt")
|
||||
for(var/t in Lines)
|
||||
if(!t) continue
|
||||
|
||||
t = trim(t)
|
||||
if (length(t) == 0)
|
||||
continue
|
||||
else if (copytext(t, 1, 2) == "#")
|
||||
continue
|
||||
|
||||
var/pos = findtext(t, " ")
|
||||
var/name = null
|
||||
var/value = null
|
||||
|
||||
if (pos)
|
||||
name = lowertext(copytext(t, 1, pos))
|
||||
value = copytext(t, pos + 1)
|
||||
else
|
||||
name = lowertext(t)
|
||||
|
||||
if (!name)
|
||||
continue
|
||||
|
||||
switch (name)
|
||||
if ("chat_webhook_url")
|
||||
config.chat_webhook_url = value
|
||||
if ("chat_webhook_key")
|
||||
config.chat_webhook_key = value
|
||||
if ("fax_export_dir")
|
||||
config.fax_export_dir = value
|
||||
if ("items_survive_digestion")
|
||||
config.items_survive_digestion = 1
|
||||
if ("limit_interns")
|
||||
config.limit_interns = text2num(value)
|
||||
if ("limit_visitors")
|
||||
config.limit_visitors = text2num(value)
|
||||
if ("pto_cap")
|
||||
config.pto_cap = text2num(value)
|
||||
if ("time_off")
|
||||
config.time_off = TRUE
|
||||
if ("pto_job_change")
|
||||
config.pto_job_change = TRUE
|
||||
if ("require_flavor")
|
||||
config.require_flavor = TRUE
|
||||
if ("ipqualityscore_apikey")
|
||||
config.ipqualityscore_apikey = value
|
||||
if ("use_playtime_restriction_for_jobs")
|
||||
config.use_playtime_restriction_for_jobs = TRUE
|
||||
return 1
|
||||
+104
-26
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* Failsafe
|
||||
*
|
||||
* Pretty much pokes the MC to make sure it's still alive.
|
||||
/**
|
||||
* Failsafe
|
||||
*
|
||||
* Pretty much pokes the MC to make sure it's still alive.
|
||||
**/
|
||||
|
||||
var/datum/controller/failsafe/Failsafe
|
||||
// See initialization order in /code/game/world.dm
|
||||
GLOBAL_REAL(Failsafe, /datum/controller/failsafe)
|
||||
|
||||
/datum/controller/failsafe // This thing pretty much just keeps poking the master controller
|
||||
name = "Failsafe"
|
||||
@@ -15,7 +16,7 @@ var/datum/controller/failsafe/Failsafe
|
||||
// The alert level. For every failed poke, we drop a DEFCON level. Once we hit DEFCON 1, restart the MC.
|
||||
var/defcon = 5
|
||||
//the world.time of the last check, so the mc can restart US if we hang.
|
||||
// (Real friends look out for *eachother*)
|
||||
// (Real friends look out for *each other*)
|
||||
var/lasttick = 0
|
||||
|
||||
// Track the MC iteration to make sure its still on track.
|
||||
@@ -31,8 +32,24 @@ var/datum/controller/failsafe/Failsafe
|
||||
Initialize()
|
||||
|
||||
/datum/controller/failsafe/Initialize()
|
||||
set waitfor = 0
|
||||
set waitfor = FALSE
|
||||
Failsafe.Loop()
|
||||
if (!Master || defcon == 0) //Master is gone/not responding and Failsafe just exited its loop
|
||||
defcon = 3 //Reset defcon level as its used inside the emergency loop
|
||||
while (defcon > 0)
|
||||
var/recovery_result = emergency_loop()
|
||||
if (recovery_result == 1) //Exit emergency loop and delete self if it was able to recover MC
|
||||
break
|
||||
else if (defcon == 1) //Exit Failsafe if we weren't able to recover the MC in the last stage
|
||||
log_game("FailSafe: Failed to recover MC while in emergency state. Failsafe exiting.")
|
||||
message_admins(span_boldannounce("Failsafe failed critically while trying to recreate broken MC. Please manually fix the MC or reboot the server. Failsafe exiting now."))
|
||||
message_admins(span_boldannounce("You can try manually calling these two procs:."))
|
||||
message_admins(span_boldannounce("/proc/recover_all_SS_and_recreate_master: Most stuff should still function but expect instability/runtimes/broken stuff."))
|
||||
message_admins(span_boldannounce("/proc/delete_all_SS_and_recreate_master: Most stuff will be broken but basic stuff like movement and chat should still work."))
|
||||
else if (recovery_result == -1) //Failed to recreate MC
|
||||
defcon--
|
||||
sleep(initial(processing_interval)) //Wait a bit until the next try
|
||||
|
||||
if(!QDELETED(src))
|
||||
qdel(src) //when Loop() returns, we delete ourselves and let the mc recreate us
|
||||
|
||||
@@ -45,43 +62,56 @@ var/datum/controller/failsafe/Failsafe
|
||||
while(running)
|
||||
lasttick = world.time
|
||||
if(!Master)
|
||||
// Replace the missing Master! This should never, ever happen.
|
||||
new /datum/controller/master()
|
||||
// Break out of the main loop so we go into emergency state
|
||||
break
|
||||
// Only poke it if overrides are not in effect.
|
||||
if(processing_interval > 0)
|
||||
if(Master.processing && Master.iteration)
|
||||
if (defcon > 1 && (!Master.stack_end_detector || !Master.stack_end_detector.check()))
|
||||
|
||||
to_chat(GLOB.admins, span_boldannounce("ERROR: The Master Controller code stack has exited unexpectedly, Restarting..."))
|
||||
defcon = 0
|
||||
var/rtn = Recreate_MC()
|
||||
if(rtn > 0)
|
||||
master_iteration = 0
|
||||
to_chat(GLOB.admins, span_adminnotice("MC restarted successfully"))
|
||||
else if(rtn < 0)
|
||||
log_game("FailSafe: Could not restart MC, runtime encountered. Entering defcon 0")
|
||||
to_chat(GLOB.admins, span_boldannounce("ERROR: DEFCON [defcon_pretty()]. Could not restart MC, runtime encountered. I will silently keep retrying."))
|
||||
// Check if processing is done yet.
|
||||
if(Master.iteration == master_iteration)
|
||||
log_debug("DEFCON [defcon]: Master.iteration=[Master.iteration] Master.last_run=[Master.last_run] world.time=[world.time]")
|
||||
switch(defcon)
|
||||
if(4,5)
|
||||
--defcon
|
||||
if(3)
|
||||
log_and_message_admins(span_adminnotice("SSfailsafe Notice: DEFCON [defcon_pretty()]. The Master Controller (\ref[Master]) has not fired in the last [(5-defcon) * processing_interval] ticks."))
|
||||
--defcon
|
||||
if(2)
|
||||
log_and_message_admins(span_boldannounce("SSfailsafe Warning: DEFCON [defcon_pretty()]. The Master Controller (\ref[Master]) has not fired in the last [(5-defcon) * processing_interval] ticks. Automatic restart in [processing_interval] ticks."))
|
||||
--defcon
|
||||
if(1)
|
||||
|
||||
log_and_message_admins(span_boldannounce("SSfailsafe Warning: DEFCON [defcon_pretty()]. The Master Controller (\ref[Master]) has still not fired within the last [(5-defcon) * processing_interval] ticks. Killing and restarting..."))
|
||||
if(3)
|
||||
message_admins(span_adminnotice("Notice: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks."))
|
||||
--defcon
|
||||
|
||||
if(2)
|
||||
to_chat(GLOB.admins, span_boldannounce("Warning: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks. Automatic restart in [processing_interval] ticks."))
|
||||
--defcon
|
||||
|
||||
if(1)
|
||||
to_chat(GLOB.admins, span_boldannounce("Warning: DEFCON [defcon_pretty()]. The Master Controller has still not fired within the last [(5-defcon) * processing_interval] ticks. Killing and restarting..."))
|
||||
--defcon
|
||||
var/rtn = Recreate_MC()
|
||||
if(rtn > 0)
|
||||
defcon = 4
|
||||
master_iteration = 0
|
||||
log_and_message_admins(span_adminnotice("SSfailsafe Notice: MC (New:\ref[Master]) restarted successfully"))
|
||||
to_chat(GLOB.admins, span_adminnotice("MC restarted successfully"))
|
||||
else if(rtn < 0)
|
||||
log_game("SSfailsafe Notice: Could not restart MC (\ref[Master]), runtime encountered. Entering defcon 0")
|
||||
log_and_message_admins(span_boldannounce("SSFAILSAFE ERROR: DEFCON [defcon_pretty()]. Could not restart MC (\ref[Master]), runtime encountered. I will silently keep retrying."))
|
||||
log_game("FailSafe: Could not restart MC, runtime encountered. Entering defcon 0")
|
||||
to_chat(GLOB.admins, span_boldannounce("ERROR: DEFCON [defcon_pretty()]. Could not restart MC, runtime encountered. I will silently keep retrying."))
|
||||
//if the return number was 0, it just means the mc was restarted too recently, and it just needs some time before we try again
|
||||
//no need to handle that specially when defcon 0 can handle it
|
||||
|
||||
if(0) //DEFCON 0! (mc failed to restart)
|
||||
var/rtn = Recreate_MC()
|
||||
if(rtn > 0)
|
||||
defcon = 4
|
||||
master_iteration = 0
|
||||
log_and_message_admins(span_adminnotice("SSfailsafe Notice: MC (New:\ref[Master]) restarted successfully"))
|
||||
to_chat(GLOB.admins, span_adminnotice("MC restarted successfully"))
|
||||
else
|
||||
defcon = min(defcon + 1,5)
|
||||
master_iteration = Master.iteration
|
||||
@@ -93,12 +123,60 @@ var/datum/controller/failsafe/Failsafe
|
||||
defcon = 5
|
||||
sleep(initial(processing_interval))
|
||||
|
||||
//Emergency loop used when Master got deleted or the main loop exited while Defcon == 0
|
||||
//Loop is driven externally so runtimes only cancel the current recovery attempt
|
||||
/datum/controller/failsafe/proc/emergency_loop()
|
||||
//The code in this proc should be kept as simple as possible, anything complicated like to_chat might rely on master existing and runtime
|
||||
//The goal should always be to get a new Master up and running before anything else
|
||||
. = -1
|
||||
switch (defcon) //The lower defcon goes the harder we try to fix the MC
|
||||
if (2 to 3) //Try to normally recreate the MC two times
|
||||
. = Recreate_MC()
|
||||
if (1) //Delete the old MC first so we don't transfer any info, in case that caused any issues
|
||||
del(Master)
|
||||
. = Recreate_MC()
|
||||
|
||||
if (. == 1) //We were able to create a new master
|
||||
master_iteration = 0
|
||||
SSticker.Recover(); //Recover the ticket system so the Masters runlevel gets set
|
||||
Master.Initialize(10, FALSE, FALSE) //Need to manually start the MC, normally world.new would do this
|
||||
to_chat(GLOB.admins, span_adminnotice("Failsafe recovered MC while in emergency state [defcon_pretty()]"))
|
||||
else
|
||||
log_game("FailSafe: Failsafe in emergency state and was unable to recreate MC while in defcon state [defcon_pretty()].")
|
||||
message_admins(span_boldannounce("Failsafe in emergency state and master down, trying to recreate MC while in defcon level [defcon_pretty()] failed."))
|
||||
|
||||
///Recreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars
|
||||
/proc/recover_all_SS_and_recreate_master()
|
||||
del(Master)
|
||||
var/list/subsytem_types = subtypesof(/datum/controller/subsystem)
|
||||
sortTim(subsytem_types, GLOBAL_PROC_REF(cmp_subsystem_init))
|
||||
for(var/I in subsytem_types)
|
||||
new I
|
||||
. = Recreate_MC()
|
||||
if (. == 1) //We were able to create a new master
|
||||
SSticker.Recover(); //Recover the ticket system so the Masters runlevel gets set
|
||||
Master.Initialize(10, FALSE, FALSE) //Need to manually start the MC, normally world.new would do this
|
||||
to_chat(GLOB.admins, span_adminnotice("MC successfully recreated after recovering all subsystems!"))
|
||||
else
|
||||
message_admins(span_boldannounce("Failed to create new MC!"))
|
||||
|
||||
///Delete all existing SS to basically start over
|
||||
/proc/delete_all_SS_and_recreate_master()
|
||||
del(Master)
|
||||
for(var/global_var in global.vars)
|
||||
if (istype(global.vars[global_var], /datum/controller/subsystem))
|
||||
del(global.vars[global_var])
|
||||
. = Recreate_MC()
|
||||
if (. == 1) //We were able to create a new master
|
||||
SSticker.Recover(); //Recover the ticket system so the Masters runlevel gets set
|
||||
Master.Initialize(10, FALSE, FALSE) //Need to manually start the MC, normally world.new would do this
|
||||
to_chat(GLOB.admins, span_adminnotice("MC successfully recreated after deleting and recreating all subsystems!"))
|
||||
else
|
||||
message_admins(span_boldannounce("Failed to create new MC!"))
|
||||
|
||||
/datum/controller/failsafe/proc/defcon_pretty()
|
||||
return defcon
|
||||
|
||||
/datum/controller/failsafe/stat_entry(msg)
|
||||
if(!statclick)
|
||||
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
|
||||
|
||||
msg = "Failsafe Controller: [statclick.update("Defcon: [defcon_pretty()] (Interval: [Failsafe.processing_interval] | Iteration: [Failsafe.master_iteration])")]"
|
||||
msg = "Defcon: [defcon_pretty()] (Interval: [Failsafe.processing_interval] | Iteration: [Failsafe.master_iteration])"
|
||||
return msg
|
||||
|
||||
+17
-16
@@ -1,26 +1,23 @@
|
||||
/**
|
||||
* StonedMC
|
||||
*
|
||||
* Designed to properly split up a given tick among subsystems
|
||||
* Note: if you read parts of this code and think "why is it doing it that way"
|
||||
* Odds are, there is a reason
|
||||
*
|
||||
/**
|
||||
* StonedMC
|
||||
*
|
||||
* Designed to properly split up a given tick among subsystems
|
||||
* Note: if you read parts of this code and think "why is it doing it that way"
|
||||
* Odds are, there is a reason
|
||||
*
|
||||
**/
|
||||
|
||||
//This is the ABSOLUTE ONLY THING that should init globally like this
|
||||
// See initialization order in /code/game/world.dm
|
||||
GLOBAL_REAL(Master, /datum/controller/master) = new
|
||||
|
||||
//THIS IS THE INIT ORDER
|
||||
//Master -> SSPreInit -> GLOB -> world -> config -> SSInit -> Failsafe
|
||||
//GOT IT MEMORIZED?
|
||||
|
||||
/datum/controller/master
|
||||
name = "Master"
|
||||
|
||||
// Are we processing (higher values increase the processing delay by n ticks)
|
||||
/// Are we processing (higher values increase the processing delay by n ticks)
|
||||
var/processing = TRUE
|
||||
// How many times have we ran
|
||||
/// How many times have we ran
|
||||
var/iteration = 0
|
||||
/// Stack end detector to detect stack overflows that kill the mc's main loop
|
||||
var/datum/stack_end_detector/stack_end_detector
|
||||
|
||||
// world.time of last fire, for tracking lag outside of the mc
|
||||
var/last_run
|
||||
@@ -291,8 +288,12 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
|
||||
var/error_level = 0
|
||||
var/sleep_delta = 1
|
||||
var/list/subsystems_to_check
|
||||
//the actual loop.
|
||||
|
||||
//setup the stack overflow detector
|
||||
stack_end_detector = new()
|
||||
var/datum/stack_canary/canary = stack_end_detector.prime_canary()
|
||||
canary.use_variable()
|
||||
//the actual loop.
|
||||
while (1)
|
||||
tickdrift = max(0, MC_AVERAGE_FAST(tickdrift, (((REALTIMEOFDAY - init_timeofday) - (world.time - init_time)) / world.tick_lag)))
|
||||
var/starting_tick_usage = TICK_USAGE
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
/// verb_manager subsystem just for handling say's
|
||||
VERB_MANAGER_SUBSYSTEM_DEF(speech_controller)
|
||||
name = "Speech Controller"
|
||||
wait = 1
|
||||
priority = FIRE_PRIORITY_SPEECH_CONTROLLER//has to be high priority, second in priority ONLY to SSinput
|
||||
@@ -0,0 +1,167 @@
|
||||
/**
|
||||
* SSverb_manager, a subsystem that runs every tick and runs through its entire queue without yielding like SSinput.
|
||||
* this exists because of how the byond tick works and where user inputted verbs are put within it.
|
||||
*
|
||||
* see TICK_ORDER.md for more info on how the byond tick is structured.
|
||||
*
|
||||
* The way the MC allots its time is via TICK_LIMIT_RUNNING, it simply subtracts the cost of SendMaps (MAPTICK_LAST_INTERNAL_TICK_USAGE)
|
||||
* plus TICK_BYOND_RESERVE from the tick and uses up to that amount of time (minus the percentage of the tick used by the time it executes subsystems)
|
||||
* on subsystems running cool things like atmospherics or Life or SSInput or whatever.
|
||||
*
|
||||
* Without this subsystem, verbs are likely to cause overtime if the MC uses all of the time it has allotted for itself in the tick, and SendMaps
|
||||
* uses as much as its expected to, and an expensive verb ends up executing that tick. This is because the MC is completely blind to the cost of
|
||||
* verbs, it can't account for it at all. The only chance for verbs to not cause overtime in a tick where the MC used as much of the tick
|
||||
* as it allotted itself and where SendMaps costed as much as it was expected to is if the verb(s) take less than TICK_BYOND_RESERVE percent of
|
||||
* the tick, which isn't much. Not to mention if SendMaps takes more than 30% of the tick and the MC forces itself to take at least 70% of the
|
||||
* normal tick duration which causes ticks to naturally overrun even in the absence of verbs.
|
||||
*
|
||||
* With this subsystem, the MC can account for the cost of verbs and thus stop major overruns of ticks. This means that the most important subsystems
|
||||
* like SSinput can start at the same time they were supposed to, leading to a smoother experience for the player since ticks aren't riddled with
|
||||
* minor hangs over and over again.
|
||||
*/
|
||||
SUBSYSTEM_DEF(verb_manager)
|
||||
name = "Verb Manager"
|
||||
wait = 1
|
||||
flags = SS_TICKER | SS_NO_INIT
|
||||
priority = FIRE_PRIORITY_DELAYED_VERBS
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
|
||||
///list of callbacks to procs called from verbs or verblike procs that were executed when the server was overloaded and had to delay to the next tick.
|
||||
///this list is ran through every tick, and the subsystem does not yield until this queue is finished.
|
||||
var/list/datum/callback/verb_callback/verb_queue = list()
|
||||
|
||||
///running average of how many verb callbacks are executed every second. used for the stat entry
|
||||
var/verbs_executed_per_second = 0
|
||||
|
||||
///if TRUE we treat usr's with holders just like usr's without holders. otherwise they always execute immediately
|
||||
var/can_queue_admin_verbs = FALSE
|
||||
|
||||
///if this is true all verbs immediately execute and don't queue. in case the mc is fucked or something
|
||||
var/FOR_ADMINS_IF_VERBS_FUCKED_immediately_execute_all_verbs = FALSE
|
||||
|
||||
///used for subtypes to determine if they use their own stats for the stat entry
|
||||
var/use_default_stats = TRUE
|
||||
|
||||
///if TRUE this will... message admins every time a verb is queued to this subsystem for the next tick with stats.
|
||||
///for obvious reasons don't make this be TRUE on the code level this is for admins to turn on
|
||||
var/message_admins_on_queue = FALSE
|
||||
|
||||
///always queue if possible. overrides can_queue_admin_verbs but not FOR_ADMINS_IF_VERBS_FUCKED_immediately_execute_all_verbs
|
||||
var/always_queue = FALSE
|
||||
|
||||
/**
|
||||
* queue a callback for the given verb/verblike proc and any given arguments to the specified verb subsystem, so that they process in the next tick.
|
||||
* intended to only work with verbs or verblike procs called directly from client input, use as part of TRY_QUEUE_VERB() and co.
|
||||
*
|
||||
* returns TRUE if the queuing was successful, FALSE otherwise.
|
||||
*/
|
||||
/proc/_queue_verb(datum/callback/verb_callback/incoming_callback, tick_check, datum/controller/subsystem/verb_manager/subsystem_to_use = SSverb_manager, ...)
|
||||
if(QDELETED(incoming_callback))
|
||||
var/destroyed_string
|
||||
if(!incoming_callback)
|
||||
destroyed_string = "callback is null."
|
||||
else
|
||||
destroyed_string = "callback was deleted [DS2TICKS(world.time - incoming_callback.gc_destroyed)] ticks ago. callback was created [DS2TICKS(world.time) - incoming_callback.creation_time] ticks ago."
|
||||
|
||||
stack_trace("_queue_verb() returned false because it was given a deleted callback! [destroyed_string]")
|
||||
return FALSE
|
||||
|
||||
if(!istext(incoming_callback.object) && QDELETED(incoming_callback.object)) //just in case the object is GLOBAL_PROC
|
||||
var/destroyed_string
|
||||
if(!incoming_callback.object)
|
||||
destroyed_string = "callback.object is null."
|
||||
else
|
||||
destroyed_string = "callback.object was deleted [DS2TICKS(world.time - incoming_callback.object.gc_destroyed)] ticks ago. callback was created [DS2TICKS(world.time) - incoming_callback.creation_time] ticks ago."
|
||||
|
||||
stack_trace("_queue_verb() returned false because it was given a callback acting on a qdeleted object! [destroyed_string]")
|
||||
return FALSE
|
||||
|
||||
//we want unit tests to be able to directly call verbs that attempt to queue, and since unit tests should test internal behavior, we want the queue
|
||||
//to happen as if it was actually from player input if its called on a mob.
|
||||
#ifdef UNIT_TESTS
|
||||
if(QDELETED(usr) && ismob(incoming_callback.object))
|
||||
incoming_callback.user = WEAKREF(incoming_callback.object)
|
||||
var/datum/callback/new_us = CALLBACK(arglist(list(GLOBAL_PROC, GLOBAL_PROC_REF(_queue_verb)) + args.Copy()))
|
||||
return world.push_usr(incoming_callback.object, new_us)
|
||||
|
||||
#else
|
||||
|
||||
if(QDELETED(usr) || isnull(usr.client))
|
||||
stack_trace("_queue_verb() returned false because it wasn't called from player input!")
|
||||
return FALSE
|
||||
|
||||
#endif
|
||||
|
||||
if(!istype(subsystem_to_use))
|
||||
stack_trace("_queue_verb() returned false because it was given an invalid subsystem to queue for!")
|
||||
return FALSE
|
||||
|
||||
if((TICK_USAGE < tick_check) && !subsystem_to_use.always_queue)
|
||||
return FALSE
|
||||
|
||||
var/list/args_to_check = args.Copy()
|
||||
args_to_check.Cut(2, 4)//cut out tick_check and subsystem_to_use
|
||||
|
||||
//any subsystem can use the additional arguments to refuse queuing
|
||||
if(!subsystem_to_use.can_queue_verb(arglist(args_to_check)))
|
||||
return FALSE
|
||||
|
||||
return subsystem_to_use.queue_verb(incoming_callback)
|
||||
|
||||
/**
|
||||
* subsystem-specific check for whether a callback can be queued.
|
||||
* intended so that subsystem subtypes can verify whether
|
||||
*
|
||||
* subtypes may include additional arguments here if they need them! you just need to include them properly
|
||||
* in TRY_QUEUE_VERB() and co.
|
||||
*/
|
||||
/datum/controller/subsystem/verb_manager/proc/can_queue_verb(datum/callback/verb_callback/incoming_callback)
|
||||
if(always_queue && !FOR_ADMINS_IF_VERBS_FUCKED_immediately_execute_all_verbs)
|
||||
return TRUE
|
||||
|
||||
if((usr.client?.holder && !can_queue_admin_verbs) \
|
||||
|| (!subsystem_initialized && !(flags & SS_NO_INIT)) \
|
||||
|| FOR_ADMINS_IF_VERBS_FUCKED_immediately_execute_all_verbs \
|
||||
|| !(runlevels & Master.current_runlevel))
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* queue a callback for the given proc, so that it is invoked in the next tick.
|
||||
* intended to only work with verbs or verblike procs called directly from client input, use as part of TRY_QUEUE_VERB()
|
||||
*
|
||||
* returns TRUE if the queuing was successful, FALSE otherwise.
|
||||
*/
|
||||
/datum/controller/subsystem/verb_manager/proc/queue_verb(datum/callback/verb_callback/incoming_callback)
|
||||
. = FALSE //errored
|
||||
if(message_admins_on_queue)
|
||||
message_admins("[name] verb queuing: tick usage: [TICK_USAGE]%, proc: [incoming_callback.delegate], object: [incoming_callback.object], usr: [usr]")
|
||||
verb_queue += incoming_callback
|
||||
return TRUE
|
||||
|
||||
/datum/controller/subsystem/verb_manager/fire(resumed)
|
||||
run_verb_queue()
|
||||
|
||||
/// runs through all of this subsystems queue of verb callbacks.
|
||||
/// goes through the entire verb queue without yielding.
|
||||
/// used so you can flush the queue outside of fire() without interfering with anything else subtype subsystems might do in fire().
|
||||
/datum/controller/subsystem/verb_manager/proc/run_verb_queue()
|
||||
var/executed_verbs = 0
|
||||
|
||||
for(var/datum/callback/verb_callback/verb_callback as anything in verb_queue)
|
||||
if(!istype(verb_callback))
|
||||
stack_trace("non /datum/callback/verb_callback inside [name]'s verb_queue!")
|
||||
continue
|
||||
|
||||
verb_callback.InvokeAsync()
|
||||
executed_verbs++
|
||||
|
||||
verb_queue.Cut()
|
||||
verbs_executed_per_second = MC_AVG_SECONDS(verbs_executed_per_second, executed_verbs, wait SECONDS)
|
||||
//note that wait SECONDS is incorrect if this is called outside of fire() but because byond is garbage i need to add a timer to rustg to find a valid solution
|
||||
|
||||
/datum/controller/subsystem/verb_manager/stat_entry(msg)
|
||||
. = ..()
|
||||
if(use_default_stats)
|
||||
. += "V/S: [round(verbs_executed_per_second, 0.01)]"
|
||||
@@ -43,7 +43,7 @@
|
||||
/datum/ColorMate/tgui_state(mob/user)
|
||||
return GLOB.tgui_conscious_state
|
||||
|
||||
/datum/ColorMate/tgui_data()
|
||||
/datum/ColorMate/tgui_data(mob/user)
|
||||
. = list()
|
||||
.["activemode"] = active_mode
|
||||
.["matrixcolors"] = list(
|
||||
@@ -69,7 +69,7 @@
|
||||
.["item"] = list()
|
||||
.["item"]["name"] = inserted.name
|
||||
.["item"]["sprite"] = icon2base64(get_flat_icon(inserted,dir=SOUTH,no_anim=TRUE))
|
||||
.["item"]["preview"] = icon2base64(build_preview())
|
||||
.["item"]["preview"] = icon2base64(build_preview(user))
|
||||
else
|
||||
.["item"] = null
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
return TRUE
|
||||
|
||||
/// Produces the preview image of the item, used in the UI, the way the color is not stacking is a sin.
|
||||
/datum/ColorMate/proc/build_preview()
|
||||
/datum/ColorMate/proc/build_preview(mob/user)
|
||||
if(inserted) //sanity
|
||||
var/list/cm
|
||||
switch(active_mode)
|
||||
@@ -178,17 +178,17 @@
|
||||
text2num(color_matrix_last[11]),
|
||||
text2num(color_matrix_last[12]),
|
||||
)
|
||||
if(!check_valid_color(cm, usr))
|
||||
if(!check_valid_color(cm, user))
|
||||
return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE)
|
||||
|
||||
if(COLORMATE_TINT)
|
||||
if(!check_valid_color(activecolor, usr))
|
||||
if(!check_valid_color(activecolor, user))
|
||||
return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE)
|
||||
|
||||
if(COLORMATE_HSV)
|
||||
cm = color_matrix_hsv(build_hue, build_sat, build_val)
|
||||
color_matrix_last = cm
|
||||
if(!check_valid_color(cm, usr))
|
||||
if(!check_valid_color(cm, user))
|
||||
return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE)
|
||||
|
||||
var/cur_color = inserted.color
|
||||
|
||||
@@ -452,26 +452,25 @@
|
||||
data["crafting_recipes"] = crafting_recipes
|
||||
return data
|
||||
|
||||
/datum/component/personal_crafting/tgui_act(action, params)
|
||||
/datum/component/personal_crafting/tgui_act(action, params, datum/tgui/ui)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
switch(action)
|
||||
if("make")
|
||||
var/mob/user = usr
|
||||
var/datum/crafting_recipe/TR = locate(params["recipe"]) in GLOB.crafting_recipes
|
||||
busy = TRUE
|
||||
tgui_interact(user)
|
||||
var/atom/movable/result = construct_item(user, TR)
|
||||
tgui_interact(ui.user)
|
||||
var/atom/movable/result = construct_item(ui.user, TR)
|
||||
if(!istext(result)) //We made an item and didn't get a fail message
|
||||
if(ismob(user) && isitem(result)) //In case the user is actually possessing a non mob like a machine
|
||||
user.put_in_hands(result)
|
||||
if(ismob(ui.user) && isitem(result)) //In case the user is actually possessing a non mob like a machine
|
||||
ui.user.put_in_hands(result)
|
||||
else
|
||||
result.forceMove(user.drop_location())
|
||||
to_chat(user, span_notice("[TR.name] constructed."))
|
||||
TR.on_craft_completion(user, result)
|
||||
result.forceMove(ui.user.drop_location())
|
||||
to_chat(ui.user, span_notice("[TR.name] constructed."))
|
||||
TR.on_craft_completion(ui.user, result)
|
||||
else
|
||||
to_chat(user, span_warning("Construction failed[result]"))
|
||||
to_chat(ui.user, span_warning("Construction failed[result]"))
|
||||
busy = FALSE
|
||||
if("toggle_recipes")
|
||||
display_craftable_only = !display_craftable_only
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/datum/component/gargoyle
|
||||
var/energy = 100
|
||||
var/transformed = FALSE
|
||||
var/paused = FALSE
|
||||
var/paused_loc
|
||||
var/cooldown
|
||||
|
||||
var/mob/living/carbon/human/gargoyle //easy reference
|
||||
var/obj/structure/gargoyle/statue //another easy ref
|
||||
|
||||
//Adjustable mod
|
||||
var/identifier = "statue"
|
||||
var/adjective = "hardens"
|
||||
var/material = "stone"
|
||||
var/tint = "#FFFFFF"
|
||||
|
||||
/datum/component/gargoyle/Initialize()
|
||||
if (!ishuman(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
gargoyle = parent
|
||||
add_verb(gargoyle,/mob/living/carbon/human/proc/gargoyle_transformation)
|
||||
add_verb(gargoyle,/mob/living/carbon/human/proc/gargoyle_pause)
|
||||
add_verb(gargoyle,/mob/living/carbon/human/proc/gargoyle_checkenergy)
|
||||
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
|
||||
/datum/component/gargoyle/process()
|
||||
if (QDELETED(gargoyle))
|
||||
return
|
||||
if (paused && gargoyle.loc != paused_loc)
|
||||
unpause()
|
||||
if (energy > 0)
|
||||
if (!transformed && !paused)
|
||||
energy = max(0,energy-0.05)
|
||||
else if (!transformed && isturf(gargoyle.loc))
|
||||
gargoyle.gargoyle_transformation()
|
||||
if (transformed)
|
||||
if (!statue)
|
||||
transformed = FALSE
|
||||
statue.damage(-0.5)
|
||||
energy = min(energy+0.3, 100)
|
||||
|
||||
/datum/component/gargoyle/proc/unpause()
|
||||
if (!paused || transformed)
|
||||
paused = FALSE
|
||||
paused_loc = null
|
||||
UnregisterSignal(gargoyle, COMSIG_ATOM_ENTERING)
|
||||
return
|
||||
if (gargoyle?.loc != paused_loc)
|
||||
paused = FALSE
|
||||
paused_loc = null
|
||||
energy = max(energy - 5, 0)
|
||||
if (energy == 0)
|
||||
gargoyle.gargoyle_transformation()
|
||||
UnregisterSignal(gargoyle, COMSIG_ATOM_ENTERING)
|
||||
|
||||
//verbs or action buttons...?
|
||||
/mob/living/carbon/human/proc/gargoyle_transformation()
|
||||
set name = "Gargoyle - Petrification"
|
||||
set category = "Abilities.Gargoyle"
|
||||
set desc = "Turn yourself into (or back from) being a gargoyle."
|
||||
|
||||
if (stat == DEAD)
|
||||
return
|
||||
|
||||
var/datum/component/gargoyle/comp = GetComponent(/datum/component/gargoyle)
|
||||
if (comp)
|
||||
if (comp.energy <= 0 && isturf(loc))
|
||||
to_chat(src, span_danger("You suddenly turn into a [comp.identifier] as you run out of energy!"))
|
||||
else if (comp.cooldown > world.time)
|
||||
var/time_to_wait = (comp.cooldown - world.time) / (1 SECONDS)
|
||||
to_chat(src, span_warning("You can't transform just yet again! Wait for another [round(time_to_wait,0.1)] seconds!"))
|
||||
return
|
||||
if (istype(loc, /obj/structure/gargoyle))
|
||||
qdel(loc)
|
||||
else if (isturf(loc))
|
||||
new /obj/structure/gargoyle(loc, src)
|
||||
|
||||
/mob/living/carbon/human/proc/gargoyle_pause()
|
||||
set name = "Gargoyle - Pause"
|
||||
set category = "Abilities.Gargoyle"
|
||||
set desc = "Pause your energy while standing still, so you don't use up any more, though you will lose a small amount upon moving again."
|
||||
|
||||
if (stat)
|
||||
return
|
||||
|
||||
var/datum/component/gargoyle/comp = GetComponent(/datum/component/gargoyle)
|
||||
if (comp && !comp.transformed && !comp.paused)
|
||||
comp.paused = TRUE
|
||||
comp.paused_loc = loc
|
||||
comp.RegisterSignal(src, COMSIG_ATOM_ENTERING, /datum/component/gargoyle/proc/unpause)
|
||||
to_chat(src, span_notice("You start conserving your energy."))
|
||||
|
||||
/mob/living/carbon/human/proc/gargoyle_checkenergy()
|
||||
set name = "Gargoyle - Check Energy"
|
||||
set category = "Abilities.Gargoyle"
|
||||
set desc = "Check how much energy you have remaining as a gargoyle."
|
||||
|
||||
var/datum/component/gargoyle/comp = GetComponent(/datum/component/gargoyle)
|
||||
if (comp)
|
||||
to_chat(src, span_notice("You have [round(comp.energy,0.01)] energy remaining. It is currently [comp.paused ? "stable" : (comp.transformed ? "increasing" : "decreasing")]."))
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
Stack End Detector.
|
||||
Can detect if a given code stack has exited, used by the mc for stack overflow detection.
|
||||
|
||||
**/
|
||||
/datum/stack_end_detector
|
||||
var/datum/weakref/_WF
|
||||
var/datum/stack_canary/_canary
|
||||
|
||||
/datum/stack_end_detector/New()
|
||||
_canary = new()
|
||||
_WF = WEAKREF(_canary)
|
||||
|
||||
/** Prime the stack overflow detector.
|
||||
Store the return value of this proc call in a proc level var.
|
||||
Can only be called once.
|
||||
**/
|
||||
/datum/stack_end_detector/proc/prime_canary()
|
||||
if (!_canary)
|
||||
CRASH("Prime_canary called twice")
|
||||
. = _canary
|
||||
_canary = null
|
||||
|
||||
/// Returns true if the stack is still going. Calling before the canary has been primed also returns true
|
||||
/datum/stack_end_detector/proc/check()
|
||||
return !!_WF.resolve()
|
||||
|
||||
/// Stack canary. Will go away if the stack it was primed by is ended by byond for return or stack overflow reasons.
|
||||
/datum/stack_canary
|
||||
|
||||
/// empty proc to avoid warnings about unused variables. Call this proc on your canary in the stack it's watching.
|
||||
/datum/stack_canary/proc/use_variable()
|
||||
@@ -0,0 +1,27 @@
|
||||
///like normal callbacks but they also record their creation time for measurement purposes
|
||||
///they also require the same usr/user that made the callback to both still exist and to still have a client in order to execute
|
||||
/datum/callback/verb_callback
|
||||
///the tick this callback datum was created in. used for testing latency
|
||||
var/creation_time = 0
|
||||
|
||||
/datum/callback/verb_callback/New(thingtocall, proctocall, ...)
|
||||
creation_time = DS2TICKS(world.time)
|
||||
. = ..()
|
||||
|
||||
#ifndef UNIT_TEST
|
||||
/datum/callback/verb_callback/Invoke(...)
|
||||
var/mob/our_user = user?.resolve()
|
||||
if(QDELETED(our_user) || isnull(our_user.client))
|
||||
return
|
||||
var/mob/temp = usr
|
||||
. = ..()
|
||||
usr = temp
|
||||
|
||||
/datum/callback/verb_callback/InvokeAsync(...)
|
||||
var/mob/our_user = user?.resolve()
|
||||
if(QDELETED(our_user) || isnull(our_user.client))
|
||||
return
|
||||
var/mob/temp = usr
|
||||
. = ..()
|
||||
usr = temp
|
||||
#endif
|
||||
+11
-12
@@ -153,24 +153,23 @@
|
||||
data["status"] = status
|
||||
return data
|
||||
|
||||
/datum/wires/tgui_act(action, list/params)
|
||||
/datum/wires/tgui_act(action, list/params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/mob/user = usr
|
||||
if(!interactable(user))
|
||||
if(!interactable(ui.user))
|
||||
return
|
||||
|
||||
var/obj/item/I = user.get_active_hand()
|
||||
var/obj/item/I = ui.user.get_active_hand()
|
||||
var/color = lowertext(params["wire"])
|
||||
holder.add_hiddenprint(user)
|
||||
holder.add_hiddenprint(ui.user)
|
||||
|
||||
switch(action)
|
||||
// Toggles the cut/mend status.
|
||||
if("cut")
|
||||
// if(!I.has_tool_quality(TOOL_WIRECUTTER) && !user.can_admin_interact())
|
||||
if(!istype(I) || !I.has_tool_quality(TOOL_WIRECUTTER))
|
||||
to_chat(user, span_warning("You need wirecutters!"))
|
||||
to_chat(ui.user, span_warning("You need wirecutters!"))
|
||||
return
|
||||
|
||||
playsound(holder, I.usesound, 20, 1)
|
||||
@@ -181,7 +180,7 @@
|
||||
if("pulse")
|
||||
// if(!I.has_tool_quality(TOOL_MULTITOOL) && !user.can_admin_interact())
|
||||
if(!istype(I) || !I.has_tool_quality(TOOL_MULTITOOL))
|
||||
to_chat(user, span_warning("You need a multitool!"))
|
||||
to_chat(ui.user, span_warning("You need a multitool!"))
|
||||
return
|
||||
|
||||
playsound(holder, 'sound/weapons/empty.ogg', 20, 1)
|
||||
@@ -189,7 +188,7 @@
|
||||
|
||||
// If they pulse the electrify wire, call interactable() and try to shock them.
|
||||
if(get_wire(color) == WIRE_ELECTRIFY)
|
||||
interactable(user)
|
||||
interactable(ui.user)
|
||||
|
||||
return TRUE
|
||||
|
||||
@@ -198,18 +197,18 @@
|
||||
if(is_attached(color))
|
||||
var/obj/item/O = detach_assembly(color)
|
||||
if(O)
|
||||
user.put_in_hands(O)
|
||||
ui.user.put_in_hands(O)
|
||||
return TRUE
|
||||
|
||||
if(!istype(I, /obj/item/assembly/signaler))
|
||||
to_chat(user, span_warning("You need a remote signaller!"))
|
||||
to_chat(ui.user, span_warning("You need a remote signaller!"))
|
||||
return
|
||||
|
||||
if(user.unEquip(I))
|
||||
if(ui.user.unEquip(I))
|
||||
attach_assembly(color, I)
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, span_warning("[I] is stuck to your hand!"))
|
||||
to_chat(ui.user, span_warning("[I] is stuck to your hand!"))
|
||||
|
||||
/**
|
||||
* Proc called to determine if the user can see wire define information, such as "Contraband", "Door Bolts", etc.
|
||||
|
||||
@@ -325,13 +325,13 @@
|
||||
throw_speed = 4
|
||||
throw_range = 20
|
||||
|
||||
/obj/item/camera_bug/attack_self(mob/usr as mob)
|
||||
/obj/item/camera_bug/attack_self(mob/user as mob)
|
||||
var/list/cameras = new/list()
|
||||
for (var/obj/machinery/camera/C in cameranet.cameras)
|
||||
if (C.bugged && C.status)
|
||||
cameras.Add(C)
|
||||
if (length(cameras) == 0)
|
||||
to_chat(usr, span_warning("No bugged functioning cameras found."))
|
||||
to_chat(user, span_warning("No bugged functioning cameras found."))
|
||||
return
|
||||
|
||||
var/list/friendly_cameras = new/list()
|
||||
@@ -339,16 +339,16 @@
|
||||
for (var/obj/machinery/camera/C in cameras)
|
||||
friendly_cameras.Add(C.c_tag)
|
||||
|
||||
var/target = tgui_input_list(usr, "Select the camera to observe", "Select Camera", friendly_cameras)
|
||||
var/target = tgui_input_list(user, "Select the camera to observe", "Select Camera", friendly_cameras)
|
||||
if (!target)
|
||||
return
|
||||
for (var/obj/machinery/camera/C in cameras)
|
||||
if (C.c_tag == target)
|
||||
target = C
|
||||
break
|
||||
if (usr.stat == 2) return
|
||||
if (user.stat == 2) return
|
||||
|
||||
usr.client.eye = target
|
||||
user.client.eye = target
|
||||
|
||||
/*
|
||||
/obj/item/cigarpacket
|
||||
|
||||
@@ -56,6 +56,8 @@ GLOBAL_LIST_EMPTY(areas_by_type)
|
||||
var/forbid_singulo = FALSE // If true singulo will not move in.
|
||||
var/no_spoilers = FALSE // If true, makes it much more difficult to see what is inside an area with things like mesons.
|
||||
var/soundproofed = FALSE // If true, blocks sounds from other areas and prevents hearers on other areas from hearing the sounds within.
|
||||
var/block_phase_shift = FALSE //Stops phase shifted mobs from entering // RS Port #658
|
||||
var/block_ghosts = FALSE //Stops ghosts from entering //RS Port #658
|
||||
|
||||
/area/New()
|
||||
// Used by the maploader, this must be done in New, not init
|
||||
@@ -398,6 +400,7 @@ var/list/mob/living/forced_ambiance_list = new
|
||||
play_ambience(L, initial = TRUE)
|
||||
if(no_spoilers)
|
||||
L.disable_spoiler_vision()
|
||||
check_phase_shift(M) //RS Port #658
|
||||
|
||||
/area/proc/play_ambience(var/mob/living/L, initial = TRUE)
|
||||
// Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch
|
||||
@@ -554,3 +557,19 @@ GLOBAL_DATUM(spoiler_obfuscation_image, /image)
|
||||
add_overlay(GLOB.spoiler_obfuscation_image)
|
||||
else
|
||||
cut_overlay(GLOB.spoiler_obfuscation_image)
|
||||
|
||||
// RS Port #658 Start
|
||||
/area/proc/check_phase_shift(var/mob/ourmob)
|
||||
if(!block_phase_shift || !ourmob.incorporeal_move)
|
||||
return
|
||||
if(!isliving(ourmob))
|
||||
return
|
||||
if(isanimal(ourmob))
|
||||
var/mob/living/simple_mob/shadekin/SK = ourmob
|
||||
if(SK.ability_flags & AB_PHASE_SHIFTED)
|
||||
SK.phase_in(SK.loc)
|
||||
if(ishuman(ourmob))
|
||||
var/mob/living/carbon/human/SK = ourmob
|
||||
if(SK.ability_flags & AB_PHASE_SHIFTED)
|
||||
SK.phase_in(SK.loc)
|
||||
// RS Port #658 End
|
||||
|
||||
@@ -449,17 +449,17 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/scan_consolenew/tgui_act(action, params)
|
||||
/obj/machinery/computer/scan_consolenew/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(!istype(usr.loc, /turf))
|
||||
if(!istype(ui.user.loc, /turf))
|
||||
return TRUE
|
||||
if(!src || !src.connected)
|
||||
return TRUE
|
||||
if(irradiating) // Make sure that it isn't already irradiating someone...
|
||||
return TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
if(tgui_act_modal(action, params))
|
||||
return TRUE
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
to_chat(src, span_notice("We return our vocal glands to their original location."))
|
||||
return
|
||||
|
||||
var/mimic_voice = sanitize(tgui_input_text(usr, "Enter a name to mimic.", "Mimic Voice", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
var/mimic_voice = sanitize(tgui_input_text(src, "Enter a name to mimic.", "Mimic Voice", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!mimic_voice)
|
||||
return
|
||||
|
||||
|
||||
@@ -315,8 +315,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
|
||||
|
||||
|
||||
/obj/item/book/tome/attack_self(mob/living/user as mob)
|
||||
usr = user
|
||||
if(!usr.canmove || usr.stat || usr.restrained())
|
||||
if(!user.canmove || user.stat || user.restrained())
|
||||
return
|
||||
|
||||
if(!cultwords["travel"])
|
||||
@@ -337,11 +336,11 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
|
||||
if("Cancel", null)
|
||||
return
|
||||
if("Read it")
|
||||
if(usr.get_active_hand() != src)
|
||||
if(user.get_active_hand() != src)
|
||||
return
|
||||
user << browse("[tomedat]", "window=Arcane Tome")
|
||||
return
|
||||
if(usr.get_active_hand() != src)
|
||||
if(user.get_active_hand() != src)
|
||||
return
|
||||
|
||||
var/list/dictionary = list (
|
||||
@@ -386,7 +385,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
|
||||
|
||||
var/chosen_rune = null
|
||||
|
||||
if(usr)
|
||||
if(user)
|
||||
chosen_rune = input ("Choose a rune to scribe.") in scribewords
|
||||
if (!chosen_rune)
|
||||
return
|
||||
@@ -398,7 +397,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
|
||||
if (chosen_rune == "teleport other")
|
||||
dictionary[chosen_rune] += input ("Choose a destination word") in english
|
||||
|
||||
if(usr.get_active_hand() != src)
|
||||
if(user.get_active_hand() != src)
|
||||
return
|
||||
|
||||
for (var/mob/V in viewers(src))
|
||||
@@ -408,7 +407,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
|
||||
if(do_after(user, 50))
|
||||
var/area/A = get_area(user)
|
||||
log_and_message_admins("created \an [chosen_rune] rune at \the [A.name] - [user.loc.x]-[user.loc.y]-[user.loc.z].")
|
||||
if(usr.get_active_hand() != src)
|
||||
if(user.get_active_hand() != src)
|
||||
return
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/effect/rune/R = new /obj/effect/rune(user.loc)
|
||||
@@ -439,7 +438,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
|
||||
w_class = ITEMSIZE_SMALL
|
||||
var/cultistsonly = 1
|
||||
/obj/item/book/tome/imbued/attack_self(mob/user as mob)
|
||||
if(src.cultistsonly && !iscultist(usr))
|
||||
if(src.cultistsonly && !iscultist(user))
|
||||
return
|
||||
if(!cultwords["travel"])
|
||||
runerandom()
|
||||
@@ -448,7 +447,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
|
||||
if (!istype(user.loc,/turf))
|
||||
to_chat(user, span_notice("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(usr, "Choose a rune to scribe", "Rune Scribing") in runes // Remains input() for extreme blocking
|
||||
r = input(user, "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
|
||||
@@ -460,8 +459,8 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
|
||||
if("teleport")
|
||||
var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri")
|
||||
var/beacon
|
||||
if(usr)
|
||||
beacon = input(usr, "Select the last rune", "Rune Scribing") in words // Remains input() for extreme blocking
|
||||
if(user)
|
||||
beacon = input(user, "Select the last rune", "Rune Scribing") in words // Remains input() for extreme blocking
|
||||
R.word1=cultwords["travel"]
|
||||
R.word2=cultwords["self"]
|
||||
R.word3=beacon
|
||||
@@ -470,8 +469,8 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
|
||||
if("itemport")
|
||||
var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri")
|
||||
var/beacon
|
||||
if(usr)
|
||||
beacon = input(usr, "Select the last rune", "Rune Scribing") in words // Remains input() for extreme blocking
|
||||
if(user)
|
||||
beacon = input(user, "Select the last rune", "Rune Scribing") in words // Remains input() for extreme blocking
|
||||
R.word1=cultwords["travel"]
|
||||
R.word2=cultwords["other"]
|
||||
R.word3=beacon
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
if("armor")
|
||||
call(/obj/effect/rune/proc/armor)()
|
||||
if("emp")
|
||||
call(/obj/effect/rune/proc/emp)(usr.loc,3)
|
||||
call(/obj/effect/rune/proc/emp)(user.loc,3)
|
||||
if("conceal")
|
||||
call(/obj/effect/rune/proc/obscure)(2)
|
||||
if("revealrunes")
|
||||
|
||||
@@ -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 = tgui_input_list(usr, "Select the sound you want to make.", "Sounds", sound_options)
|
||||
var/new_sound = tgui_input_list(user, "Select the sound you want to make.", "Sounds", sound_options)
|
||||
if(new_sound)
|
||||
selected_sound = sound_options[new_sound]
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
access = list(access_eva, access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_external_airlocks, access_construction, access_atmospherics)
|
||||
minimal_access = list(access_eva, access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_external_airlocks, access_construction)
|
||||
alt_titles = list(JOB_ALT_MAINTENANCE_TECHNICIAN = /datum/alt_title/maint_tech, JOB_ALT_ENGINE_TECHNICIAN = /datum/alt_title/engine_tech,
|
||||
JOB_ALT_ELECTRICIAN = /datum/alt_title/electrician, JOB_ALT_CONSTRUCTION_ENGINEER = /datum/alt_title/construction_engi, JOB_ALT_ENGINEERING_CONTRACTOR = /datum/alt_title/engineering_contractor, JOB_ALT_COMPUTER_TECHNICIAN = /datum/alt_title/computer_tech)
|
||||
JOB_ALT_ELECTRICIAN = /datum/alt_title/electrician, JOB_ALT_CONSTRUCTION_ENGINEER = /datum/alt_title/construction_engi, JOB_ALT_ENGINEERING_CONTRACTOR = /datum/alt_title/engineering_contractor, JOB_ALT_COMPUTER_TECHNICIAN = /datum/alt_title/computer_tech, JOB_ALT_SALVAGE_TECHNICIAN = /datum/alt_title/salvage_tech)
|
||||
|
||||
minimal_player_age = 3
|
||||
min_age_by_species = list(SPECIES_PROMETHEAN = 2)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
if(O.has_tool_quality(TOOL_WIRECUTTER))
|
||||
if(cable && cable.get_amount())
|
||||
var/m = round(input(usr, "Please specify the length of cable to cut", "Cut cable", min(cable.get_amount(), 30)) as num, 1)
|
||||
var/m = round(input(user, "Please specify the length of cable to cut", "Cut cable", min(cable.get_amount(), 30)) as num, 1)
|
||||
m = min(m, cable.get_amount())
|
||||
m = min(m, 30)
|
||||
if(m)
|
||||
@@ -45,7 +45,7 @@
|
||||
var/obj/item/stack/cable_coil/CC = new (get_turf(src))
|
||||
CC.set_amount(m)
|
||||
else
|
||||
to_chat(usr, span_warning("There's no more cable on the reel."))
|
||||
to_chat(user, span_warning("There's no more cable on the reel."))
|
||||
|
||||
/obj/machinery/cablelayer/examine(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
return
|
||||
|
||||
/obj/machinery/optable/attack_hand(mob/user as mob)
|
||||
if(HULK in usr.mutations)
|
||||
visible_message(span_danger("\The [usr] destroys \the [src]!"))
|
||||
if(HULK in user.mutations)
|
||||
visible_message(span_danger("\The [user] destroys \the [src]!"))
|
||||
density = FALSE
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -296,10 +296,10 @@
|
||||
/obj/machinery/sleeper/tgui_act(action, params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(!controls_inside && usr == occupant)
|
||||
if(!controls_inside && ui.user == occupant)
|
||||
return
|
||||
if(panel_open)
|
||||
to_chat(usr, span_notice("Close the maintenance panel first."))
|
||||
to_chat(ui.user, span_notice("Close the maintenance panel first."))
|
||||
return
|
||||
|
||||
. = TRUE
|
||||
@@ -309,16 +309,16 @@
|
||||
return
|
||||
if(occupant.stat == DEAD)
|
||||
var/datum/gender/G = gender_datums[occupant.get_visible_gender()]
|
||||
to_chat(usr, span_danger("This person has no life to preserve anymore. Take [G.him] to a department capable of reanimating [G.him]."))
|
||||
to_chat(ui.user, span_danger("This person has no life to preserve anymore. Take [G.him] to a department capable of reanimating [G.him]."))
|
||||
return
|
||||
var/chemical = params["chemid"]
|
||||
var/amount = text2num(params["amount"])
|
||||
if(!length(chemical) || amount <= 0)
|
||||
return
|
||||
if(occupant.health > min_health) //|| (chemical in emergency_chems))
|
||||
inject_chemical(usr, chemical, amount)
|
||||
inject_chemical(ui.user, chemical, amount)
|
||||
else
|
||||
to_chat(usr, span_danger("This person is not in good enough condition for sleepers to be effective! Use another means of treatment, such as cryogenics!"))
|
||||
to_chat(ui.user, span_danger("This person is not in good enough condition for sleepers to be effective! Use another means of treatment, such as cryogenics!"))
|
||||
if("removebeaker")
|
||||
remove_beaker()
|
||||
if("togglefilter")
|
||||
@@ -328,7 +328,7 @@
|
||||
if("ejectify")
|
||||
go_out()
|
||||
if("changestasis")
|
||||
var/new_stasis = tgui_input_list(usr, "Levels deeper than 50% stasis level will render the patient unconscious.","Stasis Level", stasis_choices)
|
||||
var/new_stasis = tgui_input_list(ui.user, "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")
|
||||
@@ -337,7 +337,7 @@
|
||||
auto_eject_dead = FALSE
|
||||
else
|
||||
return FALSE
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
/obj/machinery/sleeper/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
if(istype(user, /mob/living/silicon))
|
||||
return attack_hand(user)
|
||||
else // trying to unlock the interface
|
||||
if(allowed(usr))
|
||||
if(allowed(user))
|
||||
locked = !locked
|
||||
to_chat(user, "You [ locked ? "lock" : "unlock"] the device.")
|
||||
if(locked)
|
||||
@@ -48,7 +48,7 @@
|
||||
user << browse(null, "window=ai_slipper")
|
||||
else
|
||||
if(user.machine==src)
|
||||
attack_hand(usr)
|
||||
attack_hand(user)
|
||||
else
|
||||
to_chat(user, span_warning("Access denied."))
|
||||
return
|
||||
|
||||
@@ -682,10 +682,10 @@
|
||||
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 = tgui_input_number(usr, "What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C, max_temperature, min_temperature, round_value = FALSE)
|
||||
var/input_temperature = tgui_input_number(ui.user, "What temperature would you like the system to mantain? (Capped between [min_temperature] and [max_temperature]C)", "Thermostat Controls", target_temperature - T0C, max_temperature, min_temperature, round_value = FALSE)
|
||||
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")
|
||||
to_chat(ui.user, "Temperature must be between [min_temperature]C and [max_temperature]C")
|
||||
else
|
||||
target_temperature = input_temperature + T0C
|
||||
return TRUE
|
||||
@@ -694,13 +694,13 @@
|
||||
// Yes, this is kinda snowflaky; however, I would argue it would be far more snowflakey
|
||||
// to include "custom hrefs" and all the other bullshit that nano states have just for the
|
||||
// like, two UIs, that want remote access to other UIs.
|
||||
if((locked && !issilicon(usr) && !istype(state, /datum/tgui_state/air_alarm_remote)) || (issilicon(usr) && aidisabled))
|
||||
if((locked && !issilicon(ui.user) && !istype(state, /datum/tgui_state/air_alarm_remote)) || (issilicon(ui.user) && aidisabled))
|
||||
return
|
||||
|
||||
var/device_id = params["id_tag"]
|
||||
switch(action)
|
||||
if("lock")
|
||||
if(issilicon(usr) && !wires.is_cut(WIRE_IDSCAN))
|
||||
if(issilicon(ui.user) && !wires.is_cut(WIRE_IDSCAN))
|
||||
locked = !locked
|
||||
. = TRUE
|
||||
if( "power",
|
||||
@@ -713,42 +713,42 @@
|
||||
"panic_siphon",
|
||||
"scrubbing",
|
||||
"direction")
|
||||
send_signal(device_id, list("[action]" = text2num(params["val"])), usr)
|
||||
send_signal(device_id, list("[action]" = text2num(params["val"])), ui.user)
|
||||
. = TRUE
|
||||
if("excheck")
|
||||
send_signal(device_id, list("checks" = text2num(params["val"])^1), usr)
|
||||
send_signal(device_id, list("checks" = text2num(params["val"])^1), ui.user)
|
||||
. = TRUE
|
||||
if("incheck")
|
||||
send_signal(device_id, list("checks" = text2num(params["val"])^2), usr)
|
||||
send_signal(device_id, list("checks" = text2num(params["val"])^2), ui.user)
|
||||
. = TRUE
|
||||
if("set_external_pressure", "set_internal_pressure")
|
||||
var/target = params["value"]
|
||||
if(!isnull(target))
|
||||
send_signal(device_id, list("[action]" = target), usr)
|
||||
send_signal(device_id, list("[action]" = target), ui.user)
|
||||
. = TRUE
|
||||
if("reset_external_pressure")
|
||||
send_signal(device_id, list("reset_external_pressure"), usr)
|
||||
send_signal(device_id, list("reset_external_pressure"), ui.user)
|
||||
. = TRUE
|
||||
if("reset_internal_pressure")
|
||||
send_signal(device_id, list("reset_internal_pressure"), usr)
|
||||
send_signal(device_id, list("reset_internal_pressure"), ui.user)
|
||||
. = TRUE
|
||||
if("threshold")
|
||||
var/env = params["env"]
|
||||
|
||||
var/name = params["var"]
|
||||
var/value = tgui_input_number(usr, "New [name] for [env]:", name, TLV[env][name], min_value=-1, round_value = FALSE)
|
||||
var/value = tgui_input_number(ui.user, "New [name] for [env]:", name, TLV[env][name], min_value=-1, round_value = FALSE)
|
||||
if(!isnull(value) && !..())
|
||||
if(value < 0)
|
||||
TLV[env][name] = -1
|
||||
else
|
||||
TLV[env][name] = round(value, 0.01)
|
||||
clamp_tlv_values(env, name)
|
||||
// investigate_log(" treshold value for [env]:[name] was set to [value] by [key_name(usr)]",INVESTIGATE_ATMOS)
|
||||
// investigate_log(" treshold value for [env]:[name] was set to [value] by [key_name(ui.user)]",INVESTIGATE_ATMOS)
|
||||
. = TRUE
|
||||
if("mode")
|
||||
mode = text2num(params["mode"])
|
||||
// investigate_log("was turned to [get_mode_name(mode)] mode by [key_name(usr)]",INVESTIGATE_ATMOS)
|
||||
apply_mode(usr)
|
||||
// investigate_log("was turned to [get_mode_name(mode)] mode by [key_name(ui.user)]",INVESTIGATE_ATMOS)
|
||||
apply_mode(ui.user)
|
||||
. = TRUE
|
||||
if("alarm")
|
||||
if(alarm_area.atmosalert(2, src))
|
||||
@@ -817,7 +817,7 @@
|
||||
to_chat(user, "It does nothing.")
|
||||
return
|
||||
else
|
||||
if(allowed(usr) && !wires.is_cut(WIRE_IDSCAN))
|
||||
if(allowed(user) && !wires.is_cut(WIRE_IDSCAN))
|
||||
locked = !locked
|
||||
to_chat(user, span_notice("You [locked ? "lock" : "unlock"] the Air Alarm interface."))
|
||||
else
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
return list("scrubbers" = working)
|
||||
|
||||
/obj/machinery/computer/area_atmos/tgui_act(action, params)
|
||||
/obj/machinery/computer/area_atmos/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
scanscrubbers()
|
||||
. = TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
/obj/machinery/computer/area_atmos/proc/toggle_all(on)
|
||||
for(var/id in connectedscrubbers)
|
||||
|
||||
@@ -315,7 +315,7 @@ update_flag
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/tgui_act(action, params)
|
||||
/obj/machinery/portable_atmospherics/canister/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -331,7 +331,7 @@ update_flag
|
||||
"\[Air\]" = "grey", \
|
||||
"\[CAUTION\]" = "yellow", \
|
||||
)
|
||||
var/label = tgui_input_list(usr, "Choose canister label", "Gas canister", colors)
|
||||
var/label = tgui_input_list(ui.user, "Choose canister label", "Gas canister", colors)
|
||||
if(label)
|
||||
canister_color = colors[label]
|
||||
icon_state = colors[label]
|
||||
@@ -348,7 +348,7 @@ update_flag
|
||||
pressure = 10*ONE_ATMOSPHERE
|
||||
. = TRUE
|
||||
else if(pressure == "input")
|
||||
pressure = tgui_input_number(usr, "New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure, 10*ONE_ATMOSPHERE, ONE_ATMOSPHERE/10)
|
||||
pressure = tgui_input_number(ui.user, "New release pressure ([ONE_ATMOSPHERE/10]-[10*ONE_ATMOSPHERE] kPa):", name, release_pressure, 10*ONE_ATMOSPHERE, ONE_ATMOSPHERE/10)
|
||||
if(!isnull(pressure) && !..())
|
||||
. = TRUE
|
||||
else if(text2num(pressure) != null)
|
||||
@@ -359,14 +359,14 @@ update_flag
|
||||
if("valve")
|
||||
if(valve_open)
|
||||
if(holding)
|
||||
release_log += "Valve was " + span_bold("closed") + " by [usr] ([usr.ckey]), stopping the transfer into the [holding]<br>"
|
||||
release_log += "Valve was " + span_bold("closed") + " by [ui.user] ([ui.user.ckey]), stopping the transfer into the [holding]<br>"
|
||||
else
|
||||
release_log += "Valve was " + span_bold("closed") + " by [usr] ([usr.ckey]), stopping the transfer into the " + span_red(span_bold("air")) + "<br>"
|
||||
release_log += "Valve was " + span_bold("closed") + " by [ui.user] ([ui.user.ckey]), stopping the transfer into the " + span_red(span_bold("air")) + "<br>"
|
||||
else
|
||||
if(holding)
|
||||
release_log += "Valve was " + span_bold("opened") + " by [usr] ([usr.ckey]), starting the transfer into the [holding]<br>"
|
||||
release_log += "Valve was " + span_bold("opened") + " by [ui.user] ([ui.user.ckey]), starting the transfer into the [holding]<br>"
|
||||
else
|
||||
release_log += "Valve was " + span_bold("opened") + " by [usr] ([usr.ckey]), starting the transfer into the " + span_red(span_bold("air")) + "<br>"
|
||||
release_log += "Valve was " + span_bold("opened") + " by [ui.user] ([ui.user.ckey]), starting the transfer into the " + span_red(span_bold("air")) + "<br>"
|
||||
log_open()
|
||||
valve_open = !valve_open
|
||||
. = TRUE
|
||||
@@ -374,14 +374,14 @@ update_flag
|
||||
if(holding)
|
||||
if(valve_open)
|
||||
valve_open = 0
|
||||
release_log += "Valve was " + span_bold("closed") + " by [usr] ([usr.ckey]), stopping the transfer into the [holding]<br>"
|
||||
release_log += "Valve was " + span_bold("closed") + " by [ui.user] ([ui.user.ckey]), stopping the transfer into the [holding]<br>"
|
||||
if(istype(holding, /obj/item/tank))
|
||||
holding.manipulated_by = usr.real_name
|
||||
holding.manipulated_by = ui.user.real_name
|
||||
holding.loc = loc
|
||||
holding = null
|
||||
. = TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/phoron/New()
|
||||
|
||||
@@ -146,11 +146,11 @@
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
ui.user.set_machine(src)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
if(busy)
|
||||
to_chat(usr, span_notice("The autolathe is busy. Please wait for completion of previous operation."))
|
||||
to_chat(ui.user, span_notice("The autolathe is busy. Please wait for completion of previous operation."))
|
||||
return
|
||||
switch(action)
|
||||
if("make")
|
||||
@@ -176,8 +176,8 @@
|
||||
if(!isnull(materials.get_material_amount(material)) && materials.get_material_amount(material) < round(making.resources[material] * coeff))
|
||||
max_sheets = 0
|
||||
//Build list of multipliers for sheets.
|
||||
multiplier = tgui_input_number(usr, "How many do you want to print? (0-[max_sheets])", null, null, max_sheets, 0)
|
||||
if(!multiplier || multiplier <= 0 || (multiplier != round(multiplier)) || multiplier > max_sheets || tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
multiplier = tgui_input_number(ui.user, "How many do you want to print? (0-[max_sheets])", null, null, max_sheets, 0)
|
||||
if(!multiplier || multiplier <= 0 || (multiplier != round(multiplier)) || multiplier > max_sheets || tgui_status(ui.user, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
|
||||
//Check if we still have the materials.
|
||||
|
||||
@@ -135,14 +135,14 @@
|
||||
ui = new(user, src, "Biogenerator", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/biogenerator/tgui_act(action, params)
|
||||
/obj/machinery/biogenerator/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("activate")
|
||||
INVOKE_ASYNC(src, PROC_REF(activate))
|
||||
INVOKE_ASYNC(src, PROC_REF(activate), ui.user)
|
||||
return TRUE
|
||||
if("detach")
|
||||
if(beaker)
|
||||
@@ -166,11 +166,11 @@
|
||||
return
|
||||
var/cost = round(br.cost / build_eff)
|
||||
if(cost > points)
|
||||
to_chat(usr, span_danger("Insufficient biomass."))
|
||||
to_chat(ui.user, span_danger("Insufficient biomass."))
|
||||
return
|
||||
var/amt_to_actually_dispense = round(min(beaker.reagents.get_free_space(), br.reagent_amt))
|
||||
if(amt_to_actually_dispense <= 0)
|
||||
to_chat(usr, span_danger("The loaded beaker is full!"))
|
||||
to_chat(ui.user, span_danger("The loaded beaker is full!"))
|
||||
return
|
||||
points -= (cost * (amt_to_actually_dispense / br.reagent_amt))
|
||||
beaker.reagents.add_reagent(br.reagent_id, amt_to_actually_dispense)
|
||||
@@ -179,7 +179,7 @@
|
||||
|
||||
var/cost = round(bi.cost / build_eff)
|
||||
if(cost > points)
|
||||
to_chat(usr, span_danger("Insufficient biomass."))
|
||||
to_chat(ui.user, span_danger("Insufficient biomass."))
|
||||
return
|
||||
|
||||
points -= cost
|
||||
@@ -263,13 +263,13 @@
|
||||
return
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/biogenerator/proc/activate()
|
||||
if(usr.stat)
|
||||
/obj/machinery/biogenerator/proc/activate(mob/user)
|
||||
if(user.stat)
|
||||
return
|
||||
if(stat) //NOPOWER etc
|
||||
return
|
||||
if(processing)
|
||||
to_chat(usr, span_notice("The biogenerator is in the process of working."))
|
||||
to_chat(user, span_notice("The biogenerator is in the process of working."))
|
||||
return
|
||||
var/S = 0
|
||||
for(var/obj/item/reagent_containers/food/snacks/grown/I in contents)
|
||||
@@ -289,7 +289,7 @@
|
||||
playsound(src, 'sound/machines/biogenerator_end.ogg', 40, 1)
|
||||
update_icon()
|
||||
else
|
||||
to_chat(usr, span_warning("Error: No growns inside. Please insert growns."))
|
||||
to_chat(user, span_warning("Error: No growns inside. Please insert growns."))
|
||||
return
|
||||
|
||||
/obj/machinery/biogenerator/RefreshParts()
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
if(anomalous_organs)
|
||||
possible_list |= anomalous_products
|
||||
|
||||
var/choice = tgui_input_list(usr, "What would you like to print?", "Print Choice", possible_list)
|
||||
var/choice = tgui_input_list(user, "What would you like to print?", "Print Choice", possible_list)
|
||||
|
||||
if(!choice || printing || (stat & (BROKEN|NOPOWER)))
|
||||
return
|
||||
|
||||
@@ -149,26 +149,26 @@
|
||||
text_mode = "tank transfer valve detonation"
|
||||
if(MODE_CANISTER)
|
||||
text_mode = "canister-assisted single gas tank detonation"
|
||||
to_chat(usr, span_notice("[src] set to simulate a [text_mode]."))
|
||||
to_chat(ui.user, span_notice("[src] set to simulate a [text_mode]."))
|
||||
return TRUE
|
||||
|
||||
if("add_tank")
|
||||
if(istype(usr.get_active_hand(), /obj/item/tank))
|
||||
var/obj/item/tank/T = usr.get_active_hand()
|
||||
if(istype(ui.user.get_active_hand(), /obj/item/tank))
|
||||
var/obj/item/tank/T = ui.user.get_active_hand()
|
||||
var/slot = params["slot"]
|
||||
if(slot == 1 && !tank1)
|
||||
tank1 = T
|
||||
else if(slot == 2 && !tank2)
|
||||
tank2 = T
|
||||
else
|
||||
to_chat(usr, span_warning("Slot [slot] is full."))
|
||||
to_chat(ui.user, span_warning("Slot [slot] is full."))
|
||||
return
|
||||
|
||||
usr.drop_item(T)
|
||||
ui.user.drop_item(T)
|
||||
T.forceMove(src)
|
||||
return TRUE
|
||||
else
|
||||
to_chat(usr, span_warning("You must be wielding a tank to insert it!"))
|
||||
to_chat(ui.user, span_warning("You must be wielding a tank to insert it!"))
|
||||
|
||||
if("remove_tank")
|
||||
var/obj/item/tank/T = locate(params["ref"]) in list(tank1, tank2)
|
||||
|
||||
@@ -80,19 +80,19 @@
|
||||
if(W.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
|
||||
var/input = sanitize(tgui_input_text(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT))
|
||||
var/input = sanitize(tgui_input_text(user, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT))
|
||||
if(!input)
|
||||
to_chat(usr, "No input found please hang up and try your call again.")
|
||||
to_chat(user, "No input found please hang up and try your call again.")
|
||||
return
|
||||
|
||||
var/list/tempnetwork = splittext(input, ",")
|
||||
if(tempnetwork.len < 1)
|
||||
to_chat(usr, "No network found please hang up and try your call again.")
|
||||
to_chat(user, "No network found please hang up and try your call again.")
|
||||
return
|
||||
|
||||
var/area/camera_area = get_area(src)
|
||||
var/temptag = "[sanitize(camera_area.name)] ([rand(1, 999)])"
|
||||
input = sanitizeSafe(tgui_input_text(usr, "How would you like to name the camera?", "Set Camera Name", camera_name ? camera_name : temptag), MAX_NAME_LEN)
|
||||
input = sanitizeSafe(tgui_input_text(user, "How would you like to name the camera?", "Set Camera Name", camera_name ? camera_name : temptag), MAX_NAME_LEN)
|
||||
|
||||
state = 4
|
||||
var/obj/machinery/camera/C = new(src.loc)
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
cashmoney.update_icon()
|
||||
|
||||
if(cashmoney.worth <= 0)
|
||||
usr.drop_from_inventory(cashmoney)
|
||||
user.drop_from_inventory(cashmoney)
|
||||
qdel(cashmoney)
|
||||
cashmoney.update_icon()
|
||||
|
||||
|
||||
@@ -127,11 +127,11 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/operating/tgui_act(action, params)
|
||||
/obj/machinery/computer/operating/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
|
||||
usr.set_machine(src)
|
||||
if((ui.user.contents.Find(src) || (in_range(src, ui.user) && istype(src.loc, /turf))) || (istype(ui.user, /mob/living/silicon)))
|
||||
ui.user.set_machine(src)
|
||||
|
||||
. = TRUE
|
||||
switch(action)
|
||||
|
||||
@@ -111,23 +111,23 @@
|
||||
laws.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
laws.add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
|
||||
laws.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
|
||||
to_chat(usr, "Law module applied.")
|
||||
to_chat(user, "Law module applied.")
|
||||
|
||||
if(istype(P, /obj/item/aiModule/nanotrasen))
|
||||
laws.add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.")
|
||||
laws.add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
|
||||
laws.add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
|
||||
laws.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
|
||||
to_chat(usr, "Law module applied.")
|
||||
to_chat(user, "Law module applied.")
|
||||
|
||||
if(istype(P, /obj/item/aiModule/purge))
|
||||
laws.clear_inherent_laws()
|
||||
to_chat(usr, "Law module applied.")
|
||||
to_chat(user, "Law module applied.")
|
||||
|
||||
if(istype(P, /obj/item/aiModule/freeform))
|
||||
var/obj/item/aiModule/freeform/M = P
|
||||
laws.add_inherent_law(M.newFreeFormLaw)
|
||||
to_chat(usr, "Added a freeform law.")
|
||||
to_chat(user, "Added a freeform law.")
|
||||
|
||||
if(istype(P, /obj/item/mmi))
|
||||
var/obj/item/mmi/M = P
|
||||
@@ -148,7 +148,7 @@
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
brain = P
|
||||
to_chat(usr, "Added [P].")
|
||||
to_chat(user, "Added [P].")
|
||||
icon_state = "3b"
|
||||
|
||||
if(P.has_tool_quality(TOOL_CROWBAR) && brain)
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/aifixer/tgui_act(action, params)
|
||||
/obj/machinery/computer/aifixer/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(!occupier)
|
||||
@@ -92,7 +92,7 @@
|
||||
switch(action)
|
||||
if("PRG_beginReconstruction")
|
||||
if(occupier?.health < 100)
|
||||
to_chat(usr, span_notice("Reconstruction in progress. This will take several minutes."))
|
||||
to_chat(ui.user, span_notice("Reconstruction in progress. This will take several minutes."))
|
||||
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 25, FALSE)
|
||||
restoring = TRUE
|
||||
var/mob/observer/dead/ghost = occupier.get_ghost()
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
sleep(10)
|
||||
enemy_hp -= attackamt
|
||||
arcade_action()
|
||||
arcade_action(ui.user)
|
||||
|
||||
if("heal")
|
||||
blocked = 1
|
||||
@@ -173,7 +173,7 @@
|
||||
player_mp -= pointamt
|
||||
player_hp += healamt
|
||||
blocked = 1
|
||||
arcade_action()
|
||||
arcade_action(ui.user)
|
||||
|
||||
if("charge")
|
||||
blocked = 1
|
||||
@@ -185,7 +185,7 @@
|
||||
turtle--
|
||||
|
||||
sleep(10)
|
||||
arcade_action()
|
||||
arcade_action(ui.user)
|
||||
|
||||
|
||||
if(action == "newgame") //Reset everything
|
||||
@@ -201,10 +201,10 @@
|
||||
randomize_characters()
|
||||
emagged = 0
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/arcade/battle/proc/arcade_action()
|
||||
/obj/machinery/computer/arcade/battle/proc/arcade_action(var/mob/user)
|
||||
if ((enemy_mp <= 0) || (enemy_hp <= 0))
|
||||
if(!gameover)
|
||||
gameover = 1
|
||||
@@ -215,8 +215,8 @@
|
||||
feedback_inc("arcade_win_emagged")
|
||||
new /obj/effect/spawner/newbomb/timer/syndicate(src.loc)
|
||||
new /obj/item/clothing/head/collectable/petehat(src.loc)
|
||||
message_admins("[key_name_admin(usr)] has outbombed Cuban Pete and been awarded a bomb.")
|
||||
log_game("[key_name_admin(usr)] has outbombed Cuban Pete and been awarded a bomb.")
|
||||
message_admins("[key_name_admin(user)] has outbombed Cuban Pete and been awarded a bomb.")
|
||||
log_game("[key_name_admin(user)] has outbombed Cuban Pete and been awarded a bomb.")
|
||||
randomize_characters()
|
||||
emagged = 0
|
||||
else if(!contents.len)
|
||||
@@ -245,7 +245,7 @@
|
||||
temp = "You have been drained! GAME OVER"
|
||||
if(emagged)
|
||||
feedback_inc("arcade_loss_mana_emagged")
|
||||
usr.gib()
|
||||
user.gib()
|
||||
else
|
||||
feedback_inc("arcade_loss_mana_normal")
|
||||
|
||||
@@ -267,7 +267,7 @@
|
||||
playsound(src, 'sound/arcade/lose.ogg', 50, 1, extrarange = -3, falloff = 0.1, ignore_walls = FALSE)
|
||||
if(emagged)
|
||||
feedback_inc("arcade_loss_hp_emagged")
|
||||
usr.gib()
|
||||
user.gib()
|
||||
else
|
||||
feedback_inc("arcade_loss_hp_normal")
|
||||
|
||||
@@ -367,12 +367,12 @@
|
||||
"You have made it to Orion! Congratulations! Your crew is one of the few to start a new foothold for mankind!"
|
||||
)
|
||||
|
||||
/obj/machinery/computer/arcade/orion_trail/proc/newgame()
|
||||
/obj/machinery/computer/arcade/orion_trail/proc/newgame(var/mob/user)
|
||||
// Set names of settlers in crew
|
||||
settlers = list()
|
||||
for(var/i = 1; i <= 3; i++)
|
||||
add_crewmember()
|
||||
add_crewmember("[usr]")
|
||||
add_crewmember("[user]")
|
||||
// Re-set items to defaults
|
||||
engine = 1
|
||||
hull = 1
|
||||
@@ -466,7 +466,7 @@
|
||||
if (href_list["continue"]) //Continue your travels
|
||||
if(gameStatus == ORION_STATUS_NORMAL && !event && turns != 7)
|
||||
if(turns >= ORION_TRAIL_WINTURN)
|
||||
win()
|
||||
win(usr)
|
||||
else
|
||||
food -= (alive+traitors_aboard)*2
|
||||
fuel -= 5
|
||||
@@ -535,7 +535,7 @@
|
||||
else if(href_list["newgame"]) //Reset everything
|
||||
if(gameStatus == ORION_STATUS_START)
|
||||
playsound(src, 'sound/arcade/Ori_begin.ogg', 50, 1, extrarange = -3, falloff = 0.1, ignore_walls = FALSE)
|
||||
newgame()
|
||||
newgame(usr)
|
||||
else if(href_list["menu"]) //back to the main menu
|
||||
if(gameStatus == ORION_STATUS_GAMEOVER)
|
||||
gameStatus = ORION_STATUS_START
|
||||
@@ -1006,14 +1006,14 @@
|
||||
return removed
|
||||
|
||||
|
||||
/obj/machinery/computer/arcade/orion_trail/proc/win()
|
||||
/obj/machinery/computer/arcade/orion_trail/proc/win(var/mob/user)
|
||||
gameStatus = ORION_STATUS_START
|
||||
src.visible_message("\The [src] plays a triumpant tune, stating 'CONGRATULATIONS, YOU HAVE MADE IT TO ORION.'")
|
||||
playsound(src, 'sound/arcade/Ori_win.ogg', 50, 1, extrarange = -3, falloff = 0.1, ignore_walls = FALSE)
|
||||
if(emagged)
|
||||
new /obj/item/orion_ship(src.loc)
|
||||
message_admins("[key_name_admin(usr)] made it to Orion on an emagged machine and got an explosive toy ship.")
|
||||
log_game("[key_name(usr)] made it to Orion on an emagged machine and got an explosive toy ship.")
|
||||
message_admins("[key_name_admin(user)] made it to Orion on an emagged machine and got an explosive toy ship.")
|
||||
log_game("[key_name(user)] made it to Orion on an emagged machine and got an explosive toy ship.")
|
||||
else
|
||||
prizevend()
|
||||
emagged = 0
|
||||
@@ -1025,7 +1025,7 @@
|
||||
to_chat(user, span_notice("You override the cheat code menu and skip to Cheat #[rand(1, 50)]: Realism Mode."))
|
||||
name = "The Orion Trail: Realism Edition"
|
||||
desc = "Learn how our ancestors got to Orion, and try not to die in the process!"
|
||||
newgame()
|
||||
newgame(user)
|
||||
emagged = 1
|
||||
return 1
|
||||
|
||||
@@ -1049,8 +1049,8 @@
|
||||
if(active)
|
||||
return
|
||||
|
||||
message_admins("[key_name_admin(usr)] primed an explosive Orion ship for detonation.")
|
||||
log_game("[key_name(usr)] primed an explosive Orion ship for detonation.")
|
||||
message_admins("[key_name_admin(user)] primed an explosive Orion ship for detonation.")
|
||||
log_game("[key_name(user)] primed an explosive Orion ship for detonation.")
|
||||
|
||||
to_chat(user, span_warning("You flip the switch on the underside of [src]."))
|
||||
active = 1
|
||||
@@ -1112,10 +1112,10 @@
|
||||
var/paid = 0
|
||||
var/obj/item/card/id/W = I.GetID()
|
||||
if(W) //for IDs and PDAs and wallets with IDs
|
||||
paid = pay_with_card(W,I)
|
||||
paid = pay_with_card(W, I, user)
|
||||
else if(istype(I, /obj/item/spacecash/ewallet))
|
||||
var/obj/item/spacecash/ewallet/C = I
|
||||
paid = pay_with_ewallet(C)
|
||||
paid = pay_with_ewallet(C, user)
|
||||
else if(istype(I, /obj/item/spacecash))
|
||||
var/obj/item/spacecash/C = I
|
||||
paid = pay_with_cash(C, user)
|
||||
@@ -1132,16 +1132,16 @@
|
||||
|
||||
// This is not a status display message, since it's something the character
|
||||
// themselves is meant to see BEFORE putting the money in
|
||||
to_chat(usr, "[icon2html(cashmoney,user.client)] " + span_warning("That is not enough money."))
|
||||
to_chat(user, "[icon2html(cashmoney,user.client)] " + span_warning("That is not enough money."))
|
||||
return 0
|
||||
|
||||
if(istype(cashmoney, /obj/item/spacecash))
|
||||
|
||||
visible_message(span_info("\The [usr] inserts some cash into \the [src]."))
|
||||
visible_message(span_info("\The [user] inserts some cash into \the [src]."))
|
||||
cashmoney.worth -= gameprice
|
||||
|
||||
if(cashmoney.worth <= 0)
|
||||
usr.drop_from_inventory(cashmoney)
|
||||
user.drop_from_inventory(cashmoney)
|
||||
qdel(cashmoney)
|
||||
else
|
||||
cashmoney.update_icon()
|
||||
@@ -1155,9 +1155,9 @@
|
||||
|
||||
|
||||
///// Ewallet
|
||||
/obj/machinery/computer/arcade/clawmachine/proc/pay_with_ewallet(var/obj/item/spacecash/ewallet/wallet)
|
||||
/obj/machinery/computer/arcade/clawmachine/proc/pay_with_ewallet(var/obj/item/spacecash/ewallet/wallet, var/mob/user)
|
||||
if(!emagged)
|
||||
visible_message(span_info("\The [usr] swipes \the [wallet] through \the [src]."))
|
||||
visible_message(span_info("\The [user] swipes \the [wallet] through \the [src]."))
|
||||
playsound(src, 'sound/machines/id_swipe.ogg', 50, 1)
|
||||
if(gameprice > wallet.worth)
|
||||
visible_message(span_info("Insufficient funds."))
|
||||
@@ -1168,14 +1168,14 @@
|
||||
return 1
|
||||
if(emagged)
|
||||
playsound(src, 'sound/arcade/steal.ogg', 50, 1, extrarange = -3, falloff = 0.1, ignore_walls = FALSE)
|
||||
to_chat(usr, span_info("It doesn't seem to accept that! Seem you'll need to swipe a valid ID."))
|
||||
to_chat(user, span_info("It doesn't seem to accept that! Seem you'll need to swipe a valid ID."))
|
||||
|
||||
///// ID
|
||||
/obj/machinery/computer/arcade/clawmachine/proc/pay_with_card(var/obj/item/card/id/I, var/obj/item/ID_container)
|
||||
/obj/machinery/computer/arcade/clawmachine/proc/pay_with_card(var/obj/item/card/id/I, var/obj/item/ID_container, var/mob/user)
|
||||
if(I==ID_container || ID_container == null)
|
||||
visible_message(span_info("\The [usr] swipes \the [I] through \the [src]."))
|
||||
visible_message(span_info("\The [user] swipes \the [I] through \the [src]."))
|
||||
else
|
||||
visible_message(span_info("\The [usr] swipes \the [ID_container] through \the [src]."))
|
||||
visible_message(span_info("\The [user] swipes \the [ID_container] through \the [src]."))
|
||||
playsound(src, 'sound/machines/id_swipe.ogg', 50, 1)
|
||||
var/datum/money_account/customer_account = get_account(I.associated_account_number)
|
||||
if(!customer_account)
|
||||
@@ -1189,7 +1189,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 = tgui_input_number(usr, "Enter pin code", "Vendor transaction")
|
||||
var/attempt_pin = tgui_input_number(user, "Enter pin code", "Vendor transaction")
|
||||
customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2)
|
||||
|
||||
if(!customer_account)
|
||||
@@ -1268,7 +1268,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/arcade/clawmachine/tgui_act(action, params)
|
||||
/obj/machinery/computer/arcade/clawmachine/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -1289,9 +1289,9 @@
|
||||
|
||||
if(action == "pointless" && wintick >= 10)
|
||||
instructions = "Insert 1 thaler or swipe a card to play!"
|
||||
clawvend()
|
||||
clawvend(ui.user)
|
||||
|
||||
/obj/machinery/computer/arcade/clawmachine/proc/clawvend() /// True to a real claw machine, it's NEARLY impossible to win.
|
||||
/obj/machinery/computer/arcade/clawmachine/proc/clawvend(var/mob/user) /// True to a real claw machine, it's NEARLY impossible to win.
|
||||
winprob += 1 /// Yeah.
|
||||
|
||||
if(prob(winprob)) /// YEAH.
|
||||
@@ -1304,7 +1304,7 @@
|
||||
winscreen = "You won...?"
|
||||
var/obj/item/grenade/G = new /obj/item/grenade/explosive(get_turf(src)) /// YEAAAAAAAAAAAAAAAAAAH!!!!!!!!!!
|
||||
G.activate()
|
||||
G.throw_at(get_turf(usr),10,10) /// Play stupid games, win stupid prizes.
|
||||
G.throw_at(get_turf(user),10,10) /// Play stupid games, win stupid prizes.
|
||||
|
||||
playsound(src, 'sound/arcade/Ori_win.ogg', 50, 1, extrarange = -3, falloff = 0.1, ignore_walls = FALSE)
|
||||
winprob = 0
|
||||
|
||||
@@ -158,35 +158,35 @@
|
||||
if(modify)
|
||||
data_core.manifest_modify(modify.registered_name, modify.assignment, modify.rank)
|
||||
modify.name = "[modify.registered_name]'s ID Card ([modify.assignment])"
|
||||
if(ishuman(usr))
|
||||
if(ishuman(ui.user))
|
||||
modify.forceMove(get_turf(src))
|
||||
if(!usr.get_active_hand())
|
||||
usr.put_in_hands(modify)
|
||||
if(!ui.user.get_active_hand())
|
||||
ui.user.put_in_hands(modify)
|
||||
modify = null
|
||||
else
|
||||
modify.forceMove(get_turf(src))
|
||||
modify = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if(istype(I, /obj/item/card/id) && usr.unEquip(I))
|
||||
var/obj/item/I = ui.user.get_active_hand()
|
||||
if(istype(I, /obj/item/card/id) && ui.user.unEquip(I))
|
||||
I.forceMove(src)
|
||||
modify = I
|
||||
. = TRUE
|
||||
|
||||
if("scan")
|
||||
if(scan)
|
||||
if(ishuman(usr))
|
||||
if(ishuman(ui.user))
|
||||
scan.forceMove(get_turf(src))
|
||||
if(!usr.get_active_hand())
|
||||
usr.put_in_hands(scan)
|
||||
if(!ui.user.get_active_hand())
|
||||
ui.user.put_in_hands(scan)
|
||||
scan = null
|
||||
else
|
||||
scan.forceMove(get_turf(src))
|
||||
scan = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
var/obj/item/I = ui.user.get_active_hand()
|
||||
if(istype(I, /obj/item/card/id))
|
||||
usr.drop_item()
|
||||
ui.user.drop_item()
|
||||
I.forceMove(src)
|
||||
scan = I
|
||||
. = TRUE
|
||||
@@ -205,7 +205,7 @@
|
||||
if(is_authenticated() && modify)
|
||||
var/t1 = params["assign_target"]
|
||||
if(t1 == "Custom")
|
||||
var/temp_t = sanitize(tgui_input_text(usr, "Enter a custom job assignment.","Assignment"), 45)
|
||||
var/temp_t = sanitize(tgui_input_text(ui.user, "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
|
||||
@@ -216,7 +216,7 @@
|
||||
else
|
||||
var/datum/job/jobdatum = SSjob.get_job(t1)
|
||||
if(!jobdatum)
|
||||
to_chat(usr, span_warning("No log exists for this job: [t1]"))
|
||||
to_chat(ui.user, span_warning("No log exists for this job: [t1]"))
|
||||
return
|
||||
access = jobdatum.get_access()
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/cloning/tgui_act(action, params)
|
||||
/obj/machinery/computer/cloning/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
switch(tgui_modal_act(src, action, params))
|
||||
if(TGUI_MODAL_ANSWER)
|
||||
if(params["id"] == "del_rec" && active_record)
|
||||
var/obj/item/card/id/C = usr.get_active_hand()
|
||||
var/obj/item/card/id/C = ui.user.get_active_hand()
|
||||
if(!istype(C) && !istype(C, /obj/item/pda))
|
||||
set_temp("ID not in hand.", "danger")
|
||||
return
|
||||
@@ -360,16 +360,16 @@
|
||||
else
|
||||
scan_mode = FALSE
|
||||
if("eject")
|
||||
if(usr.incapacitated() || !scanner || loading)
|
||||
if(ui.user.incapacitated() || !scanner || loading)
|
||||
return
|
||||
scanner.eject_occupant(usr)
|
||||
scanner.add_fingerprint(usr)
|
||||
scanner.eject_occupant(ui.user)
|
||||
scanner.add_fingerprint(ui.user)
|
||||
if("cleartemp")
|
||||
temp = null
|
||||
else
|
||||
return FALSE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
/obj/machinery/computer/cloning/proc/scan_mob(mob/living/carbon/human/subject as mob, var/scan_brain = 0)
|
||||
if(stat & NOPOWER)
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
if (!can_climb(user))
|
||||
return
|
||||
|
||||
usr.visible_message(span_warning("[user] starts climbing onto \the [src]!"))
|
||||
user.visible_message(span_warning("[user] starts climbing onto \the [src]!"))
|
||||
LAZYDISTINCTADD(climbers, user)
|
||||
|
||||
if(!do_after(user,(issmall(user) ? climb_delay * 0.6 : climb_delay)))
|
||||
@@ -196,10 +196,10 @@
|
||||
LAZYREMOVE(climbers, user)
|
||||
return
|
||||
|
||||
usr.forceMove(climb_to(user))
|
||||
user.forceMove(climb_to(user))
|
||||
|
||||
if (get_turf(user) == get_turf(src))
|
||||
usr.visible_message(span_warning("[user] climbs onto \the [src]!"))
|
||||
user.visible_message(span_warning("[user] climbs onto \the [src]!"))
|
||||
LAZYREMOVE(climbers, user)
|
||||
|
||||
/obj/machinery/computer/proc/climb_to(var/mob/living/user)
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
to_chat(user, span_warning("This guest pass is already deactivated!"))
|
||||
return
|
||||
|
||||
var/confirm = tgui_alert(usr, "Do you really want to deactivate this guest pass? (you can't reactivate it)", "Confirm Deactivation", list("Yes", "No"))
|
||||
var/confirm = tgui_alert(user, "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 </3
|
||||
user.visible_message(span_infoplain(span_bold("\The [user]") + "deactivates \the [src]."))
|
||||
@@ -193,20 +193,20 @@
|
||||
mode = params["mode"]
|
||||
|
||||
if("giv_name")
|
||||
var/nam = sanitizeName(tgui_input_text(usr, "Person pass is issued to", "Name", giv_name))
|
||||
var/nam = sanitizeName(tgui_input_text(ui.user, "Person pass is issued to", "Name", giv_name))
|
||||
if(nam)
|
||||
giv_name = nam
|
||||
if("reason")
|
||||
var/reas = sanitize(tgui_input_text(usr, "Reason why pass is issued", "Reason", reason))
|
||||
var/reas = sanitize(tgui_input_text(ui.user, "Reason why pass is issued", "Reason", reason))
|
||||
if(reas)
|
||||
reason = reas
|
||||
if("duration")
|
||||
var/dur = tgui_input_number(usr, "Duration (in minutes) during which pass is valid (up to 360 minutes).", "Duration", null, 360, 0)
|
||||
var/dur = tgui_input_number(ui.user, "Duration (in minutes) during which pass is valid (up to 360 minutes).", "Duration", null, 360, 0)
|
||||
if(dur)
|
||||
if(dur > 0 && dur <= 360) //VOREStation Edit
|
||||
duration = dur
|
||||
else
|
||||
to_chat(usr, span_warning("Invalid duration."))
|
||||
to_chat(ui.user, span_warning("Invalid duration."))
|
||||
if("access")
|
||||
var/A = text2num(params["access"])
|
||||
if(A in accesses)
|
||||
@@ -215,22 +215,22 @@
|
||||
if(A in giver.GetAccess()) //Let's make sure the ID card actually has the access.
|
||||
accesses.Add(A)
|
||||
else
|
||||
to_chat(usr, span_warning("Invalid selection, please consult technical support if there are any issues."))
|
||||
log_debug("[key_name_admin(usr)] tried selecting an invalid guest pass terminal option.")
|
||||
to_chat(ui.user, span_warning("Invalid selection, please consult technical support if there are any issues."))
|
||||
log_debug("[key_name_admin(ui.user)] tried selecting an invalid guest pass terminal option.")
|
||||
if("id")
|
||||
if(giver)
|
||||
if(ishuman(usr))
|
||||
giver.loc = usr.loc
|
||||
if(!usr.get_active_hand())
|
||||
usr.put_in_hands(giver)
|
||||
if(ishuman(ui.user))
|
||||
giver.loc = ui.user.loc
|
||||
if(!ui.user.get_active_hand())
|
||||
ui.user.put_in_hands(giver)
|
||||
giver = null
|
||||
else
|
||||
giver.loc = src.loc
|
||||
giver = null
|
||||
accesses.Cut()
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if(istype(I, /obj/item/card/id) && usr.unEquip(I))
|
||||
var/obj/item/I = ui.user.get_active_hand()
|
||||
if(istype(I, /obj/item/card/id) && ui.user.unEquip(I))
|
||||
I.loc = src
|
||||
giver = I
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
var/dat = "<h3>Activity log of guest pass terminal #[uid]</h3><br>"
|
||||
for (var/entry in internal_log)
|
||||
dat += "[entry]<br><hr>"
|
||||
//to_chat(usr, "Printing the log, standby...")
|
||||
//to_chat(ui.user, "Printing the log, standby...")
|
||||
//sleep(50)
|
||||
var/obj/item/paper/P = new/obj/item/paper( loc )
|
||||
P.name = "activity log"
|
||||
@@ -263,7 +263,7 @@
|
||||
pass.reason = reason
|
||||
pass.name = "guest pass #[number]"
|
||||
else
|
||||
to_chat(usr, span_warning("Cannot issue pass without issuing ID."))
|
||||
to_chat(ui.user, span_warning("Cannot issue pass without issuing ID."))
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
return TRUE
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
data["modal"] = tgui_modal_data(src)
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/med_data/tgui_act(action, params)
|
||||
/obj/machinery/computer/med_data/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -221,13 +221,13 @@
|
||||
if("scan")
|
||||
if(scan)
|
||||
scan.forceMove(loc)
|
||||
if(ishuman(usr) && !usr.get_active_hand())
|
||||
usr.put_in_hands(scan)
|
||||
if(ishuman(ui.user) && !ui.user.get_active_hand())
|
||||
ui.user.put_in_hands(scan)
|
||||
scan = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
var/obj/item/I = ui.user.get_active_hand()
|
||||
if(istype(I, /obj/item/card/id))
|
||||
usr.drop_item()
|
||||
ui.user.drop_item()
|
||||
I.forceMove(src)
|
||||
scan = I
|
||||
if("login")
|
||||
@@ -236,12 +236,12 @@
|
||||
if(check_access(scan))
|
||||
authenticated = scan.registered_name
|
||||
rank = scan.assignment
|
||||
else if(login_type == LOGIN_TYPE_AI && isAI(usr))
|
||||
authenticated = usr.name
|
||||
else if(login_type == LOGIN_TYPE_AI && isAI(ui.user))
|
||||
authenticated = ui.user.name
|
||||
rank = JOB_AI
|
||||
else if(login_type == LOGIN_TYPE_ROBOT && isrobot(usr))
|
||||
authenticated = usr.name
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
else if(login_type == LOGIN_TYPE_ROBOT && isrobot(ui.user))
|
||||
authenticated = ui.user.name
|
||||
var/mob/living/silicon/robot/R = ui.user
|
||||
rank = "[R.modtype] [R.braintype]"
|
||||
if(authenticated)
|
||||
active1 = null
|
||||
@@ -259,8 +259,8 @@
|
||||
if("logout")
|
||||
if(scan)
|
||||
scan.forceMove(loc)
|
||||
if(ishuman(usr) && !usr.get_active_hand())
|
||||
usr.put_in_hands(scan)
|
||||
if(ishuman(ui.user) && !ui.user.get_active_hand())
|
||||
ui.user.put_in_hands(scan)
|
||||
scan = null
|
||||
authenticated = null
|
||||
screen = null
|
||||
@@ -298,6 +298,16 @@
|
||||
active1 = general_record
|
||||
active2 = medical_record
|
||||
screen = MED_DATA_RECORD
|
||||
if("sync_r")
|
||||
if(active2)
|
||||
set_temp(client_update_record(src,usr))
|
||||
if("edit_notes")
|
||||
// The modal input in tgui is busted for this sadly...
|
||||
var/new_notes = strip_html_simple(tgui_input_text(usr,"Enter new information here.","Character Preference", html_decode(active2.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
|
||||
if(usr.Adjacent(src))
|
||||
if(new_notes != "" || tgui_alert(usr, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete")
|
||||
if(usr.Adjacent(src))
|
||||
active2.fields["notes"] = new_notes
|
||||
if("new")
|
||||
if(istype(active1, /datum/data/record) && !istype(active2, /datum/data/record))
|
||||
var/datum/data/record/R = new /datum/data/record()
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
custommessage = "This is a test, please ignore."
|
||||
customjob = "Admin"
|
||||
|
||||
/obj/machinery/computer/message_monitor/tgui_act(action, params)
|
||||
/obj/machinery/computer/message_monitor/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
//Find a server
|
||||
if("find")
|
||||
if(message_servers && message_servers.len > 1)
|
||||
linkedServer = tgui_input_list(usr,"Please select a server.", "Select a server.", message_servers)
|
||||
linkedServer = tgui_input_list(ui.user,"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]
|
||||
@@ -211,13 +211,13 @@
|
||||
temp = noserver
|
||||
//Hack the Console to get the password
|
||||
if("hack")
|
||||
if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && (usr.mind.special_role && usr.mind.original == usr))
|
||||
if((istype(ui.user, /mob/living/silicon/ai) || istype(ui.user, /mob/living/silicon/robot)) && (ui.user.mind.special_role && ui.user.mind.original == ui.user))
|
||||
hacking = 1
|
||||
update_icon()
|
||||
//Time it takes to bruteforce is dependant on the password length.
|
||||
spawn(100*length(linkedServer.decryptkey))
|
||||
if(src && linkedServer && usr)
|
||||
BruteForce(usr)
|
||||
if(src && linkedServer && ui.user)
|
||||
BruteForce(ui.user)
|
||||
|
||||
if(!auth)
|
||||
return
|
||||
@@ -243,10 +243,10 @@
|
||||
. = TRUE
|
||||
//Change the password - KEY REQUIRED
|
||||
if("pass")
|
||||
var/dkey = trim(tgui_input_text(usr, "Please enter the current decryption key."))
|
||||
var/dkey = trim(tgui_input_text(ui.user, "Please enter the current decryption key."))
|
||||
if(dkey && dkey != "")
|
||||
if(linkedServer.decryptkey == dkey)
|
||||
var/newkey = trim(tgui_input_text(usr,"Please enter the new key (3 - 16 characters max):",null,null,16))
|
||||
var/newkey = trim(tgui_input_text(ui.user,"Please enter the new key (3 - 16 characters max):",null,null,16))
|
||||
if(length(newkey) <= 3)
|
||||
set_temp("NOTICE: Decryption key too short!", "average")
|
||||
else if(length(newkey) > 16)
|
||||
@@ -325,7 +325,7 @@
|
||||
. = TRUE
|
||||
|
||||
if("addtoken")
|
||||
linkedServer.spamfilter += tgui_input_text(usr,"Enter text you want to be filtered out","Token creation")
|
||||
linkedServer.spamfilter += tgui_input_text(ui.user,"Enter text you want to be filtered out","Token creation")
|
||||
. = TRUE
|
||||
|
||||
if("deltoken")
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
dat += "<BR>\n<A href = '?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
|
||||
dat += "<BR><BR><A href='?src=\ref[user];mach_close=computer'>Close</A></TT></BODY></HTML>"
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(user)
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
return list("locked" = !screen, "chemImplants" = chemImplants, "trackImplants" = trackImplants)
|
||||
|
||||
|
||||
/obj/machinery/computer/prisoner/tgui_act(action, list/params)
|
||||
/obj/machinery/computer/prisoner/tgui_act(action, list/params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
switch(action)
|
||||
@@ -76,17 +76,17 @@
|
||||
I.activate(clamp(params["val"], 0, 10))
|
||||
. = TRUE
|
||||
if("lock")
|
||||
if(allowed(usr))
|
||||
if(allowed(ui.user))
|
||||
screen = !screen
|
||||
else
|
||||
to_chat(usr, "Unauthorized Access.")
|
||||
to_chat(ui.user, "Unauthorized Access.")
|
||||
. = TRUE
|
||||
if("warn")
|
||||
var/warning = sanitize(tgui_input_text(usr, "Message:", "Enter your message here!", ""))
|
||||
var/warning = sanitize(tgui_input_text(ui.user, "Message:", "Enter your message here!", ""))
|
||||
if(!warning)
|
||||
return
|
||||
var/obj/item/implant/I = locate(params["imp"])
|
||||
if(I && I.imp_in)
|
||||
to_chat(I.imp_in, span_notice("You hear a voice in your head saying: '[warning]'"))
|
||||
. = TRUE
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
@@ -151,30 +151,30 @@
|
||||
data["show_detonate_all"] = (data["auth"] && length(data["cyborgs"]) > 0 && ishuman(user))
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/robotics/tgui_act(action, params)
|
||||
/obj/machinery/computer/robotics/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
. = FALSE
|
||||
if(!is_authenticated(usr))
|
||||
to_chat(usr, span_warning("Access denied."))
|
||||
if(!is_authenticated(ui.user))
|
||||
to_chat(ui.user, span_warning("Access denied."))
|
||||
return
|
||||
switch(action)
|
||||
if("arm") // Arms the emergency self-destruct system
|
||||
if(issilicon(usr))
|
||||
to_chat(usr, span_danger("Access Denied (silicon detected)"))
|
||||
if(issilicon(ui.user))
|
||||
to_chat(ui.user, span_danger("Access Denied (silicon detected)"))
|
||||
return
|
||||
safety = !safety
|
||||
to_chat(usr, span_notice("You [safety ? "disarm" : "arm"] the emergency self destruct."))
|
||||
to_chat(ui.user, span_notice("You [safety ? "disarm" : "arm"] the emergency self destruct."))
|
||||
. = TRUE
|
||||
if("nuke") // Destroys all accessible cyborgs if safety is disabled
|
||||
if(issilicon(usr))
|
||||
to_chat(usr, span_danger("Access Denied (silicon detected)"))
|
||||
if(issilicon(ui.user))
|
||||
to_chat(ui.user, span_danger("Access Denied (silicon detected)"))
|
||||
return
|
||||
if(safety)
|
||||
to_chat(usr, span_danger("Self-destruct aborted - safety active"))
|
||||
to_chat(ui.user, span_danger("Self-destruct aborted - safety active"))
|
||||
return
|
||||
message_admins(span_notice("[key_name_admin(usr)] detonated all cyborgs!"))
|
||||
log_game(span_notice("[key_name(usr)] detonated all cyborgs!"))
|
||||
message_admins(span_notice("[key_name_admin(ui.user)] detonated all cyborgs!"))
|
||||
log_game(span_notice("[key_name(ui.user)] detonated all cyborgs!"))
|
||||
for(var/mob/living/silicon/robot/R in mob_list)
|
||||
if(istype(R, /mob/living/silicon/robot/drone))
|
||||
continue
|
||||
@@ -188,7 +188,7 @@
|
||||
. = TRUE
|
||||
if("killbot") // destroys one specific cyborg
|
||||
var/mob/living/silicon/robot/R = locate(params["ref"])
|
||||
if(!can_control(usr, R, TRUE))
|
||||
if(!can_control(ui.user, R, TRUE))
|
||||
return
|
||||
if(R.mind && R.mind.special_role && R.emagged)
|
||||
to_chat(R, span_userdanger("Extreme danger! Termination codes detected. Scrambling security codes and automatic AI unlink triggered."))
|
||||
@@ -196,22 +196,22 @@
|
||||
. = TRUE
|
||||
return
|
||||
var/turf/T = get_turf(R)
|
||||
message_admins(span_notice("[key_name_admin(usr)] detonated [key_name_admin(R)] ([ADMIN_COORDJMP(T)])!"))
|
||||
log_game(span_notice("[key_name(usr)] detonated [key_name(R)]!"))
|
||||
message_admins(span_notice("[key_name_admin(ui.user)] detonated [key_name_admin(R)] ([ADMIN_COORDJMP(T)])!"))
|
||||
log_game(span_notice("[key_name(ui.user)] detonated [key_name(R)]!"))
|
||||
to_chat(R, span_danger("Self-destruct command received."))
|
||||
if(R.connected_ai)
|
||||
to_chat(R.connected_ai, "<br><br>[span_alert("ALERT - Cyborg detonation detected: [R.name]")]<br>")
|
||||
R.self_destruct()
|
||||
. = TRUE
|
||||
if("stopbot") // lock or unlock the borg
|
||||
if(isrobot(usr))
|
||||
to_chat(usr, span_danger("Access Denied."))
|
||||
if(isrobot(ui.user))
|
||||
to_chat(ui.user, span_danger("Access Denied."))
|
||||
return
|
||||
var/mob/living/silicon/robot/R = locate(params["ref"])
|
||||
if(!can_control(usr, R, TRUE))
|
||||
if(!can_control(ui.user, R, TRUE))
|
||||
return
|
||||
message_admins(span_notice("[ADMIN_LOOKUPFLW(usr)] [!R.lockcharge ? "locked down" : "released"] [ADMIN_LOOKUPFLW(R)]!"))
|
||||
log_game("[key_name(usr)] [!R.lockcharge ? "locked down" : "released"] [key_name(R)]!")
|
||||
message_admins(span_notice("[ADMIN_LOOKUPFLW(ui.user)] [!R.lockcharge ? "locked down" : "released"] [ADMIN_LOOKUPFLW(R)]!"))
|
||||
log_game("[key_name(ui.user)] [!R.lockcharge ? "locked down" : "released"] [key_name(R)]!")
|
||||
R.SetLockdown(!R.lockcharge)
|
||||
to_chat(R, "[!R.lockcharge ? span_notice("Your lockdown has been lifted!") : span_alert("You have been locked down!")]")
|
||||
if(R.connected_ai)
|
||||
@@ -219,13 +219,13 @@
|
||||
. = TRUE
|
||||
if("hackbot") // AIs hacking/emagging a borg
|
||||
var/mob/living/silicon/robot/R = locate(params["ref"])
|
||||
if(!can_hack(usr, R))
|
||||
if(!can_hack(ui.user, R))
|
||||
return
|
||||
var/choice = tgui_alert(usr, "Really hack [R.name]? This cannot be undone.", "Hack?", list("Yes", "No"))
|
||||
var/choice = tgui_alert(ui.user, "Really hack [R.name]? This cannot be undone.", "Hack?", list("Yes", "No"))
|
||||
if(choice != "Yes")
|
||||
return
|
||||
log_game("[key_name(usr)] emagged [key_name(R)] using robotic console!")
|
||||
message_admins(span_notice("[key_name_admin(usr)] emagged [key_name_admin(R)] using robotic console!"))
|
||||
log_game("[key_name(ui.user)] emagged [key_name(R)] using robotic console!")
|
||||
message_admins(span_notice("[key_name_admin(ui.user)] emagged [key_name_admin(R)] using robotic console!"))
|
||||
R.emagged = TRUE
|
||||
to_chat(R, span_notice("Failsafe protocols overridden. New tools available."))
|
||||
. = TRUE
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
data["modal"] = tgui_modal_data(src)
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/secure_data/tgui_act(action, params)
|
||||
/obj/machinery/computer/secure_data/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -204,13 +204,13 @@
|
||||
if("scan")
|
||||
if(scan)
|
||||
scan.forceMove(loc)
|
||||
if(ishuman(usr) && !usr.get_active_hand())
|
||||
usr.put_in_hands(scan)
|
||||
if(ishuman(ui.user) && !ui.user.get_active_hand())
|
||||
ui.user.put_in_hands(scan)
|
||||
scan = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
var/obj/item/I = ui.user.get_active_hand()
|
||||
if(istype(I, /obj/item/card/id))
|
||||
usr.drop_item()
|
||||
ui.user.drop_item()
|
||||
I.forceMove(src)
|
||||
scan = I
|
||||
if("login")
|
||||
@@ -219,12 +219,12 @@
|
||||
if(check_access(scan))
|
||||
authenticated = scan.registered_name
|
||||
rank = scan.assignment
|
||||
else if(login_type == LOGIN_TYPE_AI && isAI(usr))
|
||||
authenticated = usr.name
|
||||
else if(login_type == LOGIN_TYPE_AI && isAI(ui.user))
|
||||
authenticated = ui.user.name
|
||||
rank = JOB_AI
|
||||
else if(login_type == LOGIN_TYPE_ROBOT && isrobot(usr))
|
||||
authenticated = usr.name
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
else if(login_type == LOGIN_TYPE_ROBOT && isrobot(ui.user))
|
||||
authenticated = ui.user.name
|
||||
var/mob/living/silicon/robot/R = ui.user
|
||||
rank = "[R.modtype] [R.braintype]"
|
||||
if(authenticated)
|
||||
active1 = null
|
||||
@@ -242,8 +242,8 @@
|
||||
if("logout")
|
||||
if(scan)
|
||||
scan.forceMove(loc)
|
||||
if(ishuman(usr) && !usr.get_active_hand())
|
||||
usr.put_in_hands(scan)
|
||||
if(ishuman(ui.user) && !ui.user.get_active_hand())
|
||||
ui.user.put_in_hands(scan)
|
||||
scan = null
|
||||
authenticated = null
|
||||
screen = null
|
||||
@@ -270,6 +270,16 @@
|
||||
qdel(active1)
|
||||
if(active2)
|
||||
qdel(active2)
|
||||
if("sync_r")
|
||||
if(active2)
|
||||
set_temp(client_update_record(src,usr))
|
||||
if("edit_notes")
|
||||
// The modal input in tgui is busted for this sadly...
|
||||
var/new_notes = strip_html_simple(tgui_input_text(usr,"Enter new information here.","Character Preference", html_decode(active2.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
|
||||
if(usr.Adjacent(src))
|
||||
if(new_notes != "" || tgui_alert(usr, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete")
|
||||
if(usr.Adjacent(src))
|
||||
active2.fields["notes"] = new_notes
|
||||
if("d_rec")
|
||||
var/datum/data/record/general_record = locate(params["d_rec"] || "")
|
||||
if(!data_core.general.Find(general_record))
|
||||
@@ -338,12 +348,12 @@
|
||||
SStgui.update_uis(src)
|
||||
addtimer(CALLBACK(src, PROC_REF(print_finish)), 5 SECONDS)
|
||||
if("photo_front")
|
||||
var/icon/photo = get_photo(usr)
|
||||
var/icon/photo = get_photo(ui.user)
|
||||
if(photo && active1)
|
||||
active1.fields["photo_front"] = photo
|
||||
active1.fields["photo-south"] = "'data:image/png;base64,[icon2base64(photo)]'"
|
||||
if("photo_side")
|
||||
var/icon/photo = get_photo(usr)
|
||||
var/icon/photo = get_photo(ui.user)
|
||||
if(photo && active1)
|
||||
active1.fields["photo_side"] = photo
|
||||
active1.fields["photo-west"] = "'data:image/png;base64,[icon2base64(photo)]'"
|
||||
@@ -474,7 +484,7 @@
|
||||
var/obj/item/photo/photo = user.get_active_hand()
|
||||
return photo.img
|
||||
if(istype(user, /mob/living/silicon))
|
||||
var/mob/living/silicon/tempAI = usr
|
||||
var/mob/living/silicon/tempAI = user
|
||||
var/obj/item/photo/selection = tempAI.GetPicture()
|
||||
if (selection)
|
||||
return selection.img
|
||||
|
||||
@@ -143,11 +143,11 @@
|
||||
data["modal"] = tgui_modal_data(src)
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/skills/tgui_act(action, params)
|
||||
/obj/machinery/computer/skills/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
if(!data_core.general.Find(active1))
|
||||
active1 = null
|
||||
@@ -160,13 +160,13 @@
|
||||
if("scan")
|
||||
if(scan)
|
||||
scan.forceMove(loc)
|
||||
if(ishuman(usr) && !usr.get_active_hand())
|
||||
usr.put_in_hands(scan)
|
||||
if(ishuman(ui.user) && !ui.user.get_active_hand())
|
||||
ui.user.put_in_hands(scan)
|
||||
scan = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
var/obj/item/I = ui.user.get_active_hand()
|
||||
if(istype(I, /obj/item/card/id))
|
||||
usr.drop_item()
|
||||
ui.user.drop_item()
|
||||
I.forceMove(src)
|
||||
scan = I
|
||||
if("cleartemp")
|
||||
@@ -177,12 +177,12 @@
|
||||
if(check_access(scan))
|
||||
authenticated = scan.registered_name
|
||||
rank = scan.assignment
|
||||
else if(login_type == LOGIN_TYPE_AI && isAI(usr))
|
||||
authenticated = usr.name
|
||||
else if(login_type == LOGIN_TYPE_AI && isAI(ui.user))
|
||||
authenticated = ui.user.name
|
||||
rank = JOB_AI
|
||||
else if(login_type == LOGIN_TYPE_ROBOT && isrobot(usr))
|
||||
authenticated = usr.name
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
else if(login_type == LOGIN_TYPE_ROBOT && isrobot(ui.user))
|
||||
authenticated = ui.user.name
|
||||
var/mob/living/silicon/robot/R = ui.user
|
||||
rank = "[R.modtype] [R.braintype]"
|
||||
if(authenticated)
|
||||
active1 = null
|
||||
@@ -199,8 +199,8 @@
|
||||
if("logout")
|
||||
if(scan)
|
||||
scan.forceMove(loc)
|
||||
if(ishuman(usr) && !usr.get_active_hand())
|
||||
usr.put_in_hands(scan)
|
||||
if(ishuman(ui.user) && !ui.user.get_active_hand())
|
||||
ui.user.put_in_hands(scan)
|
||||
scan = null
|
||||
authenticated = null
|
||||
screen = null
|
||||
@@ -214,6 +214,16 @@
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
qdel(R)
|
||||
set_temp("All employment records deleted.")
|
||||
if("sync_r")
|
||||
if(active1)
|
||||
set_temp(client_update_record(src,active1,usr))
|
||||
if("edit_notes")
|
||||
// The modal input in tgui is busted for this sadly...
|
||||
var/new_notes = strip_html_simple(tgui_input_text(usr,"Enter new information here.","Character Preference", html_decode(active1.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH)
|
||||
if(usr.Adjacent(src))
|
||||
if(new_notes != "" || tgui_alert(usr, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete")
|
||||
if(usr.Adjacent(src))
|
||||
active1.fields["notes"] = new_notes
|
||||
if("del_r")
|
||||
if(PDA_Manifest)
|
||||
PDA_Manifest.Cut()
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
data["categories"] = all_supply_groups
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/supplycomp/tgui_act(action, params)
|
||||
/obj/machinery/computer/supplycomp/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(!SSsupply)
|
||||
@@ -221,29 +221,29 @@
|
||||
visible_message(span_warning("[src]'s monitor flashes, \"[reqtime - world.time] seconds remaining until another requisition form may be printed.\""))
|
||||
return FALSE
|
||||
|
||||
var/amount = clamp(tgui_input_number(usr, "How many crates? (0 to 20)", null, null, 20, 0), 0, 20)
|
||||
var/amount = clamp(tgui_input_number(ui.user, "How many crates? (0 to 20)", null, null, 20, 0), 0, 20)
|
||||
if(!amount)
|
||||
return FALSE
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = sanitize(tgui_input_text(usr, "Reason:","Why do you require this item?",""))
|
||||
var/reason = sanitize(tgui_input_text(ui.user, "Reason:","Why do you require this item?",""))
|
||||
if(world.time > timeout)
|
||||
to_chat(usr, span_warning("Error. Request timed out."))
|
||||
to_chat(ui.user, span_warning("Error. Request timed out."))
|
||||
return FALSE
|
||||
if(!reason)
|
||||
return FALSE
|
||||
|
||||
for(var/i in 1 to amount)
|
||||
SSsupply.create_order(S, usr, reason)
|
||||
SSsupply.create_order(S, ui.user, reason)
|
||||
|
||||
var/idname = "*None Provided*"
|
||||
var/idrank = "*None Provided*"
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(ishuman(ui.user))
|
||||
var/mob/living/carbon/human/H = ui.user
|
||||
idname = H.get_authentification_name()
|
||||
idrank = H.get_assignment()
|
||||
else if(issilicon(usr))
|
||||
idname = usr.real_name
|
||||
else if(issilicon(ui.user))
|
||||
idname = ui.user.real_name
|
||||
idrank = "Stationbound synthetic"
|
||||
|
||||
var/obj/item/paper/reqform = new /obj/item/paper(loc)
|
||||
@@ -280,23 +280,23 @@
|
||||
return FALSE
|
||||
|
||||
var/timeout = world.time + 600
|
||||
var/reason = sanitize(tgui_input_text(usr, "Reason:","Why do you require this item?",""))
|
||||
var/reason = sanitize(tgui_input_text(ui.user, "Reason:","Why do you require this item?",""))
|
||||
if(world.time > timeout)
|
||||
to_chat(usr, span_warning("Error. Request timed out."))
|
||||
to_chat(ui.user, span_warning("Error. Request timed out."))
|
||||
return FALSE
|
||||
if(!reason)
|
||||
return FALSE
|
||||
|
||||
SSsupply.create_order(S, usr, reason)
|
||||
SSsupply.create_order(S, ui.user, reason)
|
||||
|
||||
var/idname = "*None Provided*"
|
||||
var/idrank = "*None Provided*"
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
if(ishuman(ui.user))
|
||||
var/mob/living/carbon/human/H = ui.user
|
||||
idname = H.get_authentification_name()
|
||||
idrank = H.get_assignment()
|
||||
else if(issilicon(usr))
|
||||
idname = usr.real_name
|
||||
else if(issilicon(ui.user))
|
||||
idname = ui.user.real_name
|
||||
idrank = "Stationbound synthetic"
|
||||
|
||||
var/obj/item/paper/reqform = new /obj/item/paper(loc)
|
||||
@@ -323,7 +323,7 @@
|
||||
return FALSE
|
||||
if(!(authorization & SUP_ACCEPT_ORDERS))
|
||||
return FALSE
|
||||
var/new_val = sanitize(tgui_input_text(usr, params["edit"], "Enter the new value for this field:", params["default"]))
|
||||
var/new_val = sanitize(tgui_input_text(ui.user, params["edit"], "Enter the new value for this field:", params["default"]))
|
||||
if(!new_val)
|
||||
return FALSE
|
||||
|
||||
@@ -362,7 +362,7 @@
|
||||
return FALSE
|
||||
if(!(authorization & SUP_ACCEPT_ORDERS))
|
||||
return FALSE
|
||||
SSsupply.approve_order(O, usr)
|
||||
SSsupply.approve_order(O, ui.user)
|
||||
. = TRUE
|
||||
if("deny_order")
|
||||
var/datum/supply_order/O = locate(params["ref"])
|
||||
@@ -370,7 +370,7 @@
|
||||
return FALSE
|
||||
if(!(authorization & SUP_ACCEPT_ORDERS))
|
||||
return FALSE
|
||||
SSsupply.deny_order(O, usr)
|
||||
SSsupply.deny_order(O, ui.user)
|
||||
. = TRUE
|
||||
if("delete_order")
|
||||
var/datum/supply_order/O = locate(params["ref"])
|
||||
@@ -378,12 +378,12 @@
|
||||
return FALSE
|
||||
if(!(authorization & SUP_ACCEPT_ORDERS))
|
||||
return FALSE
|
||||
SSsupply.delete_order(O, usr)
|
||||
SSsupply.delete_order(O, ui.user)
|
||||
. = TRUE
|
||||
if("clear_all_requests")
|
||||
if(!(authorization & SUP_ACCEPT_ORDERS))
|
||||
return FALSE
|
||||
SSsupply.deny_all_pending(usr)
|
||||
SSsupply.deny_all_pending(ui.user)
|
||||
. = TRUE
|
||||
// Exports
|
||||
if("export_edit_field")
|
||||
@@ -394,11 +394,11 @@
|
||||
if(!(authorization & SUP_ACCEPT_ORDERS))
|
||||
return FALSE
|
||||
var/list/L = E.contents[params["index"]]
|
||||
var/field = tgui_alert(usr, "Select which field to edit", "Field Choice", list("Name", "Quantity", "Value"))
|
||||
var/field = tgui_alert(ui.user, "Select which field to edit", "Field Choice", list("Name", "Quantity", "Value"))
|
||||
if(!field)
|
||||
return FALSE
|
||||
|
||||
var/new_val = sanitize(tgui_input_text(usr, field, "Enter the new value for this field:", L[lowertext(field)]))
|
||||
var/new_val = sanitize(tgui_input_text(ui.user, field, "Enter the new value for this field:", L[lowertext(field)]))
|
||||
if(!new_val)
|
||||
return
|
||||
|
||||
@@ -432,7 +432,7 @@
|
||||
return FALSE
|
||||
if(!(authorization & SUP_ACCEPT_ORDERS))
|
||||
return FALSE
|
||||
SSsupply.add_export_item(E, usr)
|
||||
SSsupply.add_export_item(E, ui.user)
|
||||
. = TRUE
|
||||
if("export_edit")
|
||||
var/datum/exported_crate/E = locate(params["ref"])
|
||||
@@ -441,7 +441,7 @@
|
||||
return FALSE
|
||||
if(!(authorization & SUP_ACCEPT_ORDERS))
|
||||
return FALSE
|
||||
var/new_val = sanitize(tgui_input_text(usr, params["edit"], "Enter the new value for this field:", params["default"]))
|
||||
var/new_val = sanitize(tgui_input_text(ui.user, params["edit"], "Enter the new value for this field:", params["default"]))
|
||||
if(!new_val)
|
||||
return
|
||||
|
||||
@@ -461,20 +461,20 @@
|
||||
return FALSE
|
||||
if(!(authorization & SUP_ACCEPT_ORDERS))
|
||||
return FALSE
|
||||
SSsupply.delete_export(E, usr)
|
||||
SSsupply.delete_export(E, ui.user)
|
||||
. = TRUE
|
||||
if("send_shuttle")
|
||||
switch(params["mode"])
|
||||
if("send_away")
|
||||
if (shuttle.forbidden_atoms_check())
|
||||
to_chat(usr, span_warning("For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons."))
|
||||
to_chat(ui.user, span_warning("For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons."))
|
||||
else
|
||||
shuttle.launch(src)
|
||||
to_chat(usr, span_notice("Initiating launch sequence."))
|
||||
to_chat(ui.user, span_notice("Initiating launch sequence."))
|
||||
|
||||
if("send_to_station")
|
||||
shuttle.launch(src)
|
||||
to_chat(usr, span_notice("The supply shuttle has been called and will arrive in approximately [round(SSsupply.movetime/600,1)] minutes."))
|
||||
to_chat(ui.user, span_notice("The supply shuttle has been called and will arrive in approximately [round(SSsupply.movetime/600,1)] minutes."))
|
||||
|
||||
if("cancel_shuttle")
|
||||
shuttle.cancel_launch(src)
|
||||
@@ -483,7 +483,7 @@
|
||||
shuttle.force_launch(src)
|
||||
. = TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
/obj/machinery/computer/supplycomp/proc/post_signal(var/command)
|
||||
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1435)
|
||||
|
||||
@@ -112,33 +112,33 @@
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
switch(action)
|
||||
if("id")
|
||||
if(card)
|
||||
usr.put_in_hands(card)
|
||||
ui.user.put_in_hands(card)
|
||||
card = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/card/id) && usr.unEquip(I))
|
||||
var/obj/item/I = ui.user.get_active_hand()
|
||||
if (istype(I, /obj/item/card/id) && ui.user.unEquip(I))
|
||||
I.forceMove(src)
|
||||
card = I
|
||||
update_icon()
|
||||
return TRUE
|
||||
if("switch-to-onduty-rank")
|
||||
if(checkFace())
|
||||
if(checkCardCooldown())
|
||||
makeOnDuty(params["switch-to-onduty-rank"], params["switch-to-onduty-assignment"])
|
||||
usr.put_in_hands(card)
|
||||
if(checkFace(ui.user))
|
||||
if(checkCardCooldown(ui.user))
|
||||
makeOnDuty(params["switch-to-onduty-rank"], params["switch-to-onduty-assignment"], ui.user)
|
||||
ui.user.put_in_hands(card)
|
||||
card = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
if("switch-to-offduty")
|
||||
if(checkFace())
|
||||
if(checkCardCooldown())
|
||||
makeOffDuty()
|
||||
usr.put_in_hands(card)
|
||||
if(checkFace(ui.user))
|
||||
if(checkCardCooldown(ui.user))
|
||||
makeOffDuty(ui.user)
|
||||
ui.user.put_in_hands(card)
|
||||
card = null
|
||||
update_icon()
|
||||
return TRUE
|
||||
@@ -165,10 +165,10 @@
|
||||
&& !job.disallow_jobhop \
|
||||
&& job.timeoff_factor > 0
|
||||
|
||||
/obj/machinery/computer/timeclock/proc/makeOnDuty(var/newrank, var/newassignment)
|
||||
/obj/machinery/computer/timeclock/proc/makeOnDuty(var/newrank, var/newassignment, var/mob/user)
|
||||
var/datum/job/oldjob = job_master.GetJob(card.rank)
|
||||
var/datum/job/newjob = job_master.GetJob(newrank)
|
||||
if(!oldjob || !isOpenOnDutyJob(usr, oldjob.pto_type, newjob))
|
||||
if(!oldjob || !isOpenOnDutyJob(user, oldjob.pto_type, newjob))
|
||||
return
|
||||
if(newassignment != newjob.title && !(newassignment in newjob.alt_titles))
|
||||
return
|
||||
@@ -181,13 +181,13 @@
|
||||
card.last_job_switch = world.time
|
||||
callHook("reassign_employee", list(card))
|
||||
newjob.current_positions++
|
||||
var/mob/living/carbon/human/H = usr
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.mind.assigned_role = card.rank
|
||||
H.mind.role_alt_title = card.assignment
|
||||
announce.autosay("[card.registered_name] has moved On-Duty as [card.assignment].", "Employee Oversight", channel, zlevels = using_map.get_map_levels(get_z(src)))
|
||||
return
|
||||
|
||||
/obj/machinery/computer/timeclock/proc/makeOffDuty()
|
||||
/obj/machinery/computer/timeclock/proc/makeOffDuty(var/mob/user)
|
||||
var/datum/job/foundjob = job_master.GetJob(card.rank)
|
||||
if(!foundjob)
|
||||
return
|
||||
@@ -206,35 +206,35 @@
|
||||
data_core.manifest_modify(card.registered_name, card.assignment, card.rank)
|
||||
card.last_job_switch = world.time
|
||||
callHook("reassign_employee", list(card))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.mind.assigned_role = ptojob.title
|
||||
H.mind.role_alt_title = ptojob.title
|
||||
foundjob.current_positions--
|
||||
announce.autosay("[card.registered_name], [oldtitle], has moved Off-Duty.", "Employee Oversight", channel, zlevels = using_map.get_map_levels(get_z(src)))
|
||||
return
|
||||
|
||||
/obj/machinery/computer/timeclock/proc/checkCardCooldown()
|
||||
/obj/machinery/computer/timeclock/proc/checkCardCooldown(var/mob/user)
|
||||
if(!card)
|
||||
return FALSE
|
||||
var/time_left = 10 MINUTES - (world.time - card.last_job_switch)
|
||||
if(time_left > 0)
|
||||
to_chat(usr, "You need to wait another [round((time_left/10)/60, 1)] minute\s before you can switch.")
|
||||
to_chat(user, "You need to wait another [round((time_left/10)/60, 1)] minute\s before you can switch.")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/timeclock/proc/checkFace()
|
||||
/obj/machinery/computer/timeclock/proc/checkFace(var/mob/user)
|
||||
if(!card)
|
||||
to_chat(usr, span_notice("No ID is inserted."))
|
||||
to_chat(user, span_notice("No ID is inserted."))
|
||||
return FALSE
|
||||
var/mob/living/carbon/human/H = usr
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(!(istype(H)))
|
||||
to_chat(usr, span_warning("Invalid user detected. Access denied."))
|
||||
to_chat(user, span_warning("Invalid user detected. Access denied."))
|
||||
return FALSE
|
||||
else if((H.wear_mask && (H.wear_mask.flags_inv & HIDEFACE)) || (H.head && (H.head.flags_inv & HIDEFACE))) //Face hiding bad
|
||||
to_chat(usr, span_warning("Facial recognition scan failed due to physical obstructions. Access denied."))
|
||||
to_chat(user, span_warning("Facial recognition scan failed due to physical obstructions. Access denied."))
|
||||
return FALSE
|
||||
else if(H.get_face_name() == "Unknown" || !(H.real_name == card.registered_name))
|
||||
to_chat(usr, span_warning("Facial recognition scan failed. Access denied."))
|
||||
to_chat(user, span_warning("Facial recognition scan failed. Access denied."))
|
||||
return FALSE
|
||||
else
|
||||
return TRUE
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
return
|
||||
|
||||
if(panel_open)
|
||||
to_chat(usr, span_boldnotice("Close the maintenance panel first."))
|
||||
to_chat(user, span_boldnotice("Close the maintenance panel first."))
|
||||
return
|
||||
|
||||
tgui_interact(user)
|
||||
@@ -139,8 +139,8 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/tgui_act(action, params)
|
||||
if(..() || usr == occupant)
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..() || ui.user == occupant)
|
||||
return TRUE
|
||||
|
||||
. = TRUE
|
||||
@@ -157,13 +157,13 @@
|
||||
beaker = null
|
||||
update_icon()
|
||||
if("ejectOccupant")
|
||||
if(!occupant || isslime(usr) || ispAI(usr))
|
||||
if(!occupant || isslime(ui.user) || ispAI(ui.user))
|
||||
return 0 // don't update UIs attached to this object
|
||||
go_out()
|
||||
else
|
||||
return FALSE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/attackby(var/obj/item/G as obj, var/mob/user as mob)
|
||||
if(istype(G, /obj/item/reagent_containers/glass))
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
if(..())
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
return FALSE // VOREStation Edit - prevent topic exploits
|
||||
/* VOREStation Edit - Unreachable due to above
|
||||
@@ -124,12 +124,12 @@
|
||||
return
|
||||
|
||||
if(!LAZYLEN(frozen_items))
|
||||
to_chat(usr, span_notice("There is nothing to recover from storage."))
|
||||
to_chat(ui.user, span_notice("There is nothing to recover from storage."))
|
||||
return
|
||||
|
||||
var/obj/item/I = locate(params["ref"]) in frozen_items
|
||||
if(!I)
|
||||
to_chat(usr, span_notice("\The [I] is no longer in storage."))
|
||||
to_chat(ui.user, span_notice("\The [I] is no longer in storage."))
|
||||
return
|
||||
|
||||
visible_message(span_notice("The console beeps happily as it disgorges [I]."))
|
||||
@@ -141,7 +141,7 @@
|
||||
return
|
||||
|
||||
if(!LAZYLEN(frozen_items))
|
||||
to_chat(usr, span_notice("There is nothing to recover from storage."))
|
||||
to_chat(ui.user, span_notice("There is nothing to recover from storage."))
|
||||
return
|
||||
|
||||
visible_message(span_notice("The console beeps happily as it disgorges the desired objects."))
|
||||
@@ -709,7 +709,7 @@
|
||||
|
||||
if(willing)
|
||||
if(M == user)
|
||||
visible_message("[usr] [on_enter_visible_message] [src].", 3)
|
||||
visible_message("[user] [on_enter_visible_message] [src].", 3)
|
||||
else
|
||||
visible_message("\The [user] starts putting [M] into \the [src].", 3)
|
||||
|
||||
|
||||
@@ -660,7 +660,7 @@ About the new airlock wires panel:
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/bumpopen(mob/living/user as mob) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite
|
||||
if(!issilicon(usr))
|
||||
if(!issilicon(user))
|
||||
if(src.isElectrified())
|
||||
if(!src.justzap)
|
||||
if(src.shock(user, 100))
|
||||
@@ -984,7 +984,7 @@ About the new airlock wires panel:
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/airlock/attack_hand(mob/user as mob)
|
||||
if(!istype(usr, /mob/living/silicon))
|
||||
if(!istype(user, /mob/living/silicon))
|
||||
if(src.isElectrified())
|
||||
if(src.shock(user, 100))
|
||||
return
|
||||
@@ -1046,10 +1046,10 @@ About the new airlock wires panel:
|
||||
src.hold_open = user
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/door/airlock/tgui_act(action, params)
|
||||
/obj/machinery/door/airlock/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(!user_allowed(usr))
|
||||
if(!user_allowed(ui.user))
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
@@ -1058,14 +1058,14 @@ About the new airlock wires panel:
|
||||
loseMainPower()
|
||||
update_icon()
|
||||
else
|
||||
to_chat(usr, span_warning("Main power is already offline."))
|
||||
to_chat(ui.user, span_warning("Main power is already offline."))
|
||||
. = TRUE
|
||||
if("disrupt-backup")
|
||||
if(!backup_power_lost_until)
|
||||
loseBackupPower()
|
||||
update_icon()
|
||||
else
|
||||
to_chat(usr, span_warning("Backup power is already offline."))
|
||||
to_chat(ui.user, span_warning("Backup power is already offline."))
|
||||
. = TRUE
|
||||
if("shock-restore")
|
||||
electrify(0, 1)
|
||||
@@ -1080,14 +1080,14 @@ About the new airlock wires panel:
|
||||
set_idscan(aiDisabledIdScanner, 1)
|
||||
. = TRUE
|
||||
// if("emergency-toggle")
|
||||
// toggle_emergency(usr)
|
||||
// toggle_emergency(ui.user)
|
||||
// . = TRUE
|
||||
if("bolt-toggle")
|
||||
toggle_bolt(usr)
|
||||
toggle_bolt(ui.user)
|
||||
. = TRUE
|
||||
if("light-toggle")
|
||||
if(wires.is_cut(WIRE_BOLT_LIGHT))
|
||||
to_chat(usr, "The bolt lights wire is cut - The door bolt lights are permanently disabled.")
|
||||
to_chat(ui.user, "The bolt lights wire is cut - The door bolt lights are permanently disabled.")
|
||||
return
|
||||
lights = !lights
|
||||
update_icon()
|
||||
@@ -1097,12 +1097,12 @@ About the new airlock wires panel:
|
||||
. = TRUE
|
||||
if("speed-toggle")
|
||||
if(wires.is_cut(WIRE_SPEED))
|
||||
to_chat(usr, "The timing wire is cut - Cannot alter timing.")
|
||||
to_chat(ui.user, "The timing wire is cut - Cannot alter timing.")
|
||||
return
|
||||
normalspeed = !normalspeed
|
||||
. = TRUE
|
||||
if("open-close")
|
||||
user_toggle_open(usr)
|
||||
user_toggle_open(ui.user)
|
||||
. = TRUE
|
||||
|
||||
update_icon()
|
||||
@@ -1158,7 +1158,7 @@ About the new airlock wires panel:
|
||||
|
||||
/obj/machinery/door/airlock/attackby(obj/item/C, mob/user as mob)
|
||||
//to_world("airlock attackby src [src] obj [C] mob [user]")
|
||||
if(!istype(usr, /mob/living/silicon))
|
||||
if(!istype(user, /mob/living/silicon))
|
||||
if(src.isElectrified())
|
||||
if(src.shock(user, 75))
|
||||
return
|
||||
@@ -1189,7 +1189,7 @@ About the new airlock wires panel:
|
||||
else if(C.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
if (src.p_open)
|
||||
if (stat & BROKEN)
|
||||
to_chat(usr, span_warning("The panel is broken and cannot be closed."))
|
||||
to_chat(user, span_warning("The panel is broken and cannot be closed."))
|
||||
else
|
||||
src.p_open = FALSE
|
||||
playsound(src, C.usesound, 50, 1)
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/access_button/attack_hand(mob/user)
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(user)
|
||||
if(!allowed(user))
|
||||
to_chat(user, span_warning("Access Denied"))
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
to_chat(user, span_warning("You don't have enough sheets to repair this! You need at least [amt] sheets."))
|
||||
return
|
||||
to_chat(user, span_notice("You begin repairing [src]..."))
|
||||
if(do_after(usr, 30))
|
||||
if(do_after(user, 30))
|
||||
if(P.use(amt))
|
||||
to_chat(user, span_notice("You have repaired \The [src]"))
|
||||
src.repair()
|
||||
|
||||
@@ -173,13 +173,13 @@
|
||||
break
|
||||
return data
|
||||
|
||||
/obj/machinery/door_timer/tgui_act(action, params)
|
||||
/obj/machinery/door_timer/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
. = TRUE
|
||||
|
||||
if(!allowed(usr))
|
||||
to_chat(usr, span_warning("Access denied."))
|
||||
if(!allowed(ui.user))
|
||||
to_chat(ui.user, span_warning("Access denied."))
|
||||
return FALSE
|
||||
|
||||
switch(action)
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
. = ..()
|
||||
// stack_trace("WARNING: Embedded controller [src] ([type]) had Topic() called unexpectedly. Please report this.") // statpanel means that topic can always be called for clicking
|
||||
|
||||
/obj/machinery/embedded_controller/tgui_act(action, params)
|
||||
/obj/machinery/embedded_controller/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(LAZYLEN(valid_actions))
|
||||
if(action in valid_actions)
|
||||
program.receive_user_command(action)
|
||||
if(usr)
|
||||
add_fingerprint(usr)
|
||||
if(ui.user)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
/obj/machinery/embedded_controller/process()
|
||||
if(program)
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
// Proc: tgui_act()
|
||||
// Parameters: 2 (standard tgui_act arguments)
|
||||
// Description: Responds to button presses on the TGUI interface.
|
||||
/obj/machinery/exonet_node/tgui_act(action, params)
|
||||
/obj/machinery/exonet_node/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
toggle = !toggle
|
||||
update_power()
|
||||
if(!toggle)
|
||||
var/msg = "[usr.client.key] ([usr]) has turned [src] off, at [x],[y],[z]."
|
||||
var/msg = "[ui.user.client.key] ([ui.user]) has turned [src] off, at [x],[y],[z]."
|
||||
message_admins(msg)
|
||||
log_game(msg)
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
. = TRUE
|
||||
allow_external_communicators = !allow_external_communicators
|
||||
if(!allow_external_communicators)
|
||||
var/msg = "[usr.client.key] ([usr]) has turned [src]'s communicator port off, at [x],[y],[z]."
|
||||
var/msg = "[ui.user.client.key] ([ui.user]) has turned [src]'s communicator port off, at [x],[y],[z]."
|
||||
message_admins(msg)
|
||||
log_game(msg)
|
||||
|
||||
@@ -154,12 +154,12 @@
|
||||
. = TRUE
|
||||
allow_external_newscasters = !allow_external_newscasters
|
||||
if(!allow_external_newscasters)
|
||||
var/msg = "[usr.client.key] ([usr]) has turned [src]'s newscaster port off, at [x],[y],[z]."
|
||||
var/msg = "[ui.user.client.key] ([ui.user]) has turned [src]'s newscaster port off, at [x],[y],[z]."
|
||||
message_admins(msg)
|
||||
log_game(msg)
|
||||
|
||||
update_icon()
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
// Proc: get_exonet_node()
|
||||
// Parameters: None
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
|
||||
/obj/machinery/floorlayer/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
var/m = tgui_input_list(usr, "Choose work mode", "Mode", mode)
|
||||
var/m = tgui_input_list(user, "Choose work mode", "Mode", mode)
|
||||
mode[m] = !mode[m]
|
||||
var/O = mode[m]
|
||||
user.visible_message(span_notice("[usr] has set \the [src] [m] mode [!O?"off":"on"]."), span_notice("You set \the [src] [m] mode [!O?"off":"on"]."))
|
||||
user.visible_message(span_notice("[user] has set \the [src] [m] mode [!O?"off":"on"]."), span_notice("You set \the [src] [m] mode [!O?"off":"on"]."))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/stack/tile))
|
||||
@@ -51,7 +51,7 @@
|
||||
if(!length(contents))
|
||||
to_chat(user, span_notice("\The [src] is empty."))
|
||||
else
|
||||
var/obj/item/stack/tile/E = tgui_input_list(usr, "Choose remove tile type.", "Tiles", contents)
|
||||
var/obj/item/stack/tile/E = tgui_input_list(user, "Choose remove tile type.", "Tiles", contents)
|
||||
if(E)
|
||||
to_chat(user, span_notice("You remove the [E] from \the [src]."))
|
||||
E.loc = src.loc
|
||||
@@ -59,7 +59,7 @@
|
||||
return
|
||||
|
||||
if(W.has_tool_quality(TOOL_SCREWDRIVER))
|
||||
T = tgui_input_list(usr, "Choose tile type.", "Tiles", contents)
|
||||
T = tgui_input_list(user, "Choose tile type.", "Tiles", contents)
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ var/list/dispenser_presets = list()
|
||||
dispenser_flags &= ~GD_BUSY
|
||||
return
|
||||
|
||||
var/choice = tgui_input_list(usr, "Select equipment to dispense.", "Equipment Dispenser", gear_list)
|
||||
var/choice = tgui_input_list(user, "Select equipment to dispense.", "Equipment Dispenser", gear_list)
|
||||
|
||||
if(!choice)
|
||||
dispenser_flags &= ~GD_BUSY
|
||||
|
||||
@@ -85,7 +85,7 @@ GLOBAL_LIST_EMPTY(holoposters)
|
||||
return
|
||||
if (W.has_tool_quality(TOOL_MULTITOOL))
|
||||
playsound(src, 'sound/items/penclick.ogg', 60, 1)
|
||||
icon_state = tgui_input_list(usr, "Available Posters", "Holographic Poster", postertypes + "random")
|
||||
icon_state = tgui_input_list(user, "Available Posters", "Holographic Poster", postertypes + "random")
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
if(icon_state == "random")
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
|
||||
/obj/machinery/media/jukebox/interact(mob/user)
|
||||
if(inoperable())
|
||||
to_chat(usr, "\The [src] doesn't appear to function.")
|
||||
to_chat(user, "\The [src] doesn't appear to function.")
|
||||
return
|
||||
tgui_interact(user)
|
||||
|
||||
@@ -235,17 +235,17 @@
|
||||
spawn(15)
|
||||
explode()
|
||||
else if(current_track == null)
|
||||
to_chat(usr, "No track selected.")
|
||||
to_chat(ui.user, "No track selected.")
|
||||
else
|
||||
StartPlaying()
|
||||
return TRUE
|
||||
if("add_new_track")
|
||||
SSmedia_tracks.add_track(usr, params["url"], params["title"], text2num(params["duration"]) * 10, params["artist"], params["genre"], text2num(params["secret"]), text2num(params["lobby"]))
|
||||
SSmedia_tracks.add_track(ui.user, params["url"], params["title"], text2num(params["duration"]) * 10, params["artist"], params["genre"], text2num(params["secret"]), text2num(params["lobby"]))
|
||||
if("remove_new_track")
|
||||
var/datum/track/track_to_remove = locate(params["ref"]) in getTracksList()
|
||||
if(track_to_remove == current_track && playing)
|
||||
StopPlaying()
|
||||
SSmedia_tracks.remove_track(usr, track_to_remove)
|
||||
SSmedia_tracks.remove_track(ui.user, track_to_remove)
|
||||
|
||||
/obj/machinery/media/jukebox/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
|
||||
if(istype(I, /obj/item/multitool))
|
||||
if(panel_open)
|
||||
var/input = sanitize(tgui_input_text(usr, "What id would you like to give this conveyor?", "Multitool-Conveyor interface", id))
|
||||
var/input = sanitize(tgui_input_text(user, "What id would you like to give this conveyor?", "Multitool-Conveyor interface", id))
|
||||
if(!input)
|
||||
to_chat(usr, "No input found please hang up and try your call again.")
|
||||
to_chat(user, "No input found please hang up and try your call again.")
|
||||
return
|
||||
id = input
|
||||
return
|
||||
|
||||
@@ -416,7 +416,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
if(FC.channel_name == channel_name)
|
||||
check = 1
|
||||
break
|
||||
var/our_user = tgui_user_name(usr)
|
||||
var/our_user = tgui_user_name(ui.user)
|
||||
if(channel_name == "" || channel_name == "\[REDACTED\]")
|
||||
set_temp("Error: Could not submit feed channel to network: Invalid Channel Name.", "danger", FALSE)
|
||||
return TRUE
|
||||
@@ -430,7 +430,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
set_temp("Error: Could not submit feed channel to network: A feed channel already exists under your name.", "danger", FALSE)
|
||||
return TRUE
|
||||
|
||||
var/choice = tgui_alert(usr, "Please confirm Feed channel creation","Network Channel Handler",list("Confirm","Cancel"))
|
||||
var/choice = tgui_alert(ui.user, "Please confirm Feed channel creation","Network Channel Handler",list("Confirm","Cancel"))
|
||||
if(choice == "Confirm")
|
||||
news_network.CreateFeedChannel(channel_name, our_user, c_locked)
|
||||
set_temp("Feed channel [channel_name] created successfully.", "success", FALSE)
|
||||
@@ -442,25 +442,25 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
for(var/datum/feed_channel/F in news_network.network_channels)
|
||||
if((!F.locked || F.author == scanned_user) && !F.censored)
|
||||
available_channels += F.channel_name
|
||||
var/new_channel_name = tgui_input_list(usr, "Choose receiving Feed Channel", "Network Channel Handler", available_channels)
|
||||
var/new_channel_name = tgui_input_list(ui.user, "Choose receiving Feed Channel", "Network Channel Handler", available_channels)
|
||||
if(new_channel_name)
|
||||
channel_name = new_channel_name
|
||||
return TRUE
|
||||
|
||||
if("set_new_message")
|
||||
msg = sanitize(tgui_input_text(usr, "Write your Feed story", "Network Channel Handler", multiline = TRUE, prevent_enter = TRUE))
|
||||
msg = sanitize(tgui_input_text(ui.user, "Write your Feed story", "Network Channel Handler", multiline = TRUE, prevent_enter = TRUE))
|
||||
return TRUE
|
||||
|
||||
if("set_new_title")
|
||||
title = sanitize(tgui_input_text(usr, "Enter your Feed title", "Network Channel Handler"))
|
||||
title = sanitize(tgui_input_text(ui.user, "Enter your Feed title", "Network Channel Handler"))
|
||||
return TRUE
|
||||
|
||||
if("set_attachment")
|
||||
AttachPhoto(usr)
|
||||
AttachPhoto(ui.user)
|
||||
return TRUE
|
||||
|
||||
if("submit_new_message")
|
||||
var/our_user = tgui_user_name(usr)
|
||||
var/our_user = tgui_user_name(ui.user)
|
||||
if(msg == "" || msg == "\[REDACTED\]")
|
||||
set_temp("Error: Could not submit feed message to network: Invalid Message.", "danger", FALSE)
|
||||
return TRUE
|
||||
@@ -496,7 +496,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
if("submit_wanted")
|
||||
if(!securityCaster)
|
||||
return FALSE
|
||||
var/our_user = tgui_user_name(usr)
|
||||
var/our_user = tgui_user_name(ui.user)
|
||||
if(channel_name == "")
|
||||
set_temp("Error: Could not submit wanted issue to network: Invalid Criminal Name.", "danger", FALSE)
|
||||
return TRUE
|
||||
@@ -507,11 +507,11 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
set_temp("Error: Could not submit wanted issue to network: Author unverified.", "danger", FALSE)
|
||||
return TRUE
|
||||
|
||||
var/choice = tgui_alert(usr, "Please confirm Wanted Issue change.", "Network Security Handler", list("Confirm", "Cancel"))
|
||||
var/choice = tgui_alert(ui.user, "Please confirm Wanted Issue change.", "Network Security Handler", list("Confirm", "Cancel"))
|
||||
if(choice == "Confirm")
|
||||
if(news_network.wanted_issue)
|
||||
if(news_network.wanted_issue.is_admin_message)
|
||||
tgui_alert_async(usr, "The wanted issue has been distributed by a [using_map.company_name] higherup. You cannot edit it.")
|
||||
tgui_alert_async(ui.user, "The wanted issue has been distributed by a [using_map.company_name] higherup. You cannot edit it.")
|
||||
return
|
||||
news_network.wanted_issue.author = channel_name
|
||||
news_network.wanted_issue.body = msg
|
||||
@@ -536,9 +536,9 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
if(!securityCaster)
|
||||
return FALSE
|
||||
if(news_network.wanted_issue.is_admin_message)
|
||||
tgui_alert_async(usr, "The wanted issue has been distributed by a [using_map.company_name] higherup. You cannot take it down.")
|
||||
tgui_alert_async(ui.user, "The wanted issue has been distributed by a [using_map.company_name] higherup. You cannot take it down.")
|
||||
return
|
||||
var/choice = tgui_alert(usr, "Please confirm Wanted Issue removal","Network Security Handler",list("Confirm","Cancel"))
|
||||
var/choice = tgui_alert(ui.user, "Please confirm Wanted Issue removal","Network Security Handler",list("Confirm","Cancel"))
|
||||
if(choice=="Confirm")
|
||||
news_network.wanted_issue = null
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
@@ -551,7 +551,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
return FALSE
|
||||
var/datum/feed_channel/FC = locate(params["ref"])
|
||||
if(FC.is_admin_channel)
|
||||
tgui_alert_async(usr, "This channel was created by a [using_map.company_name] Officer. You cannot censor it.")
|
||||
tgui_alert_async(ui.user, "This channel was created by a [using_map.company_name] Officer. You cannot censor it.")
|
||||
return
|
||||
if(FC.author != "\[REDACTED\]")
|
||||
FC.backup_author = FC.author
|
||||
@@ -566,7 +566,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
return FALSE
|
||||
var/datum/feed_message/MSG = locate(params["ref"])
|
||||
if(MSG.is_admin_message)
|
||||
tgui_alert_async(usr, "This message was created by a [using_map.company_name] Officer. You cannot censor its author.")
|
||||
tgui_alert_async(ui.user, "This message was created by a [using_map.company_name] Officer. You cannot censor its author.")
|
||||
return
|
||||
if(MSG.author != "\[REDACTED\]")
|
||||
MSG.backup_author = MSG.author
|
||||
@@ -581,7 +581,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
return FALSE
|
||||
var/datum/feed_message/MSG = locate(params["ref"])
|
||||
if(MSG.is_admin_message)
|
||||
tgui_alert_async(usr, "This channel was created by a [using_map.company_name] Officer. You cannot censor it.")
|
||||
tgui_alert_async(ui.user, "This channel was created by a [using_map.company_name] Officer. You cannot censor it.")
|
||||
return
|
||||
if(MSG.body != "\[REDACTED\]")
|
||||
MSG.backup_body = MSG.body
|
||||
@@ -603,7 +603,7 @@ GLOBAL_LIST_BOILERPLATE(allCasters, /obj/machinery/newscaster)
|
||||
return FALSE
|
||||
var/datum/feed_channel/FC = locate(params["ref"])
|
||||
if(FC.is_admin_channel)
|
||||
tgui_alert_async(usr, "This channel was created by a [using_map.company_name] Officer. You cannot place a D-Notice upon it.")
|
||||
tgui_alert_async(ui.user, "This channel was created by a [using_map.company_name] Officer. You cannot place a D-Notice upon it.")
|
||||
return
|
||||
FC.censored = !FC.censored
|
||||
FC.update()
|
||||
|
||||
@@ -85,7 +85,7 @@ var/bomb_set
|
||||
|
||||
if(extended)
|
||||
if(istype(O, /obj/item/disk/nuclear))
|
||||
usr.drop_item()
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
auth = O
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -106,17 +106,16 @@
|
||||
|
||||
/obj/machinery/gear_painter/AltClick(mob/user)
|
||||
. = ..()
|
||||
drop_item()
|
||||
drop_item(user)
|
||||
|
||||
/obj/machinery/gear_painter/proc/drop_item()
|
||||
/obj/machinery/gear_painter/proc/drop_item(var/mob/user)
|
||||
if(!oview(1,src))
|
||||
return
|
||||
if(!inserted)
|
||||
return
|
||||
to_chat(usr, span_notice("You remove [inserted] from [src]"))
|
||||
to_chat(user, span_notice("You remove [inserted] from [src]"))
|
||||
inserted.forceMove(drop_location())
|
||||
var/mob/living/user = usr
|
||||
if(istype(user))
|
||||
if(isliving(user))
|
||||
user.put_in_hands(inserted)
|
||||
inserted = null
|
||||
update_icon()
|
||||
@@ -155,11 +154,11 @@
|
||||
.["item"] = list()
|
||||
.["item"]["name"] = inserted.name
|
||||
.["item"]["sprite"] = icon2base64(get_flat_icon(inserted,dir=SOUTH,no_anim=TRUE))
|
||||
.["item"]["preview"] = icon2base64(build_preview())
|
||||
.["item"]["preview"] = icon2base64(build_preview(user))
|
||||
else
|
||||
.["item"] = null
|
||||
|
||||
/obj/machinery/gear_painter/tgui_act(action, params)
|
||||
/obj/machinery/gear_painter/tgui_act(action, params, datum/tgui/ui)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
@@ -169,17 +168,17 @@
|
||||
active_mode = text2num(params["mode"])
|
||||
return TRUE
|
||||
if("choose_color")
|
||||
var/chosen_color = input(usr, "Choose a color: ", "ColorMate colour picking", activecolor) as color|null
|
||||
var/chosen_color = input(ui.user, "Choose a color: ", "ColorMate colour picking", activecolor) as color|null
|
||||
if(chosen_color)
|
||||
activecolor = chosen_color
|
||||
return TRUE
|
||||
if("paint")
|
||||
do_paint(usr)
|
||||
do_paint(ui.user)
|
||||
temp = "Painted Successfully!"
|
||||
return TRUE
|
||||
if("drop")
|
||||
temp = ""
|
||||
drop_item()
|
||||
drop_item(ui.user)
|
||||
return TRUE
|
||||
if("clear")
|
||||
inserted.remove_atom_colour(FIXED_COLOUR_PRIORITY)
|
||||
@@ -242,7 +241,7 @@
|
||||
|
||||
|
||||
/// Produces the preview image of the item, used in the UI, the way the color is not stacking is a sin.
|
||||
/obj/machinery/gear_painter/proc/build_preview()
|
||||
/obj/machinery/gear_painter/proc/build_preview(mob/user)
|
||||
if(inserted) //sanity
|
||||
var/list/cm
|
||||
switch(active_mode)
|
||||
@@ -261,17 +260,17 @@
|
||||
text2num(color_matrix_last[11]),
|
||||
text2num(color_matrix_last[12]),
|
||||
)
|
||||
if(!check_valid_color(cm, usr))
|
||||
if(!check_valid_color(cm, user))
|
||||
return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE)
|
||||
|
||||
if(COLORMATE_TINT)
|
||||
if(!check_valid_color(activecolor, usr))
|
||||
if(!check_valid_color(activecolor, user))
|
||||
return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE)
|
||||
|
||||
if(COLORMATE_HSV)
|
||||
cm = color_matrix_hsv(build_hue, build_sat, build_val)
|
||||
color_matrix_last = cm
|
||||
if(!check_valid_color(cm, usr))
|
||||
if(!check_valid_color(cm, user))
|
||||
return get_flat_icon(inserted, dir=SOUTH, no_anim=TRUE)
|
||||
|
||||
var/cur_color = inserted.color
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
default_name = replacetext(beaker.name, new/regex(" culture bottle\\Z", "g"), "")
|
||||
else
|
||||
default_name = D.name
|
||||
var/name = tgui_input_text(usr, "Name:", "Name the culture", default_name, MAX_NAME_LEN)
|
||||
var/name = tgui_input_text(ui.user, "Name:", "Name the culture", default_name, MAX_NAME_LEN)
|
||||
if(name == null || wait)
|
||||
return
|
||||
var/obj/item/reagent_containers/glass/bottle/B = create_culture(name)
|
||||
@@ -167,7 +167,7 @@
|
||||
if(!A)
|
||||
atom_say("Unable to find requested strain.")
|
||||
return
|
||||
print_form(A, usr)
|
||||
print_form(A, ui.user)
|
||||
if("name_strain")
|
||||
var/strain_index = text2num(params["strain_index"])
|
||||
if(isnull(strain_index))
|
||||
@@ -184,7 +184,7 @@
|
||||
if(A.name != "Unknown")
|
||||
atom_say("Request rejected. Strain already has a name.")
|
||||
return
|
||||
var/new_name = tgui_input_text(usr, "Name the Strain", "New Name", max_length = MAX_NAME_LEN)
|
||||
var/new_name = tgui_input_text(ui.user, "Name the Strain", "New Name", max_length = MAX_NAME_LEN)
|
||||
if(!new_name)
|
||||
return
|
||||
A.AssignName(new_name)
|
||||
|
||||
@@ -297,7 +297,7 @@
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
switch(action)
|
||||
// Queue management can be done even while busy
|
||||
if("queue")
|
||||
@@ -331,7 +331,7 @@
|
||||
return TRUE
|
||||
|
||||
if(busy)
|
||||
to_chat(usr, span_notice("[src] is busy. Please wait for completion of previous operation."))
|
||||
to_chat(ui.user, span_notice("[src] is busy. Please wait for completion of previous operation."))
|
||||
return
|
||||
|
||||
switch(action)
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
visible_message("\the [user] turns \the [src] [toggle ? "on" : "off"].")
|
||||
update_power()
|
||||
if(!toggle)
|
||||
var/msg = "[usr.client.key] ([usr]) has turned [src] off, at [x],[y],[z]."
|
||||
var/msg = "[user.client.key] ([user]) has turned [src] off, at [x],[y],[z]."
|
||||
message_admins(msg)
|
||||
log_game(msg)
|
||||
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
/obj/machinery/petrification
|
||||
name = "odd interface"
|
||||
desc = "An odd looking machine with an interface, some buttons and a tiny keyboard on the side."
|
||||
icon = 'icons/obj/machines/petrification.dmi'
|
||||
icon_state = "petrification"
|
||||
|
||||
idle_power_usage = 100
|
||||
active_power_usage = 1000
|
||||
use_power = USE_POWER_IDLE
|
||||
anchored = TRUE
|
||||
unacidable = TRUE
|
||||
dir = EAST
|
||||
var/material = "stone"
|
||||
var/identifier = "statue"
|
||||
var/adjective = "hardens"
|
||||
var/tint = "#ffffff"
|
||||
var/able_to_unpetrify = TRUE
|
||||
var/discard_clothes = TRUE
|
||||
var/mob/living/carbon/human/target
|
||||
var/list/remotes = list()
|
||||
|
||||
/obj/machinery/petrification/New()
|
||||
. = ..()
|
||||
if(!pixel_x && !pixel_y)
|
||||
pixel_x = (dir & 3) ? 0 : (dir == 4 ? 26 : -26)
|
||||
pixel_y = (dir & 3) ? (dir == 1 ? 26 : -26) : 0
|
||||
|
||||
/obj/machinery/petrification/proc/get_viable_targets()
|
||||
var/list/targets = list()
|
||||
//dir is the opposite of whichever direction we want to scan
|
||||
var/turf/center
|
||||
center = get_step(src, turn(dir, 180))
|
||||
if (!center)
|
||||
return
|
||||
//square of 3x3 in front of the device
|
||||
for (var/n = center.x-1; n <= center.x+1; n++)
|
||||
for (var/m = center.y-1; m <= center.y+1; m++)
|
||||
var/turf/T = locate(n,m,z)
|
||||
if (!isturf(T))
|
||||
continue
|
||||
for (var/mob/living/carbon/human/H in T)
|
||||
if (H.stat == DEAD)
|
||||
continue
|
||||
var/option = "[H]["[H]" != H.real_name ? " ([H.real_name])" : ""]"
|
||||
var/r = 1
|
||||
if (option in targets)
|
||||
while ("[option] ([r])" in targets)
|
||||
r += 1
|
||||
option = "[option] ([r])"
|
||||
targets[option] = H
|
||||
return targets
|
||||
|
||||
/obj/machinery/petrification/proc/is_valid_target(var/mob/living/carbon/human/H)
|
||||
if (QDELETED(H) || !istype(H) || !H.client)
|
||||
return FALSE
|
||||
var/turf/T = H.loc
|
||||
if (!isturf(T))
|
||||
return FALSE
|
||||
var/turf/center
|
||||
center = get_step(get_turf(src), turn(dir, 180))
|
||||
if (!center)
|
||||
return
|
||||
if (T.z != z || T.x > center.x + 1 || T.x < center.x - 1 || T.y > center.y + 1 || T.y < center.y - 1)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/petrification/proc/popup_msg(var/mob/user, var/message, var/notice = TRUE)
|
||||
if (notice)
|
||||
message = "A notice pops up on the interface: \"[message]\""
|
||||
if (target)
|
||||
to_chat(user, span_notice("[message]"))
|
||||
|
||||
/obj/machinery/petrification/proc/petrify(var/mob/user, var/obj/item/petrifier/petrifier = null)
|
||||
. = FALSE
|
||||
var/mat = material
|
||||
var/idt = identifier
|
||||
var/adj = adjective
|
||||
var/tnt = tint
|
||||
var/can_unpetrify = able_to_unpetrify
|
||||
var/no_clothes = discard_clothes
|
||||
var/mob/living/carbon/human/statue = target
|
||||
if (petrifier && istype(petrifier))
|
||||
mat = petrifier.material
|
||||
idt = petrifier.identifier
|
||||
adj = petrifier.adjective
|
||||
tnt = petrifier.tint
|
||||
can_unpetrify = petrifier.able_to_unpetrify
|
||||
no_clothes = petrifier.discard_clothes
|
||||
statue = petrifier.target
|
||||
if (QDELETED(statue) || !istype(statue))
|
||||
popup_msg(user, "Invalid target.")
|
||||
return
|
||||
if (statue.stat == DEAD)
|
||||
popup_msg(user, "The target must be alive.")
|
||||
return
|
||||
if (!statue.client)
|
||||
popup_msg(user, "The target must be capable of conscious thought.")
|
||||
return
|
||||
if (!istext(mat) || !istext(idt) || !istext(adj) || !istext(tnt))
|
||||
popup_msg(user, "Invalid options.")
|
||||
var/turf/T = statue.loc
|
||||
if (!istype(T))
|
||||
popup_msg(user, "They must be visible to the [petrifier ? "device" : "machine"].")
|
||||
if (!petrifier)
|
||||
var/turf/center = get_step(get_turf(src), turn(dir, 180))
|
||||
if (!center)
|
||||
return
|
||||
if (T.z != z || T.x > center.x + 1 || T.x < center.x - 1 || T.y > center.y + 1 || T.y < center.y - 1)
|
||||
popup_msg(user, "They are out of range. They must be standing within a 3x3 square in front of the machine.")
|
||||
return
|
||||
else
|
||||
var/turf/center = get_turf(petrifier)
|
||||
if (!center)
|
||||
return
|
||||
if (T.z != center.z || get_dist(center, T) > 4)
|
||||
popup_msg(user, "They are out of range. They must be standing within 4 tiles of the device.")
|
||||
return
|
||||
var/datum/component/gargoyle/comp = statue.GetComponent(/datum/component/gargoyle)
|
||||
if (no_clothes)
|
||||
for(var/obj/item/W in statue)
|
||||
if(istype(W, /obj/item/implant/backup) || istype(W, /obj/item/nif))
|
||||
continue
|
||||
statue.drop_from_inventory(W)
|
||||
|
||||
var/obj/structure/gargoyle/G = new(T, statue, idt, mat, adj, tnt, can_unpetrify, no_clothes)
|
||||
G.was_rayed = TRUE
|
||||
|
||||
if (can_unpetrify)
|
||||
add_verb(statue,/mob/living/carbon/human/proc/gargoyle_transformation)
|
||||
comp?.cooldown = 0
|
||||
else
|
||||
remove_verb(statue,/mob/living/carbon/human/proc/gargoyle_transformation)
|
||||
remove_verb(statue,/mob/living/carbon/human/proc/gargoyle_pause)
|
||||
remove_verb(statue,/mob/living/carbon/human/proc/gargoyle_checkenergy)
|
||||
comp?.cooldown = INFINITY
|
||||
|
||||
if (!petrifier)
|
||||
visible_message(span_notice("A ray of purple light streams out of \the [src], aimed directly at [statue]. Everywhere the light touches on them quickly [adj] into [mat]."))
|
||||
SStgui.update_uis(src)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/petrification/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/petrification/tgui_interact(mob/user, datum/tgui/ui = null)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "PetrificationInterface", name)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/petrification/tgui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["material"] = material
|
||||
data["identifier"] = identifier
|
||||
data["adjective"] = adjective
|
||||
data["tint"] = tint
|
||||
var/list/h = rgb2num(tint)
|
||||
data["t"] = ((h[1]*0.299)+(h[2]*0.587)+(h[3]*0.114)) > 102 //0.4 luminance
|
||||
data["target"] = "[target ? target : "None"]"
|
||||
data["able_to_unpetrify"] = able_to_unpetrify
|
||||
data["discard_clothes"] = discard_clothes
|
||||
data["can_remote"] = is_valid_target(target) && istext(material) && istext(identifier) && istext(adjective) && istext(tint)
|
||||
return data
|
||||
|
||||
/obj/machinery/petrification/proc/set_input(var/option, mob/user)
|
||||
var/list/only_these = list("tint","material","identifier","adjective","able_to_unpetrify","discard_clothes","target")
|
||||
if (!(option in only_these))
|
||||
return
|
||||
switch(option)
|
||||
if("tint")
|
||||
var/new_color = input(user, "Choose the color for the [identifier] to be:", "Statue color", tint) as color|null
|
||||
if (new_color)
|
||||
tint = new_color
|
||||
if("material","identifier","adjective")
|
||||
var/input = tgui_input_text(user, "What should the [option] be?", "Statue [option]", vars[option], MAX_NAME_LEN)
|
||||
input = sanitizeSafe(input, 25)
|
||||
if (length(input) <= 0)
|
||||
return
|
||||
if (option == "adjective")
|
||||
if (copytext_char(input, -1) != "s")
|
||||
switch(copytext_char(input, -2))
|
||||
if ("ss")
|
||||
input += "es"
|
||||
if ("sh")
|
||||
input += "es"
|
||||
if ("ch")
|
||||
input += "es"
|
||||
else
|
||||
switch(copytext_char(input, -1))
|
||||
if("s", "x", "z")
|
||||
input += "es"
|
||||
else
|
||||
input += "s"
|
||||
vars[option] = input
|
||||
if("able_to_unpetrify", "discard_clothes")
|
||||
vars[option] = !vars[option]
|
||||
if("target")
|
||||
var/list/targets = get_viable_targets()
|
||||
if (!length(targets))
|
||||
popup_msg(user, "No targets within range. Make sure there is a humanoid being within a 3x3 metre square in front of the interface.")
|
||||
return
|
||||
var/selected = input(user, "Choose the target.", "Petrification Target") as null|anything in targets
|
||||
if (selected && ishuman(targets[selected]) && is_valid_target(targets[selected]))
|
||||
var/confirmation = tgui_alert(targets[selected], "You have been selected as a petrification target. If you press confirm, you will possibly be turned into a statue, and if the option is selected, possibly one that cannot be reverted back from a statue at all.","Petrification Target",list("Confirm", "Cancel"))
|
||||
if (confirmation != "Confirm")
|
||||
popup_msg(user, "They declined the request.", FALSE)
|
||||
return
|
||||
var/double = tgui_alert(targets[selected], "This is your last warning, are you -certain-?","Petrification Target",list("Confirm", "Cancel"))
|
||||
if (confirmation == "Confirm" && double == "Confirm")
|
||||
target = targets[selected]
|
||||
else
|
||||
popup_msg(user, "They declined the request.", FALSE)
|
||||
|
||||
/obj/machinery/petrification/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
if (ui.user)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
switch(action)
|
||||
if("set_option")
|
||||
if (params["option"])
|
||||
set_input(params["option"], ui.user)
|
||||
SStgui.update_uis(src)
|
||||
return TRUE
|
||||
if("petrify")
|
||||
petrify(ui.user)
|
||||
return TRUE
|
||||
if("remote")
|
||||
if (is_valid_target(target) && istext(material) && istext(identifier) && istext(adjective) && istext(tint))
|
||||
var/obj/item/petrifier/PE = remotes[target]
|
||||
if (!QDELETED(PE))
|
||||
PE.visible_message(span_warning("\The [PE] disappears!"))
|
||||
qdel(PE)
|
||||
var/obj/item/petrifier/P = new(loc, src)
|
||||
P.material = material
|
||||
P.identifier = identifier
|
||||
P.adjective = adjective
|
||||
P.tint = tint
|
||||
P.able_to_unpetrify = able_to_unpetrify
|
||||
P.discard_clothes = discard_clothes
|
||||
P.target = target
|
||||
remotes[target] = P
|
||||
ui.user.put_in_hands(P)
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
/obj/item/paper/petrification_notes
|
||||
name = "written notes"
|
||||
info = "<font face=\"Times New Roman\">" + span_italics("Found this buried in the machine over there after digging through it a bit- I hooked it up to one of our displays so it was a bit more usable- seems to be a spare part, it was right next to another one that actually " + span_bold("was") + " hooked up. Turns things into other materials, probably one of the components that makes that machine work.") + "</font>"
|
||||
@@ -67,10 +67,10 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/pipedispenser/tgui_act(action, params)
|
||||
/obj/machinery/pipedispenser/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(unwrenched || !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
|
||||
if(unwrenched || !ui.user.canmove || ui.user.stat || ui.user.restrained() || !in_range(loc, ui.user))
|
||||
return TRUE
|
||||
|
||||
. = TRUE
|
||||
@@ -101,18 +101,18 @@
|
||||
else if(istype(recipe, /datum/pipe_recipe/meter))
|
||||
created_object = new recipe.pipe_type(loc)
|
||||
else
|
||||
log_runtime(EXCEPTION("Warning: [usr] attempted to spawn pipe recipe type by params [json_encode(params)] ([recipe] [recipe?.type]), but it was not allowed by this machine ([src] [type])"))
|
||||
log_runtime(EXCEPTION("Warning: [ui.user] attempted to spawn pipe recipe type by params [json_encode(params)] ([recipe] [recipe?.type]), but it was not allowed by this machine ([src] [type])"))
|
||||
return
|
||||
|
||||
created_object.add_fingerprint(usr)
|
||||
created_object.add_fingerprint(ui.user)
|
||||
wait = TRUE
|
||||
VARSET_IN(src, wait, FALSE, 15)
|
||||
|
||||
|
||||
/obj/machinery/pipedispenser/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
src.add_fingerprint(user)
|
||||
if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter))
|
||||
to_chat(usr, span_notice("You put [W] back in [src]."))
|
||||
to_chat(user, span_notice("You put [W] back in [src]."))
|
||||
user.drop_item()
|
||||
qdel(W)
|
||||
return
|
||||
@@ -128,8 +128,8 @@
|
||||
src.anchored = FALSE
|
||||
src.stat |= MAINT
|
||||
src.unwrenched = 1
|
||||
if (usr.machine==src)
|
||||
usr << browse(null, "window=pipedispenser")
|
||||
if (user.machine==src)
|
||||
user << browse(null, "window=pipedispenser")
|
||||
else /*if (unwrenched==1)*/
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, span_notice("You begin to fasten \the [src] to the floor..."))
|
||||
@@ -155,17 +155,17 @@
|
||||
disposals = TRUE
|
||||
|
||||
//Allow you to drag-drop disposal pipes into it
|
||||
/obj/machinery/pipedispenser/disposal/MouseDrop_T(var/obj/structure/disposalconstruct/pipe as obj, mob/usr as mob)
|
||||
if(!usr.canmove || usr.stat || usr.restrained())
|
||||
/obj/machinery/pipedispenser/disposal/MouseDrop_T(var/obj/structure/disposalconstruct/pipe as obj, mob/user as mob)
|
||||
if(!user.canmove || user.stat || user.restrained())
|
||||
return
|
||||
|
||||
if (!istype(pipe) || get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 )
|
||||
if (!istype(pipe) || get_dist(user, src) > 1 || get_dist(src,pipe) > 1 )
|
||||
return
|
||||
|
||||
if (pipe.anchored)
|
||||
return
|
||||
|
||||
to_chat(usr, span_notice("You shove [pipe] back in [src]."))
|
||||
to_chat(user, span_notice("You shove [pipe] back in [src]."))
|
||||
qdel(pipe)
|
||||
|
||||
// adding a pipe dispensers that spawn unhooked from the ground
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
if(default_part_replacement(user, W))
|
||||
return
|
||||
if (!panel_open && W.has_tool_quality(TOOL_WRENCH))
|
||||
P_type_t = tgui_input_list(usr, "Choose pipe type", "Pipe type", Pipes)
|
||||
P_type_t = tgui_input_list(user, "Choose pipe type", "Pipe type", Pipes)
|
||||
P_type = Pipes[P_type_t]
|
||||
user.visible_message(span_notice("[user] has set \the [src] to manufacture [P_type_t]."), span_notice("You set \the [src] to manufacture [P_type_t]."))
|
||||
return
|
||||
|
||||
@@ -62,7 +62,7 @@ GLOBAL_LIST_BOILERPLATE(pointdefense_turrets, /obj/machinery/power/pointdefense)
|
||||
return FALSE
|
||||
|
||||
if(!(get_z(PD) in GetConnectedZlevels(get_z(src))))
|
||||
to_chat(usr, span_warning("[PD] is not within control range."))
|
||||
to_chat(ui.user, span_warning("[PD] is not within control range."))
|
||||
return FALSE
|
||||
|
||||
if(!PD.Activate()) //Activate() whilst the device is active will return false.
|
||||
|
||||
@@ -443,7 +443,7 @@
|
||||
/obj/machinery/porta_turret/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(isLocked(usr))
|
||||
if(isLocked(ui.user))
|
||||
return TRUE
|
||||
. = TRUE
|
||||
|
||||
@@ -1094,7 +1094,7 @@
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new turret name", name, finish_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && loc != usr)
|
||||
if(!in_range(src, user) && loc != user)
|
||||
return
|
||||
|
||||
finish_name = t
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
|
||||
if(W.has_tool_quality(TOOL_WRENCH))
|
||||
if(protean_brain || protean_orchestrator || protean_refactory)
|
||||
var/choice = tgui_input_list(usr, "What component would you like to remove?", "Remove Component", list(protean_brain,protean_orchestrator,protean_refactory))
|
||||
var/choice = tgui_input_list(user, "What component would you like to remove?", "Remove Component", list(protean_brain,protean_orchestrator,protean_refactory))
|
||||
if(!choice) return
|
||||
|
||||
if(choice == protean_brain)
|
||||
|
||||
@@ -137,18 +137,18 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
data["announceAuth"] = announceAuth
|
||||
return data
|
||||
|
||||
/obj/machinery/requests_console/tgui_act(action, list/params)
|
||||
/obj/machinery/requests_console/tgui_act(action, list/params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
switch(action)
|
||||
if("write")
|
||||
if(reject_bad_text(params["write"]))
|
||||
recipient = params["write"] //write contains the string of the receiving department's name
|
||||
|
||||
var/new_message = sanitize(tgui_input_text(usr, "Write your message:", "Awaiting Input", ""))
|
||||
var/new_message = sanitize(tgui_input_text(ui.user, "Write your message:", "Awaiting Input", ""))
|
||||
if(new_message)
|
||||
message = new_message
|
||||
screen = RCS_MESSAUTH
|
||||
@@ -164,7 +164,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
. = TRUE
|
||||
|
||||
if("writeAnnouncement")
|
||||
var/new_message = sanitize(tgui_input_text(usr, "Write your message:", "Awaiting Input", ""))
|
||||
var/new_message = sanitize(tgui_input_text(ui.user, "Write your message:", "Awaiting Input", ""))
|
||||
if(new_message)
|
||||
message = new_message
|
||||
else
|
||||
@@ -233,9 +233,9 @@ var/list/obj/machinery/requests_console/allConsoles = list()
|
||||
if(computer_deconstruction_screwdriver(user, O))
|
||||
return
|
||||
if(istype(O, /obj/item/multitool))
|
||||
var/input = sanitize(tgui_input_text(usr, "What Department ID would you like to give this request console?", "Multitool-Request Console Interface", department))
|
||||
var/input = sanitize(tgui_input_text(user, "What Department ID would you like to give this request console?", "Multitool-Request Console Interface", department))
|
||||
if(!input)
|
||||
to_chat(usr, "No input found. Please hang up and try your call again.")
|
||||
to_chat(user, "No input found. Please hang up and try your call again.")
|
||||
return
|
||||
department = input
|
||||
announcement.title = "[department] announcement"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user