diff --git a/FEATURES.md b/FEATURES.md index eb5d38c8..9720fb07 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -41,6 +41,7 @@ Intergrated with [Spam Filter](https://runelite.net/plugin-hub/show/spamfilter) ## 1.3.0 - Fixed numbers with commas in system messages not being read correctly +- Audit of `ChatMessageType` coverage: previously-dropped message types (challenge requests, trade sent, friend list changes, etc.) now speak; all system message types respect the System messages toggle; new "Did you know?" and "Level up messages" toggles (both off by default) ## 1.2.6 - Updated Menu event handler to work with the latest update affecting submenus diff --git a/src/main/java/dev/phyce/naturalspeech/SpeechEventHandler.java b/src/main/java/dev/phyce/naturalspeech/SpeechEventHandler.java index 0ea170b8..5475ea3f 100644 --- a/src/main/java/dev/phyce/naturalspeech/SpeechEventHandler.java +++ b/src/main/java/dev/phyce/naturalspeech/SpeechEventHandler.java @@ -199,11 +199,11 @@ public static boolean isChatInnerVoice(ChatMessage message) { case PUBLICCHAT: return Objects.equals(Text.standardize(message.getName()), getLocalPlayerUsername()); case PRIVATECHATOUT: - case MODPRIVATECHAT: case ITEM_EXAMINE: case NPC_EXAMINE: case OBJECT_EXAMINE: case TRADEREQ: + case TRADE_SENT: return true; default: return false; @@ -233,6 +233,9 @@ public static boolean isChatSystemVoice(ChatMessageType messageType) { case LOGINLOGOUTNOTIFICATION: case BROADCAST: case IGNORENOTIFICATION: + case FRIENDNOTIFICATION: + case FRIENDSCHATNOTIFICATION: + case SNAPSHOTFEEDBACK: case CLAN_MESSAGE: case CONSOLE: case TRADE: @@ -243,6 +246,11 @@ public static boolean isChatSystemVoice(ChatMessageType messageType) { case CLAN_GIM_FORM_GROUP: case CLAN_GIM_GROUP_WITH: case GAMEMESSAGE: + case DIDYOUKNOW: + case LEVELUPMESSAGE: + case CHALREQ_TRADE: + case CHALREQ_FRIENDSCHAT: + case CHALREQ_CLANCHAT: return true; default: return false; @@ -250,7 +258,12 @@ public static boolean isChatSystemVoice(ChatMessageType messageType) { } public boolean isChatMessageMuted(ChatMessage message) { + // AUTOTYPER and MODAUTOTYPER are always muted - they're the in-game + // "autotyper" mechanism we have no reason to voice. SPAM is content + // that the game (or our SpamFilter) has already flagged - don't speak it. if (message.getType() == ChatMessageType.AUTOTYPER) return true; + if (message.getType() == ChatMessageType.MODAUTOTYPER) return true; + if (message.getType() == ChatMessageType.SPAM) return true; // dialog messages are handled in onWidgetLoad if (message.getType() == ChatMessageType.DIALOG) return true; @@ -358,9 +371,35 @@ public boolean isMessageTypeDisabledInConfig(ChatMessage message) { case WELCOME: case GAMEMESSAGE: case CONSOLE: + case ENGINE: + case BROADCAST: + case IGNORENOTIFICATION: + case TRADE: + case PLAYERRELATED: + case TENSECTIMEOUT: + case SNAPSHOTFEEDBACK: + case CLAN_GIM_FORM_GROUP: + case CLAN_GIM_GROUP_WITH: + if (!config.systemMesagesEnabled()) return true; + break; + case LOGINLOGOUTNOTIFICATION: + case FRIENDNOTIFICATION: + case FRIENDSCHATNOTIFICATION: + if (!config.friendsChatEnabled()) return true; if (!config.systemMesagesEnabled()) return true; break; + case CLAN_CREATION_INVITATION: + if (!config.clanChatEnabled()) return true; + if (!config.systemMesagesEnabled()) return true; + break; + case DIDYOUKNOW: + if (!config.didYouKnowEnabled()) return true; + break; + case LEVELUPMESSAGE: + if (!config.levelUpMessagesEnabled()) return true; + break; case TRADEREQ: + case TRADE_SENT: case CHALREQ_CLANCHAT: case CHALREQ_FRIENDSCHAT: case CHALREQ_TRADE: diff --git a/src/main/java/dev/phyce/naturalspeech/configs/NaturalSpeechConfig.java b/src/main/java/dev/phyce/naturalspeech/configs/NaturalSpeechConfig.java index 3dd4cac6..c766b4c6 100644 --- a/src/main/java/dev/phyce/naturalspeech/configs/NaturalSpeechConfig.java +++ b/src/main/java/dev/phyce/naturalspeech/configs/NaturalSpeechConfig.java @@ -39,6 +39,8 @@ final class ConfigKeys { public static final String SHORTENED_PHRASES = "shortenedPhrases"; public static final String HOLD_SHIFT_RIGHT_CLICK_MENU = "holdShiftRightClickMenu"; public static final String MUTE_GRAND_EXCHANGE_NPC_SPAM = "muteGrandExchangeNpcSpam"; + public static final String DID_YOU_KNOW = "didYouKnow"; + public static final String LEVEL_UP_MESSAGES = "levelUpMessages"; } // @@ -284,6 +286,28 @@ default boolean requestsEnabled() { default boolean systemMesagesEnabled() { return true; } + + @ConfigItem( + keyName=ConfigKeys.DID_YOU_KNOW, + name="\"Did you know?\" tips", + description="Speak the periodic \"Did you know?\" tips the game shows.", + section=ttsOptionsSection, + position=13 + ) + default boolean didYouKnowEnabled() { + return false; + } + + @ConfigItem( + keyName=ConfigKeys.LEVEL_UP_MESSAGES, + name="Level up messages", + description="Speak the \"Check the skill guide\" message that fires alongside the level-up jingle.", + section=ttsOptionsSection, + position=14 + ) + default boolean levelUpMessagesEnabled() { + return false; + } // //