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

[UPSTREAM] TGUI Say #2618

Merged
merged 16 commits into from
May 17, 2024
Merged
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
45 changes: 23 additions & 22 deletions code/__DEFINES/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,36 @@
#define INVESTIGATE_VERB_EQUIPPED "equipped"

// Logging types for log_message()
#define LOG_ATTACK (1 << 0)
#define LOG_SAY (1 << 1)
#define LOG_WHISPER (1 << 2)
#define LOG_EMOTE (1 << 3)
#define LOG_DSAY (1 << 4)
#define LOG_PDA (1 << 5)
#define LOG_CHAT (1 << 6)
#define LOG_COMMENT (1 << 7)
#define LOG_TELECOMMS (1 << 8)
#define LOG_OOC (1 << 9)
#define LOG_ADMIN (1 << 10)
#define LOG_OWNERSHIP (1 << 11)
#define LOG_GAME (1 << 12)
#define LOG_ADMIN_PRIVATE (1 << 13)
#define LOG_ASAY (1 << 14)
#define LOG_MECHA (1 << 15)
#define LOG_VIRUS (1 << 16)
#define LOG_CLONING (1 << 17)
#define LOG_ID (1 << 18)
#define LOG_RADIO_EMOTE (1 << 19) //NSV13 - Radio emotes
#define LOG_ATTACK (1 << 0)
#define LOG_SAY (1 << 1)
#define LOG_WHISPER (1 << 2)
#define LOG_EMOTE (1 << 3)
#define LOG_DSAY (1 << 4)
#define LOG_PDA (1 << 5)
#define LOG_CHAT (1 << 6)
#define LOG_COMMENT (1 << 7)
#define LOG_TELECOMMS (1 << 8)
#define LOG_OOC (1 << 9)
#define LOG_ADMIN (1 << 10)
#define LOG_OWNERSHIP (1 << 11)
#define LOG_GAME (1 << 12)
#define LOG_ADMIN_PRIVATE (1 << 13)
#define LOG_ASAY (1 << 14)
#define LOG_MECHA (1 << 15)
#define LOG_VIRUS (1 << 16)
#define LOG_CLONING (1 << 17)
#define LOG_ID (1 << 18)
#define LOG_RADIO_EMOTE (1 << 19)
#define LOG_SPEECH_INDICATORS (1 << 20)

//Individual logging panel pages
#define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK)
#define INDIVIDUAL_SAY_LOG (LOG_SAY | LOG_WHISPER | LOG_DSAY)
#define INDIVIDUAL_SAY_LOG (LOG_SAY | LOG_WHISPER | LOG_DSAY | LOG_SPEECH_INDICATORS)
#define INDIVIDUAL_EMOTE_LOG (LOG_EMOTE)
#define INDIVIDUAL_COMMS_LOG (LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS)
#define INDIVIDUAL_OOC_LOG (LOG_OOC | LOG_ADMIN)
#define INDIVIDUAL_OWNERSHIP_LOG (LOG_OWNERSHIP)
#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME)
#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME | LOG_SPEECH_INDICATORS)

#define LOGSRC_CLIENT "Client"
#define LOGSRC_MOB "Mob"
Expand Down
10 changes: 8 additions & 2 deletions code/__DEFINES/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@
#define PREFTOGGLE_2_SHOW_CREDITS (1<<11)
#define PREFTOGGLE_2_HOTKEYS (1<<12)
#define PREFTOGGLE_2_WIDESCREEN (1<<13) //NSV13

#define TOGGLES_2_DEFAULT (PREFTOGGLE_2_FANCY_TGUI|PREFTOGGLE_2_LOCKED_TGUI|PREFTOGGLE_2_LOCKED_BUTTONS|PREFTOGGLE_2_WINDOW_FLASHING|PREFTOGGLE_2_CREW_OBJECTIVES|PREFTOGGLE_2_GHOST_HUD|PREFTOGGLE_2_GHOST_INQUISITIVENESS|PREFTOGGLE_2_AMBIENT_OCCLUSION|PREFTOGGLE_2_AUTO_FIT_VIEWPORT|PREFTOGGLE_2_ENABLE_TIPS|PREFTOGGLE_2_SHOW_CREDITS|PREFTOGGLE_2_HOTKEYS|PREFTOGGLE_2_WIDESCREEN)
#define PREFTOGGLE_2_TGUI_INPUT (1<<14)
#define PREFTOGGLE_2_BIG_BUTTONS (1<<15)
#define PREFTOGGLE_2_SWITCHED_BUTTONS (1<<16)
#define PREFTOGGLE_2_TGUI_SAY (1<<17)
#define PREFTOGGLE_2_SAY_LIGHT_THEME (1<<18)
#define PREFTOGGLE_2_SAY_SHOW_PREFIX (1<<19)

#define TOGGLES_2_DEFAULT (PREFTOGGLE_2_FANCY_TGUI|PREFTOGGLE_2_LOCKED_TGUI|PREFTOGGLE_2_LOCKED_BUTTONS|PREFTOGGLE_2_WINDOW_FLASHING|PREFTOGGLE_2_CREW_OBJECTIVES|PREFTOGGLE_2_GHOST_HUD|PREFTOGGLE_2_GHOST_INQUISITIVENESS|PREFTOGGLE_2_AMBIENT_OCCLUSION|PREFTOGGLE_2_AUTO_FIT_VIEWPORT|PREFTOGGLE_2_ENABLE_TIPS|PREFTOGGLE_2_SHOW_CREDITS|PREFTOGGLE_2_HOTKEYS|PREFTOGGLE_2_WIDESCREEN|PREFTOGGLE_2_TGUI_INPUT|PREFTOGGLE_2_BIG_BUTTONS|PREFTOGGLE_2_SWITCHED_BUTTONS|PREFTOGGLE_2_TGUI_SAY) //NSV13 - Widescreen

//Chat toggles
#define CHAT_OOC (1<<0)
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/radio.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// Radios use a large variety of predefined frequencies.

// ------------------------------------------------------------------------------------
//
// If you update these PLEASE update [[tgui\packages\tgui-say\constants\index.tsx]]
//
// ------------------------------------------------------------------------------------

//say based modes like binary are in living/say.dm

#define RADIO_CHANNEL_COMMON "Common"
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/speech_channels.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Used to direct channels to speak into.
#define SAY_CHANNEL "Say"
#define RADIO_CHANNEL "Radio"
#define ME_CHANNEL "Me"
#define OOC_CHANNEL "OOC"
#define LOOC_CHANNEL "LOOC"
5 changes: 5 additions & 0 deletions code/__DEFINES/tgui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"%7b%22type%22%3a%22[type]%22%2c%22payload%22%3a[url_encode(json_encode(payload))]%7d" \
)

/// Creates a message packet for sending via output() with no payload
#define TGUI_CREATE_MESSAGE_EMPTY(type) ( \
"%7b%22type%22%3a%22[type]%22%7d" \
)

/// Telemetry

/**
Expand Down
4 changes: 4 additions & 0 deletions code/__HELPERS/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@
if (CONFIG_GET(flag/log_vote))
WRITE_LOG(GLOB.world_game_log, "VOTE: [text]")

/// Logging for speech indicators.
/proc/log_speech_indicators(text)
if (CONFIG_GET(flag/log_speech_indicators))
WRITE_LOG(GLOB.world_speech_indicators_log, "SPEECH INDICATOR: [text]")

/proc/log_topic(text)
WRITE_LOG(GLOB.world_game_log, "TOPIC: [text]")
Expand Down
3 changes: 0 additions & 3 deletions code/_globalvars/lists/flavor_misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ GLOBAL_LIST_INIT(uplink_spawn_loc_list_save, list(UPLINK_PDA, UPLINK_RADIO, UPLI
//Female Uniforms
GLOBAL_LIST_EMPTY(female_clothing_icons)

//radical shit
GLOBAL_LIST_INIT(hit_appends, list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF"))

GLOBAL_LIST_INIT(scarySounds, list('sound/weapons/thudswoosh.ogg','sound/weapons/taser.ogg','sound/weapons/armbomb.ogg','sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg','sound/voice/hiss5.ogg','sound/voice/hiss6.ogg','sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg','sound/items/welder.ogg','sound/items/welder2.ogg','sound/machines/airlock.ogg','sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg'))


Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ GLOBAL_VAR(world_pda_log)
GLOBAL_PROTECT(world_pda_log)
GLOBAL_VAR(world_telecomms_log)
GLOBAL_PROTECT(world_telecomms_log)
GLOBAL_VAR(world_speech_indicators_log)
GLOBAL_PROTECT(world_speech_indicators_log)
GLOBAL_VAR(world_manifest_log)
GLOBAL_PROTECT(world_manifest_log)
GLOBAL_VAR(query_debug_log)
Expand Down
3 changes: 3 additions & 0 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@

/datum/config_entry/flag/log_world_topic // log all world.Topic() calls

/// log speech indicators(started/stopped speaking)
/datum/config_entry/flag/log_speech_indicators

/datum/config_entry/flag/log_manifest // log crew manifest to seperate file

/datum/config_entry/flag/log_job_debug // log roundstart divide occupations debug information to a file
Expand Down
8 changes: 0 additions & 8 deletions code/controllers/subsystem/input.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,19 @@ SUBSYSTEM_DEF(input)
if(default_macro_sets)
macro_sets = default_macro_sets
return

default_macro_sets = list(
"default" = list(
"Tab" = "\".winset \\\"input.focus=true?map.focus=true input.background-color=[COLOR_INPUT_DISABLED]:input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
"O" = "ooc",
"T" = "\".winset \\\"command=\\\".start_typing say\\\";command=.init_say;saywindow.is-visible=true;saywindow.input.focus=true\\\"\"",
"M" = "\".winset \\\"command=\\\".start_typing me\\\";command=.init_me;mewindow.is-visible=true;mewindow.input.focus=true\\\"\"",
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"", // This makes it so backspace can remove default inputs
"Any" = "\"KeyDown \[\[*\]\]\"",
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
),
"old_default" = list(
"Tab" = "\".winset \\\"mainwindow.macro=old_hotkeys map.focus=true input.background-color=[COLOR_INPUT_DISABLED]\\\"\"",
"Ctrl+T" = "\".winset \\\"command=\\\".start_typing say\\\";command=.init_say;saywindow.is-visible=true;saywindow.input.focus=true\\\"\"",
"Ctrl+O" = "ooc",
),
"old_hotkeys" = list(
"Tab" = "\".winset \\\"mainwindow.macro=old_default input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
"O" = "ooc",
"T" = "\".winset \\\"command=\\\".start_typing say\\\";command=.init_say;saywindow.is-visible=true;saywindow.input.focus=true\\\"\"",
"M" = "\".winset \\\"command=\\\".start_typing me\\\";command=.init_me;mewindow.is-visible=true;mewindow.input.focus=true\\\"\"",
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"", // This makes it so backspace can remove default inputs
"Any" = "\"KeyDown \[\[*\]\]\"",
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
Expand Down
2 changes: 1 addition & 1 deletion code/datums/martial/_martial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
log_combat(A, D, "punched")

if(!(D.mobility_flags & MOBILITY_STAND))
D.forcesay(GLOB.hit_appends)
D.force_say(A)
return 1

/datum/martial_art/proc/teach(mob/living/carbon/human/H,make_temporary=0)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/martial/boxing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"<span class='userdanger'>[A] knocks you out with a haymaker!</span>")
D.apply_effect(200,EFFECT_KNOCKDOWN,armor_block)
D.SetSleeping(100)
D.forcesay(GLOB.hit_appends)
D.force_say(A)
log_combat(A, D, "knocked out (boxing) ")
else if(!(D.mobility_flags & MOBILITY_STAND))
D.forcesay(GLOB.hit_appends)
D.force_say(A)
return 1

/obj/item/clothing/gloves/boxing
Expand Down
4 changes: 2 additions & 2 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1375,10 +1375,10 @@
log_game(log_text)
if(LOG_MECHA)
log_mecha(log_text)
//NSV13 START - RADIO EMOTES
if(LOG_RADIO_EMOTE)
log_radio_emote(log_text)
//NSV13 END
if(LOG_SPEECH_INDICATORS)
log_speech_indicators(log_text)
else
stack_trace("Invalid individual logging type: [message_type]. Defaulting to [LOG_GAME] (LOG_GAME).")
log_game(log_text)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/stunbaton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@

if(ishuman(target))
var/mob/living/carbon/human/H = target
H.forcesay(GLOB.hit_appends)
H.force_say(user)


return 1
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/tanks/jetpack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
/obj/item/tank/jetpack/suicide_act(mob/user)
if (istype(user, /mob/living/carbon/human/))
var/mob/living/carbon/human/H = user
H.forcesay("WHAT THE FUCK IS CARBON DIOXIDE?")
H.say(";WHAT THE FUCK IS CARBON DIOXIDE?", forced="jetpack suicide")
H.visible_message("<span class='suicide'>[user] is suffocating [user.p_them()]self with [src]! It looks like [user.p_they()] didn't read what that jetpack says!</span>")
return (OXYLOSS)
else
Expand Down
1 change: 1 addition & 0 deletions code/game/world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ GLOBAL_VAR(restart_counter)
GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"
GLOB.world_pda_log = "[GLOB.log_directory]/pda.log"
GLOB.world_telecomms_log = "[GLOB.log_directory]/telecomms.log"
GLOB.world_speech_indicators_log = "[GLOB.log_directory]/speech_indicators.log"
GLOB.world_manifest_log = "[GLOB.log_directory]/manifest.log"
GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log"
GLOB.sql_error_log = "[GLOB.log_directory]/sql.log"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ Congratulations! You are now trained for invasive xenobiology research!"}

if(ishuman(L))
var/mob/living/carbon/human/H = L
H.forcesay(GLOB.hit_appends)
H.force_say(user)

log_combat(user, L, "stunned")

Expand Down
8 changes: 8 additions & 0 deletions code/modules/asset_cache/asset_list_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
"tgui-panel.bundle.css" = file("tgui/public/tgui-panel.bundle.css"),
)

//For development purposes only
/datum/asset/simple/tgui_say
keep_local_name = TRUE
assets = list(
"tgui-say.bundle.js" = file("tgui/public/tgui-say.bundle.js"),
"tgui-say.bundle.css" = file("tgui/public/tgui-say.bundle.css"),
)

/datum/asset/simple/headers
assets = list(
"alarm_green.gif" = 'icons/program_icons/alarm_green.gif',
Expand Down
8 changes: 6 additions & 2 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
GLOB.clients += src
GLOB.directory[ckey] = src

// Instantiate tgui panel
tgui_panel = new(src)
// Instantiate tgui panel
tgui_panel = new(src, "browseroutput")

tgui_say = new(src, "tgui_say")

GLOB.ahelp_tickets.ClientLogin(src)
GLOB.interviews.client_login(src)
Expand Down Expand Up @@ -340,6 +342,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
// Initialize tgui panel
tgui_panel.Initialize()

tgui_say.initialize()

if(alert_mob_dupe_login && !holder)
var/dupe_login_message = "Your ComputerID has already logged in with another key this round, please log out of this one NOW or risk being banned!"
if (alert_admin_multikey)
Expand Down
42 changes: 40 additions & 2 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<b>UI Style:</b> <a href='?_src_=prefs;task=input;preference=ui'>[UI_style]</a><br>"
dat += "<b>Outline:</b> <a href='?_src_=prefs;preference=outline_enabled'>[toggles & PREFTOGGLE_OUTLINE_ENABLED ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>Outline Color:</b> <span style='border:1px solid #161616; background-color: [outline_color];'>&nbsp;&nbsp;&nbsp;</span> <a href='?_src_=prefs;preference=outline_color'>Change</a><BR>"
dat += "<b>tgui Monitors:</b> <a href='?_src_=prefs;preference=tgui_lock'>[(toggles2 & PREFTOGGLE_2_LOCKED_TGUI) ? "Primary" : "All"]</a><br>"
dat += "<b>tgui Style:</b> <a href='?_src_=prefs;preference=tgui_fancy'>[(toggles2 & PREFTOGGLE_2_FANCY_TGUI) ? "Fancy" : "No Frills"]</a><br>"
dat += "<b>Show Runechat Chat Bubbles:</b> <a href='?_src_=prefs;preference=chat_on_map'>[toggles & PREFTOGGLE_RUNECHAT_GLOBAL ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>See Runechat for non-mobs:</b> <a href='?_src_=prefs;preference=see_chat_non_mob'>[toggles & PREFTOGGLE_RUNECHAT_NONMOBS ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>See Runechat emotes:</b> <a href='?_src_=prefs;preference=see_rc_emotes'>[toggles & PREFTOGGLE_RUNECHAT_EMOTES ? "Enabled" : "Disabled"]</a><br>"
Expand Down Expand Up @@ -656,6 +654,20 @@ GLOBAL_LIST_EMPTY(preferences_datums)

// right box
dat += "<td width='400px' height='300px' valign='top'>"
dat += "<h2>TGUI Settings</h2>"
dat += "<b>Monitor Lock:</b> <a href='?_src_=prefs;preference=tgui_lock'>[(toggles2 & PREFTOGGLE_2_LOCKED_TGUI) ? "Primary" : "All"]</a><br>"
dat += "<b>Window Style:</b> <a href='?_src_=prefs;preference=tgui_fancy'>[(toggles2 & PREFTOGGLE_2_FANCY_TGUI) ? "Fancy (Borderless)" : "System Window"]</a><br>"
dat += "<br>"
dat += "<h3>TGUI Input</h3>"
dat += "<b>Input Engine:</b> <a href='?_src_=prefs;preference=tgui_input'>[(toggles2 & PREFTOGGLE_2_TGUI_INPUT) ? "TGUI" : "Classic"]</a><br>"
dat += "<b>Button Size:</b> <a href='?_src_=prefs;preference=tgui_big_buttons'>[(toggles2 & PREFTOGGLE_2_BIG_BUTTONS) ? "Large" : "Small"]</a><br>"
dat += "<b>Button Location:</b> <a href='?_src_=prefs;preference=tgui_switched_buttons'>[(toggles2 & PREFTOGGLE_2_SWITCHED_BUTTONS) ? "OK - Cancel" : "Cancel - OK"]</a><br>"
dat += "<br>"
dat += "<h3>TGUI Say</h3>"
dat += "<b>Say Engine:</b> <a href='?_src_=prefs;preference=tgui_say'>[(toggles2 & PREFTOGGLE_2_TGUI_SAY) ? "TGUI" : "Classic"]</a><br>"
dat += "<b>Say Theme:</b> <a href='?_src_=prefs;preference=tgui_say_light'>[(toggles2 & PREFTOGGLE_2_SAY_LIGHT_THEME) ? "Light" : "Dark"]</a><br>"
dat += "<b>Radio Prefixes:</b> <a href='?_src_=prefs;preference=tgui_say_radio_prefix'>[(toggles2 & PREFTOGGLE_2_SAY_SHOW_PREFIX) ? "Show" : "Hidden"]</a><br>"

dat += "<h2>Graphics Settings</h2>"
dat += "<b>FPS:</b> <a href='?_src_=prefs;preference=clientfps;task=input'>[clientfps]</a><br>"

Expand Down Expand Up @@ -2140,6 +2152,32 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if("pull_requests")
chat_toggles ^= CHAT_PULLR

if("tgui_input")
toggles2 ^= PREFTOGGLE_2_TGUI_INPUT

if("tgui_big_buttons")
toggles2 ^= PREFTOGGLE_2_BIG_BUTTONS

if("tgui_switched_buttons")
toggles2 ^= PREFTOGGLE_2_SWITCHED_BUTTONS

if("tgui_say")
toggles2 ^= PREFTOGGLE_2_TGUI_SAY
if(parent)
if(parent.tgui_say)
parent.tgui_say.close()
parent.set_macros()

if("tgui_say_light")
toggles2 ^= PREFTOGGLE_2_SAY_LIGHT_THEME
if(parent && parent.tgui_say) // change the theme
parent.tgui_say.load()

if("tgui_say_radio_prefix")
toggles2 ^= PREFTOGGLE_2_SAY_SHOW_PREFIX
if(parent && parent.tgui_say) // update the UI
parent.tgui_say.load()

if("parallaxup")
parallax = WRAP(parallax + 1, PARALLAX_INSANE, PARALLAX_DISABLE + 1)
if (parent && parent.mob && parent.mob.hud_used)
Expand Down
17 changes: 10 additions & 7 deletions code/modules/client/verbs/input_box.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,17 @@
winset(src, null, "[id].size=[window_width]x[window_height];[id].input.font-size=[font_size];[id].accept.font-size=[font_size];[id].cancel.font-size=[font_size]")
//End window scaling

center_window(id, window_width, window_height)

if(show)
//Show the window and focus on the textbox
winshow(src, id, TRUE)
winset(src, "[id].input", "focus=true")

/// Centers a window on the main game window for this client
/// Arguments: id - the id of the window to set the position of
/client/proc/center_window(id, window_width, window_height)
//Center the window on the main window
//The window size is hardcoded to be 410x133, taken from skin.dmf
var/mainwindow_data = params2list(winget(src, "mainwindow", "pos;outer-size;size;inner-size;is-maximized"))
var/mainwindow_pos = splittext(mainwindow_data["pos"], ",")
var/mainwindow_size = splittext(mainwindow_data["size"], "x")
Expand All @@ -106,12 +115,6 @@
target_y = text2num(mainwindow_pos[2])+text2num(mainwindow_outersize[2])/2-window_height/2

winset(src, id, "pos=[target_x],[target_y]")
//End centering

if(show)
//Show the window and focus on the textbox
winshow(src, id, TRUE)
winset(src, "[id].input", "focus=true")

///Presets for standard windows
GLOBAL_LIST_INIT(input_window_presets, list(
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/under/color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
can_adjust = FALSE

/obj/item/clothing/under/color/grey/glorf/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
owner.forcesay(GLOB.hit_appends)
owner.force_say(hitby)
return 0

/obj/item/clothing/under/color/blue
Expand Down
Loading
Loading