mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
tgui usr to ui.user
This commit is contained in:
@@ -201,8 +201,8 @@
|
||||
/mob/living/bot/cleanbot/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
if(..())
|
||||
return TRUE
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
ui.user.set_machine(src)
|
||||
add_fingerprint(ui.user)
|
||||
switch(action)
|
||||
if("start")
|
||||
if(on)
|
||||
@@ -222,11 +222,11 @@
|
||||
. = TRUE
|
||||
if("wet_floors")
|
||||
wet_floors = !wet_floors
|
||||
to_chat(usr, span_notice("You twiddle the screw."))
|
||||
to_chat(ui.user, span_notice("You twiddle the screw."))
|
||||
. = TRUE
|
||||
if("spray_blood")
|
||||
spray_blood = !spray_blood
|
||||
to_chat(usr, span_notice("You press the weird button."))
|
||||
to_chat(ui.user, span_notice("You press the weird button."))
|
||||
. = TRUE
|
||||
|
||||
/mob/living/bot/cleanbot/emag_act(var/remaining_uses, var/mob/user)
|
||||
@@ -272,6 +272,6 @@
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && src.loc != usr)
|
||||
if(!in_range(src, user) && src.loc != user)
|
||||
return
|
||||
created_name = t
|
||||
|
||||
@@ -87,15 +87,15 @@
|
||||
switch(action)
|
||||
if("red_switch")
|
||||
red_switch = !red_switch
|
||||
to_chat(usr, span_notice("You flip the red switch [red_switch ? "on" : "off"]."))
|
||||
to_chat(ui.user, span_notice("You flip the red switch [red_switch ? "on" : "off"]."))
|
||||
. = TRUE
|
||||
if("green_switch")
|
||||
green_switch = !green_switch
|
||||
to_chat(usr, span_notice("You flip the green switch [green_switch ? "on" : "off"]."))
|
||||
to_chat(ui.user, span_notice("You flip the green switch [green_switch ? "on" : "off"]."))
|
||||
. = TRUE
|
||||
if("blue_switch")
|
||||
blue_switch = !blue_switch
|
||||
to_chat(usr, span_notice("You flip the blue switch [blue_switch ? "on" : "off"]."))
|
||||
to_chat(ui.user, span_notice("You flip the blue switch [blue_switch ? "on" : "off"]."))
|
||||
. = TRUE
|
||||
|
||||
/mob/living/bot/cleanbot/edCLN/emag_act(var/remaining_uses, var/mob/user)
|
||||
@@ -124,7 +124,7 @@
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_name, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && src.loc != usr)
|
||||
if(!in_range(src, user) && src.loc != user)
|
||||
return
|
||||
created_name = t
|
||||
return
|
||||
|
||||
@@ -84,11 +84,11 @@
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
switch(action)
|
||||
if("power")
|
||||
if(!access_scanner.allowed(usr))
|
||||
if(!access_scanner.allowed(ui.user))
|
||||
return FALSE
|
||||
if(on)
|
||||
turn_off()
|
||||
@@ -413,7 +413,7 @@
|
||||
t = sanitize(t, MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && loc != usr)
|
||||
if(!in_range(src, user) && loc != user)
|
||||
return
|
||||
|
||||
created_name = t
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
turn_on()
|
||||
. = TRUE
|
||||
|
||||
if(locked && !issilicon(usr))
|
||||
if(locked && !issilicon(ui.user))
|
||||
return
|
||||
|
||||
switch(action)
|
||||
|
||||
@@ -269,20 +269,20 @@
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
ui.user.set_machine(src)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
. = TRUE
|
||||
switch(action)
|
||||
if("power")
|
||||
if(!access_scanner.allowed(usr))
|
||||
if(!access_scanner.allowed(ui.user))
|
||||
return FALSE
|
||||
if(on)
|
||||
turn_off()
|
||||
else
|
||||
turn_on()
|
||||
|
||||
if(locked && !issilicon(usr))
|
||||
if(locked && !issilicon(ui.user))
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
@@ -538,7 +538,7 @@
|
||||
var/t = sanitizeSafe(tgui_input_text(user, "Enter new robot name", name, created_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
|
||||
created_name = t
|
||||
else
|
||||
|
||||
@@ -82,43 +82,43 @@
|
||||
data["safety"] = safety
|
||||
return data
|
||||
|
||||
/mob/living/bot/mulebot/tgui_act(action, params)
|
||||
/mob/living/bot/mulebot/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
switch(action)
|
||||
if("power")
|
||||
if(on)
|
||||
turn_off()
|
||||
else
|
||||
turn_on()
|
||||
visible_message("[usr] switches [on ? "on" : "off"] [src].")
|
||||
visible_message("[ui.user] switches [on ? "on" : "off"] [src].")
|
||||
. = TRUE
|
||||
|
||||
if("stop")
|
||||
obeyCommand("Stop")
|
||||
obeyCommand(ui.user, "Stop")
|
||||
. = TRUE
|
||||
|
||||
if("go")
|
||||
obeyCommand("GoTD")
|
||||
obeyCommand(ui.user, "GoTD")
|
||||
. = TRUE
|
||||
|
||||
if("home")
|
||||
obeyCommand("Home")
|
||||
obeyCommand(ui.user, "Home")
|
||||
. = TRUE
|
||||
|
||||
if("destination")
|
||||
obeyCommand("SetD")
|
||||
obeyCommand(ui.user, "SetD")
|
||||
. = TRUE
|
||||
|
||||
if("sethome")
|
||||
var/new_dest
|
||||
var/list/beaconlist = GetBeaconList()
|
||||
if(beaconlist.len)
|
||||
new_dest = tgui_input_list(usr, "Select new home tag", "Mulebot [suffix ? "([suffix])" : ""]", beaconlist)
|
||||
new_dest = tgui_input_list(ui.user, "Select new home tag", "Mulebot [suffix ? "([suffix])" : ""]", beaconlist)
|
||||
else
|
||||
tgui_alert_async(usr, "No destination beacons available.")
|
||||
tgui_alert_async(ui.user, "No destination beacons available.")
|
||||
if(new_dest)
|
||||
home = get_turf(beaconlist[new_dest])
|
||||
homeName = new_dest
|
||||
@@ -144,7 +144,7 @@
|
||||
..()
|
||||
update_icons()
|
||||
|
||||
/mob/living/bot/mulebot/proc/obeyCommand(var/command)
|
||||
/mob/living/bot/mulebot/proc/obeyCommand(mob/user, var/command)
|
||||
switch(command)
|
||||
if("Home")
|
||||
resetTarget()
|
||||
@@ -154,9 +154,9 @@
|
||||
var/new_dest
|
||||
var/list/beaconlist = GetBeaconList()
|
||||
if(beaconlist.len)
|
||||
new_dest = tgui_input_list(usr, "Select new destination tag", "Mulebot [suffix ? "([suffix])" : ""]", beaconlist)
|
||||
new_dest = tgui_input_list(user, "Select new destination tag", "Mulebot [suffix ? "([suffix])" : ""]", beaconlist)
|
||||
else
|
||||
tgui_alert_async(usr, "No destination beacons available.")
|
||||
tgui_alert_async(user, "No destination beacons available.")
|
||||
if(new_dest)
|
||||
resetTarget()
|
||||
target = get_turf(beaconlist[new_dest])
|
||||
|
||||
@@ -129,11 +129,11 @@
|
||||
if(..())
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
switch(action)
|
||||
if("power")
|
||||
if(!access_scanner.allowed(usr))
|
||||
if(!access_scanner.allowed(ui.user))
|
||||
return FALSE
|
||||
if(on)
|
||||
turn_off()
|
||||
@@ -141,7 +141,7 @@
|
||||
turn_on()
|
||||
. = TRUE
|
||||
|
||||
if(locked && !issilicon(usr))
|
||||
if(locked && !issilicon(ui.user))
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
|
||||
@@ -294,7 +294,7 @@
|
||||
|
||||
switch(action)
|
||||
if("targetSlot")
|
||||
H.handle_strip(params["slot"], usr)
|
||||
H.handle_strip(params["slot"], ui.user)
|
||||
return TRUE
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
return data
|
||||
|
||||
/datum/pai_software/directives/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
var/mob/living/silicon/pai/P = usr
|
||||
var/mob/living/silicon/pai/P = ui.user
|
||||
if(!istype(P))
|
||||
return TRUE
|
||||
if(..())
|
||||
@@ -160,7 +160,7 @@
|
||||
|
||||
/datum/pai_software/med_records/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
. = ..()
|
||||
var/mob/living/silicon/pai/P = usr
|
||||
var/mob/living/silicon/pai/P = ui.user
|
||||
if(!istype(P))
|
||||
return
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
|
||||
/datum/pai_software/sec_records/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
. = ..()
|
||||
var/mob/living/silicon/pai/P = usr
|
||||
var/mob/living/silicon/pai/P = ui.user
|
||||
if(!istype(P))
|
||||
return
|
||||
|
||||
@@ -267,7 +267,7 @@
|
||||
return data
|
||||
|
||||
/datum/pai_software/door_jack/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
|
||||
var/mob/living/silicon/pai/P = usr
|
||||
var/mob/living/silicon/pai/P = ui.user
|
||||
if(!istype(P) || ..())
|
||||
return TRUE
|
||||
|
||||
@@ -482,7 +482,7 @@
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/mob/living/silicon/pai/user = usr
|
||||
var/mob/living/silicon/pai/user = ui.user
|
||||
if(istype(user))
|
||||
var/obj/item/radio/integrated/signal/R = user.sradio
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/drone_control/tgui_act(action, params)
|
||||
/obj/machinery/computer/drone_control/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
@@ -75,10 +75,10 @@
|
||||
return
|
||||
|
||||
drone_call_area = t_area
|
||||
to_chat(usr, span_notice("You set the area selector to [drone_call_area]."))
|
||||
to_chat(ui.user, span_notice("You set the area selector to [drone_call_area]."))
|
||||
|
||||
if("ping")
|
||||
to_chat(usr, span_notice("You issue a maintenance request for all active drones, highlighting [drone_call_area]."))
|
||||
to_chat(ui.user, span_notice("You issue a maintenance request for all active drones, highlighting [drone_call_area]."))
|
||||
for(var/mob/living/silicon/robot/drone/D in player_list)
|
||||
if(D.stat == 0)
|
||||
to_chat(D, "-- Maintenance drone presence requested in: [drone_call_area].")
|
||||
@@ -87,16 +87,16 @@
|
||||
var/mob/living/silicon/robot/drone/D = locate(params["ref"])
|
||||
|
||||
if(D.stat != 2)
|
||||
to_chat(usr, span_danger("You issue a law synchronization directive for the drone."))
|
||||
to_chat(ui.user, span_danger("You issue a law synchronization directive for the drone."))
|
||||
D.law_resync()
|
||||
|
||||
if("shutdown")
|
||||
var/mob/living/silicon/robot/drone/D = locate(params["ref"])
|
||||
|
||||
if(D.stat != 2)
|
||||
to_chat(usr, span_danger("You issue a kill command for the unfortunate drone."))
|
||||
message_admins("[key_name_admin(usr)] issued kill order for drone [key_name_admin(D)] from control console.")
|
||||
log_game("[key_name(usr)] issued kill order for [key_name(src)] from control console.")
|
||||
to_chat(ui.user, span_danger("You issue a kill command for the unfortunate drone."))
|
||||
message_admins("[key_name_admin(ui.user)] issued kill order for drone [key_name_admin(D)] from control console.")
|
||||
log_game("[key_name(ui.user)] issued kill order for [key_name(src)] from control console.")
|
||||
D.shut_down()
|
||||
|
||||
if("search_fab")
|
||||
@@ -108,10 +108,10 @@
|
||||
continue
|
||||
|
||||
dronefab = fab
|
||||
to_chat(usr, span_notice("Drone fabricator located."))
|
||||
to_chat(ui.user, span_notice("Drone fabricator located."))
|
||||
return
|
||||
|
||||
to_chat(usr, span_danger("Unable to locate drone fabricator."))
|
||||
to_chat(ui.user, span_danger("Unable to locate drone fabricator."))
|
||||
|
||||
if("toggle_fab")
|
||||
if(!dronefab)
|
||||
@@ -119,8 +119,8 @@
|
||||
|
||||
if(get_dist(src,dronefab) > 3)
|
||||
dronefab = null
|
||||
to_chat(usr, span_danger("Unable to locate drone fabricator."))
|
||||
to_chat(ui.user, span_danger("Unable to locate drone fabricator."))
|
||||
return
|
||||
|
||||
dronefab.produce_drones = !dronefab.produce_drones
|
||||
to_chat(usr, span_notice("You [dronefab.produce_drones ? "enable" : "disable"] drone production in the nearby fabricator."))
|
||||
to_chat(ui.user, span_notice("You [dronefab.produce_drones ? "enable" : "disable"] drone production in the nearby fabricator."))
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/datum/tgui_module/robot_ui/tgui_act(action, params)
|
||||
/datum/tgui_module/robot_ui/tgui_act(action, params, datum/tgui/ui)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
@@ -126,13 +126,13 @@
|
||||
if(istype(C))
|
||||
C.toggled = !C.toggled
|
||||
if(C.toggled)
|
||||
to_chat(usr, span_notice("You enable [C]."))
|
||||
to_chat(ui.user, span_notice("You enable [C]."))
|
||||
else
|
||||
to_chat(usr, span_warning("You disable [C]."))
|
||||
to_chat(ui.user, span_warning("You disable [C]."))
|
||||
. = TRUE
|
||||
if("toggle_module")
|
||||
if(R.weapon_lock)
|
||||
to_chat(usr, span_danger("Error: Modules locked."))
|
||||
to_chat(ui.user, span_danger("Error: Modules locked."))
|
||||
return
|
||||
var/obj/item/module = locate(params["ref"])
|
||||
if(istype(module))
|
||||
|
||||
Reference in New Issue
Block a user