Files
Paradise/code/modules/mob/typing_indicator.dm
S34N 91660824fa Browser/TGUI Stat Panels (#24065)
* initial commit (broken)

* load the html

* fix this

* Fix various issues with browser statpanel

* Fix Alt Clicking opening up a window and Add back some object verbs to the browser stat panel

* Optimize stat panel and fix guardian verbs

* Restyles Stat Panel, Adds Subpanel Sub-Categories

* Use better layout for verbs in stat panel

* Updates statpanel verb widths to be more dynamic at higher screen resolutions.

* Adjust stat panel grid item widths and breakpoints

* refactors statpanel to use tgui API

* CI moment

* more CI

* this stupid thing

* Apply suggestions from code review

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/client/client_procs.dm

* ci fix

* emergency mc debug view

* temp revert some code change suggestions due to massive runtiming

* proper atom click topic implementation

* optimise

* mob clicking in stat panels work

* yeet spell tab thingy

* yeet simple stat panel pref

* allow insertion of html into MC tab content

* tidy up status tab

* Apply suggestions from code review

* fix this

* fix CI

* oops

* fix index runtime

* fixes MC tab showing up for mentors, fixes runtime

* safeties!

* Return of theme support

* more fixes

* fix view range pref, tidy prefs tab

* Remove old stat panel from themes

* fixes

* make sure verbs don't go missing

* fix ooc/looc breaking

* Revert "make sure verbs don't go missing"

This reverts commit 7d07ad45ed.

* fix this properly

* fix stat panel hitting rate limiters

* fix borg status tab

* Object Window Niceties

* Adds file cycling for icon2base64

* optimizes icon2html() for icon files known to be in the rsc at compile time

* CI moment

* remove dupe emergency shuttle timers

* more robust verb updates

* statpanel tweaks

* zip archived changelog to avoid search results

* optimise

* fix mentor chat wonkyness when disabled

* debug log moment

* i am very smart

* reintroduce this because it was needed

* better time listings

* less jank

* stops telling admins they arent mentors

* returns MC tab pref for admins

* Update code/controllers/subsystem/SSstatpanel.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* lewcc

* OD typemaker prep

---------

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Aylong <alexanderkitsa@gmail.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
2024-03-07 10:31:36 -05:00

111 lines
3.2 KiB
Plaintext

GLOBAL_LIST_EMPTY(typing_indicator)
GLOBAL_LIST_EMPTY(thinking_indicator)
/**
* Toggles the floating chat bubble above a players head.
*
* Arguments:
* * state - Should a chat bubble be shown or hidden
* * me - Is the bubble being caused by the 'me' emote command
*/
/mob/proc/set_typing_indicator(state, me)
if(!GLOB.typing_indicator[bubble_icon])
GLOB.typing_indicator[bubble_icon] = image('icons/mob/talk.dmi', null, "[bubble_icon]_typing", ABOVE_HUD_LAYER)
var/image/I = GLOB.typing_indicator[bubble_icon]
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
if(ishuman(src) && !me)
var/mob/living/carbon/human/H = src
if(HAS_TRAIT(H, TRAIT_MUTE))
overlays -= GLOB.typing_indicator[bubble_icon]
typing = FALSE
return FALSE
if(!client)
return FALSE
if(stat != CONSCIOUS || is_muzzled() || (client.prefs.toggles & PREFTOGGLE_SHOW_TYPING))
overlays -= GLOB.typing_indicator[bubble_icon]
typing = FALSE
return FALSE
if(state && !typing)
overlays += GLOB.typing_indicator[bubble_icon]
typing = TRUE
if(!state && typing)
overlays -= GLOB.typing_indicator[bubble_icon]
typing = FALSE
return state
/**
* Toggles the floating thought bubble above a players head.
*
* Arguments:
* * state - Should a thought bubble be shown or hidden
*/
/mob/proc/set_thinking_indicator(state)
if(!GLOB.thinking_indicator[bubble_icon])
GLOB.thinking_indicator[bubble_icon] = image('icons/mob/talk.dmi', null, "[bubble_icon]_thinking", ABOVE_HUD_LAYER)
var/image/I = GLOB.thinking_indicator[bubble_icon]
I.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
if(!client && !isliving(src))
return FALSE
if(stat != CONSCIOUS || (client.prefs.toggles & PREFTOGGLE_SHOW_TYPING))
overlays -= GLOB.thinking_indicator[bubble_icon]
thinking = FALSE
return FALSE
if(!state && thinking)
overlays -= GLOB.thinking_indicator[bubble_icon]
thinking = FALSE
if(state && !thinking)
overlays += GLOB.thinking_indicator[bubble_icon]
thinking = TRUE
return state
/mob/verb/say_wrapper()
set name = ".Say"
set hidden = TRUE
set_typing_indicator(TRUE)
typing = TRUE
var/message = typing_input(src, "", "say (text)")
typing = FALSE
set_typing_indicator(FALSE)
if(message)
say_verb(message)
/mob/verb/me_wrapper()
set name = ".Me"
set hidden = TRUE
set_typing_indicator(TRUE, TRUE)
typing = TRUE
var/message = typing_input(src, "", "me (text)")
typing = FALSE
set_typing_indicator(FALSE)
if(message)
me_verb(message)
/client/verb/typing_indicator()
set name = "Typing Indicator"
set category = "Preferences.Show/Hide"
set desc = "Toggles showing a typing/thought indicator when you have TGUIsay open."
prefs.toggles ^= PREFTOGGLE_SHOW_TYPING
prefs.save_preferences(src)
to_chat(src, "You will [(prefs.toggles & PREFTOGGLE_SHOW_TYPING) ? "no longer" : "now"] display a typing/thought indicator when you have TGUIsay open.")
// Clear out any existing typing indicator.
if(prefs.toggles & PREFTOGGLE_SHOW_TYPING)
if(istype(mob))
mob.set_typing_indicator(FALSE)
mob.set_thinking_indicator(FALSE)
SSblackbox.record_feedback("tally", "toggle_verbs", 1, "Toggle Typing Indicator (Speech)") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!