Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
silicons committed Sep 20, 2024
1 parent bca43e9 commit a99feec
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 31 deletions.
2 changes: 0 additions & 2 deletions code/game/rendering/legacy/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ GLOBAL_DATUM_INIT(global_hud, /datum/global_hud, new)
wiz_energy_display = null
blobpwrdisplay = null
blobhealthdisplay = null
r_hand_hud_object = null
l_hand_hud_object = null
action_intent = null
move_intent = null
adding = null
Expand Down
29 changes: 1 addition & 28 deletions code/game/rendering/legacy/inventory/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,4 @@
/atom/movable/screen/inventory/plate/hand/Click()
usr.activate_hand_of_index(index)

Check failure on line 31 in code/game/rendering/legacy/inventory/inventory.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined proc: "activate_hand_of_index" on /mob

/atom/movable/screen/inventory/plate/hand/update_icon()
..()
if(!hud)
return
if(!handcuff_overlay)
handcuff_overlay = image(
"icon" = 'icons/mob/screen_gen.dmi',
"icon_state" = "[is_left_hand? "l_hand" : "r_hand"]_hud_handcuffs"
)
cut_overlays()
if(iscarbon(hud?.mymob))
var/mob/living/carbon/C = hud.mymob
if(C.handcuffed)
add_overlay(handcuff_overlay)

/atom/movable/screen/inventory/plate/hand/left
name = "l_hand"
is_left_hand = TRUE

/atom/movable/screen/inventory/plate/hand/right
name = "r_hand"
is_left_hand = FALSE

/atom/movable/screen/inventory/swap_hands
name = "swap hands"

/atom/movable/screen/inventory/swap_hands/Click()
usr.swap_hand()
#warn parse above

Check warning on line 33 in code/game/rendering/legacy/inventory/inventory.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn parse above
21 changes: 21 additions & 0 deletions code/game/rendering/mob_huds/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@
/atom/movable/screen/inventory/plate/hand
/// target hand index
var/hand_index
/// should we have handcuffed overlay?
var/handcuffed = FALSE

/atom/movable/screen/inventory/plate/hand/Initialize(mapload, datum/inventory/host, hand_index)
. = ..()
Expand All @@ -301,6 +303,18 @@
name = "[index % 2? "left" : "right"] hand[index > 1? " #[index]" : ""]"
icon_state = "hand-[index % 2? "left" : "right"]"

#warn hook

Check warning on line 306 in code/game/rendering/mob_huds/inventory.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn hook
/atom/movable/screen/inventory/plate/hand/proc/set_handcuffed(state)
if(state == handcuffed)
return
handcuffed = state
update_icon()

/atom/movable/screen/inventory/plate/hand/update_overlays()
. = ..()
if(handcuffed)
. += image('icons/mob/screen_gen.dmi', "[hand_index % 2 ? "r_hand" : "l_hand"]_hud_handcuffs")

/**
* Button: 'swap hand'
*/
Expand All @@ -312,6 +326,8 @@
icon = style.inventory_icons_wide

/atom/movable/screen/inventory/swap_hands/on_click(mob/user, list/params)
// todo: remote control
user.swap_hand()

/**
* Button: 'auto equip'
Expand All @@ -324,9 +340,14 @@
icon = style.inventory_icons

/atom/movable/screen/inventory/equip_hand/on_click(mob/user, list/params)
// todo: remote control
user.attempt_smart_equip(user.get_active_held_item())

/**
* Button: 'activate inhand'
*/
/atom/movable/screen/inventory/use_self_hand
#warn does main have this?

Check warning on line 350 in code/game/rendering/mob_huds/inventory.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn does main have this?

/atom/movable/screen/inventory/use_self_hand/on_click(mob/user, list/params)
// todo: remote control
2 changes: 1 addition & 1 deletion code/modules/mob/living/simple_mob/simple_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
hud_elements |= zone_sel

//Hand things
if(has_hands)
if(get_nominal_hand_count() > 0)
//Drop button
using = new /atom/movable/screen()
using.name = "drop"
Expand Down

0 comments on commit a99feec

Please sign in to comment.