This commit is contained in:
kevinz000
2020-03-04 15:42:01 -07:00
parent 0d312b8dff
commit d1f161fe0f
6 changed files with 40 additions and 25 deletions
+12 -11
View File
@@ -15,24 +15,25 @@ GLOBAL_LIST_EMPTY(typing_indicator_overlays)
/mob/proc/get_typing_indicator_icon_state()
return typing_indicator_state
/*!
* Displays typing indicator.
* @param timeout_override - Sets how long until this will disappear on its own without the user finishing their message or logging out. Defaults to src.typing_indicator_timeout
* @param state_override - Sets the state that we will fetch. Defaults to src.get_typing_indicator_icon_state()
* @param force - shows even if src.typing_indcator_enabled is FALSE.
*/
/**
* Displays typing indicator.
* @param timeout_override - Sets how long until this will disappear on its own without the user finishing their message or logging out. Defaults to src.typing_indicator_timeout
* @param state_override - Sets the state that we will fetch. Defaults to src.get_typing_indicator_icon_state()
* @param force - shows even if src.typing_indcator_enabled is FALSE.
*/
/mob/proc/display_typing_indicator(timeout_override = typing_indicator_timeout, state_override = get_typing_indicator_icon_state(), force = FALSE)
if(!typing_indicator_enabled || force)
if(!typing_indicator_enabled && !force)
return
add_overlay(get_indicator_overlay(state_override))
addtimer(CALLBACK(src, .proc/clear_typing_indicator, state_override), timeout_override, TIMER_STOPPABLE)
/*!
* Removes typing indicator.
* @param state_override Sets the state that we will remove. Defaults to src.get_typing_indicator_icon_state()
*/
/**
* Removes typing indicator.
* @param state_override Sets the state that we will remove. Defaults to src.get_typing_indicator_icon_state()
*/
/mob/proc/clear_typing_indicator(state_override = get_typing_indicator_icon_state())
deltimer(typing_indicator_timerid)
typing_indicator_timerid = null
cut_overlay(get_indicator_overlay(state_override))
/// Default typing indicator