mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
[MIRROR] usr to user up to player effects (#9552)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a7e4ef7dad
commit
0180cc74c5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user