diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsConfig.java index 089acbe8db..606e48ff2e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsConfig.java @@ -24,7 +24,6 @@ */ package net.runelite.client.plugins.chatcommands; -import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; @@ -57,136 +56,4 @@ public interface ChatCommandsConfig extends Config { return true; } - - @ConfigItem( - position = 2, - keyName = "hexColorPublic", - name = "Public chat", - description = "Color of Public chat" - ) - default Color getPublicRecolor() - { - return Color.decode("#0000FF"); - } - - @ConfigItem( - position = 3, - keyName = "hexColorPublicH", - name = "Public chat highlight", - description = "Color of Public chat highlight" - ) - default Color getPublicHRecolor() - { - return Color.decode("#000000"); - } - - @ConfigItem( - position = 4, - keyName = "hexColorPrivate", - name = "Private chat", - description = "Color of Private chat" - ) - default Color getPrivateRecolor() - { - return Color.decode("#0088FF"); - } - - @ConfigItem( - position = 5, - keyName = "hexColorPrivateH", - name = "Private chat highlight", - description = "Color of Private chat highlight" - ) - default Color getPrivateHRecolor() - { - return Color.decode("#002783"); - } - - @ConfigItem( - position = 6, - keyName = "hexColorCc", - name = "Clan chat", - description = "Color of Clan chat" - ) - default Color getCcRecolor() - { - return Color.decode("#7f0000"); - } - - @ConfigItem( - position = 7, - keyName = "hexColorCcH", - name = "Clan chat Highlight", - description = "Color of Clan chat highlight" - ) - default Color getCcHRecolor() - { - return Color.decode("#000000"); - } - - @ConfigItem( - position = 8, - keyName = "transparentHexColorPublic", - name = "Transparent public chat", - description = "Color of Public chat" - ) - default Color getTransparentPublicRecolor() - { - return Color.decode("#9090FF"); - } - - @ConfigItem( - position = 9, - keyName = "transparentHexColorPublicH", - name = "Transparent public chat highlight", - description = "Color of Public chat highlight" - ) - default Color getTransparentPublicHRecolor() - { - return Color.decode("#FFFFFF"); - } - - @ConfigItem( - position = 10, - keyName = "transparentHexColorPrivate", - name = "Transparent private chat", - description = "Color of Private chat" - ) - default Color getTransparentPrivateRecolor() - { - return Color.decode("#FFFFFF"); - } - - @ConfigItem( - position = 11, - keyName = "transparentHexColorPrivateH", - name = "Transparent private chat highlight", - description = "Color of Private chat highlight" - ) - default Color getTransparentPrivateHRecolor() - { - return Color.decode("#00FFFF"); - } - - @ConfigItem( - position = 12, - keyName = "transparentHexColorCc", - name = "Transparent clan chat", - description = "Color of Clan chat" - ) - default Color getTransparentCcRecolor() - { - return Color.decode("#Ef5050"); - } - - @ConfigItem( - position = 13, - keyName = "transparentHexColorCcH", - name = "Transparent clan chat Highlight", - description = "Color of Clan chat highlight" - ) - default Color getTransparentCcHRecolor() - { - return Color.decode("#FFFFFF"); - } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 81fbd90c70..099ec4e356 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -38,10 +38,7 @@ import net.runelite.api.Client; import net.runelite.api.GameState; import net.runelite.api.ItemComposition; import net.runelite.api.MessageNode; -import net.runelite.api.events.ConfigChanged; -import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.SetMessage; -import net.runelite.client.chat.ChatColor; import net.runelite.client.chat.ChatColorType; import net.runelite.client.chat.ChatMessageBuilder; import net.runelite.client.chat.ChatMessageManager; @@ -83,67 +80,12 @@ public class ChatCommandsPlugin extends Plugin @Inject private ScheduledExecutorService executor; - @Override - protected void startUp() - { - cacheConfiguredColors(); - chatMessageManager.refreshAll(); - } - @Provides ChatCommandsConfig provideConfig(ConfigManager configManager) { return configManager.getConfig(ChatCommandsConfig.class); } - @Subscribe - public void onGameStateChange(GameStateChanged event) - { - if (event.getGameState().equals(GameState.LOGIN_SCREEN)) - { - cacheConfiguredColors(); - } - } - - @Subscribe - public void onConfigChanged(ConfigChanged event) - { - if (event.getGroup().equals("chatcommands")) - { - cacheConfiguredColors(); - chatMessageManager.refreshAll(); - } - } - - private void cacheConfiguredColors() - { - chatMessageManager - .cacheColor(new ChatColor(ChatColorType.NORMAL, config.getPublicRecolor(), false), - ChatMessageType.PUBLIC) - .cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, config.getPublicHRecolor(), false), - ChatMessageType.PUBLIC) - .cacheColor(new ChatColor(ChatColorType.NORMAL, config.getPrivateRecolor(), false), - ChatMessageType.PRIVATE_MESSAGE_SENT, ChatMessageType.PRIVATE_MESSAGE_RECEIVED) - .cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, config.getPrivateHRecolor(), false), - ChatMessageType.PRIVATE_MESSAGE_SENT, ChatMessageType.PRIVATE_MESSAGE_RECEIVED) - .cacheColor(new ChatColor(ChatColorType.NORMAL, config.getCcRecolor(), false), - ChatMessageType.CLANCHAT) - .cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, config.getCcHRecolor(), false), - ChatMessageType.CLANCHAT) - .cacheColor(new ChatColor(ChatColorType.NORMAL, config.getTransparentPublicRecolor(), true), - ChatMessageType.PUBLIC) - .cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, config.getTransparentPublicHRecolor(), true), - ChatMessageType.PUBLIC) - .cacheColor(new ChatColor(ChatColorType.NORMAL, config.getTransparentPrivateRecolor(), true), - ChatMessageType.PRIVATE_MESSAGE_SENT, ChatMessageType.PRIVATE_MESSAGE_RECEIVED) - .cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, config.getTransparentPrivateHRecolor(), true), - ChatMessageType.PRIVATE_MESSAGE_SENT, ChatMessageType.PRIVATE_MESSAGE_RECEIVED) - .cacheColor(new ChatColor(ChatColorType.NORMAL, config.getTransparentCcRecolor(), true), - ChatMessageType.CLANCHAT) - .cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, config.getTransparentCcHRecolor(), true), - ChatMessageType.CLANCHAT); - } - /** * Checks if the chat message is a command. * diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/dailytaskindicators/DailyTasksPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/dailytaskindicators/DailyTasksPlugin.java index fade8f4cca..2d8a43f65f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/dailytaskindicators/DailyTasksPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/dailytaskindicators/DailyTasksPlugin.java @@ -27,7 +27,6 @@ package net.runelite.client.plugins.dailytaskindicators; import com.google.common.eventbus.Subscribe; import com.google.inject.Provides; -import java.awt.Color; import javax.inject.Inject; import lombok.extern.slf4j.Slf4j; import net.runelite.api.ChatMessageType; @@ -37,7 +36,6 @@ import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.vars.AccountType; -import net.runelite.client.chat.ChatColor; import net.runelite.client.chat.ChatColorType; import net.runelite.client.chat.ChatMessageBuilder; import net.runelite.client.chat.ChatMessageManager; @@ -74,7 +72,6 @@ public class DailyTasksPlugin extends Plugin protected void startUp() throws Exception { hasSentHerbMsg = hasSentStavesMsg = hasSentEssenceMsg = false; - cacheColors(); } @Override @@ -164,11 +161,6 @@ public class DailyTasksPlugin extends Plugin return value == 0; // 1 = can't claim } - private void cacheColors() - { - chatMessageManager.cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, Color.RED, false), ChatMessageType.GAME).refreshAll(); - } - private void sendChatMessage(String chatMessage) { final String message = new ChatMessageBuilder() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExamineConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExamineConfig.java deleted file mode 100644 index 4f4baa79b7..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExamineConfig.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2017, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.examine; - -import java.awt.Color; -import net.runelite.client.config.Config; -import net.runelite.client.config.ConfigGroup; -import net.runelite.client.config.ConfigItem; - -@ConfigGroup( - keyName = "examine", - name = "Examine", - description = "Configuration for examine plugin" -) -public interface ExamineConfig extends Config -{ - @ConfigItem( - position = 2, - keyName = "hexColorExamine", - name = "Examine messages", - description = "Color of examine messages" - ) - default Color getExamineRecolor() - { - return Color.decode("#000000"); - } - - @ConfigItem( - position = 3, - keyName = "hexColorExamineH", - name = "Examine messages highlight", - description = "Color of examine messages highlight" - ) - default Color getExamineHRecolor() - { - return Color.decode("#0000FF"); - } - - @ConfigItem( - position = 4, - keyName = "transparentHexColorExamine", - name = "Transparent examine messages", - description = "Color of examine messages" - ) - default Color getTransparentExamineRecolor() - { - return Color.decode("#FFFFFF"); - } - - @ConfigItem( - position = 5, - keyName = "transparentHexColorExamineH", - name = "Transparent examine messages highlight", - description = "Color of examine messages highlight" - ) - default Color getTransparentExamineHRecolor() - { - return Color.decode("#9090FF"); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java index 8929428ec8..9c2ca1f522 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java @@ -27,7 +27,6 @@ package net.runelite.client.plugins.examine; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.eventbus.Subscribe; -import com.google.inject.Provides; import java.io.IOException; import java.time.Instant; import java.util.ArrayDeque; @@ -37,10 +36,8 @@ import javax.inject.Inject; import lombok.extern.slf4j.Slf4j; import net.runelite.api.ChatMessageType; import net.runelite.api.Client; -import net.runelite.api.GameState; import net.runelite.api.ItemComposition; import net.runelite.api.events.ChatMessage; -import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.widgets.Widget; @@ -48,12 +45,10 @@ import net.runelite.api.widgets.WidgetInfo; import static net.runelite.api.widgets.WidgetInfo.TO_CHILD; import static net.runelite.api.widgets.WidgetInfo.TO_GROUP; import net.runelite.api.widgets.WidgetItem; -import net.runelite.client.chat.ChatColor; import net.runelite.client.chat.ChatColorType; import net.runelite.client.chat.ChatMessageBuilder; import net.runelite.client.chat.ChatMessageManager; import net.runelite.client.chat.QueuedMessage; -import net.runelite.client.config.ConfigManager; import net.runelite.client.game.ItemManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; @@ -83,9 +78,6 @@ public class ExaminePlugin extends Plugin @Inject private Client client; - @Inject - private ExamineConfig config; - @Inject private ItemManager itemManager; @@ -95,51 +87,11 @@ public class ExaminePlugin extends Plugin @Inject private ScheduledExecutorService executor; - @Override - protected void startUp() - { - cacheConfiguredColors(); - chatMessageManager.refreshAll(); - } - - @Provides - ExamineConfig provideConfig(ConfigManager configManager) - { - return configManager.getConfig(ExamineConfig.class); - } - - @Subscribe - public void onConfigChanged(ConfigChanged event) - { - if (event.getGroup().equals("examine")) - { - cacheConfiguredColors(); - chatMessageManager.refreshAll(); - } - } - - private void cacheConfiguredColors() - { - chatMessageManager - .cacheColor(new ChatColor(ChatColorType.NORMAL, config.getExamineRecolor(), false), - ChatMessageType.EXAMINE_ITEM, ChatMessageType.EXAMINE_NPC, ChatMessageType.EXAMINE_OBJECT) - .cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, config.getExamineHRecolor(), false), - ChatMessageType.EXAMINE_ITEM, ChatMessageType.EXAMINE_NPC, ChatMessageType.EXAMINE_OBJECT) - .cacheColor(new ChatColor(ChatColorType.NORMAL, config.getTransparentExamineRecolor(), true), - ChatMessageType.EXAMINE_ITEM, ChatMessageType.EXAMINE_NPC, ChatMessageType.EXAMINE_OBJECT) - .cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, config.getTransparentExamineHRecolor(), true), - ChatMessageType.EXAMINE_ITEM, ChatMessageType.EXAMINE_NPC, ChatMessageType.EXAMINE_OBJECT); - } @Subscribe public void onGameStateChange(GameStateChanged event) { pending.clear(); - - if (event.getGameState().equals(GameState.LOGIN_SCREEN)) - { - cacheConfiguredColors(); - } } @Subscribe diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java index e17047c8e5..27bd48f589 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java @@ -27,7 +27,6 @@ package net.runelite.client.plugins.raids; import com.google.common.eventbus.Subscribe; import com.google.inject.Binder; import com.google.inject.Provides; -import java.awt.Color; import java.awt.image.BufferedImage; import java.io.IOException; import java.text.DecimalFormat; @@ -46,18 +45,17 @@ import net.runelite.api.Client; import net.runelite.api.GameState; import net.runelite.api.InstanceTemplates; import net.runelite.api.ObjectID; -import net.runelite.api.Point; -import net.runelite.api.VarPlayer; -import net.runelite.api.Tile; -import net.runelite.api.Varbits; import static net.runelite.api.Perspective.SCENE_SIZE; +import net.runelite.api.Point; +import net.runelite.api.Tile; +import net.runelite.api.VarPlayer; +import net.runelite.api.Varbits; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.VarbitChanged; import net.runelite.api.events.WidgetHiddenChanged; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; -import net.runelite.client.chat.ChatColor; import net.runelite.client.chat.ChatColorType; import net.runelite.client.chat.ChatMessageBuilder; import net.runelite.client.chat.ChatMessageManager; @@ -156,11 +154,6 @@ public class RaidsPlugin extends Plugin updateInfoBoxState(); } - if (config.pointsMessage()) - { - cacheColors(); - } - updateLists(); } @@ -176,11 +169,6 @@ public class RaidsPlugin extends Plugin @Subscribe public void onConfigChanged(ConfigChanged event) { - if (config.pointsMessage()) - { - cacheColors(); - } - if (event.getKey().equals("raidsTimer")) { updateInfoBoxState(); @@ -379,15 +367,6 @@ public class RaidsPlugin extends Plugin } } - private void cacheColors() - { - chatMessageManager.cacheColor(new ChatColor(ChatColorType.NORMAL, Color.BLACK, false), ChatMessageType.CLANCHAT_INFO) - .cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, Color.RED, false), ChatMessageType.CLANCHAT_INFO) - .cacheColor(new ChatColor(ChatColorType.NORMAL, Color.WHITE, true), ChatMessageType.CLANCHAT_INFO) - .cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, Color.RED, true), ChatMessageType.CLANCHAT_INFO) - .refreshAll(); - } - public int getRotationMatches() { String rotation = raid.getRotationString().toLowerCase();