chat channel: add target mode config

This commit is contained in:
Adam
2021-06-02 10:57:09 -04:00
parent 8fe75748f9
commit 657132b39b
2 changed files with 34 additions and 1 deletions

View File

@@ -68,6 +68,17 @@ public interface ChatChannelConfig extends Config
return 20;
}
@ConfigItem(
keyName = "targetMode",
name = "Target mode",
description = "Enables target changing mode via /f, /c, and /g which controls which channel messages are sent to.",
position = 1
)
default boolean targetMode()
{
return true;
}
@ConfigItem(
keyName = "clanChatIcons",
name = "Chat Icons",

View File

@@ -172,7 +172,15 @@ public class ChatChannelPlugin extends Plugin
chats = null;
clientThread.invoke(() -> colorIgnoredPlayers(Color.WHITE));
rebuildFriendsChat();
inputMode = null;
if (inputMode != null)
{
clientThread.invoke(() ->
{
switchTypingMode(null);
client.runScript(ScriptID.CHAT_PROMPT_INIT);
});
}
}
@Subscribe
@@ -187,6 +195,15 @@ public class ChatChannelPlugin extends Plugin
Color ignoreColor = config.showIgnores() ? config.showIgnoresColor() : Color.WHITE;
clientThread.invoke(() -> colorIgnoredPlayers(ignoreColor));
if (inputMode != null && !config.targetMode())
{
clientThread.invoke(() ->
{
switchTypingMode(null);
client.runScript(ScriptID.CHAT_PROMPT_INIT);
});
}
}
}
@@ -600,6 +617,11 @@ public class ChatChannelPlugin extends Plugin
}
case "preChatSendpublic":
{
if (!config.targetMode())
{
return;
}
final String chatboxInput = client.getVar(VarClientStr.CHATBOX_TYPED_TEXT);
switch (chatboxInput)
{