chat channel: add target mode config
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user