diff --git a/code/datums/keybindings/emote.dm b/code/datums/keybindings/emote.dm index ba2a86b08f0..1d16bd1484a 100644 --- a/code/datums/keybindings/emote.dm +++ b/code/datums/keybindings/emote.dm @@ -141,6 +141,10 @@ linked_emote = /datum/emote/living/snore name = "Snore" +/datum/keybinding/emote/nightmare + linked_emote = /datum/emote/living/nightmare + name = "Nightmare" + /datum/keybinding/emote/stare linked_emote = /datum/emote/living/stare name = "Stare" @@ -263,6 +267,10 @@ linked_emote = /datum/emote/living/carbon/faint name = "Faint" +/datum/keybinding/emote/carbon/sign + linked_emote = /datum/emote/living/carbon/sign + name = "Sign" + /datum/keybinding/emote/carbon/alien category = KB_CATEGORY_EMOTE_ALIEN @@ -377,6 +385,10 @@ linked_emote = /datum/emote/living/carbon/human/salute name = "Salute" +/datum/keybinding/emote/carbon/human/sign/signal + linked_emote = /datum/emote/living/carbon/sign/signal + name = "Signal" + /datum/keybinding/emote/carbon/human/shrug linked_emote = /datum/emote/living/carbon/human/shrug name = "Shrug" @@ -413,6 +425,10 @@ linked_emote = /datum/emote/living/carbon/human/snap name = "Snap" +/datum/keybinding/emote/carbon/human/crack + linked_emote = /datum/emote/living/carbon/human/crack + name = "Crack" + /datum/keybinding/emote/carbon/human/fart linked_emote = /datum/emote/living/carbon/human/fart name = "Fart" diff --git a/code/modules/unit_tests/emotes.dm b/code/modules/unit_tests/emotes.dm index 18f7c4b11e3..c231c031a15 100644 --- a/code/modules/unit_tests/emotes.dm +++ b/code/modules/unit_tests/emotes.dm @@ -1,5 +1,16 @@ + /datum/unit_test/emote/Run() + + // Special cases that shouldn't need keybinds. + var/list/ignored_emote_types = list( + /datum/emote/living/simple_animal/slime, // The emotes are usable if you are a slime, but I don't think we need to flood the keybind list with them + /datum/emote/help, + /datum/emote/living/custom // This one's handled by its own set of keybinds + ) + + var/list/keybound_emotes = get_emote_keybinds() + // be aware that some of these values (like message, message_param) are subject to being set at runtime. for(var/emote_type in subtypesof(/datum/emote)) var/datum/emote/cur_emote = new emote_type() @@ -18,6 +29,10 @@ if(isnull(cur_emote.emote_type)) Fail("emote [cur_emote] has a null target type.") + // If we're at this point, we're definitely an emote that a user could use, and therefore ought to make sure it's bound to a keybind if possible. + if(!is_type_in_list(cur_emote, keybound_emotes) && !is_type_in_list(cur_emote, ignored_emote_types)) + Fail("Emote [cur_emote] is usable, but not assigned a keybind.") + if(isnum(cur_emote.max_stat_allowed) && cur_emote.max_stat_allowed < cur_emote.stat_allowed) Fail("emote [cur_emote]'s max_stat_allowed is greater than its stat_allowed, and would be unusable.") @@ -25,5 +40,13 @@ Fail("emote [cur_emote]'s max_unintentional_stat_allowed is greater than its unintentional_stat_allowed, and would be unusable.") -/datum/unit_test/emote/proc/has_punctuation(datum/emote/E, msg) - return E.remove_ending_punctuation(msg) == msg + +/datum/unit_test/emote/proc/get_emote_keybinds() + var/list/bound_emotes = list() + for(var/keybind in subtypesof(/datum/keybinding/emote)) + var/datum/keybinding/emote/E = new keybind() + bound_emotes |= E.linked_emote + + return bound_emotes + +