Files
IronDragoon d132c3c5af Headshots in Examine Box (#5767)
## About The Pull Request

I've been a player on Roguetown for a while, and a small thing I noticed
I missed a lot was the feature of displaying character headshots in the
examine text. As such, i've ported this in a fairly straightforward way
from Ratwood Keep.

The headshot will grow bigger on mouseover and shrink again when the
mouse moves away.

Headshots will be always hidden for someone who has an unknown identity
(masked and without standard ID).

There is an option toggle to not view chat headshots, should you prefer
to not see them.
## Why It's Good For The Game

Improves immersion, making it much quicker to see someone's headshot in
a situation instead of needing to examine them closer.

## Proof Of Testing
<details>
<summary>Screenshots/Videos</summary>
<img width="565" height="400" alt="image"
src="https://github.com/user-attachments/assets/1b1df66e-63ac-4e8d-be2d-36bcd3461724"
/>
<img width="593" height="393" alt="image"
src="https://github.com/user-attachments/assets/abd355e7-969b-42af-8eff-ded9acc1d52a"
/>
<img width="660" height="137" alt="image"
src="https://github.com/user-attachments/assets/5e890a80-f1a4-453a-8cbf-c96ea6ff0ace"
/>
<img width="613" height="293" alt="image"
src="https://github.com/user-attachments/assets/6024f190-4a1c-4daf-a6b5-d1ba0705c65c"
/>

</details>

## Changelog
🆑
add: Headshots now display in examine chat box. A toggle is added to
options to disable this if you so desire.
/🆑
2026-06-11 12:37:18 -04:00

61 lines
2.9 KiB
Plaintext

/*!
* Copyright (c) 2020 Aleksej Komarov
* SPDX-License-Identifier: MIT
*/
/// How many chat payloads to keep in history
#define CHAT_RELIABILITY_HISTORY_SIZE 5
/// How many resends to allow before giving up
#define CHAT_RELIABILITY_MAX_RESENDS 3
#define MESSAGE_TYPE_SYSTEM "system"
#define MESSAGE_TYPE_LOCALCHAT "localchat"
#define MESSAGE_TYPE_RADIO "radio"
#define MESSAGE_TYPE_ENTERTAINMENT = "entertainment"
#define MESSAGE_TYPE_INFO "info"
#define MESSAGE_TYPE_WARNING "warning"
#define MESSAGE_TYPE_DEADCHAT "deadchat"
#define MESSAGE_TYPE_OOC "ooc"
#define MESSAGE_TYPE_ADMINPM "adminpm"
#define MESSAGE_TYPE_COMBAT "combat"
#define MESSAGE_TYPE_ADMINCHAT "adminchat"
#define MESSAGE_TYPE_PRAYER "prayer"
#define MESSAGE_TYPE_MODCHAT "modchat"
#define MESSAGE_TYPE_EVENTCHAT "eventchat"
#define MESSAGE_TYPE_ADMINLOG "adminlog"
#define MESSAGE_TYPE_ATTACKLOG "attacklog"
#define MESSAGE_TYPE_DEBUG "debug"
/// Max length of chat message in characters
#define CHAT_MESSAGE_MAX_LENGTH 110
//debug printing macros (for development and testing)
/// Used for debug messages to the world
#define debug_world(msg) if (GLOB.debugging_enabled) to_chat(world, \
type = MESSAGE_TYPE_DEBUG, \
text = "DEBUG: [msg]")
/// Used for debug messages to the player
#define debug_usr(msg) if (GLOB.debugging_enabled && usr) to_chat(usr, \
type = MESSAGE_TYPE_DEBUG, \
text = "DEBUG: [msg]")
/// Used for debug messages to the admins
#define debug_admins(msg) if (GLOB.debugging_enabled) to_chat(GLOB.admins, \
type = MESSAGE_TYPE_DEBUG, \
text = "DEBUG: [msg]")
/// Used for debug messages to the server
#define debug_world_log(msg) if (GLOB.debugging_enabled) log_world("DEBUG: [msg]")
/// Adds a generic box around whatever message you're sending in chat. Really makes things stand out.
#define boxed_message(str) ("<div class='boxed_message'>" + str + "</div>")
/// Adds a box around whatever message you're sending in chat. Can apply color and/or additional classes. Available colors: red, green, blue, purple. Use it like red_box
#define custom_boxed_message(classes, str) ("<div class='boxed_message " + classes + "'>" + str + "</div>")
/// Makes a fieldset with a neaty styled name. Can apply additional classes.
#define fieldset_block(title, content, classes) ("<fieldset class='fieldset " + classes + "'><legend class='fieldset_legend'>" + title + "</legend>" + content + "</fieldset>")
/// Makes a horizontal line with text in the middle
#define separator_hr(str) ("<div class='separator'>" + str + "</div>")
/// Emboldens runechat messages
#define RUNECHAT_BOLD(str) "+[str]+"
/// Helper which creates a chat message which may have a tooltip in some contexts, but not others.
#define conditional_tooltip(normal_text, tooltip_text, condition) ((condition) ? (span_tooltip(tooltip_text, normal_text)) : (normal_text))
/// Displays a character headshot in chat examine output.
#define chat_headshot(str) ("<div class='chat_headshot'><img src='" + str + "' alt='Character headshot'/></div>")