Skip to content

Commit

Permalink
Move holocards to the squad hud (#6029)
Browse files Browse the repository at this point in the history
# About the pull request

This PR is a followup to #5968 which made holocards more prominent. Now
the holocards are tied to the squad hud.

Changes to sprites are just to move the holocards into the dmi with the
rest of the squad hud icons.

# Explain why it's good for the game

It is not super important that this overlay *always* be displayed, and
especially not to xenos. Now it is as if your squad visor is identifying
the person you are looking at.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>


https://github.com/cmss13-devs/cmss13/assets/76988376/b4f0e369-a269-4678-9f17-69dafffe0848

</details>


# Changelog
:cl: Drathek
add: Moved holocards to the squad hud
/:cl:
  • Loading branch information
Drulikar committed Mar 31, 2024
1 parent 4d403fe commit ad5daf7
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 21 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#define STATUS_HUD_XENO_CULTIST "24" // Whether they are a xeno cultist or not
#define HUNTER_CLAN "25" //Displays a colored icon to represent ingame Hunter Clans
#define HUNTER_HUD "26" //Displays various statuses on mobs for Hunters to identify targets
#define HOLOCARD_HUD "27" //Displays the holocards set by medical personnel

//data HUD (medhud, sechud) defines
#define MOB_HUD_SECURITY_BASIC 1
Expand Down
10 changes: 8 additions & 2 deletions code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(

//Factions
/datum/mob_hud/faction
hud_icons = list(FACTION_HUD, ORDER_HUD)
hud_icons = list(FACTION_HUD, ORDER_HUD, HOLOCARD_HUD)
var/faction_to_check = FACTION_MARINE

/datum/mob_hud/faction/add_to_single_hud(mob/user, mob/target)
Expand All @@ -209,7 +209,7 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
faction_to_check = FACTION_PMC

/datum/mob_hud/faction/observer
hud_icons = list(FACTION_HUD, ORDER_HUD, HUNTER_CLAN)
hud_icons = list(FACTION_HUD, ORDER_HUD, HUNTER_CLAN, HOLOCARD_HUD)

///////// MOB PROCS //////////////////////////////:

Expand Down Expand Up @@ -753,7 +753,13 @@ GLOBAL_DATUM(hud_icon_hudfocus, /image)
holder.overlays += GLOB.hud_icon_hudfocus
hud_list[ORDER_HUD] = holder

/mob/proc/hud_set_holocard()
return

// HOLOCARD HUD
/mob/living/carbon/human/hud_set_holocard()
var/image/holder = hud_list[HOLOCARD_HUD]
holder.icon_state = holo_card_color ? "holo_card_[holo_card_color]" : "hudblank"

// Xeno "hostile" HUD
/mob/living/carbon/human/proc/update_xeno_hostile_hud()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@
return
holo_card_color = null
to_chat(user, SPAN_NOTICE("You reset your holocard."))
update_targeted()
hud_set_holocard()
return
to_chat(user, SPAN_WARNING("You're not trained to use this."))
return
Expand All @@ -917,7 +917,7 @@
else if(newcolor != holo_card_color)
holo_card_color = newcolor
to_chat(user, SPAN_NOTICE("You add a [newcolor] holo card on [src]."))
update_targeted()
hud_set_holocard()

/mob/living/carbon/human/tgui_interact(mob/user, datum/tgui/ui) // I'M SORRY, SO FUCKING SORRY
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
var/last_chew = 0

//taken from human.dm
hud_possible = list(HEALTH_HUD,STATUS_HUD, STATUS_HUD_OOC, STATUS_HUD_XENO_INFECTION, STATUS_HUD_XENO_CULTIST, ID_HUD, WANTED_HUD, ORDER_HUD, XENO_HOSTILE_ACID, XENO_HOSTILE_SLOW, XENO_HOSTILE_TAG, XENO_HOSTILE_FREEZE, HUNTER_CLAN, HUNTER_HUD, FACTION_HUD)
hud_possible = list(HEALTH_HUD, STATUS_HUD, STATUS_HUD_OOC, STATUS_HUD_XENO_INFECTION, STATUS_HUD_XENO_CULTIST, ID_HUD, WANTED_HUD, ORDER_HUD, XENO_HOSTILE_ACID, XENO_HOSTILE_SLOW, XENO_HOSTILE_TAG, XENO_HOSTILE_FREEZE, HUNTER_CLAN, HUNTER_HUD, FACTION_HUD, HOLOCARD_HUD)
var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
var/allow_gun_usage = TRUE
var/melee_allowed = TRUE
Expand Down
16 changes: 0 additions & 16 deletions code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -225,22 +225,6 @@ There are several things that need to be remembered:
overlays_standing[HAIR_LAYER] = hair_s
apply_overlay(HAIR_LAYER)

//Call when target overlay should be added/removed
/mob/living/carbon/human/update_targeted()
remove_overlay(TARGETED_LAYER)

var/image/holo_card_image

if(holo_card_color)
holo_card_image = image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "holo_card_[holo_card_color]")

if(!holo_card_image)
return

holo_card_image.layer = -TARGETED_LAYER
overlays_standing[TARGETED_LAYER] = holo_card_image
apply_overlay(TARGETED_LAYER)

//Call when someone is gauzed or splinted, or when one of those items are removed
/mob/living/carbon/human/update_med_icon()
remove_overlay(MEDICAL_LAYER)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
I = image('icons/mob/hud/sec_hud.dmi', src, "")
if(HUNTER_CLAN,HUNTER_HUD)
I = image('icons/mob/hud/hud_yautja.dmi', src, "")
if(HOLOCARD_HUD)
I = image('icons/mob/hud/marine_hud.dmi', src, "")
I.appearance_flags |= NO_CLIENT_COLOR|KEEP_APART|RESET_COLOR
hud_list[hud] = I

Expand Down
Binary file modified icons/effects/Targeted.dmi
Binary file not shown.
Binary file modified icons/mob/hud/marine_hud.dmi
Binary file not shown.

0 comments on commit ad5daf7

Please sign in to comment.