Add JagexColors constants file, update Color uses
Fixes runelite/runelite#4073
This commit is contained in:
@@ -50,6 +50,7 @@ import net.runelite.api.events.SetMessage;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ChatColorConfig;
|
||||
import net.runelite.client.ui.JagexColors;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
@Singleton
|
||||
@@ -206,18 +207,18 @@ public class ChatMessageManager
|
||||
{
|
||||
case PUBLIC:
|
||||
case PUBLIC_MOD:
|
||||
return Color.decode("#0000FF");
|
||||
return JagexColors.CHAT_PUBLIC_TEXT_OPAQUE_BACKGROUND;
|
||||
case PRIVATE_MESSAGE_SENT:
|
||||
case PRIVATE_MESSAGE_RECEIVED_MOD:
|
||||
case PRIVATE_MESSAGE_RECEIVED:
|
||||
return Color.decode("#00FFFF");
|
||||
return JagexColors.CHAT_PRIVATE_MESSAGE_TEXT_OPAQUE_BACKGROUND;
|
||||
case CLANCHAT:
|
||||
return Color.decode("#7F0000");
|
||||
return JagexColors.CHAT_CLAN_TEXT_OPAQUE_BACKGROUND;
|
||||
case EXAMINE_ITEM:
|
||||
case EXAMINE_OBJECT:
|
||||
case EXAMINE_NPC:
|
||||
case GAME:
|
||||
return Color.decode("#000000");
|
||||
return JagexColors.CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -226,18 +227,18 @@ public class ChatMessageManager
|
||||
{
|
||||
case PUBLIC:
|
||||
case PUBLIC_MOD:
|
||||
return Color.decode("#9090FF");
|
||||
return JagexColors.CHAT_PUBLIC_TEXT_TRANSPARENT_BACKGROUND;
|
||||
case PRIVATE_MESSAGE_SENT:
|
||||
case PRIVATE_MESSAGE_RECEIVED_MOD:
|
||||
case PRIVATE_MESSAGE_RECEIVED:
|
||||
return Color.decode("#00FFFF");
|
||||
return JagexColors.CHAT_PRIVATE_MESSAGE_TEXT_TRANSPARENT_BACKGROUND;
|
||||
case CLANCHAT:
|
||||
return Color.decode("#7F0000");
|
||||
return JagexColors.CHAT_CLAN_TEXT_TRANSPARENT_BACKGROUND;
|
||||
case EXAMINE_ITEM:
|
||||
case EXAMINE_OBJECT:
|
||||
case EXAMINE_NPC:
|
||||
case GAME:
|
||||
return Color.decode("#FFFFFF");
|
||||
return JagexColors.CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
package net.runelite.client.config;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.runelite.client.ui.JagexColors;
|
||||
|
||||
@ConfigGroup("textrecolor")
|
||||
public interface ChatColorConfig extends Config
|
||||
@@ -94,7 +95,7 @@ public interface ChatColorConfig extends Config
|
||||
)
|
||||
default Color opaqueClanChatInfo()
|
||||
{
|
||||
return Color.BLACK;
|
||||
return JagexColors.CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
@@ -334,7 +335,7 @@ public interface ChatColorConfig extends Config
|
||||
)
|
||||
default Color transparentClanChatInfo()
|
||||
{
|
||||
return Color.WHITE;
|
||||
return JagexColors.CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
|
||||
@@ -27,6 +27,7 @@ package net.runelite.client.menus;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.runelite.client.ui.JagexColors;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
public final class WidgetMenuOption
|
||||
@@ -42,7 +43,7 @@ public final class WidgetMenuOption
|
||||
/**
|
||||
* The color that the menuTarget should be. Defaults to the brownish color that most menu options have.
|
||||
*/
|
||||
private Color color = Color.decode("#ff9040");
|
||||
private Color color = JagexColors.MENU_TARGET;
|
||||
|
||||
/**
|
||||
* The widget to add the option to
|
||||
|
||||
@@ -83,13 +83,14 @@ import static net.runelite.client.plugins.banktags.BankTagsPlugin.SPLITTER;
|
||||
import static net.runelite.client.plugins.banktags.BankTagsPlugin.TAG_SEARCH;
|
||||
import static net.runelite.client.plugins.banktags.BankTagsPlugin.VAR_TAG_SUFFIX;
|
||||
import net.runelite.client.plugins.banktags.TagManager;
|
||||
import net.runelite.client.ui.JagexColors;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
import net.runelite.client.util.Text;
|
||||
|
||||
@Singleton
|
||||
public class TabInterface
|
||||
{
|
||||
private static final Color HILIGHT_COLOR = Color.decode("#ff9040");
|
||||
private static final Color HILIGHT_COLOR = JagexColors.MENU_TARGET;
|
||||
private static final String SCROLL_UP = "Scroll up";
|
||||
private static final String SCROLL_DOWN = "Scroll down";
|
||||
private static final String NEW_TAB = "New tag tab";
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.image.BufferedImage;
|
||||
import static java.lang.Math.min;
|
||||
@@ -54,6 +53,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.FontManager;
|
||||
import net.runelite.client.ui.JagexColors;
|
||||
import net.runelite.client.ui.NavigationButton;
|
||||
import net.runelite.client.ui.ClientToolbar;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -70,7 +70,6 @@ public class DevToolsPlugin extends Plugin
|
||||
{
|
||||
private static final List<MenuAction> EXAMINE_MENU_ACTIONS = ImmutableList.of(MenuAction.EXAMINE_ITEM,
|
||||
MenuAction.EXAMINE_ITEM_GROUND, MenuAction.EXAMINE_NPC, MenuAction.EXAMINE_OBJECT);
|
||||
private static final Color COLOR_ORANGE = new Color(255, 144, 64);
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
@@ -309,7 +308,7 @@ public class DevToolsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
entry.setTarget(entry.getTarget() + " " + ColorUtil.prependColorTag("(" + info + ")", COLOR_ORANGE));
|
||||
entry.setTarget(entry.getTarget() + " " + ColorUtil.prependColorTag("(" + info + ")", JagexColors.MENU_TARGET));
|
||||
client.setMenuEntries(entries);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ package net.runelite.client.plugins.wasdcamera;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.Color;
|
||||
import javax.inject.Inject;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
@@ -44,6 +43,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.JagexColors;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -177,7 +177,7 @@ public class WASDCameraPlugin extends Plugin
|
||||
{
|
||||
if (client.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
chatboxInput.setText(client.getLocalPlayer().getName() + ": " + ColorUtil.wrapWithColorTag(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT) + "*", Color.BLUE));
|
||||
chatboxInput.setText(client.getLocalPlayer().getName() + ": " + ColorUtil.wrapWithColorTag(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT) + "*", JagexColors.CHAT_TYPED_TEXT_OPAQUE_BACKGROUND));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Jordan Atwood <jordan.atwood423@gmail.com>
|
||||
* 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.ui;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
/**
|
||||
* This class serves to hold colors used in Oldschool RuneScape that are also used in client code.
|
||||
*/
|
||||
public class JagexColors
|
||||
{
|
||||
/*
|
||||
* Colors of chat text when displayed on an opaque background.
|
||||
*/
|
||||
public static final Color CHAT_PUBLIC_TEXT_OPAQUE_BACKGROUND = Color.BLUE;
|
||||
public static final Color CHAT_PRIVATE_MESSAGE_TEXT_OPAQUE_BACKGROUND = Color.CYAN;
|
||||
public static final Color CHAT_CLAN_TEXT_OPAQUE_BACKGROUND = new Color(127, 0, 0);
|
||||
public static final Color CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND = Color.BLACK;
|
||||
public static final Color CHAT_TYPED_TEXT_OPAQUE_BACKGROUND = Color.BLUE;
|
||||
|
||||
/*
|
||||
* Colors of chat text when displayed on a transparent background.
|
||||
*/
|
||||
public static final Color CHAT_PUBLIC_TEXT_TRANSPARENT_BACKGROUND = new Color(144, 144, 255);
|
||||
public static final Color CHAT_PRIVATE_MESSAGE_TEXT_TRANSPARENT_BACKGROUND = Color.CYAN;
|
||||
public static final Color CHAT_CLAN_TEXT_TRANSPARENT_BACKGROUND = new Color(127, 0, 0);
|
||||
public static final Color CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND = Color.WHITE;
|
||||
public static final Color CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND = new Color(144, 144, 255);
|
||||
|
||||
/*
|
||||
* Colors relating to right-click menus.
|
||||
*/
|
||||
public static final Color MENU_TARGET = new Color(255, 144, 64);
|
||||
|
||||
/*
|
||||
* Colors relating to tooltips.
|
||||
*/
|
||||
public static final Color TOOLTIP_BACKGROUND = new Color(255, 255, 160);
|
||||
public static final Color TOOLTIP_BORDER = Color.BLACK;
|
||||
public static final Color TOOLTIP_TEXT = Color.BLACK;
|
||||
}
|
||||
@@ -24,7 +24,6 @@
|
||||
*/
|
||||
package net.runelite.client.ui.overlay.worldmap;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FontMetrics;
|
||||
import java.awt.Graphics2D;
|
||||
@@ -42,6 +41,7 @@ import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.input.MouseManager;
|
||||
import net.runelite.client.ui.FontManager;
|
||||
import net.runelite.client.ui.JagexColors;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
@@ -50,7 +50,6 @@ import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
@Singleton
|
||||
public class WorldMapOverlay extends Overlay
|
||||
{
|
||||
private static final Color TOOLTIP_BACKGROUND = new Color(255, 255, 160);
|
||||
private static final int TOOLTIP_OFFSET_HEIGHT = 25;
|
||||
private static final int TOOLTIP_OFFSET_WIDTH = 5;
|
||||
private static final int TOOLTIP_PADDING_HEIGHT = 1;
|
||||
@@ -260,7 +259,7 @@ public class WorldMapOverlay extends Overlay
|
||||
drawPoint = new Point(drawPoint.getX() + TOOLTIP_OFFSET_WIDTH, drawPoint.getY() + TOOLTIP_OFFSET_HEIGHT);
|
||||
|
||||
graphics.setClip(client.getCanvas().getBounds());
|
||||
graphics.setColor(TOOLTIP_BACKGROUND);
|
||||
graphics.setColor(JagexColors.TOOLTIP_BACKGROUND);
|
||||
graphics.setFont(FontManager.getRunescapeFont());
|
||||
FontMetrics fm = graphics.getFontMetrics();
|
||||
int width = fm.stringWidth(tooltip);
|
||||
@@ -269,8 +268,9 @@ public class WorldMapOverlay extends Overlay
|
||||
Rectangle tooltipRect = new Rectangle(drawPoint.getX() - TOOLTIP_PADDING_WIDTH, drawPoint.getY() - TOOLTIP_PADDING_HEIGHT, width + TOOLTIP_PADDING_WIDTH * 2, height + TOOLTIP_PADDING_HEIGHT * 2);
|
||||
graphics.fillRect((int) tooltipRect.getX(), (int) tooltipRect.getY(), (int) tooltipRect.getWidth(), (int) tooltipRect.getHeight());
|
||||
|
||||
graphics.setColor(Color.black);
|
||||
graphics.setColor(JagexColors.TOOLTIP_BORDER);
|
||||
graphics.drawRect((int) tooltipRect.getX(), (int) tooltipRect.getY(), (int) tooltipRect.getWidth(), (int) tooltipRect.getHeight());
|
||||
graphics.setColor(JagexColors.TOOLTIP_TEXT);
|
||||
graphics.drawString(tooltip, drawPoint.getX(), drawPoint.getY() + height);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user