Skip to content

Commit

Permalink
makes atom/movable/screen setup hud on new instead of relying on upda…
Browse files Browse the repository at this point in the history
…te icon (#19632)

it was done on the update appearance pr but it's neat and the pr is not getting anywhere until auxtools
  • Loading branch information
tattax authored Jul 13, 2023
1 parent 1d6c661 commit 1568b5f
Show file tree
Hide file tree
Showing 30 changed files with 254 additions and 292 deletions.
36 changes: 18 additions & 18 deletions code/_onclick/hud/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,20 @@
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
using.screen_loc = ui_ai_language_menu
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
Expand All @@ -214,80 +214,80 @@
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
using.screen_loc = ui_ai_multicam
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
Expand Down
29 changes: 14 additions & 15 deletions code/_onclick/hud/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
14 changes: 7 additions & 7 deletions code/_onclick/hud/alien_larva.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
..()
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

using = new/atom/movable/screen/language_menu
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
24 changes: 11 additions & 13 deletions code/_onclick/hud/blob_overmind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

5 changes: 2 additions & 3 deletions code/_onclick/hud/blobbernauthud.dm
Original file line number Diff line number Diff line change
@@ -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
blobpwrdisplay = new /atom/movable/screen/healths/blob/overmind(src)
infodisplay += blobpwrdisplay
6 changes: 3 additions & 3 deletions code/_onclick/hud/constructs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 8 additions & 8 deletions code/_onclick/hud/devil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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


Expand Down
Loading

0 comments on commit 1568b5f

Please sign in to comment.