From 1568b5f480059d575bb257cb94550f9173065961 Mon Sep 17 00:00:00 2001 From: tattax <71668564+tattax@users.noreply.github.com> Date: Thu, 13 Jul 2023 00:41:48 -0300 Subject: [PATCH] makes atom/movable/screen setup hud on new instead of relying on update icon (#19632) it was done on the update appearance pr but it's neat and the pr is not getting anywhere until auxtools --- code/_onclick/hud/ai.dm | 36 +++++----- code/_onclick/hud/alien.dm | 29 ++++---- code/_onclick/hud/alien_larva.dm | 14 ++-- code/_onclick/hud/blob_overmind.dm | 24 +++---- code/_onclick/hud/blobbernauthud.dm | 5 +- code/_onclick/hud/constructs.dm | 6 +- code/_onclick/hud/devil.dm | 16 ++--- code/_onclick/hud/drones.dm | 5 +- code/_onclick/hud/generic_dextrous.dm | 21 +++--- code/_onclick/hud/ghost.dm | 22 +++--- code/_onclick/hud/guardian.dm | 13 ++-- code/_onclick/hud/horror.dm | 2 +- code/_onclick/hud/hud.dm | 3 +- code/_onclick/hud/human.dm | 72 +++++++++---------- code/_onclick/hud/lavaland_elite.dm | 6 +- code/_onclick/hud/living.dm | 6 +- code/_onclick/hud/monkey.dm | 35 +++++---- code/_onclick/hud/pai.dm | 30 ++++---- code/_onclick/hud/revenanthud.dm | 5 +- code/_onclick/hud/robot.dm | 37 +++++----- code/_onclick/hud/screen_objects.dm | 69 +++++++++--------- code/_onclick/hud/slime.dm | 5 +- code/_onclick/hud/swarmer.dm | 18 ++--- .../antagonists/bloodsuckers/bloodsuckers.dm | 9 +-- .../antagonists/changeling/changeling.dm | 12 ++-- .../modules/mob/living/silicon/ai/multicam.dm | 2 +- .../simple_animal/hostile/jungle/seedling.dm | 2 +- code/modules/pai/hud.dm | 30 ++++---- .../game/gamemodes/darkspawn/darkspawn_hud.dm | 6 +- .../game/gamemodes/vampire/vampire_hud.dm | 6 +- 30 files changed, 254 insertions(+), 292 deletions(-) diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm index 1b13ac173001..bd31a0a94bd3 100644 --- a/code/_onclick/hud/ai.dm +++ b/code/_onclick/hud/ai.dm @@ -192,7 +192,7 @@ var/widescreen = owner?.client?.prefs?.read_preference(/datum/preference/toggle/widescreen) // Language menu - using = new /atom/movable/screen/language_menu + using = new /atom/movable/screen/language_menu(src) if(widescreen) using.screen_loc = ui_ai_language_menu_widescreen else @@ -200,12 +200,12 @@ static_inventory += using //AI core - using = new /atom/movable/screen/ai/aicore() + using = new /atom/movable/screen/ai/aicore(src) using.screen_loc = ui_ai_core static_inventory += using //Dashboard - using = new /atom/movable/screen/ai/dashboard + using = new /atom/movable/screen/ai/dashboard(src) if(widescreen) using.screen_loc = ui_ai_dashboard_widescreen else @@ -214,72 +214,72 @@ static_inventory += using //Camera list - using = new /atom/movable/screen/ai/camera_list() + using = new /atom/movable/screen/ai/camera_list(src) using.screen_loc = ui_ai_camera_list static_inventory += using //Track - using = new /atom/movable/screen/ai/camera_track() + using = new /atom/movable/screen/ai/camera_track(src) using.screen_loc = ui_ai_track_with_camera static_inventory += using //Camera light - using = new /atom/movable/screen/ai/camera_light() + using = new /atom/movable/screen/ai/camera_light(src) using.screen_loc = ui_ai_camera_light static_inventory += using //Crew Monitoring - using = new /atom/movable/screen/ai/crew_monitor() + using = new /atom/movable/screen/ai/crew_monitor(src) using.screen_loc = ui_ai_crew_monitor static_inventory += using //Crew Manifest - using = new /atom/movable/screen/ai/crew_manifest() + using = new /atom/movable/screen/ai/crew_manifest(src) using.screen_loc = ui_ai_crew_manifest static_inventory += using //Alerts - using = new /atom/movable/screen/ai/alerts() + using = new /atom/movable/screen/ai/alerts(src) using.screen_loc = ui_ai_alerts static_inventory += using //Announcement - using = new /atom/movable/screen/ai/announcement() + using = new /atom/movable/screen/ai/announcement(src) using.screen_loc = ui_ai_announcement static_inventory += using //Shuttle - using = new /atom/movable/screen/ai/call_shuttle() + using = new /atom/movable/screen/ai/call_shuttle(src) using.screen_loc = ui_ai_shuttle static_inventory += using //Laws - using = new /atom/movable/screen/ai/state_laws() + using = new /atom/movable/screen/ai/state_laws(src) using.screen_loc = ui_ai_state_laws static_inventory += using //Integrated Tablet - using = new /atom/movable/screen/ai/mod_pc() + using = new /atom/movable/screen/ai/mod_pc(src) using.screen_loc = ui_ai_pda_send static_inventory += using //Take image - using = new /atom/movable/screen/ai/image_take() + using = new /atom/movable/screen/ai/image_take(src) using.screen_loc = ui_ai_take_picture static_inventory += using //View images - using = new /atom/movable/screen/ai/image_view() + using = new /atom/movable/screen/ai/image_view(src) using.screen_loc = ui_ai_view_images static_inventory += using //Medical/Security sensors - using = new /atom/movable/screen/ai/sensors() + using = new /atom/movable/screen/ai/sensors(src) using.screen_loc = ui_ai_sensor static_inventory += using //Multicamera mode - using = new /atom/movable/screen/ai/multicam() + using = new /atom/movable/screen/ai/multicam(src) if(widescreen) using.screen_loc = ui_ai_multicam_widescreen else @@ -287,7 +287,7 @@ static_inventory += using //Add multicamera camera - using = new /atom/movable/screen/ai/add_multicam() + using = new /atom/movable/screen/ai/add_multicam(src) if(widescreen) using.screen_loc = ui_ai_add_multicam_widescreen else diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm index 7473d74e5e5a..928ef604a091 100644 --- a/code/_onclick/hud/alien.dm +++ b/code/_onclick/hud/alien.dm @@ -39,73 +39,72 @@ //begin buttons - using = new /atom/movable/screen/swap_hand() + using = new /atom/movable/screen/swap_hand(src) using.icon = ui_style using.icon_state = "swap_1" using.screen_loc = ui_swaphand_position(owner,1) static_inventory += using - using = new /atom/movable/screen/swap_hand() + using = new /atom/movable/screen/swap_hand(src) using.icon = ui_style using.icon_state = "swap_2" using.screen_loc = ui_swaphand_position(owner,2) static_inventory += using - using = new /atom/movable/screen/act_intent/alien() + using = new /atom/movable/screen/act_intent/alien(src) using.icon_state = mymob.a_intent static_inventory += using action_intent = using if(isalienhunter(mymob)) var/mob/living/carbon/alien/humanoid/hunter/H = mymob - H.leap_icon = new /atom/movable/screen/alien/leap() + H.leap_icon = new /atom/movable/screen/alien/leap(src) H.leap_icon.screen_loc = ui_alien_storage_r static_inventory += H.leap_icon - using = new/atom/movable/screen/language_menu + using = new /atom/movable/screen/language_menu(src) using.screen_loc = ui_alien_language_menu static_inventory += using - using = new /atom/movable/screen/drop() + using = new /atom/movable/screen/drop(src) using.icon = ui_style using.screen_loc = ui_drop_throw static_inventory += using - using = new /atom/movable/screen/resist() + using = new /atom/movable/screen/resist(src) using.icon = ui_style using.screen_loc = ui_above_movement hotkeybuttons += using - throw_icon = new /atom/movable/screen/throw_catch() + throw_icon = new /atom/movable/screen/throw_catch(src) throw_icon.icon = ui_style throw_icon.screen_loc = ui_drop_throw hotkeybuttons += throw_icon - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_above_movement static_inventory += pull_icon //begin indicators - healths = new /atom/movable/screen/healths/alien() + healths = new /atom/movable/screen/healths/alien(src) infodisplay += healths - alien_plasma_display = new /atom/movable/screen/alien/plasma_display() + alien_plasma_display = new /atom/movable/screen/alien/plasma_display(src) infodisplay += alien_plasma_display if(!isalienqueen(mymob)) alien_queen_finder = new /atom/movable/screen/alien/alien_queen_finder infodisplay += alien_queen_finder - zone_select = new /atom/movable/screen/zone_sel/alien() - zone_select.update_icon(mymob) + zone_select = new /atom/movable/screen/zone_sel/alien(src) + zone_select.update_icon() static_inventory += zone_select for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory)) if(inv.slot_id) - inv.hud = src inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv inv.update_icon() diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index 5c7062a365f1..9672ff701b7c 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -5,19 +5,19 @@ ..() var/atom/movable/screen/using - using = new /atom/movable/screen/act_intent/alien() + using = new /atom/movable/screen/act_intent/alien(src) using.icon_state = mymob.a_intent static_inventory += using action_intent = using - healths = new /atom/movable/screen/healths/alien() + healths = new /atom/movable/screen/healths/alien(src) infodisplay += healths - alien_queen_finder = new /atom/movable/screen/alien/alien_queen_finder() + alien_queen_finder = new /atom/movable/screen/alien/alien_queen_finder(src) infodisplay += alien_queen_finder - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = 'icons/mob/screen_alien.dmi' - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_above_movement hotkeybuttons += pull_icon @@ -25,6 +25,6 @@ using.screen_loc = ui_alien_language_menu static_inventory += using - zone_select = new /atom/movable/screen/zone_sel/alien() - zone_select.update_icon(mymob) + zone_select = new /atom/movable/screen/zone_sel/alien(src) + zone_select.update_icon() static_inventory += zone_select diff --git a/code/_onclick/hud/blob_overmind.dm b/code/_onclick/hud/blob_overmind.dm index 622e45e69e98..8a1c0a940299 100644 --- a/code/_onclick/hud/blob_overmind.dm +++ b/code/_onclick/hud/blob_overmind.dm @@ -126,7 +126,7 @@ ..() var/atom/movable/screen/using - blobpwrdisplay = new /atom/movable/screen() + blobpwrdisplay = new /atom/movable/screen(src) blobpwrdisplay.name = "blob power" blobpwrdisplay.icon_state = "block" blobpwrdisplay.screen_loc = ui_health @@ -135,44 +135,42 @@ blobpwrdisplay.plane = ABOVE_HUD_PLANE infodisplay += blobpwrdisplay - healths = new /atom/movable/screen/healths/blob() + healths = new /atom/movable/screen/healths/blob(src) infodisplay += healths - using = new /atom/movable/screen/blob/BlobHelp() + using = new /atom/movable/screen/blob/BlobHelp(src) using.screen_loc = "WEST:6,NORTH:-3" static_inventory += using - using = new /atom/movable/screen/blob/JumpToNode() + using = new /atom/movable/screen/blob/JumpToNode(src) using.screen_loc = ui_inventory static_inventory += using - using = new /atom/movable/screen/blob/JumpToCore() + using = new /atom/movable/screen/blob/JumpToCore(src) using.screen_loc = ui_zonesel - using.hud = src static_inventory += using - using = new /atom/movable/screen/blob/Blobbernaut() + using = new /atom/movable/screen/blob/Blobbernaut(src) using.screen_loc = ui_belt static_inventory += using - using = new /atom/movable/screen/blob/ResourceBlob() + using = new /atom/movable/screen/blob/ResourceBlob(src) using.screen_loc = ui_back static_inventory += using - using = new /atom/movable/screen/blob/NodeBlob() + using = new /atom/movable/screen/blob/NodeBlob(src) using.screen_loc = ui_hand_position(2) static_inventory += using - using = new /atom/movable/screen/blob/FactoryBlob() + using = new /atom/movable/screen/blob/FactoryBlob(src) using.screen_loc = ui_hand_position(1) static_inventory += using - using = new /atom/movable/screen/blob/ReadaptStrain() + using = new /atom/movable/screen/blob/ReadaptStrain(src) using.screen_loc = ui_storage1 - using.hud = src static_inventory += using - using = new /atom/movable/screen/blob/RelocateCore() + using = new /atom/movable/screen/blob/RelocateCore(src) using.screen_loc = ui_storage2 static_inventory += using diff --git a/code/_onclick/hud/blobbernauthud.dm b/code/_onclick/hud/blobbernauthud.dm index 2431a1afeaa2..d31c56d31b10 100644 --- a/code/_onclick/hud/blobbernauthud.dm +++ b/code/_onclick/hud/blobbernauthud.dm @@ -1,6 +1,5 @@ /datum/hud/living/blobbernaut/New(mob/living/owner) . = ..() - blobpwrdisplay = new /atom/movable/screen/healths/blob/overmind() - blobpwrdisplay.hud = src - infodisplay += blobpwrdisplay \ No newline at end of file + blobpwrdisplay = new /atom/movable/screen/healths/blob/overmind(src) + infodisplay += blobpwrdisplay diff --git a/code/_onclick/hud/constructs.dm b/code/_onclick/hud/constructs.dm index 4b8fb2838042..4c3115006086 100644 --- a/code/_onclick/hud/constructs.dm +++ b/code/_onclick/hud/constructs.dm @@ -3,11 +3,11 @@ /datum/hud/constructs/New(mob/owner) ..() - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_construct_pull static_inventory += pull_icon - healths = new /atom/movable/screen/healths/construct() + healths = new /atom/movable/screen/healths/construct(src) infodisplay += healths diff --git a/code/_onclick/hud/devil.dm b/code/_onclick/hud/devil.dm index 3e4b39832322..83b5c95dd283 100644 --- a/code/_onclick/hud/devil.dm +++ b/code/_onclick/hud/devil.dm @@ -6,20 +6,20 @@ ..() var/atom/movable/screen/using - using = new /atom/movable/screen/drop() + using = new /atom/movable/screen/drop(src) using.icon = ui_style using.screen_loc = ui_drone_drop static_inventory += using - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_drone_pull static_inventory += pull_icon build_hand_slots() - using = new /atom/movable/screen/inventory() + using = new /atom/movable/screen/inventory(src) using.name = "hand" using.icon = ui_style using.icon_state = "swap_1_m" @@ -28,7 +28,7 @@ using.plane = HUD_PLANE static_inventory += using - using = new /atom/movable/screen/inventory() + using = new /atom/movable/screen/inventory(src) using.name = "hand" using.icon = ui_style using.icon_state = "swap_2" @@ -37,11 +37,11 @@ using.plane = HUD_PLANE static_inventory += using - zone_select = new /atom/movable/screen/zone_sel() + zone_select = new /atom/movable/screen/zone_sel(src) zone_select.icon = ui_style - zone_select.update_icon(mymob) + zone_select.update_icon() - devilsouldisplay = new /atom/movable/screen/devil/soul_counter + devilsouldisplay = new /atom/movable/screen/devil/soul_counter(src) infodisplay += devilsouldisplay diff --git a/code/_onclick/hud/drones.dm b/code/_onclick/hud/drones.dm index a2cae8986443..c173ebcdea03 100644 --- a/code/_onclick/hud/drones.dm +++ b/code/_onclick/hud/drones.dm @@ -2,7 +2,7 @@ ..() var/atom/movable/screen/inventory/inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "internal storage" inv_box.icon = ui_style inv_box.icon_state = "suit_storage" @@ -11,7 +11,7 @@ inv_box.slot_id = ITEM_SLOT_DEX_STORAGE static_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "head/mask" inv_box.icon = ui_style inv_box.icon_state = "mask" @@ -22,7 +22,6 @@ for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory)) if(inv.slot_id) - inv.hud = src inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv inv.update_icon() diff --git a/code/_onclick/hud/generic_dextrous.dm b/code/_onclick/hud/generic_dextrous.dm index 85077ac2c398..efce1d8dec63 100644 --- a/code/_onclick/hud/generic_dextrous.dm +++ b/code/_onclick/hud/generic_dextrous.dm @@ -3,26 +3,26 @@ ..() var/atom/movable/screen/using - using = new /atom/movable/screen/drop() + using = new /atom/movable/screen/drop(src) using.icon = ui_style using.screen_loc = ui_drone_drop static_inventory += using - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_drone_pull static_inventory += pull_icon build_hand_slots() - using = new /atom/movable/screen/swap_hand() + using = new /atom/movable/screen/swap_hand(src) using.icon = ui_style using.icon_state = "swap_1_m" using.screen_loc = ui_swaphand_position(owner,1) static_inventory += using - using = new /atom/movable/screen/swap_hand() + using = new /atom/movable/screen/swap_hand(src) using.icon = ui_style using.icon_state = "swap_2" using.screen_loc = ui_swaphand_position(owner,2) @@ -31,20 +31,20 @@ if(mymob.possible_a_intents) if(mymob.possible_a_intents.len == 4) // All possible intents - full intent selector - action_intent = new /atom/movable/screen/act_intent/segmented + action_intent = new /atom/movable/screen/act_intent/segmented(src) else - action_intent = new /atom/movable/screen/act_intent + action_intent = new /atom/movable/screen/act_intent(src) action_intent.icon = ui_style action_intent.icon_state = mymob.a_intent static_inventory += action_intent - zone_select = new /atom/movable/screen/zone_sel() + zone_select = new /atom/movable/screen/zone_sel(src) zone_select.icon = ui_style - zone_select.update_icon(mymob) + zone_select.update_icon() static_inventory += zone_select - using = new /atom/movable/screen/area_creator + using = new /atom/movable/screen/area_creator(src) using.icon = ui_style static_inventory += using @@ -52,7 +52,6 @@ for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory)) if(inv.slot_id) - inv.hud = src inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv inv.update_icon() diff --git a/code/_onclick/hud/ghost.dm b/code/_onclick/hud/ghost.dm index b3e456eeb0ec..c58b790d3515 100644 --- a/code/_onclick/hud/ghost.dm +++ b/code/_onclick/hud/ghost.dm @@ -48,47 +48,47 @@ ..() var/atom/movable/screen/using - using = new /atom/movable/screen/ghost/jump_to_mob() + using = new /atom/movable/screen/ghost/jump_to_mob(src) using.screen_loc = ui_ghost_jump_to_mob static_inventory += using - using = new /atom/movable/screen/ghost/orbit() + using = new /atom/movable/screen/ghost/orbit(src) using.screen_loc = ui_ghost_orbit static_inventory += using - using = new /atom/movable/screen/ghost/reenter_corpse() + using = new /atom/movable/screen/ghost/reenter_corpse(src) using.screen_loc = ui_ghost_reenter_corpse static_inventory += using - using = new /atom/movable/screen/ghost/teleport() + using = new /atom/movable/screen/ghost/teleport(src) using.screen_loc = ui_ghost_teleport static_inventory += using - using = new /atom/movable/screen/ghost/spawners() + using = new /atom/movable/screen/ghost/spawners(src) using.screen_loc = ui_ghost_spawners static_inventory += using - using = new /atom/movable/screen/ghost/med_scan() + using = new /atom/movable/screen/ghost/med_scan(src) using.screen_loc = ui_ghost_med static_inventory += using - using = new /atom/movable/screen/ghost/chem_scan() + using = new /atom/movable/screen/ghost/chem_scan(src) using.screen_loc = ui_ghost_chem static_inventory += using - using = new /atom/movable/screen/ghost/nanite_scan() + using = new /atom/movable/screen/ghost/nanite_scan(src) using.screen_loc = ui_ghost_nanite static_inventory += using - using = new /atom/movable/screen/ghost/wound_scan() + using = new /atom/movable/screen/ghost/wound_scan(src) using.screen_loc = ui_ghost_wound static_inventory += using - using = new /atom/movable/screen/ghost/pai() + using = new /atom/movable/screen/ghost/pai(src) using.screen_loc = ui_ghost_pai static_inventory += using - using = new /atom/movable/screen/language_menu/ghost + using = new /atom/movable/screen/language_menu/ghost(src) using.icon = ui_style static_inventory += using diff --git a/code/_onclick/hud/guardian.dm b/code/_onclick/hud/guardian.dm index 6ea4b233d5c2..90b0c03449bd 100644 --- a/code/_onclick/hud/guardian.dm +++ b/code/_onclick/hud/guardian.dm @@ -5,21 +5,20 @@ ..() var/atom/movable/screen/using - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style pull_icon.update_icon() pull_icon.screen_loc = ui_living_pull - pull_icon.hud = src static_inventory += pull_icon - healths = new /atom/movable/screen/healths/guardian() + healths = new /atom/movable/screen/healths/guardian(src) infodisplay += healths - using = new /atom/movable/screen/guardian/Manifest() + using = new /atom/movable/screen/guardian/Manifest(src) using.screen_loc = ui_hand_position(2) static_inventory += using - using = new /atom/movable/screen/guardian/Recall() + using = new /atom/movable/screen/guardian/Recall(src) using.screen_loc = ui_hand_position(1) static_inventory += using @@ -27,11 +26,11 @@ using.screen_loc = ui_storage1 static_inventory += using - using = new /atom/movable/screen/guardian/ToggleLight() + using = new /atom/movable/screen/guardian/ToggleLight(src) using.screen_loc = ui_inventory static_inventory += using - using = new /atom/movable/screen/guardian/Communicate() + using = new /atom/movable/screen/guardian/Communicate(src) using.screen_loc = ui_back static_inventory += using diff --git a/code/_onclick/hud/horror.dm b/code/_onclick/hud/horror.dm index 3cc1c016093e..66cf769f8cee 100644 --- a/code/_onclick/hud/horror.dm +++ b/code/_onclick/hud/horror.dm @@ -9,7 +9,7 @@ /datum/hud/chemical_counter/New(mob/owner) . = ..() - chemical_counter = new /atom/movable/screen/horror_chemicals + chemical_counter = new /atom/movable/screen/horror_chemicals(src) infodisplay += chemical_counter /datum/hud/chemical_counter/Destroy() diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 3dcce9b09a83..af5fe12bd152 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -302,14 +302,13 @@ GLOBAL_LIST_INIT(available_ui_styles, list( hand_slots = list() var/atom/movable/screen/inventory/hand/hand_box for(var/i in 1 to mymob.held_items.len) - hand_box = new /atom/movable/screen/inventory/hand() + hand_box = new /atom/movable/screen/inventory/hand(src) hand_box.name = mymob.get_held_index_name(i) hand_box.icon = ui_style hand_box.icon_state = "hand_[mymob.held_index_to_dir(i)]" hand_box.screen_loc = ui_hand_position(i) hand_box.held_index = i hand_slots["[i]"] = hand_box - hand_box.hud = src static_inventory += hand_box hand_box.update_icon() diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index a887012f4cb6..e7bd42afd5f0 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -89,34 +89,34 @@ var/atom/movable/screen/using var/atom/movable/screen/inventory/inv_box - using = new/atom/movable/screen/language_menu + using = new /atom/movable/screen/language_menu(src) using.icon = ui_style if(!widescreen_layout) using.screen_loc = UI_BOXLANG static_inventory += using - using = new /atom/movable/screen/area_creator + using = new /atom/movable/screen/area_creator(src) using.icon = ui_style if(!widescreen_layout) using.screen_loc = UI_BOXAREA static_inventory += using - action_intent = new /atom/movable/screen/act_intent/segmented + action_intent = new /atom/movable/screen/act_intent/segmented(src) action_intent.icon_state = mymob.a_intent static_inventory += action_intent - using = new /atom/movable/screen/mov_intent + using = new /atom/movable/screen/mov_intent(src) using.icon = ui_style using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking") using.screen_loc = ui_movi static_inventory += using - using = new /atom/movable/screen/drop() + using = new /atom/movable/screen/drop(src) using.icon = ui_style using.screen_loc = ui_drop_throw static_inventory += using - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "i_clothing" inv_box.icon = ui_style inv_box.slot_id = ITEM_SLOT_ICLOTHING @@ -124,7 +124,7 @@ inv_box.screen_loc = ui_iclothing toggleable_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "o_clothing" inv_box.icon = ui_style inv_box.slot_id = ITEM_SLOT_OCLOTHING @@ -134,19 +134,19 @@ build_hand_slots() - using = new /atom/movable/screen/swap_hand() + using = new /atom/movable/screen/swap_hand(src) using.icon = ui_style using.icon_state = "swap_1" using.screen_loc = ui_swaphand_position(owner,1) static_inventory += using - using = new /atom/movable/screen/swap_hand() + using = new /atom/movable/screen/swap_hand(src) using.icon = ui_style using.icon_state = "swap_2" using.screen_loc = ui_swaphand_position(owner,2) static_inventory += using - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "id" inv_box.icon = ui_style inv_box.icon_state = "id" @@ -154,7 +154,7 @@ inv_box.slot_id = ITEM_SLOT_ID static_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "mask" inv_box.icon = ui_style inv_box.icon_state = "mask" @@ -162,7 +162,7 @@ inv_box.slot_id = ITEM_SLOT_MASK toggleable_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "neck" inv_box.icon = ui_style inv_box.icon_state = "neck" @@ -170,7 +170,7 @@ inv_box.slot_id = ITEM_SLOT_NECK toggleable_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "back" inv_box.icon = ui_style inv_box.icon_state = "back" @@ -178,7 +178,7 @@ inv_box.slot_id = ITEM_SLOT_BACK static_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "storage1" inv_box.icon = ui_style inv_box.icon_state = "pocket" @@ -186,7 +186,7 @@ inv_box.slot_id = ITEM_SLOT_LPOCKET static_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "storage2" inv_box.icon = ui_style inv_box.icon_state = "pocket" @@ -194,7 +194,7 @@ inv_box.slot_id = ITEM_SLOT_RPOCKET static_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "suit storage" inv_box.icon = ui_style inv_box.icon_state = "suit_storage" @@ -202,22 +202,22 @@ inv_box.slot_id = ITEM_SLOT_SUITSTORE static_inventory += inv_box - using = new /atom/movable/screen/resist() + using = new /atom/movable/screen/resist(src) using.icon = ui_style using.screen_loc = ui_above_intent hotkeybuttons += using - using = new /atom/movable/screen/human/toggle() + using = new /atom/movable/screen/human/toggle(src) using.icon = ui_style using.screen_loc = ui_inventory static_inventory += using - using = new /atom/movable/screen/human/equip() + using = new /atom/movable/screen/human/equip(src) using.icon = ui_style using.screen_loc = ui_equip_position(mymob) static_inventory += using - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "gloves" inv_box.icon = ui_style inv_box.icon_state = "gloves" @@ -225,7 +225,7 @@ inv_box.slot_id = ITEM_SLOT_GLOVES toggleable_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "eyes" inv_box.icon = ui_style inv_box.icon_state = "glasses" @@ -233,7 +233,7 @@ inv_box.slot_id = ITEM_SLOT_EYES toggleable_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "ears" inv_box.icon = ui_style inv_box.icon_state = "ears" @@ -241,7 +241,7 @@ inv_box.slot_id = ITEM_SLOT_EARS toggleable_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "head" inv_box.icon = ui_style inv_box.icon_state = "head" @@ -249,7 +249,7 @@ inv_box.slot_id = ITEM_SLOT_HEAD toggleable_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "shoes" inv_box.icon = ui_style inv_box.icon_state = "shoes" @@ -257,7 +257,7 @@ inv_box.slot_id = ITEM_SLOT_FEET toggleable_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "belt" inv_box.icon = ui_style inv_box.icon_state = "belt" @@ -266,43 +266,41 @@ inv_box.slot_id = ITEM_SLOT_BELT static_inventory += inv_box - throw_icon = new /atom/movable/screen/throw_catch() + throw_icon = new /atom/movable/screen/throw_catch(src) throw_icon.icon = ui_style throw_icon.screen_loc = ui_drop_throw hotkeybuttons += throw_icon - rest_icon = new /atom/movable/screen/rest() + rest_icon = new /atom/movable/screen/rest(src) rest_icon.icon = ui_style rest_icon.screen_loc = ui_above_movement static_inventory += rest_icon - healths = new /atom/movable/screen/healths() + healths = new /atom/movable/screen/healths(src) infodisplay += healths - stamina = new /atom/movable/screen/stamina() - stamina.hud = src + stamina = new /atom/movable/screen/stamina(src) infodisplay += stamina - healthdoll = new /atom/movable/screen/healthdoll() + healthdoll = new /atom/movable/screen/healthdoll(src) infodisplay += healthdoll - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_above_intent static_inventory += pull_icon - devilsouldisplay = new /atom/movable/screen/devil/soul_counter + devilsouldisplay = new /atom/movable/screen/devil/soul_counter(src) infodisplay += devilsouldisplay - zone_select = new /atom/movable/screen/zone_sel() + zone_select = new /atom/movable/screen/zone_sel(src) zone_select.icon = ui_style - zone_select.update_icon(mymob) + zone_select.update_icon() static_inventory += zone_select for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory)) if(inv.slot_id) - inv.hud = src inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv inv.update_icon() diff --git a/code/_onclick/hud/lavaland_elite.dm b/code/_onclick/hud/lavaland_elite.dm index fd3957f27f44..c0a1b218c029 100644 --- a/code/_onclick/hud/lavaland_elite.dm +++ b/code/_onclick/hud/lavaland_elite.dm @@ -3,13 +3,11 @@ /datum/hud/lavaland_elite/New(mob/living/simple_animal/hostile/asteroid/elite) ..() - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style pull_icon.update_icon() pull_icon.screen_loc = ui_living_pull - pull_icon.hud = src static_inventory += pull_icon - healths = new /atom/movable/screen/healths/lavaland_elite() - healths.hud = src + healths = new /atom/movable/screen/healths/lavaland_elite(src) infodisplay += healths diff --git a/code/_onclick/hud/living.dm b/code/_onclick/hud/living.dm index 90022ec028f9..5cbfb535f95e 100644 --- a/code/_onclick/hud/living.dm +++ b/code/_onclick/hud/living.dm @@ -4,14 +4,12 @@ /datum/hud/living/New(mob/living/owner) ..() - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style pull_icon.update_icon() pull_icon.screen_loc = ui_living_pull - pull_icon.hud = src static_inventory += pull_icon //mob health doll! assumes whatever sprite the mob is - healthdoll = new /atom/movable/screen/healthdoll/living() - healthdoll.hud = src + healthdoll = new /atom/movable/screen/healthdoll/living(src) infodisplay += healthdoll diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index 3789aff2e3df..da888faefb3f 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -3,42 +3,42 @@ var/atom/movable/screen/using var/atom/movable/screen/inventory/inv_box - action_intent = new /atom/movable/screen/act_intent() + action_intent = new /atom/movable/screen/act_intent(src) action_intent.icon = ui_style action_intent.icon_state = mymob.a_intent action_intent.screen_loc = ui_acti static_inventory += action_intent - using = new /atom/movable/screen/mov_intent() + using = new /atom/movable/screen/mov_intent(src) using.icon = ui_style using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking") using.screen_loc = ui_movi static_inventory += using - using = new/atom/movable/screen/language_menu + using = new /atom/movable/screen/language_menu(src) using.icon = ui_style static_inventory += using - using = new /atom/movable/screen/drop() + using = new /atom/movable/screen/drop(src) using.icon = ui_style using.screen_loc = ui_drop_throw static_inventory += using build_hand_slots() - using = new /atom/movable/screen/swap_hand() + using = new /atom/movable/screen/swap_hand(src) using.icon = ui_style using.icon_state = "swap_1_m" //extra wide! using.screen_loc = ui_swaphand_position(owner,1) static_inventory += using - using = new /atom/movable/screen/swap_hand() + using = new /atom/movable/screen/swap_hand(src) using.icon = ui_style using.icon_state = "swap_2" using.screen_loc = ui_swaphand_position(owner,2) static_inventory += using - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "mask" inv_box.icon = ui_style inv_box.icon_state = "mask" @@ -47,7 +47,7 @@ inv_box.slot_id = ITEM_SLOT_MASK static_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "neck" inv_box.icon = ui_style inv_box.icon_state = "neck" @@ -56,7 +56,7 @@ inv_box.slot_id = ITEM_SLOT_NECK static_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "head" inv_box.icon = ui_style inv_box.icon_state = "head" @@ -65,7 +65,7 @@ inv_box.slot_id = ITEM_SLOT_HEAD static_inventory += inv_box - inv_box = new /atom/movable/screen/inventory() + inv_box = new /atom/movable/screen/inventory(src) inv_box.name = "back" inv_box.icon = ui_style inv_box.icon_state = "back" @@ -73,35 +73,34 @@ inv_box.slot_id = ITEM_SLOT_BACK static_inventory += inv_box - throw_icon = new /atom/movable/screen/throw_catch() + throw_icon = new /atom/movable/screen/throw_catch(src) throw_icon.icon = ui_style throw_icon.screen_loc = ui_drop_throw hotkeybuttons += throw_icon - healths = new /atom/movable/screen/healths() + healths = new /atom/movable/screen/healths(src) infodisplay += healths - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_above_movement static_inventory += pull_icon - zone_select = new /atom/movable/screen/zone_sel() + zone_select = new /atom/movable/screen/zone_sel(src) zone_select.icon = ui_style - zone_select.update_icon(mymob) + zone_select.update_icon() static_inventory += zone_select mymob.client.screen = list() - using = new /atom/movable/screen/resist() + using = new /atom/movable/screen/resist(src) using.icon = ui_style using.screen_loc = ui_above_intent hotkeybuttons += using for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory)) if(inv.slot_id) - inv.hud = src inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv inv.update_icon() diff --git a/code/_onclick/hud/pai.dm b/code/_onclick/hud/pai.dm index 8a1fd1cbe2c0..265bbd1f5723 100644 --- a/code/_onclick/hud/pai.dm +++ b/code/_onclick/hud/pai.dm @@ -173,77 +173,77 @@ var/atom/movable/screen/using // Software menu - using = new /atom/movable/screen/pai/software + using = new /atom/movable/screen/pai/software(src) using.screen_loc = ui_pai_software static_inventory += using // Holoform - using = new /atom/movable/screen/pai/shell + using = new /atom/movable/screen/pai/shell(src) using.screen_loc = ui_pai_shell static_inventory += using // Chassis Select Menu - using = new /atom/movable/screen/pai/chassis + using = new /atom/movable/screen/pai/chassis(src) using.screen_loc = ui_pai_chassis static_inventory += using // Rest - using = new /atom/movable/screen/pai/rest + using = new /atom/movable/screen/pai/rest(src) using.screen_loc = ui_pai_rest static_inventory += using // Integrated Light - using = new /atom/movable/screen/pai/light + using = new /atom/movable/screen/pai/light(src) using.screen_loc = ui_pai_light static_inventory += using // Newscaster - using = new /atom/movable/screen/pai/newscaster + using = new /atom/movable/screen/pai/newscaster(src) using.screen_loc = ui_pai_newscaster static_inventory += using // Language menu - using = new /atom/movable/screen/language_menu + using = new /atom/movable/screen/language_menu(src) using.screen_loc = ui_borg_language_menu static_inventory += using // Host Monitor - using = new /atom/movable/screen/pai/host_monitor() + using = new /atom/movable/screen/pai/host_monitor(src) using.screen_loc = ui_pai_host_monitor static_inventory += using // Crew Manifest - using = new /atom/movable/screen/pai/crew_manifest() + using = new /atom/movable/screen/pai/crew_manifest(src) using.screen_loc = ui_pai_crew_manifest static_inventory += using // Laws - using = new /atom/movable/screen/pai/state_laws() + using = new /atom/movable/screen/pai/state_laws(src) using.screen_loc = ui_pai_state_laws static_inventory += using // PDA message - using = new /atom/movable/screen/pai/pda_msg_send() + using = new /atom/movable/screen/pai/pda_msg_send(src) using.screen_loc = ui_pai_pda_send static_inventory += using // PDA log - using = new /atom/movable/screen/pai/pda_msg_show() + using = new /atom/movable/screen/pai/pda_msg_show(src) using.screen_loc = ui_pai_pda_log static_inventory += using // Take image - using = new /atom/movable/screen/pai/image_take() + using = new /atom/movable/screen/pai/image_take(src) using.screen_loc = ui_pai_take_picture static_inventory += using // View images - using = new /atom/movable/screen/pai/image_view() + using = new /atom/movable/screen/pai/image_view(src) using.screen_loc = ui_pai_view_images static_inventory += using // Radio - using = new /atom/movable/screen/pai/radio() + using = new /atom/movable/screen/pai/radio(src) using.screen_loc = ui_borg_radio static_inventory += using diff --git a/code/_onclick/hud/revenanthud.dm b/code/_onclick/hud/revenanthud.dm index dc801fe89871..991769028e84 100644 --- a/code/_onclick/hud/revenanthud.dm +++ b/code/_onclick/hud/revenanthud.dm @@ -4,12 +4,11 @@ /datum/hud/revenant/New(mob/owner) ..() - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style pull_icon.update_icon() pull_icon.screen_loc = ui_living_pull - pull_icon.hud = src static_inventory += pull_icon - healths = new /atom/movable/screen/healths/revenant() + healths = new /atom/movable/screen/healths/revenant(src) infodisplay += healths diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 1135d4564a9f..4ace0ddaee9e 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -91,57 +91,54 @@ static_inventory += using //Radio - using = new /atom/movable/screen/robot/radio() + using = new /atom/movable/screen/robot/radio(src) using.screen_loc = ui_borg_radio static_inventory += using //Module select - using = new /atom/movable/screen/robot/module1() + using = new /atom/movable/screen/robot/module1(src) using.screen_loc = ui_inv1 static_inventory += using mymobR.inv1 = using - using = new /atom/movable/screen/robot/module2() + using = new /atom/movable/screen/robot/module2(src) using.screen_loc = ui_inv2 static_inventory += using mymobR.inv2 = using - using = new /atom/movable/screen/robot/module3() + using = new /atom/movable/screen/robot/module3(src) using.screen_loc = ui_inv3 static_inventory += using mymobR.inv3 = using //End of module select - using = new /atom/movable/screen/robot/lamp() + using = new /atom/movable/screen/robot/lamp(src) using.screen_loc = ui_borg_lamp - using.hud = src static_inventory += using mymobR.lampButton = using var/atom/movable/screen/robot/lamp/lampscreen = using lampscreen.robot = mymobR //Photography stuff - using = new /atom/movable/screen/ai/image_take() + using = new /atom/movable/screen/ai/image_take(src) using.screen_loc = ui_borg_camera - using.hud = src static_inventory += using //Sec/Med HUDs - using = new /atom/movable/screen/ai/sensors() + using = new /atom/movable/screen/ai/sensors(src) using.screen_loc = ui_borg_sensor static_inventory += using //Thrusters - using = new /atom/movable/screen/robot/thrusters() + using = new /atom/movable/screen/robot/thrusters(src) using.screen_loc = ui_borg_thrusters static_inventory += using mymobR.thruster_button = using //Borg Integrated Tablet - using = new /atom/movable/screen/robot/modPC() + using = new /atom/movable/screen/robot/modPC(src) using.screen_loc = ui_borg_tablet - using.hud = src static_inventory += using mymobR.interfaceButton = using if(mymobR.modularInterface) @@ -150,32 +147,32 @@ tabletbutton.robot = mymobR //Intent - action_intent = new /atom/movable/screen/act_intent/robot() + action_intent = new /atom/movable/screen/act_intent/robot(src) action_intent.icon_state = mymob.a_intent static_inventory += action_intent //Health - healths = new /atom/movable/screen/healths/robot() + healths = new /atom/movable/screen/healths/robot(src) infodisplay += healths //Installed Module - mymobR.hands = new /atom/movable/screen/robot/module() + mymobR.hands = new /atom/movable/screen/robot/module(src) mymobR.hands.screen_loc = ui_borg_module static_inventory += mymobR.hands //Store - module_store_icon = new /atom/movable/screen/robot/store() + module_store_icon = new /atom/movable/screen/robot/store(src) module_store_icon.screen_loc = ui_borg_store - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = 'icons/mob/screen_cyborg.dmi' - pull_icon.update_icon(mymob) + pull_icon.update_icon() pull_icon.screen_loc = ui_borg_pull hotkeybuttons += pull_icon - zone_select = new /atom/movable/screen/zone_sel/robot() - zone_select.update_icon(mymob) + zone_select = new /atom/movable/screen/zone_sel/robot(src) + zone_select.update_icon() static_inventory += zone_select diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index bb48dba1daa4..7306963f6d31 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -15,8 +15,15 @@ speech_span = SPAN_ROBOT vis_flags = VIS_INHERIT_PLANE appearance_flags = APPEARANCE_UI - var/obj/master = null //A reference to the object in the slot. Grabs or items, generally. - var/datum/hud/hud = null // A reference to the owner HUD, if any. + /// A reference to the object in the slot. Grabs or items, generally. + var/obj/master = null + /// A reference to the owner HUD, if any. + VAR_PRIVATE/datum/hud/hud = null + +/atom/movable/screen/New(datum/hud/new_hud) + . = ..() + if(istype(new_hud)) + hud = new_hud /atom/movable/screen/Destroy() master = null @@ -329,12 +336,8 @@ /atom/movable/screen/mov_intent/Click() toggle(usr) -/atom/movable/screen/mov_intent/update_icon(mob/user) - if(!user && hud) - user = hud.mymob - if(!user) - return - switch(user.m_intent) +/atom/movable/screen/mov_intent/update_icon() + switch(hud?.mymob?.m_intent) if(MOVE_INTENT_WALK) icon_state = "walking" if(MOVE_INTENT_RUN) @@ -355,13 +358,8 @@ return usr.stop_pulling() -/atom/movable/screen/pull/update_icon(mob/mymob) - if(!mymob) - return - if(mymob.pulling) - icon_state = "pull" - else - icon_state = "pull0" +/atom/movable/screen/pull/update_icon() + icon_state = "[initial(icon_state)][hud?.mymob?.pulling ? null : 0]" /atom/movable/screen/resist name = "resist" @@ -387,14 +385,12 @@ var/mob/living/L = usr L.lay_down() -/atom/movable/screen/rest/update_icon(mob/mymob) - if(!isliving(mymob)) +/atom/movable/screen/rest/update_icon() + var/mob/living/user = hud?.mymob + if(!istype(user)) return - var/mob/living/L = mymob - if(!L.resting) - icon_state = "act_rest" - else - icon_state = "act_rest0" + icon_state = "[initial(icon_state)][user.resting ? 0 : null]" + return /atom/movable/screen/storage name = "storage" @@ -434,7 +430,7 @@ name = "damage zone" icon_state = "zone_sel" screen_loc = ui_zonesel - var/selecting = BODY_ZONE_CHEST + var/overlay_icon = 'icons/mob/screen_gen.dmi' var/static/list/hover_overlays_cache = list() var/hovering @@ -452,6 +448,7 @@ return set_selected_zone(choice, usr) /atom/movable/screen/zone_sel/MouseEntered(location, control, params) + . = ..() MouseMove(location, control, params) /atom/movable/screen/zone_sel/MouseMove(location, control, params) @@ -527,31 +524,29 @@ return BODY_ZONE_HEAD /atom/movable/screen/zone_sel/proc/set_selected_zone(choice, mob/user) - if(isobserver(user)) + if(user != hud?.mymob) return - if(choice != selecting) - selecting = choice - update_icon(usr) - return 1 + if(choice != hud.mymob.zone_selected) + hud.mymob.zone_selected = choice + update_icon() + SEND_SIGNAL(user, COMSIG_MOB_SELECTED_ZONE_SET, choice) + + return TRUE -/atom/movable/screen/zone_sel/update_icon(mob/user) +/atom/movable/screen/zone_sel/update_icon() + if(!hud?.mymob) + return cut_overlays() - add_overlay(mutable_appearance('icons/mob/screen_gen.dmi', "[selecting]")) - user.zone_selected = selecting + add_overlay(mutable_appearance(overlay_icon, "[hud.mymob.zone_selected]")) /atom/movable/screen/zone_sel/alien icon = 'icons/mob/screen_alien.dmi' - -/atom/movable/screen/zone_sel/alien/update_icon(mob/user) - cut_overlays() - add_overlay(mutable_appearance('icons/mob/screen_alien.dmi', "[selecting]")) - user.zone_selected = selecting + overlay_icon = 'icons/mob/screen_alien.dmi' /atom/movable/screen/zone_sel/robot icon = 'icons/mob/screen_cyborg.dmi' - /atom/movable/screen/flash name = "flash" icon_state = "blank" diff --git a/code/_onclick/hud/slime.dm b/code/_onclick/hud/slime.dm index 20b72312db97..3cfbde95b98e 100644 --- a/code/_onclick/hud/slime.dm +++ b/code/_onclick/hud/slime.dm @@ -4,13 +4,12 @@ /datum/hud/slime/New(mob/living/simple_animal/slime/owner) ..() - pull_icon = new /atom/movable/screen/pull() + pull_icon = new /atom/movable/screen/pull(src) pull_icon.icon = ui_style pull_icon.update_icon() pull_icon.screen_loc = ui_living_pull - pull_icon.hud = src static_inventory += pull_icon - healths = new /atom/movable/screen/healths/slime() + healths = new /atom/movable/screen/healths/slime(src) infodisplay += healths diff --git a/code/_onclick/hud/swarmer.dm b/code/_onclick/hud/swarmer.dm index 328053720ccf..34ce58790a9e 100644 --- a/code/_onclick/hud/swarmer.dm +++ b/code/_onclick/hud/swarmer.dm @@ -72,32 +72,26 @@ . = ..() var/atom/movable/screen/using - using = new /atom/movable/screen/swarmer/fabricate_trap() + using = new /atom/movable/screen/swarmer/fabricate_trap(src) using.screen_loc = ui_hand_position(2) - using.hud = src static_inventory += using - using = new /atom/movable/screen/swarmer/barricade() + using = new /atom/movable/screen/swarmer/barricade(src) using.screen_loc = ui_hand_position(1) - using.hud = src static_inventory += using - using = new /atom/movable/screen/swarmer/replicate() + using = new /atom/movable/screen/swarmer/replicate(src) using.screen_loc = ui_zonesel - using.hud = src static_inventory += using - using = new /atom/movable/screen/swarmer/repair_self() + using = new /atom/movable/screen/swarmer/repair_self(src) using.screen_loc = ui_storage1 - using.hud = src static_inventory += using - using = new /atom/movable/screen/swarmer/toggle_light() + using = new /atom/movable/screen/swarmer/toggle_light(src) using.screen_loc = ui_back - using.hud = src static_inventory += using - using = new /atom/movable/screen/swarmer/contact_swarmers() + using = new /atom/movable/screen/swarmer/contact_swarmers(src) using.screen_loc = ui_inventory - using.hud = src static_inventory += using diff --git a/code/modules/antagonists/bloodsuckers/bloodsuckers.dm b/code/modules/antagonists/bloodsuckers/bloodsuckers.dm index fcd04fefdcd1..03de29db0778 100644 --- a/code/modules/antagonists/bloodsuckers/bloodsuckers.dm +++ b/code/modules/antagonists/bloodsuckers/bloodsuckers.dm @@ -157,16 +157,13 @@ var/datum/hud/bloodsucker_hud = owner.current.hud_used - blood_display = new /atom/movable/screen/bloodsucker/blood_counter() - blood_display.hud = bloodsucker_hud + blood_display = new /atom/movable/screen/bloodsucker/blood_counter(bloodsucker_hud) bloodsucker_hud.infodisplay += blood_display - vamprank_display = new /atom/movable/screen/bloodsucker/rank_counter() - vamprank_display.hud = bloodsucker_hud + vamprank_display = new /atom/movable/screen/bloodsucker/rank_counter(bloodsucker_hud) bloodsucker_hud.infodisplay += vamprank_display - sunlight_display = new /atom/movable/screen/bloodsucker/sunlight_counter() - sunlight_display.hud = bloodsucker_hud + sunlight_display = new /atom/movable/screen/bloodsucker/sunlight_counter(bloodsucker_hud) bloodsucker_hud.infodisplay += sunlight_display INVOKE_ASYNC(bloodsucker_hud, TYPE_PROC_REF(/datum/hud/, show_hud), bloodsucker_hud.hud_version) diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index 50745e796481..c17da642d50b 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -121,12 +121,10 @@ var/datum/hud/ling_hud = owner.current.hud_used - lingchemdisplay = new - lingchemdisplay.hud = ling_hud + lingchemdisplay = new(ling_hud) ling_hud.infodisplay += lingchemdisplay - lingstingdisplay = new - lingstingdisplay.hud = ling_hud + lingstingdisplay = new(ling_hud) ling_hud.infodisplay += lingstingdisplay INVOKE_ASYNC(ling_hud, TYPE_PROC_REF(/datum/hud/, show_hud),ling_hud.hud_version) @@ -407,12 +405,10 @@ if(mob_to_tweak.hud_used) var/datum/hud/hud_used = mob_to_tweak.hud_used - lingchemdisplay = new /atom/movable/screen/ling/chems() - lingchemdisplay.hud = hud_used + lingchemdisplay = new /atom/movable/screen/ling/chems(hud_used) hud_used.infodisplay += lingchemdisplay - lingstingdisplay = new /atom/movable/screen/ling/sting() - lingstingdisplay.hud = hud_used + lingstingdisplay = new /atom/movable/screen/ling/sting(hud_used) hud_used.infodisplay += lingstingdisplay hud_used.show_hud(hud_used.hud_version) diff --git a/code/modules/mob/living/silicon/ai/multicam.dm b/code/modules/mob/living/silicon/ai/multicam.dm index 2b5a31dacbcf..a5e4f80babeb 100644 --- a/code/modules/mob/living/silicon/ai/multicam.dm +++ b/code/modules/mob/living/silicon/ai/multicam.dm @@ -207,7 +207,7 @@ GLOBAL_DATUM(ai_camera_room_landmark, /obj/effect/landmark/ai_multicam_room) if(!silent) to_chat(src, span_warning("Cannot place more than [max_multicams] multicamera windows.")) return - var/atom/movable/screen/movable/pic_in_pic/ai/C = new /atom/movable/screen/movable/pic_in_pic/ai() + var/atom/movable/screen/movable/pic_in_pic/ai/C = new /atom/movable/screen/movable/pic_in_pic/ai(src) C.set_view_size(3, 3, FALSE) C.set_view_center(get_turf(eyeobj)) C.set_ai(src) diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/seedling.dm b/code/modules/mob/living/simple_animal/hostile/jungle/seedling.dm index ef4fc6d283c2..db2294d0abd9 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/seedling.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/seedling.dm @@ -79,7 +79,7 @@ /datum/status_effect/seedling_beam_indicator/on_apply() if(owner.client) - seedling_screen_object = new /atom/movable/screen/seedling() + seedling_screen_object = new /atom/movable/screen/seedling(src) owner.client.screen += seedling_screen_object tick() return ..() diff --git a/code/modules/pai/hud.dm b/code/modules/pai/hud.dm index 52df720e507e..3c53c96395a3 100644 --- a/code/modules/pai/hud.dm +++ b/code/modules/pai/hud.dm @@ -179,57 +179,57 @@ var/mob/living/silicon/pai/mypai = mymob // Software menu - using = new /atom/movable/screen/pai/software + using = new /atom/movable/screen/pai/software(src) using.screen_loc = ui_pai_software static_inventory += using // Holoform - using = new /atom/movable/screen/pai/shell + using = new /atom/movable/screen/pai/shell(src) using.screen_loc = ui_pai_shell static_inventory += using // Chassis Select Menu - using = new /atom/movable/screen/pai/chassis + using = new /atom/movable/screen/pai/chassis(src) using.screen_loc = ui_pai_chassis static_inventory += using // Rest - using = new /atom/movable/screen/pai/rest + using = new /atom/movable/screen/pai/rest(src) using.screen_loc = ui_pai_rest static_inventory += using // Integrated Light - using = new /atom/movable/screen/pai/light + using = new /atom/movable/screen/pai/light(src) using.screen_loc = ui_pai_light static_inventory += using // Newscaster - using = new /atom/movable/screen/pai/newscaster + using = new /atom/movable/screen/pai/newscaster(src) using.screen_loc = ui_pai_newscaster static_inventory += using // Language menu - using = new /atom/movable/screen/language_menu + using = new /atom/movable/screen/language_menu(src) using.screen_loc = ui_pai_language_menu static_inventory += using // Host Monitor - using = new /atom/movable/screen/pai/host_monitor() + using = new /atom/movable/screen/pai/host_monitor(src) using.screen_loc = ui_pai_host_monitor static_inventory += using // Crew Manifest - using = new /atom/movable/screen/pai/crew_manifest() + using = new /atom/movable/screen/pai/crew_manifest(src) using.screen_loc = ui_pai_crew_manifest static_inventory += using // Laws - using = new /atom/movable/screen/pai/state_laws() + using = new /atom/movable/screen/pai/state_laws(src) using.screen_loc = ui_pai_state_laws static_inventory += using // Modular Interface - using = new /atom/movable/screen/pai/modpc() + using = new /atom/movable/screen/pai/modpc(src) using.screen_loc = ui_pai_mod_int static_inventory += using mypai.pda_button = using @@ -237,22 +237,22 @@ tablet_button.pAI = mypai // Internal GPS - using = new /atom/movable/screen/pai/internal_gps() + using = new /atom/movable/screen/pai/internal_gps(src) using.screen_loc = ui_pai_internal_gps static_inventory += using // Take image - using = new /atom/movable/screen/pai/image_take() + using = new /atom/movable/screen/pai/image_take(src) using.screen_loc = ui_pai_take_picture static_inventory += using // View images - using = new /atom/movable/screen/pai/image_view() + using = new /atom/movable/screen/pai/image_view(src) using.screen_loc = ui_pai_view_images static_inventory += using // Radio - using = new /atom/movable/screen/pai/radio() + using = new /atom/movable/screen/pai/radio(src) using.screen_loc = ui_pai_radio static_inventory += using diff --git a/yogstation/code/game/gamemodes/darkspawn/darkspawn_hud.dm b/yogstation/code/game/gamemodes/darkspawn/darkspawn_hud.dm index 13890fcc370e..553f99906dd7 100644 --- a/yogstation/code/game/gamemodes/darkspawn/darkspawn_hud.dm +++ b/yogstation/code/game/gamemodes/darkspawn/darkspawn_hud.dm @@ -3,13 +3,13 @@ /datum/hud/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi') . = ..() - psi_counter = new /atom/movable/screen/darkspawn_psi + psi_counter = new /atom/movable/screen/darkspawn_psi(src) /datum/hud/human/New(mob/living/carbon/human/owner, ui_style = 'icons/mob/screen_midnight.dmi') . = ..() - psi_counter = new /atom/movable/screen/darkspawn_psi + psi_counter = new /atom/movable/screen/darkspawn_psi(src) infodisplay += psi_counter /datum/hud/Destroy() . = ..() - psi_counter = null \ No newline at end of file + psi_counter = null diff --git a/yogstation/code/game/gamemodes/vampire/vampire_hud.dm b/yogstation/code/game/gamemodes/vampire/vampire_hud.dm index c1bbbefae04c..f43b025c1d78 100644 --- a/yogstation/code/game/gamemodes/vampire/vampire_hud.dm +++ b/yogstation/code/game/gamemodes/vampire/vampire_hud.dm @@ -3,13 +3,13 @@ /datum/hud/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi') . = ..() - vamp_blood_display = new /atom/movable/screen/vampire() + vamp_blood_display = new /atom/movable/screen/vampire(src) /datum/hud/human/New(mob/living/carbon/human/owner, ui_style = 'icons/mob/screen_midnight.dmi') . = ..() - vamp_blood_display = new /atom/movable/screen/vampire() + vamp_blood_display = new /atom/movable/screen/vampire(src) infodisplay += vamp_blood_display /datum/hud/Destroy() . = ..() - vamp_blood_display = null \ No newline at end of file + vamp_blood_display = null