Skip to content

Commit

Permalink
Revert "Revert "Имя на ошейнике (BlueMoon-Labs#674)""
Browse files Browse the repository at this point in the history
This reverts commit 7cf6ba6.
  • Loading branch information
SmiLeYre committed Jan 6, 2024
1 parent 7cf6ba6 commit 179d151
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1581,6 +1581,12 @@
var/shift_lmb_ctrl_shift_lmb_line = ""
var/extra_lines = 0
var/extra_context = ""
var/auxiliary_name = ""

if(ishuman(src))
var/mob/living/carbon/human/H = src
var/obj/item/clothing/neck/petcollar/collar = H.wear_neck
auxiliary_name = (collar && collar.tagname) ? "\[[collar.tagname]\]" : ""

if ((isliving(user) || isovermind(user) || isaicamera(user)) && (user.client.prefs.screentip_pref != SCREENTIP_PREFERENCE_NO_CONTEXT))
var/obj/item/held_item = user.get_active_held_item()
Expand Down Expand Up @@ -1651,7 +1657,7 @@
active_hud.screentip_text.maptext = ""
else
//We inline a MAPTEXT() here, because there's no good way to statically add to a string like this
active_hud.screentip_text.maptext = "<span class='context' style='text-align: center; color: [user.client.prefs.screentip_color]'>[name][extra_context]</span>"
active_hud.screentip_text.maptext = "<span class='context' style='text-align: center; color: [user.client.prefs.screentip_color]'>[name] [auxiliary_name][extra_context]</span>"

/**
* Recursive getter method to return a list of all ghosts orbitting this atom
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/neck/_neck.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@

/obj/item/clothing/neck/petcollar/attack_self(mob/user)
tagname = stripped_input(user, "Would you like to change the name on the tag?", "Name your new pet", "Spot", MAX_NAME_LEN)
name = "[initial(name)] - [tagname]"
name = tagname ? "[initial(name)] - [tagname]" : initial(name)

/obj/item/clothing/neck/petcollar/Entered(atom/movable/AM)
. = ..()
Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
var/mob/living/L = user
if(HAS_TRAIT(L, TRAIT_PROSOPAGNOSIA) || HAS_TRAIT(L, TRAIT_INVISIBLE_MAN))
obscure_name = TRUE
. = list("<span class='info'>Это - <EM>[!obscure_name ? name : "Неизвестный"]</EM>!")
var/obj/item/clothing/neck/petcollar/collar = wear_neck
var/collar_tagname = (collar && collar.tagname) ? " \[[collar.tagname]\]" : ""
. = list("<span class='info'>Это - <EM>[!obscure_name ? name : "Неизвестный"][collar_tagname]</EM>!")
if(skipface || get_visible_name() == "Unknown")
. += "Вы не можете разобрать, к какому виду относится находящееся перед вами существо."
else
Expand Down

0 comments on commit 179d151

Please sign in to comment.