runelite-client: remove chat color config from plugins
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
||||
* 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");
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user