diff --git a/code/controllers/subsystem/input.dm b/code/controllers/subsystem/input.dm index 2d80cb7f3c..add2682b35 100644 --- a/code/controllers/subsystem/input.dm +++ b/code/controllers/subsystem/input.dm @@ -68,17 +68,17 @@ SUBSYSTEM_DEF(input) macro_set_reverse_lookups = list( "default" = list( - "say" = list("T"), + "say_keybind" = list("T"), "whisper" = list("T", "Ctrl"), - "me" = list("M"), + "me_keybind" = list("M"), "subtle" = list("M", "Ctrl") ), "old_default" = list( - "say" = list("T", "Ctrl"), + "say_keybind" = list("T", "Ctrl"), ), "old_hotkeys" = list( - "say" = list("T"), - "me" = list("M"), + "say_keybind" = list("T"), + "me_keybind" = list("M"), ) ) diff --git a/code/modules/keybindings/bindings_mob.dm b/code/modules/keybindings/bindings_mob.dm index 6c7b3031c5..50770c130a 100644 --- a/code/modules/keybindings/bindings_mob.dm +++ b/code/modules/keybindings/bindings_mob.dm @@ -19,7 +19,7 @@ if(valid) display_typing_indicator() switch(_key) - if("Escape") + if("Escape") //escape breaks out of clientside verb text input without executing at all, meaning we can't hook the verb to do this for us. clear_typing_indicator() if("Delete", "H") if(!pulling) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 52e14a43e4..e3123dddd4 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -2221,8 +2221,3 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) /datum/species/proc/start_wagging_tail(mob/living/carbon/human/H) /datum/species/proc/stop_wagging_tail(mob/living/carbon/human/H) - - -/////// TYPING INDICATORS /////// -/datum/species/proc/get_typing_indicator_state() - return typing_indicator_state diff --git a/code/modules/mob/living/carbon/human/typing_indicator.dm b/code/modules/mob/living/carbon/human/typing_indicator.dm index 6d420c1f7b..16ed95790a 100644 --- a/code/modules/mob/living/carbon/human/typing_indicator.dm +++ b/code/modules/mob/living/carbon/human/typing_indicator.dm @@ -1,2 +1,2 @@ /mob/living/carbon/human/get_typing_indicator_icon_state() - return dna?.species?.get_typing_indicator_state() || ..() + return dna?.species?.typing_indicator_state || ..() diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index ac5924f6d8..bca634ada9 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -1,7 +1,17 @@ //Speech verbs. -/mob/verb/say_verb(message as text) +// the _keybind verbs uses "as text" versus "as text|null" to force a popup when pressed by a keybind. +/mob/verb/say_keybind(message as text) + set name = "say_keybind" + set hidden = TRUE + set category = "IC" + return say_verb(message) + +/mob/verb/say_verb(message as text|null) set name = "Say" set category = "IC" + display_typing_indicator() + if(!length(message)) + message = input(usr, "Say something!", "Say") as text|null clear_typing_indicator() // clear it immediately! if(!length(message)) return @@ -32,9 +42,18 @@ /mob/proc/whisper(message, datum/language/language=null) say(message, language) //only living mobs actually whisper, everything else just talks -/mob/verb/me_verb(message as message) +/mob/verb/me_keybind(message as message) + set name = "me_keybind" + set hidden = TRUE + set category = "IC" + return me_verb(message) + +/mob/verb/me_verb(message as message|null) set name = "Me" set category = "IC" + display_typing_indicator() + if(!length(message)) + message = input(usr, "What do you want to emote?" , "Emote") as message|null clear_typing_indicator() // clear it immediately! if(!length(message)) return diff --git a/code/modules/mob/typing_indicator.dm b/code/modules/mob/typing_indicator.dm index 2587839cb8..7ca9eb72e9 100644 --- a/code/modules/mob/typing_indicator.dm +++ b/code/modules/mob/typing_indicator.dm @@ -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