Skip to content

Commit

Permalink
Small CM-targeted tgchat tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
fira authored and Watermelon914 committed Jan 6, 2021
1 parent b1ad998 commit ec22080
Show file tree
Hide file tree
Showing 30 changed files with 147 additions and 101 deletions.
2 changes: 2 additions & 0 deletions ColonialMarinesALPHA.dme
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "code\__DEFINES\bsql.config.dm"
#include "code\__DEFINES\bsql.dm"
#include "code\__DEFINES\callback.dm"
#include "code\__DEFINES\chat.dm"
#include "code\__DEFINES\chemistry.dm"
#include "code\__DEFINES\clans.dm"
#include "code\__DEFINES\combat.dm"
Expand Down Expand Up @@ -1740,6 +1741,7 @@
#include "code\modules\test\testenv\test_environment.dm"
#include "code\modules\test\testenv\environments\tank_gallery.dm"
#include "code\modules\test\testenv\environments\example\envstring.dm"
#include "code\modules\tgchat\cm_shims.dm"
#include "code\modules\tgchat\message.dm"
#include "code\modules\tgchat\to_chat.dm"
#include "code\modules\tgui\external.dm"
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/__game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@
#define CHAT_TYPE_ALL ((1<<16) - 1) // this is so if we have newer flags, we still have ALL working. This will work for 16 first flags
#define CHAT_TYPE_TARGETS_ME CHAT_TYPE_TAKING_HIT

// Used for pre-setting tgchat message type as combat messages
#define CHAT_TYPE_ALL_COMBAT (CHAT_TYPE_BEING_HIT|CHAT_TYPE_WEAPON_USE|CHAT_TYPE_ARMOR_DAMAGE|CHAT_TYPE_MELEE_HIT|CHAT_TYPE_COMBAT_ACTION|CHAT_TYPE_XENO_COMBAT|CHAT_TYPE_TAKING_HIT)

// Window skin types
#define TOGGLE_WINDOW_SKIN 1

Expand Down
20 changes: 20 additions & 0 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*!
* Copyright (c) 2020 Aleksej Komarov
* SPDX-License-Identifier: MIT
*/

#define MESSAGE_TYPE_SYSTEM "system"
#define MESSAGE_TYPE_LOCALCHAT "localchat"
#define MESSAGE_TYPE_RADIO "radio"
#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_MODCHAT "modchat"
#define MESSAGE_TYPE_EVENTCHAT "eventchat"
#define MESSAGE_TYPE_ADMINLOG "adminlog"
#define MESSAGE_TYPE_ATTACKLOG "attacklog"
#define MESSAGE_TYPE_DEBUG "debug"
8 changes: 4 additions & 4 deletions code/__DEFINES/subsystem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@
#define SS_INIT_CHAT -100 //Should be last to ensure chat remains smooth during init.

#define SS_PRIORITY_TIMER 700
#define SS_PRIORITY_CHAT 400
#define SS_PRIORITY_STATPANEL 390
#define SS_PRIORITY_SOUND 250
#define SS_PRIORITY_TICKER 200
#define SS_PRIORITY_MAPVIEW 170
#define SS_PRIORITY_QUADTREE 150
#define SS_PRIORITY_CELLAUTO 150
#define SS_PRIORITY_QUADTREE 160
#define SS_PRIORITY_CHAT 155
#define SS_PRIORITY_STATPANEL 154
#define SS_PRIORITY_CELLAUTO 151
#define SS_PRIORITY_MOB 150
#define SS_PRIORITY_XENO 149
#define SS_PRIORITY_HUMAN 148
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/statpanel.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(statpanels)
name = "Stat Panels"
wait = 4
wait = 6
init_order = SS_INIT_STATPANELS
priority = SS_PRIORITY_STATPANEL
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
Expand Down
6 changes: 3 additions & 3 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ SUBSYSTEM_DEF(ticker)
return
if(isnull(start_at))
start_at = time_left || world.time + (CONFIG_GET(number/lobby_countdown) * 10)
to_chat(world, SPAN_ROUNDBODY("Welcome to the pre-game lobby of [CONFIG_GET(string/servername)]!"))
to_chat(world, SPAN_ROLE_BODY("Please, setup your character and select ready. Game will start in [round(time_left / 10) || CONFIG_GET(number/lobby_countdown)] seconds."))
to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, margin_top = 2, margin_bottom = 0, html = SPAN_ROUNDHEADER("Welcome to the pre-game lobby of [CONFIG_GET(string/servername)]!"))
to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, margin_top = 0, html = SPAN_ROUNDBODY("Please, setup your character and select ready. Game will start in [round(time_left / 10) || CONFIG_GET(number/lobby_countdown)] seconds."))
current_state = GAME_STATE_PREGAME
fire()

Expand Down Expand Up @@ -193,7 +193,7 @@ SUBSYSTEM_DEF(ticker)
mode.post_setup()

if(round_statistics)
to_world(SPAN_BLUE("<B>Welcome to [round_statistics.name]</B>"))
to_chat_spaced(world, html = FONT_SIZE_BIG(SPAN_ROLE_BODY("<B>Welcome to [round_statistics.name]</B>")))

supply_controller.process() //Start the supply shuttle regenerating points -- TLE

Expand Down
4 changes: 2 additions & 2 deletions code/datums/statistics/random_facts/random_fact.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

/datum/random_fact/proc/announce()
if(message)
to_world(SPAN_ROLE_BODY("|______________________|"))
to_chat_spaced(world, margin_bottom = 0, html = SPAN_ROLE_BODY("|______________________|"))
to_world(SPAN_ROLE_HEADER("FUN FACT"))
to_world(SPAN_CENTERBOLD(message))
to_world(SPAN_ROLE_BODY("|______________________|"))
to_chat_spaced(world, margin_top = 0, html = SPAN_ROLE_BODY("|______________________|"))
return TRUE
return FALSE
2 changes: 1 addition & 1 deletion code/defines/procs/announcement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,5 @@
if(istype(T, /mob/new_player))
continue

to_chat(T, "<br>[SPAN_ANNOUNCEMENT_HEADER(title)]<br><br>[SPAN_ANNOUNCEMENT_BODY(message)]<br><br>")
to_chat_spaced(T, html = "[SPAN_ANNOUNCEMENT_HEADER(title)]<br><br>[SPAN_ANNOUNCEMENT_BODY(message)]")
playsound_client(T.client, sound_to_play, T, vol = 45)
2 changes: 1 addition & 1 deletion code/game/gamemodes/colonialmarines/colonialmarines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
return TRUE

/datum/game_mode/colonialmarines/announce()
to_world("<span class='round_header'>The current map is - [SSmapping.configs[GROUND_MAP].map_name]!</span>")
to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDHEADER("The current map is - [SSmapping.configs[GROUND_MAP].map_name]!"))

////////////////////////////////////////////////////////////////////////////////////////
//Temporary, until we sort this out properly.
Expand Down
15 changes: 6 additions & 9 deletions code/game/gamemodes/colonialmarines/xenovsxeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
return TRUE

/datum/game_mode/xenovs/announce()
to_world("<span class='round_header'>The current map is - [SSmapping.configs[GROUND_MAP].map_name]!</span>")
to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDHEADER("The current map is - [SSmapping.configs[GROUND_MAP].map_name]!"))

/* Pre-setup */
/datum/game_mode/xenovs/pre_setup()
Expand Down Expand Up @@ -287,14 +287,11 @@
return TRUE

/datum/game_mode/xenovs/announce_ending()
if(round_statistics)
round_statistics.track_round_end()
log_game("Round end result: [round_finished]")
to_world("<span class='round_header'>|Round Complete|</span>")

to_world(SPAN_ROUNDBODY("Thus ends the story of the battling hives on [SSmapping.configs[GROUND_MAP].map_name]. [round_finished]"))
to_world(SPAN_ROUNDBODY("The game-mode was: [master_mode]!"))
to_world(SPAN_ROUNDBODY("End of Round Grief (EORG) is an IMMEDIATE 3 hour ban with no warnings, see rule #3 for more details."))
if(round_statistics)
round_statistics.track_round_end()
log_game("Round end result: [round_finished]")
to_chat_spaced(world, margin_top = 2, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDHEADER("|Round Complete|"))
to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDBODY("Thus ends the story of the battling hives on [SSmapping.configs[GROUND_MAP].map_name]. [round_finished]\nThe game-mode was: [master_mode]!\nEnd of Round Grief (EORG) is an IMMEDIATE 3 hour ban with no warnings, see rule #3 for more details."))

// for the toolbox
/datum/game_mode/xenovs/end_round_message()
Expand Down
12 changes: 4 additions & 8 deletions code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,8 @@ var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracki
if(round_statistics)
round_statistics.track_round_end()
log_game("Round end result: [round_finished]")
to_world("<span class='round_header'>|Round Complete|</span>")

to_world(SPAN_ROUNDBODY("Thus ends the story of the brave men and women of the [MAIN_SHIP_NAME] and their struggle on [SSmapping.configs[GROUND_MAP].map_name]."))
to_world(SPAN_ROUNDBODY("The game-mode was: [master_mode]!"))
to_world(SPAN_ROUNDBODY("End of Round Grief (EORG) is an IMMEDIATE 3 hour ban with no warnings, see rule #3 for more details."))

to_chat_spaced(world, margin_top = 2, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDHEADER("|Round Complete|"))
to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ROUNDBODY("Thus ends the story of the brave men and women of the [MAIN_SHIP_NAME] and their struggle on [SSmapping.configs[GROUND_MAP].map_name].\nThe game-mode was: [master_mode]!\nEnd of Round Grief (EORG) is an IMMEDIATE 3 hour ban with no warnings, see rule #3 for more details."))

/datum/game_mode/proc/declare_completion()
if(round_statistics)
Expand Down Expand Up @@ -215,7 +211,7 @@ var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracki
//Reports player logouts//
//////////////////////////
proc/display_roundstart_logout_report()
var/msg = SPAN_NOTICE("<b>Roundstart logout report\n\n")
var/msg = FONT_SIZE_LARGE("<b>Roundstart logout report\n\n")
for(var/i in GLOB.living_mob_list)
var/mob/living/L = i

Expand Down Expand Up @@ -257,7 +253,7 @@ proc/display_roundstart_logout_report()

for(var/mob/M in GLOB.player_list)
if(M.client.admin_holder && (M.client.admin_holder.rights & R_MOD))
to_chat(M, msg)
to_chat_spaced(M, html = msg)

//Announces objectives/generic antag text.
/proc/show_generic_antag_text(var/datum/mind/player)
Expand Down
15 changes: 8 additions & 7 deletions code/game/jobs/job/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,14 @@
title_given = lowertext(disp_title)

//Document syntax cannot have tabs for proper formatting.
var/t = {"
<span class='role_body'>|______________________|</span>
<span class='role_header'>You are \a [title_given]![flags_startup_parameters & ROLE_ADMIN_NOTIFY? "\nYou are playing a job that is important for game progression. If you have to disconnect, please notify the admins via adminhelp." : ""]</span>
<span class='role_body'>[generate_entry_message(H)].[M ? "\nYour account number is: <b>[M.account_number]</b>. Your account pin is: <b>[M.remote_access_pin]</b>." : ""]</span>
<span class='role_body'>|______________________|</span>
"}
to_chat(H, t)
var/entrydisplay = " \
[SPAN_ROLE_BODY("|______________________|")] \n\
[SPAN_ROLE_HEADER("You are \a [title_given]")] \n\
[flags_startup_parameters & ROLE_ADMIN_NOTIFY ? SPAN_ROLE_HEADER("You are playing a job that is important for game progression. If you have to disconnect, please notify the admins via adminhelp.") : ""] \n\
[SPAN_ROLE_BODY("[generate_entry_message(H)].[M ? "Your account number is: <b>[M.account_number]</b>. Your account pin is: <b>[M.remote_access_pin]</b>." : ""]")] \n\
[SPAN_ROLE_BODY("|______________________|")] \
"
to_chat_spaced(H, html = entrydisplay)

/datum/job/proc/generate_entry_conditions(mob/living/M, var/whitelist_status)
if (istype(M) && M.client)
Expand Down
2 changes: 1 addition & 1 deletion code/game/verbs/ooc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ var/global/normal_ooc_colour = "#1c52f5"
set name = "Current Map" //Gave this shit a shorter name so you only have to time out "ooc" rather than "ooc message" to use it --NeoFite
set desc = "Information about the current round"
set category = "OOC"
to_chat(usr, SPAN_NOTICE("The current map is [SSmapping.configs[GROUND_MAP].map_name]"))
to_chat_spaced(usr, html = FONT_SIZE_LARGE(SPAN_NOTICE("The current map is [SSmapping.configs[GROUND_MAP].map_name]")))

// Sometimes the game fails to close NanoUIs, seemingly at random. This makes it impossible to open new ones
// If this happens, let the player manually close them all
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/tabs/admin_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
if(message)
if(!check_rights(R_SERVER,0))
message = adminscrub(message,500)
to_world(SPAN_ANNOUNCEMENT_HEADER_BLUE(" <b>[usr.client.admin_holder.fakekey ? "Administrator" : usr.key] Announces:</b>\n \t [message]"))
to_chat_spaced(world, type = MESSAGE_TYPE_SYSTEM, html = SPAN_ANNOUNCEMENT_HEADER_BLUE(" <b>[usr.client.admin_holder.fakekey ? "Administrator" : usr.key] Announces:</b>\n \t [message]"))
log_admin("Announce: [key_name(usr)] : [message]")

/datum/admins/proc/player_notes_show(var/key as text)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/tabs/event_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@
if(!msg)
return

to_world(SPAN_ANNOUNCEMENT_HEADER_BLUE(msg))
to_chat_spaced(world, html = SPAN_ANNOUNCEMENT_HEADER_BLUE(msg))
message_staff("\bold GlobalNarrate: [key_name_admin(usr)] : [msg]")


Expand Down
6 changes: 3 additions & 3 deletions code/modules/admin/verbs/adminhelp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ var/global/list/ahelp_msgs = list()

GLOB.STUI.staff.Add("\[[time_stamp()]] <font color=red>[key_name(src)] AHELP: </font><font color='#006400'>[get_options_bar(mob, 4, 1, 1, 0)]:</b> [msg]</font><br>")
GLOB.STUI.processing |= STUI_LOG_STAFF_CHAT
msg = "<font color='#009900'><b>[selected_upper]: [get_options_bar(mob, 2, 1, 1, msg=original_msg)]:</b></font> <br>&emsp;<font color='#DA6200'><b>[msg]</font></b><br>"
msg = "<font color='#009900'><b>[selected_upper]: [get_options_bar(mob, 2, 1, 1, msg=original_msg)]:</b></font> <br>&emsp;<font color='#DA6200'><b>[msg]</font></b>"

var/list/list/current_staff = get_staff_by_category()
var/admin_number_afk = current_staff["afk"].len
Expand All @@ -130,10 +130,10 @@ var/global/list/ahelp_msgs = list()
for(var/client/X in admins) // Admins get the full monty
if(X.prefs.toggles_sound & SOUND_ADMINHELP)
sound_to(X, 'sound/effects/adminhelp_new.ogg')
to_chat(X, msg)
to_chat_spaced(X, type = MESSAGE_TYPE_ADMINPM, margin_bottom = 0.5, margin_top = 0.5, html = SPAN_PM(msg))

//show it to the person adminhelping too
to_chat(src, "<br><font color='#009900'><b>PM to Staff ([selected_type]):</font><br>&emsp;<font color='#DA6200'>[original_msg]</b></font><br>")
to_chat_spaced(src, margin_bottom = 0.5, margin_top = 0.5, type = MESSAGE_TYPE_ADMINPM, html = SPAN_PM("<font color='#009900'><b>PM to Staff ([selected_type]):</font><br>&emsp;<font color='#DA6200'>[original_msg]</b></font>"))

// Adminhelp cooldown
remove_verb(src, /client/verb/adminhelp)
Expand Down
6 changes: 3 additions & 3 deletions code/modules/admin/verbs/adminpm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
adminhelp(reply) //sender has left, adminhelp instead
return

recieve_message = SPAN_PM("<br><font color='[recieve_color]'><b>[recieve_pm_type] PM from [get_options_bar(src, C.admin_holder ? 1 : 0, C.admin_holder ? 1 : 0, 1)]: <font color='#DA6200'>[msg]</b></font><br>")
to_chat(C, recieve_message)
to_chat(src, SPAN_PM("<br><font color='#009900'><b>[send_pm_type]PM to [get_options_bar(C, admin_holder ? 1 : 0, admin_holder ? 1 : 0, 1)]: <font color='#DA6200'>[msg]</b></font><br>"))
recieve_message = SPAN_PM("<br><font color='[recieve_color]'><b>[recieve_pm_type] PM from [get_options_bar(src, C.admin_holder ? 1 : 0, C.admin_holder ? 1 : 0, 1)]: <font color='#DA6200'>[msg]</b></font>")
to_chat_spaced(C, margin_bottom = 0.5, margin_top = 0.5, type = MESSAGE_TYPE_ADMINPM, html = recieve_message)
to_chat_spaced(src, margin_bottom = 0.5, margin_top = 0.5, type = MESSAGE_TYPE_ADMINPM, html = SPAN_PM("<br><font color='#009900'><b>[send_pm_type]PM to [get_options_bar(C, admin_holder ? 1 : 0, admin_holder ? 1 : 0, 1)]: <font color='#DA6200'>[msg]</b></font>"))

//play the recieving admin the adminhelp sound
playsound_client(C, 'sound/effects/adminhelp-reply.ogg')
Expand Down
8 changes: 4 additions & 4 deletions code/modules/admin/verbs/mooc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
for(var/i in GLOB.alive_human_list)
var/mob/M = i
if(M.client && (!M.client.admin_holder || !(M.client.admin_holder.rights & R_MOD))) // Send to marines who are non-staff
to_chat(M, SPAN_MOOC("MOOC: [src.key]([src.admin_holder.rank]): [msg]"))
to_chat_spaced(M, margin_top = 0.5, margin_bottom = 0.5, html = SPAN_MOOC("MOOC: [src.key]([src.admin_holder.rank]): [msg]"))

var/list/synthetics = getsynths()
for(var/mob/M in synthetics)
if(M.client && !M.client.admin_holder)
to_chat(M, SPAN_MOOC("MOOC: [src.key]([src.admin_holder.rank]): [msg]"))
to_chat_spaced(M, margin_top = 0.5, margin_bottom = 0.5, html = SPAN_MOOC("MOOC: [src.key]([src.admin_holder.rank]): [msg]"))

for(var/mob/dead/observer/M in GLOB.observer_list)
if(M.client && !M.client.admin_holder) // Send to observers who are non-staff
to_chat(M, SPAN_MOOC("MOOC: [src.key]([src.admin_holder.rank]): [msg]"))
to_chat_spaced(M, margin_top = 0.5, margin_bottom = 0.5, html = SPAN_MOOC("MOOC: [src.key]([src.admin_holder.rank]): [msg]"))

for(var/client/C in GLOB.admins) // Send to staff
if(!(C.admin_holder.rights & R_MOD))
continue
to_chat(C, SPAN_MOOC("MOOC: [src.key]([src.admin_holder.rank]): [msg]"))
to_chat_spaced(C, margin_top = 0.5, margin_bottom = 0.5, html = SPAN_MOOC("MOOC: [src.key]([src.admin_holder.rank]): [msg]"))

2 changes: 1 addition & 1 deletion code/modules/admin/verbs/xooc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
if(!(C.admin_holder.rights & R_MOD))
continue

to_chat(C, SPAN_XOOC("XOOC: [src.key]([src.admin_holder.rank]): [msg]"))
to_chat_spaced(C, margin_top = 0.5, margin_bottom = 0.5, html = SPAN_XOOC("XOOC: [src.key]([src.admin_holder.rank]): [msg]"))
6 changes: 3 additions & 3 deletions code/modules/admin/verbs/yooc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
// Send to preds who are non-staff
for(var/mob/living/carbon/human/Y in GLOB.yautja_mob_list)
if(Y.client && !Y.client.admin_holder)
to_chat(Y, SPAN_YOOC(yooc_message))
to_chat_spaced(Y, margin_top = 0.5, margin_bottom = 0.5, html = SPAN_YOOC(yooc_message))

// Send to observers
for(var/mob/dead/observer/O in GLOB.observer_list)
if(O.client && !O.client.admin_holder) // Send to observers who are non-staff
to_chat(O, SPAN_YOOC(yooc_message))
to_chat_spaced(O, margin_top = 0.5, margin_bottom = 0.5, html = SPAN_YOOC(yooc_message))

// Send to staff
for(var/client/C in GLOB.admins) // Send to staff
if(!(C.admin_holder.rights & R_MOD))
continue
to_chat(C, SPAN_YOOC(yooc_message))
to_chat_spaced(C, margin_top = 0.5, margin_bottom = 0.5, html = SPAN_YOOC(yooc_message))
10 changes: 5 additions & 5 deletions code/modules/mob/hear_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,17 @@

if(sdisabilities & DEAF || ear_deaf)
if(prob(20))
to_chat(src, SPAN_WARNING("You feel your headset vibrate but can hear nothing from it!"))
to_chat(src, SPAN_WARNING("You feel your headset vibrate but can hear nothing from it!"), type = MESSAGE_TYPE_RADIO)
else if(track)
if(!command)
to_chat(src, "[part_a][comm_paygrade][track][part_b][verb], <span class=\"[style]\">\"[message]\"</span></span></span>")
to_chat(src, "[part_a][comm_paygrade][track][part_b][verb], <span class=\"[style]\">\"[message]\"</span></span></span>", type = MESSAGE_TYPE_RADIO)
else
to_chat(src, "<span class=\"[fontsize_style]\">[part_a][comm_paygrade][track][part_b][verb], <span class=\"[style]\">\"[message]\"</span></span></span></span>")
to_chat(src, "<span class=\"[fontsize_style]\">[part_a][comm_paygrade][track][part_b][verb], <span class=\"[style]\">\"[message]\"</span></span></span></span>", type = MESSAGE_TYPE_RADIO)
else
if(!command)
to_chat(src, "[part_a][comm_paygrade][speaker_name][part_b][verb], <span class=\"[style]\">\"[message]\"</span></span></span>")
to_chat(src, "[part_a][comm_paygrade][speaker_name][part_b][verb], <span class=\"[style]\">\"[message]\"</span></span></span>", type = MESSAGE_TYPE_RADIO)
else
to_chat(src, "<span class=\"[fontsize_style]\">[part_a][comm_paygrade][speaker_name][part_b][verb], <span class=\"[style]\">\"[message]\"</span></span></span></span>")
to_chat(src, "<span class=\"[fontsize_style]\">[part_a][comm_paygrade][speaker_name][part_b][verb], <span class=\"[style]\">\"[message]\"</span></span></span></span>", type = MESSAGE_TYPE_RADIO)

/mob/proc/hear_signlang(var/message, var/verb = "gestures", var/datum/language/language, var/mob/speaker = null)
var/comm_paygrade = ""
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 @@ -96,6 +96,8 @@
if(message_flags == CHAT_TYPE_OTHER || client.prefs && (message_flags & client.prefs.chat_display_preferences) > 0) // or logic between types
if(stat == UNCONSCIOUS)
to_chat(src, "<I>... You can almost hear someone talking ...</I>")
else if(message_flags & CHAT_TYPE_ALL_COMBAT) // Pre-tag combat messages for tgchat
to_chat(src, html = msg, type = MESSAGE_TYPE_COMBAT)
else
to_chat(src, msg)

Expand Down
18 changes: 18 additions & 0 deletions code/modules/tgchat/cm_shims.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Transitional helper for old style messages
//
// This is PURPOSEDLY a to_chat wrapper, and not SPAN macros,
// so you CAN'T end up shoving result somewhere else,
// as these things use display: block.
//
// This is fringe enough as is, and if you want anything
// specific, just do it properly for your message as a whole.

/proc/to_chat_spaced(target, html, type, text,
avoid_highlighting = FALSE,
margin_top = 1,
margin_bottom = 1,
margin_left = 0
)
if(html)
html = "<span style='display: block; margin: [margin_top]em 0 [margin_bottom]em [margin_left]em;'>[html]</span>"
return to_chat(target, html = html, type = type, text = text, avoid_highlighting = avoid_highlighting)
Loading

0 comments on commit ec22080

Please sign in to comment.