From 1d5fb3e16bd915a8f4a9d33ce197ac10f09ead1d Mon Sep 17 00:00:00 2001 From: Morrow Date: Thu, 21 Sep 2023 03:51:00 -0400 Subject: [PATCH] Initial --- code/__DEFINES/dcs/signals/signals_client.dm | 6 ++ code/_onclick/click.dm | 2 +- code/_onclick/hud/alien.dm | 4 +- code/_onclick/hud/fullscreen.dm | 12 +-- code/_onclick/hud/ghost.dm | 4 +- code/_onclick/hud/hud.dm | 44 ++++++---- code/_onclick/hud/human.dm | 82 ++++++++++--------- code/_onclick/hud/map_popups.dm | 2 +- code/_onclick/hud/rendering/render_plate.dm | 2 +- code/_onclick/hud/robot.dm | 6 +- code/_onclick/hud/screen_object_holder.dm | 10 +-- code/_onclick/hud/screen_objects.dm | 6 +- code/controllers/subsystem/minimap.dm | 8 +- code/datums/action.dm | 12 +-- code/game/gamemodes/cm_self_destruct.dm | 4 +- code/game/objects/items.dm | 2 +- .../objects/items/devices/motion_detector.dm | 4 +- code/game/objects/items/misc.dm | 2 +- code/game/objects/items/storage/storage.dm | 41 +++++----- .../view_variables/color_matrix_editor.dm | 4 +- code/modules/buildmode/buildmode.dm | 14 ++-- code/modules/client/client_procs.dm | 2 +- code/modules/flufftext/Hallucination.dm | 4 +- code/modules/maptext_alerts/screen_alerts.dm | 6 +- code/modules/maptext_alerts/text_blurbs.dm | 4 +- code/modules/mob/dead/observer/observer.dm | 19 ++++- code/modules/mob/inventory.dm | 3 +- .../mob/living/carbon/human/update_icons.dm | 34 ++++---- .../living/carbon/xenomorph/update_icons.dm | 8 +- .../mob/living/silicon/robot/inventory.dm | 12 +-- code/modules/mob/living/silicon/robot/life.dm | 4 +- .../mob/new_player/preferences_setup.dm | 6 +- code/modules/projectiles/gun_attachables.dm | 4 +- code/modules/recycling/sortingmachinery.dm | 2 +- 34 files changed, 210 insertions(+), 169 deletions(-) diff --git a/code/__DEFINES/dcs/signals/signals_client.dm b/code/__DEFINES/dcs/signals/signals_client.dm index 639721fae260..3968f654c486 100644 --- a/code/__DEFINES/dcs/signals/signals_client.dm +++ b/code/__DEFINES/dcs/signals/signals_client.dm @@ -21,3 +21,9 @@ /// Called after a client logs into a mob: (mob) #define COMSIG_CLIENT_MOB_LOGIN "client_mob_changed" + +/// Called when something is added to a client's screen : /client/proc/add_to_screen(screen_add) +#define COMSIG_CLIENT_SCREEN_ADD "client_screen_add" + +/// Called when something is removed from a client's screen : /client/proc/remove_from_screen(screen_remove) +#define COMSIG_CLIENT_SCREEN_REMOVE "client_screen_remove" diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 86390718b6ca..3b8ba26c07e9 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -357,7 +357,7 @@ /client/proc/create_clickcatcher() if(!void) void = new() - screen += void + add_to_screen(void) /client/proc/apply_clickcatcher() create_clickcatcher() diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm index a53e82730732..d1421cb7295d 100644 --- a/code/_onclick/hud/alien.dm +++ b/code/_onclick/hud/alien.dm @@ -64,10 +64,10 @@ var/mob/living/carbon/xenomorph/H = mymob if(hud_version != HUD_STYLE_NOHUD) if(H.r_hand) - H.client.screen += H.r_hand + H.client.add_to_screen(H.r_hand) H.r_hand.screen_loc = ui_alien_datum.hud_slot_offset(H.r_hand, ui_alien_datum.ui_rhand) if(H.l_hand) - H.client.screen += H.l_hand + H.client.add_to_screen(H.l_hand) H.l_hand.screen_loc = ui_alien_datum.hud_slot_offset(H.l_hand, ui_alien_datum.ui_lhand) else if(H.r_hand) diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm index fec62c35317f..0bd2206091ba 100644 --- a/code/_onclick/hud/fullscreen.dm +++ b/code/_onclick/hud/fullscreen.dm @@ -17,7 +17,7 @@ screen.severity = severity if (client && screen.should_show_to(src)) screen.update_for_view(client.view) - client.screen += screen + client.add_to_screen(screen) return screen @@ -33,12 +33,12 @@ addtimer(CALLBACK(src, PROC_REF(clear_fullscreen_after_animate), screen), animated, TIMER_CLIENT_TIME) else if(client) - client.screen -= screen + client.remove_from_screen(screen) qdel(screen) /mob/proc/clear_fullscreen_after_animate(atom/movable/screen/fullscreen/screen) if(client) - client.screen -= screen + client.remove_from_screen(screen) qdel(screen) /mob/proc/clear_fullscreens() @@ -48,7 +48,7 @@ /mob/proc/hide_fullscreens() if(client) for(var/category in fullscreens) - client.screen -= fullscreens[category] + client.remove_from_screen(fullscreens[category]) /mob/proc/reload_fullscreens() if(client) @@ -57,9 +57,9 @@ screen = fullscreens[category] if(screen.should_show_to(src)) screen.update_for_view(client.view) - client.screen |= screen + client.add_to_screen(screen) else - client.screen -= screen + client.remove_from_screen(screen) /atom/movable/screen/fullscreen diff --git a/code/_onclick/hud/ghost.dm b/code/_onclick/hud/ghost.dm index 8a3f7d9d6a31..06251a9d4848 100644 --- a/code/_onclick/hud/ghost.dm +++ b/code/_onclick/hud/ghost.dm @@ -82,6 +82,6 @@ var/mob/screenmob = viewmob || mymob if(!hud_shown) - screenmob.client.screen -= static_inventory + screenmob.client.remove_from_screen(static_inventory) else - screenmob.client.screen += static_inventory + screenmob.client.add_to_screen(static_inventory) diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 392f3ae9a060..81f1f24b0576 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -189,43 +189,43 @@ if(HUD_STYLE_STANDARD) //Default HUD hud_shown = 1 //Governs behavior of other procs if(static_inventory.len) - screenmob.client.screen += static_inventory + screenmob.client.add_to_screen(static_inventory) if(toggleable_inventory.len && inventory_shown) - screenmob.client.screen += toggleable_inventory + screenmob.client.add_to_screen(toggleable_inventory) if(hotkeybuttons.len && !hotkey_ui_hidden) - screenmob.client.screen += hotkeybuttons + screenmob.client.add_to_screen(hotkeybuttons) if(infodisplay.len) - screenmob.client.screen += infodisplay + screenmob.client.add_to_screen(infodisplay) if(HUD_STYLE_REDUCED) //Reduced HUD hud_shown = 0 //Governs behavior of other procs if(static_inventory.len) - screenmob.client.screen -= static_inventory + screenmob.client.remove_from_screen(static_inventory) if(toggleable_inventory.len) - screenmob.client.screen -= toggleable_inventory + screenmob.client.remove_from_screen(toggleable_inventory) if(hotkeybuttons.len) - screenmob.client.screen -= hotkeybuttons + screenmob.client.remove_from_screen(hotkeybuttons) if(infodisplay.len) - screenmob.client.screen += infodisplay + screenmob.client.add_to_screen(infodisplay) //These ones are a part of 'static_inventory', 'toggleable_inventory' or 'hotkeybuttons' but we want them to stay if(l_hand_hud_object) - screenmob.client.screen += l_hand_hud_object //we want the hands to be visible + screenmob.client.add_to_screen(l_hand_hud_object) //we want the hands to be visible if(r_hand_hud_object) - screenmob.client.screen += r_hand_hud_object //we want the hands to be visible + screenmob.client.add_to_screen(r_hand_hud_object) //we want the hands to be visible if(action_intent) - screenmob.client.screen += action_intent //we want the intent switcher visible + screenmob.client.add_to_screen(action_intent) //we want the intent switcher visible if(HUD_STYLE_NOHUD) //No HUD hud_shown = 0 //Governs behavior of other procs if(static_inventory.len) - screenmob.client.screen -= static_inventory + screenmob.client.remove_from_screen(static_inventory) if(toggleable_inventory.len) - screenmob.client.screen -= toggleable_inventory + screenmob.client.remove_from_screen(toggleable_inventory) if(hotkeybuttons.len) - screenmob.client.screen -= hotkeybuttons + screenmob.client.remove_from_screen(hotkeybuttons) if(infodisplay.len) - screenmob.client.screen -= infodisplay + screenmob.client.remove_from_screen(infodisplay) hud_version = display_hud_version persistent_inventory_update(screenmob) @@ -247,7 +247,7 @@ for(var/thing in plane_masters) var/atom/movable/screen/plane_master/PM = plane_masters[thing] PM.backdrop(mymob) - mymob.client.screen += PM + mymob.client.add_to_screen(PM) /datum/hud/human/show_hud(version = 0, mob/viewmob) . = ..() @@ -412,7 +412,7 @@ if(!hud_shown) for(var/category in alerts) var/atom/movable/screen/alert/alert = alerts[category] - screenmob.client.screen -= alert + screenmob.client.remove_from_screen(alert) return TRUE var/c = 0 for(var/category in alerts) @@ -432,8 +432,16 @@ else . = "" alert.screen_loc = . - screenmob.client.screen |= alert + screenmob.client.add_to_screen(alert) if(!viewmob) for(var/obs in mymob.observers) reorganize_alerts(obs) return TRUE + +/client/proc/add_to_screen(screen_add) + screen += screen_add + SEND_SIGNAL(src, COMSIG_CLIENT_SCREEN_ADD, screen_add) + +/client/proc/remove_from_screen(screen_remove) + screen -= screen_remove + SEND_SIGNAL(src, COMSIG_CLIENT_SCREEN_REMOVE, screen_remove) diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 6cf43dc343b7..d514bdedfcdf 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -105,10 +105,10 @@ set desc = "This disables or enables the user interface buttons which can be used with hotkeys." if(hud_used.hotkey_ui_hidden) - client.screen += hud_used.hotkeybuttons + client.add_to_screen(hud_used.hotkeybuttons) hud_used.hotkey_ui_hidden = 0 else - client.screen -= hud_used.hotkeybuttons + client.remove_from_screen(hud_used.hotkeybuttons) hud_used.hotkey_ui_hidden = TRUE /datum/hud/human/hidden_inventory_update(mob/viewer) @@ -120,53 +120,57 @@ inventory_shown = FALSE return //species without inv slots don't show items. - if(screenmob.hud_used.inventory_shown && screenmob.hud_used.hud_shown) + if(H.hud_used.inventory_shown && H.hud_used.hud_shown) if(H.shoes) H.shoes.screen_loc = ui_datum.ui_shoes - screenmob.client.screen += H.shoes + screenmob.client.add_to_screen(H.shoes) if(H.gloves) H.gloves.screen_loc = ui_datum.ui_gloves - screenmob.client.screen += H.gloves + screenmob.client.add_to_screen(H.gloves) if(H.wear_l_ear) H.wear_l_ear.screen_loc = ui_datum.ui_wear_l_ear - screenmob.client.screen += H.wear_l_ear + screenmob.client.add_to_screen(H.wear_l_ear) if(H.wear_r_ear) H.wear_r_ear.screen_loc = ui_datum.ui_wear_r_ear - screenmob.client.screen += H.wear_r_ear + screenmob.client.add_to_screen(H.wear_r_ear) if(H.glasses) H.glasses.screen_loc = ui_datum.ui_glasses - screenmob.client.screen += H.glasses + screenmob.client.add_to_screen(H.glasses) if(H.w_uniform) H.w_uniform.screen_loc = ui_datum.ui_iclothing - screenmob.client.screen += H.w_uniform + screenmob.client.add_to_screen(H.w_uniform) if(H.wear_suit) H.wear_suit.screen_loc = ui_datum.ui_oclothing - screenmob.client.screen += H.wear_suit + screenmob.client.add_to_screen(H.wear_suit) if(H.wear_mask) H.wear_mask.screen_loc = ui_datum.ui_mask - screenmob.client.screen += H.wear_mask + screenmob.client.add_to_screen(H.wear_mask) if(H.head) H.head.screen_loc = ui_datum.ui_head - screenmob.client.screen += H.head + screenmob.client.add_to_screen(H.head) else if(H.shoes) - screenmob.client.screen -= H.shoes + screenmob.client.remove_from_screen(H.shoes) if(H.gloves) - screenmob.client.screen -= H.gloves + screenmob.client.remove_from_screen(H.gloves) if(H.wear_r_ear) - screenmob.client.screen -= H.wear_r_ear + screenmob.client.remove_from_screen(H.wear_r_ear) if(H.wear_l_ear) - screenmob.client.screen -= H.wear_l_ear + screenmob.client.remove_from_screen(H.wear_l_ear) if(H.glasses) - screenmob.client.screen -= H.glasses + screenmob.client.remove_from_screen(H.glasses) if(H.w_uniform) - screenmob.client.screen -= H.w_uniform + screenmob.client.remove_from_screen(H.w_uniform) if(H.wear_suit) - screenmob.client.screen -= H.wear_suit + screenmob.client.remove_from_screen(H.wear_suit) if(H.wear_mask) - screenmob.client.screen -= H.wear_mask + screenmob.client.remove_from_screen(H.wear_mask) if(H.head) - screenmob.client.screen -= H.head + screenmob.client.remove_from_screen(H.head) + + if(screenmob == mymob) + for(var/M in mymob.observers) + hidden_inventory_update(M) /datum/hud/human/persistent_inventory_update(mob/viewer) if(!mymob) @@ -177,53 +181,57 @@ var/mob/living/carbon/human/H = mymob var/mob/screenmob = viewer || H - if(screenmob.hud_used) - if(screenmob.hud_used.hud_shown) + if(H.hud_used) + if(H.hud_used.hud_shown) if(H.s_store) H.s_store.screen_loc = ui_datum.hud_slot_offset(H.s_store, ui_datum.ui_sstore1) - screenmob.client.screen += H.s_store + screenmob.client.add_to_screen(H.s_store) if(H.wear_id) H.wear_id.screen_loc = ui_datum.hud_slot_offset(H.wear_id, ui_datum.ui_id) - screenmob.client.screen += H.wear_id + screenmob.client.add_to_screen(H.wear_id) if(H.belt) H.belt.screen_loc = ui_datum.hud_slot_offset(H.belt, ui_datum.ui_belt) - screenmob.client.screen += H.belt + screenmob.client.add_to_screen(H.belt) if(H.back) H.back.screen_loc = ui_datum.hud_slot_offset(H.back, ui_datum.ui_back) - screenmob.client.screen += H.back + screenmob.client.add_to_screen(H.back) if(H.l_store) H.l_store.screen_loc = ui_datum.hud_slot_offset(H.l_store, ui_datum.ui_storage1) - screenmob.client.screen += H.l_store + screenmob.client.add_to_screen(H.l_store) if(H.r_store) H.r_store.screen_loc = ui_datum.hud_slot_offset(H.r_store, ui_datum.ui_storage2) - screenmob.client.screen += H.r_store + screenmob.client.add_to_screen(H.r_store) else if(H.s_store) - screenmob.client.screen -= H.s_store + screenmob.client.remove_from_screen(H.s_store) if(H.wear_id) - screenmob.client.screen -= H.wear_id + screenmob.client.remove_from_screen(H.wear_id) if(H.belt) - screenmob.client.screen -= H.belt + screenmob.client.remove_from_screen(H.belt) if(H.back) - screenmob.client.screen -= H.back + screenmob.client.remove_from_screen(H.back) if(H.l_store) - screenmob.client.screen -= H.l_store + screenmob.client.remove_from_screen(H.l_store) if(H.r_store) - screenmob.client.screen -= H.r_store + screenmob.client.remove_from_screen(H.r_store) if(hud_version != HUD_STYLE_NOHUD) if(H.r_hand) H.r_hand.screen_loc = ui_datum.hud_slot_offset(H.r_hand, ui_datum.ui_rhand) - H.client.screen += H.r_hand + screenmob.client.add_to_screen(H.r_hand) if(H.l_hand) H.l_hand.screen_loc = ui_datum.hud_slot_offset(H.l_hand, ui_datum.ui_lhand) - H.client.screen += H.l_hand + screenmob.client.add_to_screen(H.l_hand) else if(H.r_hand) H.r_hand.screen_loc = null if(H.l_hand) H.l_hand.screen_loc = null + if(screenmob == mymob) + for(var/M in mymob.observers) + persistent_inventory_update(M) + /datum/hud/human/proc/draw_inventory_slots(gear, datum/custom_hud/ui_datum, ui_alpha, ui_color) for(var/gear_slot in gear) var/atom/movable/screen/inventory/inv_box = new /atom/movable/screen/inventory() diff --git a/code/_onclick/hud/map_popups.dm b/code/_onclick/hud/map_popups.dm index b5ee41e6d54c..aed6b46a7905 100644 --- a/code/_onclick/hud/map_popups.dm +++ b/code/_onclick/hud/map_popups.dm @@ -108,7 +108,7 @@ if(!screen_map.Find(screen_obj)) screen_map += screen_obj if(!screen.Find(screen_obj)) - screen += screen_obj + add_to_screen(screen_obj) /** * Clears the map of registered screen objects. diff --git a/code/_onclick/hud/rendering/render_plate.dm b/code/_onclick/hud/rendering/render_plate.dm index a64284ca13a9..18236c6ee759 100644 --- a/code/_onclick/hud/rendering/render_plate.dm +++ b/code/_onclick/hud/rendering/render_plate.dm @@ -74,6 +74,6 @@ relay.blend_mode = blend_mode relay.mouse_opacity = mouse_opacity relay.name = render_target - mymob.client.screen += relay + mymob.client.add_to_screen(relay) if(blend_mode != BLEND_MULTIPLY) blend_mode = BLEND_DEFAULT diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 565a23d1bbeb..af961f82bab2 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -134,13 +134,13 @@ if(hud_shown) if(R.module_state_1) R.module_state_1.screen_loc = ui_robot_datum.ui_inv1 - R.client.screen += R.module_state_1 + R.client.add_to_screen(R.module_state_1) if(R.module_state_2) R.module_state_2.screen_loc = ui_robot_datum.ui_inv2 - R.client.screen += R.module_state_2 + R.client.add_to_screen(R.module_state_2) if(R.module_state_3) R.module_state_3.screen_loc = ui_robot_datum.ui_inv3 - R.client.screen += R.module_state_3 + R.client.add_to_screen(R.module_state_3) else if(R.module_state_1) R.module_state_1.screen_loc = null diff --git a/code/_onclick/hud/screen_object_holder.dm b/code/_onclick/hud/screen_object_holder.dm index ba6a9b961721..91b4e593c7d6 100644 --- a/code/_onclick/hud/screen_object_holder.dm +++ b/code/_onclick/hud/screen_object_holder.dm @@ -24,14 +24,14 @@ ASSERT(istype(screen_object)) screen_objects += screen_object - client?.screen += screen_object + client?.add_to_screen(screen_object) /// Gives the screen object to the client, but does not qdel it when it's cleared /datum/screen_object_holder/proc/give_protected_screen_object(atom/screen_object) ASSERT(istype(screen_object)) protected_screen_objects += screen_object - client?.screen += screen_object + client?.add_to_screen(screen_object) /datum/screen_object_holder/proc/remove_screen_object(atom/screen_object) ASSERT(istype(screen_object)) @@ -39,11 +39,11 @@ screen_objects -= screen_object protected_screen_objects -= screen_object - client?.screen -= screen_object + client?.remove_from_screen(screen_object) /datum/screen_object_holder/proc/clear() - client?.screen -= screen_objects - client?.screen -= protected_screen_objects + client?.remove_from_screen(screen_objects) + client?.remove_from_screen(protected_screen_objects) QDEL_LIST(screen_objects) protected_screen_objects.Cut() diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 685fc3d5498b..35b6073ee41b 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -37,6 +37,8 @@ /atom/movable/screen/close/clicked(mob/user) + if(isobserver(user)) + return TRUE if(master) if(isstorage(master)) var/obj/item/storage/master_storage = master @@ -612,10 +614,10 @@ if(user && user.hud_used) if(user.hud_used.inventory_shown) user.hud_used.inventory_shown = 0 - user.client.screen -= user.hud_used.toggleable_inventory + user.client.remove_from_screen(user.hud_used.toggleable_inventory) else user.hud_used.inventory_shown = 1 - user.client.screen += user.hud_used.toggleable_inventory + user.client.add_to_screen(user.hud_used.toggleable_inventory) user.hud_used.hidden_inventory_update() return 1 diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm index b154c7673855..6f5b9303a91f 100644 --- a/code/controllers/subsystem/minimap.dm +++ b/code/controllers/subsystem/minimap.dm @@ -390,9 +390,9 @@ SUBSYSTEM_DEF(minimaps) if(!map) return if(minimap_displayed) - owner.client.screen -= map + owner.client.remove_from_screen(map) else - owner.client.screen += map + owner.client.add_to_screen(map) minimap_displayed = !minimap_displayed /datum/action/minimap/give_to(mob/target) @@ -415,7 +415,7 @@ SUBSYSTEM_DEF(minimaps) /datum/action/minimap/remove_from(mob/target) . = ..() if(minimap_displayed) - owner?.client?.screen -= map + owner?.client?.remove_from_screen(map) minimap_displayed = FALSE /** @@ -424,7 +424,7 @@ SUBSYSTEM_DEF(minimaps) /datum/action/minimap/proc/on_owner_z_change(atom/movable/source, oldz, newz) SIGNAL_HANDLER if(minimap_displayed) - owner.client.screen -= map + owner.client.remove_from_screen(map) minimap_displayed = FALSE map = null if(!SSminimaps.minimaps_by_z["[newz]"] || !SSminimaps.minimaps_by_z["[newz]"].hud_image) diff --git a/code/datums/action.dm b/code/datums/action.dm index 8dcf2963590d..47b302e09aac 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -103,7 +103,7 @@ /mob/proc/handle_add_action(datum/action/action) LAZYADD(actions, action) if(client) - client.screen += action.button + client.add_to_screen(action.button) update_action_buttons() /proc/remove_action(mob/L, action_path) @@ -122,7 +122,7 @@ /mob/proc/handle_remove_action(datum/action/action) actions?.Remove(action) if(client) - client.screen -= action.button + client.remove_from_screen(action.button) update_action_buttons() /mob/living/carbon/human/handle_remove_action(datum/action/action) @@ -219,12 +219,12 @@ for(var/datum/action/A in actions) A.button.screen_loc = null if(reload_screen) - client.screen += A.button + client.add_to_screen(A.button) else for(var/datum/action/A in actions) var/atom/movable/screen/action_button/B = A.button if(reload_screen) - client.screen += B + client.add_to_screen(B) if(A.hidden) B.screen_loc = null continue @@ -234,11 +234,11 @@ if(!button_number) hud_used.hide_actions_toggle.screen_loc = null if(reload_screen) - client.screen += hud_used.hide_actions_toggle + client.add_to_screen(hud_used.hide_actions_toggle) return hud_used.hide_actions_toggle.screen_loc = hud_used.hide_actions_toggle.get_button_screen_loc(button_number+1) if(reload_screen) - client.screen += hud_used.hide_actions_toggle + client.add_to_screen(hud_used.hide_actions_toggle) diff --git a/code/game/gamemodes/cm_self_destruct.dm b/code/game/gamemodes/cm_self_destruct.dm index d2f9c4eac784..b86de24eed74 100644 --- a/code/game/gamemodes/cm_self_destruct.dm +++ b/code/game/gamemodes/cm_self_destruct.dm @@ -278,7 +278,7 @@ var/global/datum/authority/branch/evacuation/EvacuationAuthority //This is initi if(play_anim) for(var/mob/current_mob as anything in alive_mobs + dead_mobs) if(current_mob && current_mob.loc && current_mob.client) - current_mob.client.screen |= C //They may have disconnected in the mean time. + current_mob.client.add_to_screen(C) //They may have disconnected in the mean time. sleep(15) //Extra 1.5 seconds to look at the ship. flick(override ? "intro_override" : "intro_nuke", C) @@ -292,7 +292,7 @@ var/global/datum/authority/branch/evacuation/EvacuationAuthority //This is initi current_mob.death(create_cause_data("nuclear explosion")) else if(play_anim) - current_mob.client.screen -= C //those who managed to escape the z level at last second shouldn't have their view obstructed. + current_mob.client.remove_from_screen(C) //those who managed to escape the z level at last second shouldn't have their view obstructed. if(play_anim) flick(ship_status ? "ship_spared" : "ship_destroyed", C) C.icon_state = ship_status ? "summary_spared" : "summary_destroyed" diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a5a5ca40d8fb..60eda23963fd 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -186,7 +186,7 @@ if(istype(S)) for(var/mob/M in S.can_see_content()) if(M.client) - M.client.screen -= src + M.client.remove_from_screen(src) if(ismob(loc)) dropped(loc) diff --git a/code/game/objects/items/devices/motion_detector.dm b/code/game/objects/items/devices/motion_detector.dm index dd0c5d45eda4..9776eae11c8f 100644 --- a/code/game/objects/items/devices/motion_detector.dm +++ b/code/game/objects/items/devices/motion_detector.dm @@ -281,12 +281,12 @@ DB.setDir(initial(DB.dir)) DB.screen_loc = "[Clamp(c_view + 1 - view_x_offset + (target.x - user.x), 1, 2*c_view+1)],[Clamp(c_view + 1 - view_y_offset + (target.y - user.y), 1, 2*c_view+1)]" - user.client.screen += DB + user.client.add_to_screen(DB) addtimer(CALLBACK(src, PROC_REF(clear_pings), user, DB), 1 SECONDS) /obj/item/device/motiondetector/proc/clear_pings(mob/user, obj/effect/detector_blip/DB) if(user.client) - user.client.screen -= DB + user.client.remove_from_screen(DB) /obj/item/device/motiondetector/m717 name = "M717 pocket motion detector" diff --git a/code/game/objects/items/misc.dm b/code/game/objects/items/misc.dm index 5f6ca9a91272..abd8404d6e25 100644 --- a/code/game/objects/items/misc.dm +++ b/code/game/objects/items/misc.dm @@ -204,7 +204,7 @@ return //too deeply nested to access or not being carried by the user. var/obj/item/storage/U = I.loc - user.client.screen -= I + user.client.remove_from_screen(I) U.contents.Remove(I) else if(user.l_hand == I) //in a hand user.drop_l_hand() diff --git a/code/game/objects/items/storage/storage.dm b/code/game/objects/items/storage/storage.dm index 5a6b7d2b9b05..1a2aa115c8ae 100644 --- a/code/game/objects/items/storage/storage.dm +++ b/code/game/objects/items/storage/storage.dm @@ -92,25 +92,24 @@ return if(user.s_active) user.s_active.hide_from(user) - user.client.screen -= boxes - user.client.screen -= storage_start - user.client.screen -= storage_continue - user.client.screen -= storage_end - user.client.screen -= closer - user.client.screen -= contents - user.client.screen += closer - user.client.screen += contents + user.client.remove_from_screen(boxes) + user.client.remove_from_screen(storage_start) + user.client.remove_from_screen(storage_continue) + user.client.remove_from_screen(storage_end) + user.client.remove_from_screen(closer) + user.client.remove_from_screen(contents) + user.client.add_to_screen(closer) + user.client.add_to_screen(contents) if(storage_slots) - user.client.screen += boxes + user.client.add_to_screen(boxes) else - user.client.screen += storage_start - user.client.screen += storage_continue - user.client.screen += storage_end + user.client.add_to_screen(storage_start) + user.client.add_to_screen(storage_continue) + user.client.add_to_screen(storage_end) user.s_active = src add_to_watchers(user) - return /obj/item/storage/proc/add_to_watchers(mob/user) if(!(user in content_watchers)) @@ -125,12 +124,12 @@ ///Used to hide the storage's inventory screen. /obj/item/storage/proc/hide_from(mob/user as mob) if(user.client) - user.client.screen -= src.boxes - user.client.screen -= storage_start - user.client.screen -= storage_continue - user.client.screen -= storage_end - user.client.screen -= src.closer - user.client.screen -= src.contents + user.client.remove_from_screen(src.boxes) + user.client.remove_from_screen(storage_start) + user.client.remove_from_screen(storage_continue) + user.client.remove_from_screen(storage_end) + user.client.remove_from_screen(src.closer) + user.client.remove_from_screen(src.contents) if(user.s_active == src) user.s_active = null del_from_watchers(user) @@ -474,7 +473,7 @@ W is always an item. stop_warning prevents messaging. user may be null.**/ W.on_enter_storage(src) if(user) if (user.client && user.s_active != src) - user.client.screen -= W + user.client.remove_from_screen(W) add_fingerprint(user) if(!prevent_warning) var/visidist = W.w_class >= 3 ? 3 : 1 @@ -500,7 +499,7 @@ W is always an item. stop_warning prevents messaging. user may be null.**/ /obj/item/storage/proc/_item_removal(obj/item/W as obj, atom/new_location) for(var/mob/M in can_see_content()) if(M.client) - M.client.screen -= W + M.client.remove_from_screen(W) if(new_location) if(ismob(new_location)) diff --git a/code/modules/admin/view_variables/color_matrix_editor.dm b/code/modules/admin/view_variables/color_matrix_editor.dm index 73119db62052..078d2fc61221 100644 --- a/code/modules/admin/view_variables/color_matrix_editor.dm +++ b/code/modules/admin/view_variables/color_matrix_editor.dm @@ -19,7 +19,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/color_matrix_proxy_view) /atom/movable/screen/color_matrix_proxy_view/Destroy() for (var/plane_master in plane_masters) - client?.screen -= plane_master + client?.remove_from_screen(plane_master) qdel(plane_master) client?.clear_map(assigned_map) @@ -40,7 +40,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/color_matrix_proxy_view) for (var/plane_master_type in subtypesof(/atom/movable/screen/plane_master) - /atom/movable/screen/plane_master/blackness) var/atom/movable/screen/plane_master/plane_master = new plane_master_type() plane_master.screen_loc = "[assigned_map]:CENTER" - client?.screen |= plane_master + client?.add_to_screen(plane_master) plane_masters += plane_master diff --git a/code/modules/buildmode/buildmode.dm b/code/modules/buildmode/buildmode.dm index 6e652192b37c..eeab65ec031a 100644 --- a/code/modules/buildmode/buildmode.dm +++ b/code/modules/buildmode/buildmode.dm @@ -31,13 +31,13 @@ holder.player_details.post_login_callbacks += li_cb holder.show_popup_menus = FALSE create_buttons() - holder.screen += buttons + holder.add_to_screen(buttons) holder.click_intercept = src mode.enter_mode(src) /datum/buildmode/proc/quit() mode.exit_mode(src) - holder.screen -= buttons + holder.remove_from_screen(buttons) holder.click_intercept = null holder.show_popup_menus = TRUE qdel(src) @@ -53,7 +53,7 @@ /datum/buildmode/proc/post_login() // since these will get wiped upon login - holder?.screen += buttons + holder?.add_to_screen(buttons) // re-open the according switch mode switch(switch_state) if(BM_SWITCHSTATE_MODE) @@ -103,11 +103,11 @@ /datum/buildmode/proc/open_modeswitch() switch_state = BM_SWITCHSTATE_MODE - holder.screen += modeswitch_buttons + holder.add_to_screen(modeswitch_buttons) /datum/buildmode/proc/close_modeswitch() switch_state = BM_SWITCHSTATE_NONE - holder.screen -= modeswitch_buttons + holder.remove_from_screen(modeswitch_buttons) /datum/buildmode/proc/toggle_dirswitch() if(switch_state == BM_SWITCHSTATE_DIR) @@ -118,11 +118,11 @@ /datum/buildmode/proc/open_dirswitch() switch_state = BM_SWITCHSTATE_DIR - holder.screen += dirswitch_buttons + holder.add_to_screen(dirswitch_buttons) /datum/buildmode/proc/close_dirswitch() switch_state = BM_SWITCHSTATE_NONE - holder.screen -= dirswitch_buttons + holder.remove_from_screen(dirswitch_buttons) /datum/buildmode/proc/change_mode(newmode) mode.exit_mode(src) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index a7149c07d3e7..e2f5e3c66fdc 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -783,7 +783,7 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( if (!screen_object.clear_with_screen) continue - screen -= object + remove_from_screen(object) ///opens the particle editor UI for the in_atom object for this client /client/proc/open_particle_editor(atom/movable/in_atom) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index c626f9cd1ee1..c7b1d65c7da2 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -85,10 +85,10 @@ Gunshots/explosions/opening doors/less rare audio (done) halitem.icon_state = "flashbang1" halitem.name = "Flashbang" if(client) - client.screen += halitem + client.add_to_screen(halitem) spawn(rand(100,250)) if(client) - client.screen -= halitem + client.remove_from_screen(halitem) halitem = null if(26 to 40) //Flashes of danger diff --git a/code/modules/maptext_alerts/screen_alerts.dm b/code/modules/maptext_alerts/screen_alerts.dm index 6d251080e87b..9ee7af33baa0 100644 --- a/code/modules/maptext_alerts/screen_alerts.dm +++ b/code/modules/maptext_alerts/screen_alerts.dm @@ -66,7 +66,7 @@ ///proc for actually playing this screen_text on a mob. /atom/movable/screen/text/screen_text/proc/play_to_client() - player?.screen += src + player?.add_to_screen(src) if(fade_in_time) animate(src, alpha = 255) var/list/lines_to_skip = list() @@ -106,7 +106,7 @@ qdel(src) return - player.screen -= src + player.remove_from_screen(src) LAZYREMOVE(player.screen_texts, src) qdel(src) @@ -196,7 +196,7 @@ alerts -= category if(client && hud_used) hud_used.reorganize_alerts() - client.screen -= alert + client.remove_from_screen(alert) qdel(alert) /atom/movable/screen/alert diff --git a/code/modules/maptext_alerts/text_blurbs.dm b/code/modules/maptext_alerts/text_blurbs.dm index 4cc4d1980115..c942543f88df 100644 --- a/code/modules/maptext_alerts/text_blurbs.dm +++ b/code/modules/maptext_alerts/text_blurbs.dm @@ -136,7 +136,7 @@ but should see their own spawn message even if the player already dropped as USC if(!ignore_key && (M.key in GLOB.blurb_witnesses[blurb_key])) continue LAZYDISTINCTADD(GLOB.blurb_witnesses[blurb_key], M.key) - M.client?.screen += T + M.client?.add_to_screen(T) for(var/i in 1 to length(message) + 1) if(i in linebreaks) @@ -154,5 +154,5 @@ but should see their own spawn message even if the player already dropped as USC animate(T, alpha = 0, time = 0.5 SECONDS) sleep(5) for(var/mob/M as anything in targets) - M.client?.screen -= T + M.client?.remove_from_screen(T) qdel(T) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 21a992693aa8..9a3ce2a91be7 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -155,6 +155,9 @@ /mob/dead/observer/proc/clean_observetarget() SIGNAL_HANDLER UnregisterSignal(observetarget, COMSIG_PARENT_QDELETING) + if(observetarget.client) + UnregisterSignal(observetarget.client, COMSIG_CLIENT_SCREEN_ADD) + UnregisterSignal(observetarget.client, COMSIG_CLIENT_SCREEN_REMOVE) if(observetarget?.observers) observetarget.observers -= src UNSETEMPTY(observetarget.observers) @@ -169,12 +172,23 @@ return clean_observetarget() +/mob/dead/observer/proc/observertarget_screen_add(observetarget_client, add_to_screen) + SIGNAL_HANDLER + if(!client) + return + client.add_to_screen(add_to_screen) + +/mob/dead/observer/proc/observertarget_screen_remove(observetarget_client, remove_from_screen) + SIGNAL_HANDLER + if(!client) + return + client.remove_from_screen(remove_from_screen) + ///makes the ghost see the target hud and sets the eye at the target. /mob/dead/observer/proc/do_observe(mob/target) if(!client || !target || !istype(target)) return - //I do not give a singular flying fuck about not being able to see xeno huds, literally only human huds are useful to see if(!ishuman(target)) ManualFollow(target) return @@ -191,6 +205,9 @@ observetarget = target RegisterSignal(observetarget, COMSIG_PARENT_QDELETING, PROC_REF(clean_observetarget)) RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(observer_move_react)) + if(target.client) + RegisterSignal(target.client, COMSIG_CLIENT_SCREEN_ADD, PROC_REF(observertarget_screen_add)) + RegisterSignal(target.client, COMSIG_CLIENT_SCREEN_REMOVE, PROC_REF(observertarget_screen_remove)) /mob/dead/observer/reset_perspective(atom/A) if(observetarget) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 6505354a0b6e..933e9490d39e 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -211,7 +211,8 @@ update_inv_l_hand() if (client) - client.screen -= I + client.remove_from_screen(I) + I.layer = initial(I.layer) I.plane = initial(I.plane) if(newloc) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index e7e36242a90a..fd9c786bd147 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -358,7 +358,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, remove_overlay(UNIFORM_LAYER) if(w_uniform) if(client && hud_used && hud_used.hud_shown && hud_used.inventory_shown && hud_used.ui_datum) - client.screen += w_uniform + client.add_to_screen(w_uniform) w_uniform.screen_loc = hud_used.ui_datum.hud_slot_offset(w_uniform, hud_used.ui_datum.ui_iclothing) if(!(wear_suit && wear_suit.flags_inv_hide & HIDEJUMPSUIT)) @@ -375,7 +375,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(!wear_id) return if(client && hud_used && hud_used.hud_shown && hud_used.ui_datum) - client.screen += wear_id + client.add_to_screen(wear_id) wear_id.screen_loc = hud_used.ui_datum.hud_slot_offset(wear_id, hud_used.ui_datum.ui_id) if(!wear_id.pinned_on_uniform || (w_uniform && w_uniform.displays_id && !(w_uniform.flags_jumpsuit & UNIFORM_JACKET_REMOVED))) @@ -389,7 +389,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, var/image/I if(gloves) if(client && hud_used && hud_used.hud_shown && hud_used.inventory_shown && hud_used.ui_datum) - client.screen += gloves + client.add_to_screen(gloves) gloves.screen_loc = hud_used.ui_datum.hud_slot_offset(gloves, hud_used.ui_datum.ui_gloves) if(!(wear_suit && wear_suit.flags_inv_hide & HIDEGLOVES)) @@ -408,7 +408,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, remove_overlay(GLASSES_LAYER) if(glasses) if(client && hud_used && hud_used.hud_shown && hud_used.inventory_shown && hud_used.ui_datum) - client.screen += glasses + client.add_to_screen(glasses) glasses.screen_loc = hud_used.ui_datum.hud_slot_offset(glasses, hud_used.ui_datum.ui_glasses) var/image/I = glasses.get_mob_overlay(src, WEAR_EYES) @@ -423,9 +423,9 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(wear_l_ear || wear_r_ear) if(client && hud_used && hud_used.hud_shown && hud_used.inventory_shown && hud_used.ui_datum) if(wear_l_ear) - client.screen += wear_l_ear + client.add_to_screen(wear_l_ear) if(wear_r_ear) - client.screen += wear_r_ear + client.add_to_screen(wear_r_ear) wear_l_ear?.screen_loc = hud_used.ui_datum.hud_slot_offset(wear_l_ear, hud_used.ui_datum.ui_wear_l_ear) wear_r_ear?.screen_loc = hud_used.ui_datum.hud_slot_offset(wear_r_ear, hud_used.ui_datum.ui_wear_r_ear) @@ -444,7 +444,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, var/image/I if(shoes) if(client && hud_used && hud_used.hud_shown && hud_used.inventory_shown && hud_used.ui_datum) - client.screen += shoes + client.add_to_screen(shoes) shoes.screen_loc = hud_used.ui_datum.hud_slot_offset(shoes, hud_used.ui_datum.ui_shoes) if(!((wear_suit && wear_suit.flags_inv_hide & HIDESHOES) || (w_uniform && w_uniform.flags_inv_hide & HIDESHOES))) @@ -463,7 +463,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, remove_overlay(SUIT_STORE_LAYER) if(s_store) if(client && hud_used && hud_used.hud_shown && hud_used.ui_datum) - client.screen += s_store + client.add_to_screen(s_store) s_store.screen_loc = hud_used.ui_datum.hud_slot_offset(s_store, hud_used.ui_datum.ui_sstore1) var/image/I = s_store.get_mob_overlay(src, WEAR_J_STORE) @@ -483,7 +483,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(head) if(client && hud_used && hud_used.hud_shown && hud_used.inventory_shown && hud_used.ui_datum) - client.screen += head + client.add_to_screen(head) head.screen_loc = hud_used.ui_datum.hud_slot_offset(head, hud_used.ui_datum.ui_head) var/image/I = head.get_mob_overlay(src, WEAR_HEAD) @@ -528,7 +528,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(!belt) return if(client && hud_used && hud_used.hud_shown && hud_used.ui_datum) - client.screen += belt + client.add_to_screen(belt) belt.screen_loc = hud_used.ui_datum.hud_slot_offset(belt, hud_used.ui_datum.ui_belt) var/image/I = belt.get_mob_overlay(src, WEAR_WAIST) @@ -545,7 +545,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(wear_suit) if(client && hud_used && hud_used.hud_shown && hud_used.inventory_shown && hud_used.ui_datum) - client.screen += wear_suit + client.add_to_screen(wear_suit) wear_suit.screen_loc = hud_used.ui_datum.hud_slot_offset(wear_suit, hud_used.ui_datum.ui_oclothing) var/image/I = wear_suit.get_mob_overlay(src, WEAR_JACKET) @@ -597,10 +597,10 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, return if(l_store) - client.screen += l_store + client.add_to_screen(l_store) l_store.screen_loc = hud_used.ui_datum.hud_slot_offset(l_store, hud_used.ui_datum.ui_storage1) if(r_store) - client.screen += r_store + client.add_to_screen(r_store) r_store.screen_loc = hud_used.ui_datum.hud_slot_offset(r_store, hud_used.ui_datum.ui_storage2) @@ -609,7 +609,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(!wear_mask) return if(client && hud_used && hud_used.hud_shown && hud_used.inventory_shown && hud_used.ui_datum) - client.screen += wear_mask + client.add_to_screen(wear_mask) wear_mask.screen_loc = hud_used.ui_datum.hud_slot_offset(wear_mask, hud_used.ui_datum.ui_mask) if(!(head && head.flags_inv_hide & HIDEMASK)) @@ -623,7 +623,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(!back) return if(client && hud_used && hud_used.hud_shown && hud_used.ui_datum) - client.screen += back + client.add_to_screen(back) back.screen_loc = hud_used.ui_datum.hud_slot_offset(back, hud_used.ui_datum.ui_back) var/image/I = back.get_mob_overlay(src, WEAR_BACK) @@ -661,7 +661,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(!r_hand) return if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD && hud_used.ui_datum) - client.screen += r_hand + client.add_to_screen(r_hand) r_hand.screen_loc = hud_used.ui_datum.hud_slot_offset(r_hand, hud_used.ui_datum.ui_rhand) var/image/I = r_hand.get_mob_overlay(src, WEAR_R_HAND) @@ -676,7 +676,7 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, if(!l_hand) return if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD && hud_used.ui_datum) - client.screen += l_hand + client.add_to_screen(l_hand) l_hand.screen_loc = hud_used.ui_datum.hud_slot_offset(l_hand, hud_used.ui_datum.ui_lhand) var/image/I = l_hand.get_mob_overlay(src, WEAR_L_HAND) diff --git a/code/modules/mob/living/carbon/xenomorph/update_icons.dm b/code/modules/mob/living/carbon/xenomorph/update_icons.dm index 477ead761474..30e78a5fed94 100644 --- a/code/modules/mob/living/carbon/xenomorph/update_icons.dm +++ b/code/modules/mob/living/carbon/xenomorph/update_icons.dm @@ -97,11 +97,11 @@ var/datum/custom_hud/alien/ui_datum = GLOB.custom_huds_list[HUD_ALIEN] if(l_store) if(client && hud_used && hud_used.hud_shown) - client.screen += l_store + client.add_to_screen(l_store) l_store.screen_loc = ui_datum.hud_slot_offset(l_store, ui_datum.ui_storage1) if(r_store) if(client && hud_used && hud_used.hud_shown) - client.screen += r_store + client.add_to_screen(r_store) r_store.screen_loc = ui_datum.hud_slot_offset(r_store, ui_datum.ui_storage2) /mob/living/carbon/xenomorph/update_inv_r_hand() @@ -109,7 +109,7 @@ if(r_hand) if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) var/datum/custom_hud/alien/ui_datum = GLOB.custom_huds_list[HUD_ALIEN] - client.screen += r_hand + client.add_to_screen(r_hand) r_hand.screen_loc = ui_datum.hud_slot_offset(r_hand, ui_datum.ui_rhand) var/t_state = r_hand.item_state if(!t_state) @@ -122,7 +122,7 @@ if(l_hand) if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) var/datum/custom_hud/alien/ui_datum = GLOB.custom_huds_list[HUD_ALIEN] - client.screen += l_hand + client.add_to_screen(l_hand) l_hand.screen_loc = ui_datum.hud_slot_offset(l_hand, ui_datum.ui_lhand) var/t_state = l_hand.item_state if(!t_state) diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index 840c1da3f60f..51bbfd24ccb0 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -13,7 +13,7 @@ if(istype(module_state_1,/obj/item/robot/sight)) sight_mode &= ~module_state_1:sight_mode if (client) - client.screen -= module_state_1 + client.remove_from_screen(module_state_1) contents -= module_state_1 module_active = null module_state_1 = null @@ -22,7 +22,7 @@ if(istype(module_state_2,/obj/item/robot/sight)) sight_mode &= ~module_state_2:sight_mode if (client) - client.screen -= module_state_2 + client.remove_from_screen(module_state_2) contents -= module_state_2 module_active = null module_state_2 = null @@ -31,7 +31,7 @@ if(istype(module_state_3,/obj/item/robot/sight)) sight_mode &= ~module_state_3:sight_mode if (client) - client.screen -= module_state_3 + client.remove_from_screen(module_state_3) contents -= module_state_3 module_active = null module_state_3 = null @@ -45,7 +45,7 @@ if(istype(module_state_1,/obj/item/robot/sight)) sight_mode &= ~module_state_1:sight_mode if (client) - client.screen -= module_state_1 + client.remove_from_screen(module_state_1) contents -= module_state_1 module_state_1 = null inv1.icon_state = "inv1" @@ -53,7 +53,7 @@ if(istype(module_state_2,/obj/item/robot/sight)) sight_mode &= ~module_state_2:sight_mode if (client) - client.screen -= module_state_2 + client.remove_from_screen(module_state_2) contents -= module_state_2 module_state_2 = null inv2.icon_state = "inv2" @@ -61,7 +61,7 @@ if(istype(module_state_3,/obj/item/robot/sight)) sight_mode &= ~module_state_3:sight_mode if (client) - client.screen -= module_state_3 + client.remove_from_screen(module_state_3) contents -= module_state_3 module_state_3 = null inv3.icon_state = "inv3" diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index 21ddaf76b33c..b0230bba5dba 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -239,10 +239,10 @@ /mob/living/silicon/robot/proc/update_items() if (client) - client.screen -= contents + client.remove_from_screen(contents) for(var/obj/I in contents) if(I && !(istype(I,/obj/item/cell) || istype(I,/obj/item/device/radio) || istype(I,/obj/structure/machinery/camera) || istype(I,/obj/item/device/mmi))) - client.screen += I + client.add_to_screen(I) var/datum/custom_hud/robot/ui_datum = GLOB.custom_huds_list[HUD_ROBOT] if(module_state_1) module_state_1.screen_loc = ui_datum.ui_inv1 diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 1839fe191627..fb4dbac3c160 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -200,19 +200,19 @@ if(isnull(preview_front)) preview_front = new() - owner.screen |= preview_front + owner.add_to_screen(preview_front) preview_front.vis_contents += preview_dummy preview_front.screen_loc = "preview:0,0" preview_front.icon_state = bg_state if(isnull(rotate_left)) rotate_left = new(null, preview_dummy) - owner.screen |= rotate_left + owner.add_to_screen(rotate_left) rotate_left.screen_loc = "preview:-1:16,0" if(isnull(rotate_right)) rotate_right = new(null, preview_dummy) - owner.screen |= rotate_right + owner.add_to_screen(rotate_right) rotate_right.screen_loc = "preview:1:-16,0" /datum/preferences/proc/job_pref_to_gear_preset() diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index 698ea8ef5957..51c85e11141f 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -1535,7 +1535,7 @@ Defined in conflicts.dm of the #defines folder. recalculate_scope_pos() gun_user.overlay_fullscreen("vulture", /atom/movable/screen/fullscreen/vulture) scope_element = new(src) - gun_user.client.screen += scope_element + gun_user.client.add_to_screen(scope_element) gun_user.see_in_dark += darkness_view gun_user.lighting_alpha = 127 gun_user.sync_lighting_plane_alpha() @@ -1564,7 +1564,7 @@ Defined in conflicts.dm of the #defines folder. stop_holding_breath() scope_user_initial_dir = null scoper.clear_fullscreen("vulture") - scoper.client.screen -= scope_element + scoper.client.remove_from_screen(scope_element) scoper.see_in_dark -= darkness_view scoper.lighting_alpha = 127 scoper.sync_lighting_plane_alpha() diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index c7b3d3e1bae2..e61357188ad6 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -241,7 +241,7 @@ var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up! if(!istype(O.loc, /turf)) if(user.client) - user.client.screen -= O + user.client.remove_from_screen(O) P.wrapped = O O.forceMove(P) P.w_class = O.w_class