Skip to content

Commit

Permalink
TGS Test Merge (#6878)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevinz authored and Kevinz committed Nov 20, 2024
2 parents 9786f64 + fba5fce commit 8b31b08
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 19 deletions.
6 changes: 4 additions & 2 deletions code/__DEFINES/_planes+layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,13 @@
#define HUD_LAYER_INVENTORY 3
/// storage objects sit here
#define HUD_LAYER_STORAGE 4
/// storage object item borders sit here
#define HUD_LAYER_STORAGE_ITEM_BOUNDING 5

// todo: deprecate
#define HUD_LAYER_ITEM 3 /// Things sitting on HUD items (largely irrelevant because INVENTORY_PLANE).
#define HUD_LAYER_ITEM 7 /// Things sitting on HUD items (largely irrelevant because INVENTORY_PLANE).
// todo: deprecate
#define HUD_LAYER_ABOVE 4 /// Things that reside above items (highlights).
#define HUD_LAYER_ABOVE 8 /// Things that reside above items (highlights).

/**
*! -- Player HUD Plane - Items
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/systems/storage/storage-screen_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@
overlays.len = 0
var/center_thickness = (width - (VOLUMETRIC_STORAGE_BOX_BORDER_SIZE * 2))
var/shift_from_center = -((WORLD_ICON_SIZE * 0.5) - VOLUMETRIC_STORAGE_BOX_BORDER_SIZE) + (center_thickness * 0.5)
var/image/left = image(icon, "stored_left", HUD_LAYER_STORAGE, null, -shift_from_center)
var/image/left = image(icon, "stored_left", HUD_LAYER_STORAGE_ITEM_BOUNDING, null, -shift_from_center)
left.plane = HUD_PLANE
var/image/right = image(icon, "stored_right", HUD_LAYER_STORAGE, null, shift_from_center)
var/image/right = image(icon, "stored_right", HUD_LAYER_STORAGE_ITEM_BOUNDING, null, shift_from_center)
right.plane = HUD_PLANE
var/image/middle = image(icon, "stored_middle", HUD_LAYER_STORAGE)
var/image/middle = image(icon, "stored_middle", HUD_LAYER_STORAGE_ITEM_BOUNDING)
middle.plane = HUD_PLANE
middle.transform = matrix(center_thickness / VOLUMETRIC_STORAGE_BOX_ICON_SIZE, 0, 0, 0, 1, 0)
underlays = list(left, middle, right)
overlays = list(left, middle, right)

/atom/movable/screen/storage/panel/volumetric

Expand Down
15 changes: 12 additions & 3 deletions code/game/rendering/actor_huds/huds/inventory-screen_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
return ..()

/atom/movable/screen/actor_hud/inventory/plate/update_icon(updates)
cut_overlays()
. = ..()
var/image/self_render = new
self_render.icon = self_icon
Expand All @@ -59,7 +60,7 @@
self_render.color = self_color
self_render.plane = HUD_PLANE
self_render.layer = HUD_LAYER_INVENTORY
underlays = list(self_render)
add_overlay(self_render)

/atom/movable/screen/actor_hud/inventory/plate/sync_style(datum/hud_style/style, style_alpha, style_color)
self_alpha = style_alpha
Expand Down Expand Up @@ -124,6 +125,8 @@
var/hand_index
/// should we have handcuffed overlay?
var/handcuffed = FALSE
/// should we have the active overlay?
var/active = FALSE

/atom/movable/screen/actor_hud/inventory/plate/hand/Initialize(mapload, datum/inventory/host, hand_index)
. = ..()
Expand All @@ -148,10 +151,16 @@
handcuffed = state
update_icon()

/atom/movable/screen/actor_hud/inventory/plate/hand/update_overlays()
/atom/movable/screen/actor_hud/inventory/plate/hand/update_icon(updates)
. = ..()
if(handcuffed)
. += image('icons/mob/screen_gen.dmi', "[hand_index % 2 ? "r_hand" : "l_hand"]_hud_handcuffs")
add_overlay(image('icons/mob/screen_gen.dmi', "[hand_index % 2 ? "r_hand" : "l_hand"]_hud_handcuffs"))
if(active)
var/image/active_image = new
active_image.icon_state = "[icon_state]-active"
active_image.plane = HUD_PLANE
active_image.layer = HUD_LAYER_INVENTORY
add_overlay(active_image)

/**
* Button: 'swap hand'
Expand Down
6 changes: 4 additions & 2 deletions code/game/rendering/actor_huds/huds/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@
return
if(applied_active_hand)
var/atom/movable/screen/actor_hud/inventory/plate/hand/old_hand = hands[applied_active_hand]
old_hand.cut_overlay("[old_hand.icon_state]-active")
old_hand.active = FALSE
old_hand.update_icon()
applied_active_hand = null
if(!to_index)
return
Expand All @@ -334,7 +335,8 @@
CRASH("attempted to set hand active out of bounds")
applied_active_hand = to_index
var/atom/movable/screen/actor_hud/inventory/plate/hand/new_hand = hands[to_index]
new_hand.add_overlay("[new_hand.icon_state]-active")
new_hand.active = TRUE
new_hand.update_icon()

//* Hooks *//

Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
return ..()

/mob/living/carbon/init_inventory()
. = ..()
if(inventory)
return
inventory = new(src)
inventory.set_hand_count(2)
if(species) // todo: sigh we need to talk about init order; this shouldn't be needed
inventory.set_inventory_slots(species.inventory_slots)
Expand Down
7 changes: 0 additions & 7 deletions code/modules/mob/living/living-inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@
SLOT_ID_MASK
)

//* Init *//

/mob/living/init_inventory()
if(inventory)
return
inventory = new(src)

//* Carry Weight *//

// don't call this you shouldn't need to
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/silicon/robot/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
wires = new(src)

robot_modules_background = new()
robot_modules_background.icon = 'icons/screen/hud/common/storage.dmi'
robot_modules_background.icon_state = "block"
ident = rand(1, 999)
module_sprites["Basic"] = "robot"
Expand Down
Binary file modified icons/mob/screen/orange.dmi
Binary file not shown.
Binary file modified icons/mob/screen/white.dmi
Binary file not shown.
Binary file modified icons/screen/hud/orange/inventory-slot.dmi
Binary file not shown.
Binary file modified icons/screen/hud/white/inventory-slot.dmi
Binary file not shown.

0 comments on commit 8b31b08

Please sign in to comment.