Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 40 additions & 1 deletion src/main/java/dev/phyce/naturalspeech/SpeechEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand All @@ -243,14 +246,24 @@ 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;
}
}

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;

Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

//<editor-fold desc="> General Settings">
Expand Down Expand Up @@ -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;
}
//</editor-fold>

//<editor-fold desc="> Mute Options">
Expand Down