Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
silicons committed Nov 16, 2024
1 parent de56b5f commit ef0f672
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions code/__DEFINES/screen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
//* Mob HUD - Inventory *//

/// screen loc for a hand index
#define SCREEN_LOC_MOB_HUD_INVENTORY_HAND(HAND) "CENTER[index % 2? "" : "-1"]:16,BOTTOM[index < 2? "" : "+[(round(index / 2) - 1)]"]:5"
#define SCREEN_LOC_MOB_HUD_INVENTORY_HAND(HAND) "CENTER[index % 2? "-1" : ""]:16,BOTTOM[index < 2? "" : "+[(round(index / 2) - 1)]"]:5"
/// screen loc for hand swap button for a given number of hands
#define SCREEN_LOC_MOB_HUD_INVENTORY_HAND_SWAP(TOTAL_HANDS) "CENTER-1:24,BOTTOM+[ceil(TOTAL_HANDS - 2 / 2)]:5"
#define SCREEN_LOC_MOB_HUD_INVENTORY_HAND_SWAP(TOTAL_HANDS) "CENTER-1:28,BOTTOM+[ceil(TOTAL_HANDS - 2 / 2)]:5"
/// screen loc for hand swap button for a given number of hands
#define SCREEN_LOC_MOB_HUD_INVENTORY_EQUIP_HAND(TOTAL_HANDS) "CENTER-1:16,BOTTOM+[ceil(TOTAL_HANDS - 2 / 2)]:5"
/// the bottom-left drawer position of inventory HUD
Expand Down
8 changes: 7 additions & 1 deletion code/game/rendering/actor_huds/huds/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,21 @@
var/atom/movable/screen/actor_hud/inventory/plate/slot/aligning = cross_axis_list[main_axis]
aligning.inventory_hud_cross_axis = cross_axis - 1
aligning.inventory_hud_main_axis = main_axis - 1
aligned += aligning
for(var/cross_axis in 1 to length(cross_axis_for_hands_left))
var/list/cross_axis_list = cross_axis_for_hands_left[cross_axis]
for(var/main_axis in 1 to length(cross_axis_list))
var/atom/movable/screen/actor_hud/inventory/plate/slot/aligning = cross_axis_list[main_axis]
aligning.inventory_hud_cross_axis = cross_axis - 1
aligning.inventory_hud_main_axis = -main_axis
aligned += aligning
for(var/cross_axis in 1 to length(cross_axis_for_hands_right))
var/list/cross_axis_list = cross_axis_for_hands_right[cross_axis]
for(var/main_axis in 1 to length(cross_axis_list))
var/atom/movable/screen/actor_hud/inventory/plate/slot/aligning = cross_axis_list[main_axis]
aligning.inventory_hud_cross_axis = cross_axis - 1
aligning.inventory_hud_main_axis = main_axis
aligned += aligning

for(var/atom/movable/screen/actor_hud/inventory/plate/slot/slot_object as anything in aligned)
switch(slot_object.inventory_hud_anchor)
Expand Down Expand Up @@ -394,7 +397,7 @@

/atom/movable/screen/actor_hud/inventory/plate/hand/proc/sync_index(index = hand_index)
screen_loc = SCREEN_LOC_MOB_HUD_INVENTORY_HAND(index)
name = "[index % 2? "left" : "right"] hand[index > 1? " #[index]" : ""]"
name = "[index % 2? "left" : "right"] hand[index > 2? " #[index]" : ""]"
icon_state = "hand-[index % 2? "left" : "right"]"

/atom/movable/screen/actor_hud/inventory/plate/hand/proc/set_handcuffed(state)
Expand All @@ -412,6 +415,7 @@
* Button: 'swap hand'
*/
/atom/movable/screen/actor_hud/inventory/drawer
name = "drawer"
icon_state = "drawer"
screen_loc = SCREEN_LOC_MOB_HUD_INVENTORY_DRAWER

Expand All @@ -431,6 +435,7 @@
* Button: 'swap hand'
*/
/atom/movable/screen/actor_hud/inventory/swap_hand
name = "swap active hand"
icon_state = "hand-swap"
/atom/movable/screen/actor_hud/inventory/swap_hand/Initialize(mapload, datum/inventory/host, hand_count)
. = ..()
Expand All @@ -448,6 +453,7 @@
* Button: 'auto equip'
*/
/atom/movable/screen/actor_hud/inventory/equip_hand
name = "equip held item"
icon_state = "button-equip"

/atom/movable/screen/actor_hud/inventory/equip_hand/Initialize(mapload, datum/inventory/host, hand_count)
Expand Down

0 comments on commit ef0f672

Please sign in to comment.