mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-19 05:26:28 +00:00
Makes the code compatible with 515.1594+
Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword
And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.
@tgstation/commit-access Since the .proc/stuff is pretty big change.
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
108 lines
3.4 KiB
Plaintext
108 lines
3.4 KiB
Plaintext
/** Creates a thinking indicator over the mob. */
|
|
/mob/proc/create_thinking_indicator()
|
|
return
|
|
|
|
/** Removes the thinking indicator over the mob. */
|
|
/mob/proc/remove_thinking_indicator()
|
|
return
|
|
|
|
/** Creates a typing indicator over the mob. */
|
|
/mob/proc/create_typing_indicator()
|
|
return
|
|
|
|
/** Removes the typing indicator over the mob. */
|
|
/mob/proc/remove_typing_indicator()
|
|
return
|
|
|
|
/** Removes any indicators and marks the mob as not speaking IC. */
|
|
/mob/proc/remove_all_indicators()
|
|
return
|
|
|
|
/mob/set_stat(new_stat)
|
|
. = ..()
|
|
if(.)
|
|
remove_all_indicators()
|
|
|
|
/mob/Logout()
|
|
remove_all_indicators()
|
|
return ..()
|
|
|
|
/// Whether or not to show a typing indicator when speaking. Defaults to on.
|
|
/datum/preference/toggle/typing_indicator
|
|
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
|
|
savefile_key = "typingIndicator"
|
|
savefile_identifier = PREFERENCE_PLAYER
|
|
|
|
/datum/preference/toggle/typing_indicator/apply_to_client(client/client, value)
|
|
client?.typing_indicators = value
|
|
|
|
/** Sets the mob as "thinking" - with indicator and variable thinking_IC */
|
|
/datum/tgui_say/proc/start_thinking()
|
|
if(!window_open || !client.typing_indicators)
|
|
return FALSE
|
|
/// Special exemptions
|
|
if(isabductor(client.mob))
|
|
return FALSE
|
|
client.mob.thinking_IC = TRUE
|
|
client.mob.create_thinking_indicator()
|
|
|
|
/** Removes typing/thinking indicators and flags the mob as not thinking */
|
|
/datum/tgui_say/proc/stop_thinking()
|
|
client.mob?.remove_all_indicators()
|
|
|
|
/**
|
|
* Handles the user typing. After a brief period of inactivity,
|
|
* signals the client mob to revert to the "thinking" icon.
|
|
*/
|
|
/datum/tgui_say/proc/start_typing()
|
|
client.mob.remove_thinking_indicator()
|
|
if(!window_open || !client.typing_indicators || !client.mob.thinking_IC)
|
|
return FALSE
|
|
client.mob.create_typing_indicator()
|
|
addtimer(CALLBACK(src, PROC_REF(stop_typing)), 5 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_STOPPABLE)
|
|
|
|
/**
|
|
* Callback to remove the typing indicator after a brief period of inactivity.
|
|
* If the user was typing IC, the thinking indicator is shown.
|
|
*/
|
|
/datum/tgui_say/proc/stop_typing()
|
|
if(!client?.mob)
|
|
return FALSE
|
|
client.mob.remove_typing_indicator()
|
|
if(!window_open || !client.typing_indicators || !client.mob.thinking_IC)
|
|
return FALSE
|
|
client.mob.create_thinking_indicator()
|
|
|
|
/// Overrides for overlay creation
|
|
/mob/living/create_thinking_indicator()
|
|
if(active_thinking_indicator || active_typing_indicator || !thinking_IC || stat != CONSCIOUS )
|
|
return FALSE
|
|
active_thinking_indicator = mutable_appearance('icons/mob/effects/talk.dmi', "[bubble_icon]3", TYPING_LAYER)
|
|
add_overlay(active_thinking_indicator)
|
|
play_fov_effect(src, 6, "talk", ignore_self = TRUE)
|
|
|
|
/mob/living/remove_thinking_indicator()
|
|
if(!active_thinking_indicator)
|
|
return FALSE
|
|
cut_overlay(active_thinking_indicator)
|
|
active_thinking_indicator = null
|
|
|
|
/mob/living/create_typing_indicator()
|
|
if(active_typing_indicator || active_thinking_indicator || !thinking_IC || stat != CONSCIOUS)
|
|
return FALSE
|
|
active_typing_indicator = mutable_appearance('icons/mob/effects/talk.dmi', "[bubble_icon]0", TYPING_LAYER)
|
|
add_overlay(active_typing_indicator)
|
|
play_fov_effect(src, 6, "talk", ignore_self = TRUE)
|
|
|
|
/mob/living/remove_typing_indicator()
|
|
if(!active_typing_indicator)
|
|
return FALSE
|
|
cut_overlay(active_typing_indicator)
|
|
active_typing_indicator = null
|
|
|
|
/mob/living/remove_all_indicators()
|
|
thinking_IC = FALSE
|
|
remove_thinking_indicator()
|
|
remove_typing_indicator()
|
|
|