Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: bugfixes after zone refactor #6479

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,19 @@

/atom/movable/screen/zone_sel/Initialize(mapload, datum/hud/hud_owner, icon, alpha, color)
. = ..()

hover_overlays_cache = list()
selecting_overlays_cache = list()

if(icon)
src.icon = icon

if(alpha)
src.alpha = alpha

if(color)
src.color = color

hud.mymob.zone_selected = selecting
update_icon(UPDATE_OVERLAYS)

Expand Down Expand Up @@ -299,17 +304,20 @@
return set_selected_zone(choice)

/atom/movable/screen/zone_sel/AltClick(mob/user, choice)

if(user.next_click > world.time || user.next_move > world.time)
return FALSE

user.changeNext_click(1)

var/obj/item/holding_item = user.get_active_hand()
var/old_selecting = selecting

if(!istype(holding_item))
return FALSE

if(!set_selected_zone(choice, FALSE))
return FALSE

holding_item.melee_attack_chain(user, user)
set_selected_zone(old_selecting, FALSE)

Expand Down Expand Up @@ -337,8 +345,10 @@
hovering = choice

var/mutable_appearance/hovering_olay = hover_overlays_cache[hovering]

if(!hovering_olay)
hovering_olay = mutable_appearance(overlay_file, "[hovering]", alpha = 128, appearance_flags = RESET_COLOR)
var/datum/body_zone/zone = GLOB.body_zones[hovering]
hovering_olay = mutable_appearance(overlay_file, "[zone.name]", alpha = 128, appearance_flags = RESET_COLOR)
hover_overlays_cache[hovering] = hovering_olay

add_overlay(hovering_olay)
Expand Down Expand Up @@ -420,17 +430,22 @@
if(choice != selecting)
selecting = choice
hud.mymob.zone_selected = choice

if(update_overlay)
update_icon(UPDATE_OVERLAYS)

return TRUE


/atom/movable/screen/zone_sel/update_overlays()
. = ..()
var/mutable_appearance/selecting_olay = selecting_overlays_cache[selecting]

if(!selecting_olay)
selecting_olay = mutable_appearance(overlay_file, "[selecting]", appearance_flags = RESET_COLOR)
var/datum/body_zone/zone = GLOB.body_zones[selecting]
selecting_olay = mutable_appearance(overlay_file, "[zone.name]", appearance_flags = RESET_COLOR)
selecting_overlays_cache[selecting] = selecting_olay

. += selecting_olay


Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/human_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@


/mob/living/carbon/human/proc/handle_grasp()

if(!l_hand && !r_hand)
return

Expand Down