This commit is contained in:
izac112
2023-06-21 19:03:35 +02:00
346 changed files with 5621 additions and 4174 deletions
@@ -65,13 +65,13 @@
owner = H
if(owner)
GLOB.moved_event.register(owner, src, .proc/update_active_camera_screen)
GLOB.moved_event.register(owner, src, PROC_REF(update_active_camera_screen))
check_whitelist = check_species_whitelist
whitelist = species_whitelist
blacklist = species_blacklist
/datum/tgui_module/appearance_changer/Destroy()
GLOB.moved_event.unregister(owner, src, .proc/update_active_camera_screen)
GLOB.moved_event.unregister(owner, src, PROC_REF(update_active_camera_screen))
last_camera_turf = null
qdel(cam_screen)
QDEL_LIST(cam_plane_masters)
+8 -9
View File
@@ -34,7 +34,7 @@
cam_screen.assigned_map = map_name
cam_screen.del_on_map_removal = FALSE
cam_screen.screen_loc = "[map_name]:1,1"
cam_plane_masters = get_tgui_plane_masters()
for(var/obj/screen/instance as anything in cam_plane_masters)
@@ -68,7 +68,7 @@
/datum/tgui_module/camera/Destroy()
if(active_camera)
GLOB.moved_event.unregister(active_camera, src, .proc/update_active_camera_screen)
GLOB.moved_event.unregister(active_camera, src, PROC_REF(update_active_camera_screen))
active_camera = null
last_camera_turf = null
qdel(cam_screen)
@@ -131,7 +131,7 @@
/datum/tgui_module/camera/tgui_act(action, params)
if(..())
return TRUE
if(action && !issilicon(usr))
playsound(tgui_host(), "terminal_type", 50, 1)
@@ -140,9 +140,9 @@
var/list/cameras = get_available_cameras(usr)
var/obj/machinery/camera/C = cameras["[ckey(c_tag)]"]
if(active_camera)
GLOB.moved_event.unregister(active_camera, src, .proc/update_active_camera_screen)
GLOB.moved_event.unregister(active_camera, src, PROC_REF(update_active_camera_screen))
active_camera = C
GLOB.moved_event.register(active_camera, src, .proc/update_active_camera_screen)
GLOB.moved_event.register(active_camera, src, PROC_REF(update_active_camera_screen))
playsound(tgui_host(), get_sfx("terminal_type"), 25, FALSE)
update_active_camera_screen()
return TRUE
@@ -167,9 +167,9 @@
if(target)
if(active_camera)
GLOB.moved_event.unregister(active_camera, src, .proc/update_active_camera_screen)
GLOB.moved_event.unregister(active_camera, src, PROC_REF(update_active_camera_screen))
active_camera = target
GLOB.moved_event.register(active_camera, src, .proc/update_active_camera_screen)
GLOB.moved_event.register(active_camera, src, PROC_REF(update_active_camera_screen))
playsound(tgui_host(), get_sfx("terminal_type"), 25, FALSE)
update_active_camera_screen()
. = TRUE
@@ -273,7 +273,7 @@
// Turn off the console
if(length(concurrent_users) == 0 && is_living)
if(active_camera)
GLOB.moved_event.unregister(active_camera, src, .proc/update_active_camera_screen)
GLOB.moved_event.unregister(active_camera, src, PROC_REF(update_active_camera_screen))
active_camera = null
playsound(tgui_host(), 'sound/machines/terminal_off.ogg', 25, FALSE)
@@ -298,4 +298,3 @@
/datum/tgui_module/camera/bigscreen/tgui_state(mob/user)
return GLOB.tgui_physical_state_bigscreen
+14 -14
View File
@@ -30,7 +30,7 @@
var/list/paired_map = list()
var/obj/item/modular_computer/mc_host = tgui_host()
if(istype(mc_host))
for(var/weakref/wr as anything in mc_host.paired_uavs)
for(var/datum/weakref/wr as anything in mc_host.paired_uavs)
var/obj/item/device/uav/U = wr.resolve()
paired_map.Add(list(list("name" = "[U ? U.nickname : "!!Missing!!"]", "uavref" = "\ref[U]")))
@@ -40,7 +40,7 @@
/datum/tgui_module/uav/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state)
if(..())
return TRUE
switch(action)
if("switch_uav")
var/obj/item/device/uav/U = locate(params["switch_uav"]) //This is a \ref to the UAV itself
@@ -59,9 +59,9 @@
var/refstring = params["del_uav"] //This is a \ref to the UAV itself
var/obj/item/modular_computer/mc_host = tgui_host()
//This is so we can really scrape up any weakrefs that can't resolve
for(var/weakref/wr in mc_host.paired_uavs)
if(wr.ref == refstring)
if(current_uav?.weakref == wr)
for(var/datum/weakref/wr in mc_host.paired_uavs)
if(wr.reference == refstring)
if(current_uav?.weak_reference == wr)
set_current(null)
LAZYREMOVE(mc_host.paired_uavs, wr)
return TRUE
@@ -82,7 +82,7 @@
else if(current_uav.toggle_power())
//Clean up viewers faster
if(LAZYLEN(viewers))
for(var/weakref/W in viewers)
for(var/datum/weakref/W in viewers)
var/M = W.resolve()
if(M)
unlook(M)
@@ -94,10 +94,10 @@
signal_strength = 0
current_uav = U
RegisterSignal(U, COMSIG_MOVABLE_Z_CHANGED, .proc/current_uav_changed_z)
RegisterSignal(U, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(current_uav_changed_z))
if(LAZYLEN(viewers))
for(var/weakref/W in viewers)
for(var/datum/weakref/W in viewers)
var/M = W.resolve()
if(M)
look(M)
@@ -111,7 +111,7 @@
current_uav = null
if(LAZYLEN(viewers))
for(var/weakref/W in viewers)
for(var/datum/weakref/W in viewers)
var/M = W.resolve()
if(M)
to_chat(M, "<span class='warning'>You're disconnected from the UAV's camera!</span>")
@@ -172,7 +172,7 @@
/* All handling viewers */
/datum/tgui_module/uav/Destroy()
if(LAZYLEN(viewers))
for(var/weakref/W in viewers)
for(var/datum/weakref/W in viewers)
var/M = W.resolve()
if(M)
unlook(M)
@@ -191,7 +191,7 @@
unlook(user)
/datum/tgui_module/uav/proc/viewing_uav(mob/user)
return (weakref(user) in viewers)
return (WEAKREF(user) in viewers)
/datum/tgui_module/uav/proc/look(mob/user)
if(issilicon(user)) //Too complicated for me to want to mess with at the moment
@@ -205,14 +205,14 @@
user.set_machine(tgui_host())
user.reset_view(current_uav)
current_uav.add_master(user)
LAZYDISTINCTADD(viewers, weakref(user))
LAZYDISTINCTADD(viewers, WEAKREF(user))
/datum/tgui_module/uav/proc/unlook(mob/user)
user.unset_machine()
user.reset_view()
if(current_uav)
current_uav.remove_master(user)
LAZYREMOVE(viewers, weakref(user))
LAZYREMOVE(viewers, WEAKREF(user))
/datum/tgui_module/uav/check_eye(mob/user)
if(get_dist(user, tgui_host()) > 1 || user.blinded || !current_uav)
@@ -239,7 +239,7 @@
/datum/tgui_module/uav/apply_visual(mob/M)
if(!M.client)
return
if(weakref(M) in viewers)
if(WEAKREF(M) in viewers)
M.overlay_fullscreen("fishbed",/obj/screen/fullscreen/fishbed)
M.overlay_fullscreen("scanlines",/obj/screen/fullscreen/scanline)
+5 -5
View File
@@ -11,7 +11,7 @@
/datum/tgui_module/ship/Destroy()
if(LAZYLEN(viewers))
for(var/weakref/W in viewers)
for(var/datum/weakref/W in viewers)
var/M = W.resolve()
if(M)
unlook(M)
@@ -56,16 +56,16 @@
user.reset_view(linked)
user.set_viewsize(world.view + extra_view)
GLOB.moved_event.register(user, src, /datum/tgui_module/ship/proc/unlook)
LAZYDISTINCTADD(viewers, weakref(user))
LAZYDISTINCTADD(viewers, WEAKREF(user))
/datum/tgui_module/ship/proc/unlook(var/mob/user)
user.reset_view()
user.set_viewsize() // reset to default
GLOB.moved_event.unregister(user, src, /datum/tgui_module/ship/proc/unlook)
LAZYREMOVE(viewers, weakref(user))
LAZYREMOVE(viewers, WEAKREF(user))
/datum/tgui_module/ship/proc/viewing_overmap(mob/user)
return (weakref(user) in viewers)
return (WEAKREF(user) in viewers)
/datum/tgui_module/ship/check_eye(var/mob/user)
if(!get_dist(user, tgui_host()) > 1 || user.blinded || !linked)
@@ -457,4 +457,4 @@
/datum/tgui_module/ship/fullmonty/attempt_hook_up_recursive()
return
/datum/tgui_module/ship/fullmonty/attempt_hook_up()
return
return
+1 -1
View File
@@ -197,7 +197,7 @@
return
//if(!COOLDOWN_FINISHED(src, refresh_cooldown))
//refreshing = TRUE
//addtimer(CALLBACK(src, .proc/send_full_update), TGUI_REFRESH_FULL_UPDATE_COOLDOWN, TIMER_UNIQUE)
//addtimer(CALLBACK(src, PROC_REF(send_full_update)), TGUI_REFRESH_FULL_UPDATE_COOLDOWN, TIMER_UNIQUE)
//return
//refreshing = FALSE
var/should_update_data = force || status >= STATUS_UPDATE