client: Rebase further

This commit is contained in:
Owain van Brakel
2019-10-03 06:00:19 +02:00
parent 3eb6156ca4
commit 55839f684c
47 changed files with 111 additions and 64 deletions

View File

@@ -2,10 +2,10 @@
# openosrs # OpenOSRS
[![Build Status](https://github.com/runelite-extended/runelite/workflows/openosrs%20-%20CI/badge.svg)](https://github.com/runelite-extended/runelite/actions) [![Build Status](https://github.com/runelite-extended/runelite/workflows/openosrs%20-%20CI/badge.svg)](https://github.com/runelite-extended/runelite/actions)
[![HitCount](http://hits.dwyl.io/runelite-extended/runelite.svg)](http://hits.dwyl.io/runelite-extended/runelite) [![HitCount](http://hits.dwyl.io/runelite-extended/runelite.svg)](http://hits.dwyl.io/runelite-extended/runelite)
[openosrs](https://openosrs.com) is an extended version of [RuneLite](https://github.com/runelite/runelite) that provides more functionality and less restrictions while staying more open-source. We are not affiliated with RuneLite. [OpenOSRS](https://openosrs.com) is an extended version of [RuneLite](https://github.com/runelite/runelite) that provides more functionality and less restrictions while staying more open-source. We are not affiliated with RuneLite.
## Discord ## Discord
[![Discord](https://img.shields.io/discord/373382904769675265.svg)](https://discord.gg/HN5gf3m) [![Discord](https://img.shields.io/discord/373382904769675265.svg)](https://discord.gg/HN5gf3m)
@@ -14,7 +14,7 @@
- [cache](cache/src/main/java/net/runelite/cache) - Libraries used for reading/writing cache files, as well as the data in it - [cache](cache/src/main/java/net/runelite/cache) - Libraries used for reading/writing cache files, as well as the data in it
- [deobfuscator](deobfuscator/src/main/java/net/runelite/deob) - Can decompile and cleanup gamepacks as well as map updates to newer revs - [deobfuscator](deobfuscator/src/main/java/net/runelite/deob) - Can decompile and cleanup gamepacks as well as map updates to newer revs
- [http-api](http-api/src/main/java/net/runelite/http/api) - API for runelite and openosrs - [http-api](http-api/src/main/java/net/runelite/http/api) - API for runelite and OpenOSRS
- [http-service](http-service/src/main/java/net/runelite/http/service) - Service for https://api.runelite.net - [http-service](http-service/src/main/java/net/runelite/http/service) - Service for https://api.runelite.net
- [http-service-plus](http-service-plus/src/main/java/net/runelite/http/service) - Service for https://api.openosrs.com - [http-service-plus](http-service-plus/src/main/java/net/runelite/http/service) - Service for https://api.openosrs.com
- [injector-plugin](injector-plugin/src/main/java/net/runelite/injector) - Tool for implementing our modifications to the gamepack - [injector-plugin](injector-plugin/src/main/java/net/runelite/injector) - Tool for implementing our modifications to the gamepack
@@ -49,7 +49,7 @@ Disable Default World plugin if you have it enabled, this causes issues with cod
``` ```
## License ## License
openosrs is licensed under the BSD 2-clause license. See the license header in the respective file to be sure. OpenOSRS is licensed under the BSD 2-clause license. See the license header in the respective file to be sure.
## Contribute and Develop ## Contribute and Develop

View File

@@ -70,7 +70,7 @@ public class RuneLiteAPI
"http://repo.runelite.net/net/runelite/runelite-parent/maven-metadata.xml"; "http://repo.runelite.net/net/runelite/runelite-parent/maven-metadata.xml";
private static final Properties properties = new Properties(); private static final Properties properties = new Properties();
private static String rlUserAgent; private static String rlUserAgent;
private static String rlpUserAgent; private static String openosrsUserAgent;
static static
{ {
@@ -83,7 +83,7 @@ public class RuneLiteAPI
String rlpCommit = properties.getProperty("runelite.commit"); String rlpCommit = properties.getProperty("runelite.commit");
boolean dirty = Boolean.parseBoolean(properties.getProperty("runelite.dirty")); boolean dirty = Boolean.parseBoolean(properties.getProperty("runelite.dirty"));
rlpUserAgent = "openosrs/" + version + "-" + rlpCommit + (dirty ? "+" : ""); openosrsUserAgent = "openosrs/" + version + "-" + rlpCommit + (dirty ? "+" : "");
rlUserAgent = "openosrs/" + version; rlUserAgent = "openosrs/" + version;
rsVersion = Integer.parseInt(properties.getProperty("rs.version")); rsVersion = Integer.parseInt(properties.getProperty("rs.version"));
@@ -128,7 +128,7 @@ public class RuneLiteAPI
{ {
Request userAgentRequest = chain.request() Request userAgentRequest = chain.request()
.newBuilder() .newBuilder()
.header("User-Agent", rlpUserAgent) .header("User-Agent", openosrsUserAgent)
.build(); .build();
return chain.proceed(userAgentRequest); return chain.proceed(userAgentRequest);
} }
@@ -206,7 +206,7 @@ public class RuneLiteAPI
byte[] chunk = new byte[4096]; byte[] chunk = new byte[4096];
int bytesRead; int bytesRead;
URLConnection conn = toDownload.openConnection(); URLConnection conn = toDownload.openConnection();
conn.setRequestProperty("User-Agent", rlpUserAgent); conn.setRequestProperty("User-Agent", openosrsUserAgent);
stream = conn.getInputStream(); stream = conn.getInputStream();
while ((bytesRead = stream.read(chunk)) > 0) while ((bytesRead = stream.read(chunk)) > 0)

View File

@@ -1,6 +1,6 @@
apply plugin: 'war' apply plugin: 'war'
description = 'Web Service Plus' description = 'Web Service OpenOSRS'
dependencies { dependencies {
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok

View File

@@ -70,7 +70,7 @@ public class SpringBootWebApplication extends SpringBootServletInitializer
@Override @Override
public void contextInitialized(ServletContextEvent sce) public void contextInitialized(ServletContextEvent sce)
{ {
log.info("openosrs API started"); log.info("OpenOSRS API started");
} }
@Override @Override
@@ -93,7 +93,7 @@ public class SpringBootWebApplication extends SpringBootServletInitializer
log.warn(null, ex); log.warn(null, ex);
} }
log.info("openosrs API stopped"); log.info("OpenOSRS API stopped");
} }
}; };

View File

@@ -273,7 +273,7 @@ public class RuneLite
RuneLiteSplashScreen.setError("Error while loading!", "Please check your internet connection and your DNS settings."); RuneLiteSplashScreen.setError("Error while loading!", "Please check your internet connection and your DNS settings.");
}); });
RuneLiteSplashScreen.stage(0, "Starting openosrs injector"); RuneLiteSplashScreen.stage(0, "Starting OpenOSRS injector");
final long start = System.currentTimeMillis(); final long start = System.currentTimeMillis();

View File

@@ -17,7 +17,7 @@ import org.jooq.impl.DSL;
@Slf4j @Slf4j
public class DatabaseManager public class DatabaseManager
{ {
private static final String DB_URL = "jdbc:h2:" + RUNELITE_DIR + File.separator + "openosrs;AUTO_SERVER=TRUE"; private static final String DB_URL = "jdbc:h2:" + RUNELITE_DIR + File.separator + "RunelitePlus;AUTO_SERVER=TRUE";
// Database credentials // Database credentials
private static final String USER = "RLP"; private static final String USER = "RLP";

View File

@@ -139,7 +139,7 @@ public class ConfigPanel extends PluginPanel
private static final String RUNELITE_GROUP_NAME = RuneLiteConfig.class.getAnnotation(ConfigGroup.class).value(); private static final String RUNELITE_GROUP_NAME = RuneLiteConfig.class.getAnnotation(ConfigGroup.class).value();
private static final String PINNED_PLUGINS_CONFIG_KEY = "pinnedPlugins"; private static final String PINNED_PLUGINS_CONFIG_KEY = "pinnedPlugins";
private static final String RUNELITE_PLUGIN = "RuneLite"; private static final String RUNELITE_PLUGIN = "RuneLite";
private static final String openosrs_PLUGIN = "openosrs"; private static final String openosrs_PLUGIN = "OpenOSRS";
private static final String CHAT_COLOR_PLUGIN = "Chat Color"; private static final String CHAT_COLOR_PLUGIN = "Chat Color";
private final PluginManager pluginManager; private final PluginManager pluginManager;
private final ConfigManager configManager; private final ConfigManager configManager;
@@ -164,7 +164,7 @@ public class ConfigPanel extends PluginPanel
BACK_ICON = new ImageIcon(backIcon); BACK_ICON = new ImageIcon(backIcon);
BACK_ICON_HOVER = new ImageIcon(ImageUtil.alphaOffset(backIcon, -100)); BACK_ICON_HOVER = new ImageIcon(ImageUtil.alphaOffset(backIcon, -100));
final BufferedImage orangeBackIcon = ImageUtil.fillImage(backIcon, ColorScheme.BRAND_ORANGE); final BufferedImage orangeBackIcon = ImageUtil.fillImage(backIcon, ColorScheme.BRAND_BLUE);
final BufferedImage sectionRetractIcon = ImageUtil.rotateImage(orangeBackIcon, Math.PI * 1.5); final BufferedImage sectionRetractIcon = ImageUtil.rotateImage(orangeBackIcon, Math.PI * 1.5);
SECTION_RETRACT_ICON = new ImageIcon(sectionRetractIcon); SECTION_RETRACT_ICON = new ImageIcon(sectionRetractIcon);
@@ -289,10 +289,10 @@ public class ConfigPanel extends PluginPanel
runeLite.nameLabel.setForeground(Color.WHITE); runeLite.nameLabel.setForeground(Color.WHITE);
pluginList.add(runeLite); pluginList.add(runeLite);
// set openosrs config on top, as it should always have been // set OpenOSRS config on top, as it should always have been
final PluginListItem openosrs = new PluginListItem(this, configManager, OpenOSRSConfig, final PluginListItem openosrs = new PluginListItem(this, configManager, OpenOSRSConfig,
configManager.getConfigDescriptor(OpenOSRSConfig), configManager.getConfigDescriptor(OpenOSRSConfig),
openosrs_PLUGIN, "openosrs client settings", "client"); openosrs_PLUGIN, "OpenOSRS client settings", "client");
openosrs.setPinned(pinnedPlugins.contains(openosrs_PLUGIN)); openosrs.setPinned(pinnedPlugins.contains(openosrs_PLUGIN));
openosrs.nameLabel.setForeground(Color.WHITE); openosrs.nameLabel.setForeground(Color.WHITE);
pluginList.add(openosrs); pluginList.add(openosrs);
@@ -578,11 +578,6 @@ public class ConfigPanel extends PluginPanel
topPanelBackButton.setToolTipText("Back"); topPanelBackButton.setToolTipText("Back");
topPanel.add(topPanelBackButton, BorderLayout.WEST); topPanel.add(topPanelBackButton, BorderLayout.WEST);
if (!listItem.getName().equals("openosrs"))
{
topPanel.add(listItem.createToggleButton(), BorderLayout.EAST);
}
String name = listItem.getName(); String name = listItem.getName();
JLabel title = new JLabel(name); JLabel title = new JLabel(name);
title.setForeground(Color.WHITE); title.setForeground(Color.WHITE);
@@ -607,7 +602,7 @@ public class ConfigPanel extends PluginPanel
JLabel headerLabel = new JLabel(cs.name()); JLabel headerLabel = new JLabel(cs.name());
headerLabel.setFont(FontManager.getRunescapeFont()); headerLabel.setFont(FontManager.getRunescapeFont());
headerLabel.setForeground(ColorScheme.BRAND_ORANGE); headerLabel.setForeground(ColorScheme.BRAND_BLUE);
if (!description.equals("")) if (!description.equals(""))
{ {
headerLabel.setToolTipText("<html>" + name + ":<br>" + description + "</html>"); headerLabel.setToolTipText("<html>" + name + ":<br>" + description + "</html>");
@@ -679,7 +674,7 @@ public class ConfigPanel extends PluginPanel
JLabel configEntryName = new JLabel(cs.name()); JLabel configEntryName = new JLabel(cs.name());
configEntryName.setPreferredSize(new Dimension(PANEL_WIDTH, (int) configEntryName.getPreferredSize().getHeight())); configEntryName.setPreferredSize(new Dimension(PANEL_WIDTH, (int) configEntryName.getPreferredSize().getHeight()));
configEntryName.setForeground(ColorScheme.BRAND_ORANGE); configEntryName.setForeground(ColorScheme.BRAND_BLUE);
item.add(configEntryName, BorderLayout.NORTH); item.add(configEntryName, BorderLayout.NORTH);
final JPanel sectionContents = new JPanel(); final JPanel sectionContents = new JPanel();

View File

@@ -25,6 +25,7 @@
package net.runelite.client.plugins.config; package net.runelite.client.plugins.config;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@@ -98,8 +99,8 @@ public class PluginListItem extends JPanel
BufferedImage onSwitcher = ImageUtil.getResourceStreamFromClass(ConfigPanel.class, "switcher_on.png"); BufferedImage onSwitcher = ImageUtil.getResourceStreamFromClass(ConfigPanel.class, "switcher_on.png");
BufferedImage onStar = ImageUtil.getResourceStreamFromClass(ConfigPanel.class, "star_on.png"); BufferedImage onStar = ImageUtil.getResourceStreamFromClass(ConfigPanel.class, "star_on.png");
CONFIG_ICON = new ImageIcon(configIcon); CONFIG_ICON = new ImageIcon(configIcon);
ON_SWITCHER = new ImageIcon(onSwitcher); ON_SWITCHER = new ImageIcon(ImageUtil.recolorImage(onSwitcher, new Color(0, 106, 221)));
ON_STAR = new ImageIcon(onStar); ON_STAR = new ImageIcon(ImageUtil.recolorImage(onStar, new Color(0, 106, 221)));
CONFIG_ICON_HOVER = new ImageIcon(ImageUtil.grayscaleOffset(configIcon, -100)); CONFIG_ICON_HOVER = new ImageIcon(ImageUtil.grayscaleOffset(configIcon, -100));
BufferedImage offSwitcherImage = ImageUtil.flipImage( BufferedImage offSwitcherImage = ImageUtil.flipImage(
ImageUtil.grayscaleOffset( ImageUtil.grayscaleOffset(
@@ -199,7 +200,7 @@ public class PluginListItem extends JPanel
toggleButton.setPreferredSize(new Dimension(25, 0)); toggleButton.setPreferredSize(new Dimension(25, 0));
attachToggleButtonListener(toggleButton); attachToggleButtonListener(toggleButton);
if (name.equals("openosrs")) if (name.equals("OpenOSRS"))
{ {
toggleButton.setVisible(false); toggleButton.setVisible(false);
} }

View File

@@ -44,7 +44,7 @@ import net.runelite.client.ui.overlay.components.table.TableComponent;
@Singleton @Singleton
class WaveOverlay extends Overlay class WaveOverlay extends Overlay
{ {
private static final Color HEADER_COLOR = ColorScheme.BRAND_ORANGE; private static final Color HEADER_COLOR = ColorScheme.BRAND_BLUE;
private final FightCaveConfig config; private final FightCaveConfig config;
private final FightCavePlugin plugin; private final FightCavePlugin plugin;

View File

@@ -113,7 +113,7 @@ public class InfoPanel extends PluginPanel
JLabel version = new JLabel(htmlLabel("RuneLite version: ", RuneLiteProperties.getVersion())); JLabel version = new JLabel(htmlLabel("RuneLite version: ", RuneLiteProperties.getVersion()));
version.setFont(smallFont); version.setFont(smallFont);
JLabel plusVersion = new JLabel(htmlLabel("Openosrs version: ", RuneLiteProperties.getPlusVersion())); JLabel plusVersion = new JLabel(htmlLabel("OpenOSRS version: ", RuneLiteProperties.getPlusVersion()));
plusVersion.setFont(smallFont); plusVersion.setFont(smallFont);
JLabel revision = new JLabel(); JLabel revision = new JLabel();
@@ -168,7 +168,7 @@ public class InfoPanel extends PluginPanel
actionsContainer.add(buildLinkPanel(GITHUB_ICON, "License info", "for distribution", "https://github.com/runelite-extended/runelite/blob/master/LICENSE")); actionsContainer.add(buildLinkPanel(GITHUB_ICON, "License info", "for distribution", "https://github.com/runelite-extended/runelite/blob/master/LICENSE"));
actionsContainer.add(buildLinkPanel(FOLDER_ICON, "Open logs directory", "(for bug reports)", LOGS_DIR)); actionsContainer.add(buildLinkPanel(FOLDER_ICON, "Open logs directory", "(for bug reports)", LOGS_DIR));
actionsContainer.add(buildLinkPanel(DISCORD_ICON, "Talk to us on our", "discord server", "https://discord.gg/HN5gf3m")); actionsContainer.add(buildLinkPanel(DISCORD_ICON, "Talk to us on our", "discord server", "https://discord.gg/HN5gf3m"));
actionsContainer.add(buildLinkPanel(PATREON_ICON, "Patreon to support", "the openosrs devs", RuneLiteProperties.getPatreonLink())); actionsContainer.add(buildLinkPanel(PATREON_ICON, "Patreon to support", "the OpenOSRS devs", RuneLiteProperties.getPatreonLink()));
/* actionsContainer.add(buildLinkPanel(WIKI_ICON, "Information about", "RuneLite and plugins", runeLiteProperties.getWikiLink()));*/ /* actionsContainer.add(buildLinkPanel(WIKI_ICON, "Information about", "RuneLite and plugins", runeLiteProperties.getWikiLink()));*/
add(versionPanel, BorderLayout.NORTH); add(versionPanel, BorderLayout.NORTH);

View File

@@ -37,6 +37,7 @@ import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.api.widgets.WidgetID; import net.runelite.api.widgets.WidgetID;
import static net.runelite.api.widgets.WidgetInfo.*; import static net.runelite.api.widgets.WidgetInfo.*;
import net.runelite.client.callback.ClientThread; import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.config.Keybind; import net.runelite.client.config.Keybind;
import net.runelite.client.config.OpenOSRSConfig; import net.runelite.client.config.OpenOSRSConfig;
import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.EventBus;
@@ -49,7 +50,7 @@ import net.runelite.client.util.HotkeyListener;
@PluginDescriptor( @PluginDescriptor(
loadWhenOutdated = true, // prevent users from disabling loadWhenOutdated = true, // prevent users from disabling
hidden = true, // prevent users from disabling hidden = true, // prevent users from disabling
name = "openosrs" name = "OpenOSRS"
) )
@Singleton @Singleton
@Slf4j @Slf4j
@@ -71,6 +72,9 @@ public class OpenOSRSPlugin extends Plugin
@Inject @Inject
private EventBus eventbus; private EventBus eventbus;
@Inject
private ConfigManager configManager;
private HotkeyListener hotkeyListener = new HotkeyListener(() -> this.keybind) private HotkeyListener hotkeyListener = new HotkeyListener(() -> this.keybind)
{ {
@Override @Override
@@ -90,6 +94,7 @@ public class OpenOSRSPlugin extends Plugin
@Override @Override
protected void startUp() throws Exception protected void startUp() throws Exception
{ {
migrateConfigs();
addSubscriptions(); addSubscriptions();
entered = -1; entered = -1;
@@ -248,4 +253,36 @@ public class OpenOSRSPlugin extends Plugin
{ {
} }
} }
/**
* Migrates configs from runenergy and regenmeter to this plugin and deletes the old config values.
* This method should be removed after a reasonable amount of time.
*/
@Deprecated
private void migrateConfigs()
{
migrateConfig("runeliteplus", "enableOpacity");
migrateConfig("runeliteplus", "opacityPercentage");
migrateConfig("runeliteplus", "keyboardPin");
migrateConfig("runeliteplus", "enablePlugins");
migrateConfig("runeliteplus", "detachHotkey");
}
/**
* Wrapper for migrating individual config options
* This method should be removed after a reasonable amount of time.
*
* @param group old group name
* @param key key name to migrate
*/
@Deprecated
private void migrateConfig(String group, String key)
{
String value = configManager.getConfiguration(group, key);
if (value != null)
{
configManager.setConfiguration("openosrs", key, value);
configManager.unsetConfiguration(group, key);
}
}
} }

View File

@@ -52,7 +52,7 @@ class WorldTableHeader extends JPanel
private static final ImageIcon HIGHLIGHT_ARROW_UP; private static final ImageIcon HIGHLIGHT_ARROW_UP;
private static final Color ARROW_COLOR = ColorScheme.LIGHT_GRAY_COLOR; private static final Color ARROW_COLOR = ColorScheme.LIGHT_GRAY_COLOR;
private static final Color HIGHLIGHT_COLOR = ColorScheme.BRAND_ORANGE; private static final Color HIGHLIGHT_COLOR = ColorScheme.BRAND_BLUE;
static static
{ {

View File

@@ -81,7 +81,7 @@ public class ClientLoader
catch (ClassNotFoundException e) catch (ClassNotFoundException e)
{ {
RuneLiteSplashScreen.setError("Unable to load client", "Class not found. This means you" RuneLiteSplashScreen.setError("Unable to load client", "Class not found. This means you"
+ " are not running openosrs with Gradle as the injected client" + " are not running OpenOSRS with Gradle as the injected client"
+ " is not in your classpath."); + " is not in your classpath.");
log.error("Error loading RS!", e); log.error("Error loading RS!", e);

View File

@@ -536,7 +536,7 @@ public class ClientUI
if (client != null && !(client instanceof Client)) if (client != null && !(client instanceof Client))
{ {
SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(frame, SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(frame,
"openosrs has not yet been updated to work with the latest\n" "OpenOSRS has not yet been updated to work with the latest\n"
+ "game update, it will work with reduced functionality until then.", + "game update, it will work with reduced functionality until then.",
"RuneLite is outdated", INFORMATION_MESSAGE)); "RuneLite is outdated", INFORMATION_MESSAGE));
} }

View File

@@ -31,11 +31,11 @@ import java.awt.Color;
*/ */
public class ColorScheme public class ColorScheme
{ {
/* The orange color used for the branding's accents */ /* The blue color used for the branding's accents */
public static final Color BRAND_ORANGE = new Color(220, 138, 0); public static final Color BRAND_BLUE = new Color(0, 106, 221);
/* The orange color used for the branding's accents, with lowered opacity */ /* The blue color used for the branding's accents, with lowered opacity */
public static final Color BRAND_ORANGE_TRANSPARENT = new Color(220, 138, 0, 120); public static final Color BRAND_BLUE_TRANSPARENT = new Color(0, 106, 221, 120);
public static final Color DARKER_GRAY_COLOR = new Color(30, 30, 30); public static final Color DARKER_GRAY_COLOR = new Color(30, 30, 30);
public static final Color DARK_GRAY_COLOR = new Color(40, 40, 40); public static final Color DARK_GRAY_COLOR = new Color(40, 40, 40);
@@ -51,8 +51,8 @@ public class ColorScheme
/* The color for the red progress bar (used in ge offers, farming tracker, etc)*/ /* The color for the red progress bar (used in ge offers, farming tracker, etc)*/
public static final Color PROGRESS_ERROR_COLOR = new Color(230, 30, 30); public static final Color PROGRESS_ERROR_COLOR = new Color(230, 30, 30);
/* The color for the orange progress bar (used in ge offers, farming tracker, etc)*/ /* The color for the blue progress bar (used in ge offers, farming tracker, etc)*/
public static final Color PROGRESS_INPROGRESS_COLOR = new Color(230, 150, 30); public static final Color PROGRESS_INPROGRESS_COLOR = new Color(0, 106, 221);
/* The color for the price indicator in the ge search results */ /* The color for the price indicator in the ge search results */
public static final Color GRAND_EXCHANGE_PRICE = new Color(110, 225, 110); public static final Color GRAND_EXCHANGE_PRICE = new Color(110, 225, 110);

View File

@@ -48,7 +48,7 @@ public class RuneLiteSplashScreen extends JFrame
private RuneLiteSplashScreen() private RuneLiteSplashScreen()
{ {
this.setTitle("openosrs"); this.setTitle("OpenOSRS");
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.setSize(FRAME_SIZE); this.setSize(FRAME_SIZE);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());

View File

@@ -67,7 +67,7 @@ public class FlatTextField extends JPanel
this.textField.setBorder(null); this.textField.setBorder(null);
this.textField.setOpaque(false); this.textField.setOpaque(false);
this.textField.setSelectedTextColor(Color.WHITE); this.textField.setSelectedTextColor(Color.WHITE);
this.textField.setSelectionColor(ColorScheme.BRAND_ORANGE_TRANSPARENT); this.textField.setSelectionColor(ColorScheme.BRAND_BLUE_TRANSPARENT);
add(textField, BorderLayout.CENTER); add(textField, BorderLayout.CENTER);

View File

@@ -59,7 +59,7 @@ public class InfoPanel extends JPanel
private static final String RUNELITE_PLUS_DATE = "open.osrs.builddate"; private static final String RUNELITE_PLUS_DATE = "open.osrs.builddate";
private static final Color DARK_GREY = new Color(10, 10, 10, 255); private static final Color DARK_GREY = new Color(10, 10, 10, 255);
private static final BufferedImage TRANSPARENT_LOGO = ImageUtil.getResourceStreamFromClass(InfoPanel.class, "/openosrs_transparent.png"); private static final BufferedImage TRANSPARENT_LOGO = ImageUtil.getResourceStreamFromClass(InfoPanel.class, "/openosrs.png");
static final Dimension PANEL_SIZE = new Dimension(200, RuneLiteSplashScreen.FRAME_SIZE.height); static final Dimension PANEL_SIZE = new Dimension(200, RuneLiteSplashScreen.FRAME_SIZE.height);
private static final Dimension VERSION_SIZE = new Dimension(PANEL_SIZE.width, 25); private static final Dimension VERSION_SIZE = new Dimension(PANEL_SIZE.width, 25);
private static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite"); private static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
@@ -104,12 +104,8 @@ public class InfoPanel extends JPanel
c.anchor = GridBagConstraints.SOUTH; c.anchor = GridBagConstraints.SOUTH;
c.weighty = 0; c.weighty = 0;
// Version // OpenOSRS version
this.add(createPanelTextButton("RuneLite Version: " + properties.getProperty(RUNELITE_VERSION)), c); this.add(createPanelTextButton("OpenOSRS Version: " + properties.getProperty(RUNELITE_PLUS_VERSION)), c);
c.gridy++;
// Plus version
this.add(createPanelTextButton("Plus Version: " + properties.getProperty(RUNELITE_PLUS_VERSION)), c);
c.gridy++; c.gridy++;
// Build date // Build date
@@ -138,7 +134,7 @@ public class InfoPanel extends JPanel
final JLabel textButton = new JLabel(title); final JLabel textButton = new JLabel(title);
textButton.setFont(FontManager.getRunescapeSmallFont()); textButton.setFont(FontManager.getRunescapeSmallFont());
textButton.setHorizontalAlignment(JLabel.CENTER); textButton.setHorizontalAlignment(JLabel.CENTER);
textButton.setForeground(ColorScheme.BRAND_ORANGE); textButton.setForeground(ColorScheme.BRAND_BLUE);
textButton.setBackground(null); textButton.setBackground(null);
textButton.setPreferredSize(VERSION_SIZE); textButton.setPreferredSize(VERSION_SIZE);
textButton.setMinimumSize(VERSION_SIZE); textButton.setMinimumSize(VERSION_SIZE);

View File

@@ -80,7 +80,7 @@ public class MessagePanel extends JPanel
c.gridy++; c.gridy++;
// alternate message action // alternate message action
messageArea = new JLabel("<html><div style='text-align:center;'>Fork of RuneLite that provides more functionality and less restrictions whilst staying open source.</div></html>") messageArea = new JLabel("<html><div style='text-align:center;'>Open-source client for Old School RuneScape with more functionality and less restrictions.</div></html>")
{ {
@Override @Override
public Dimension getPreferredSize() public Dimension getPreferredSize()
@@ -118,8 +118,8 @@ public class MessagePanel extends JPanel
this.add(barLabel, c); this.add(barLabel, c);
c.gridy++; c.gridy++;
bar.setBackground(ColorScheme.BRAND_ORANGE_TRANSPARENT.darker()); bar.setBackground(ColorScheme.BRAND_BLUE_TRANSPARENT.darker());
bar.setForeground(ColorScheme.BRAND_ORANGE); bar.setForeground(ColorScheme.BRAND_BLUE);
bar.setMinimumSize(BAR_SIZE); bar.setMinimumSize(BAR_SIZE);
bar.setMaximumSize(BAR_SIZE); bar.setMaximumSize(BAR_SIZE);
bar.setBorder(new MatteBorder(0, 0, 0, 0, Color.LIGHT_GRAY)); bar.setBorder(new MatteBorder(0, 0, 0, 0, Color.LIGHT_GRAY));

View File

@@ -51,7 +51,7 @@ import net.runelite.client.ui.ColorScheme;
public class MaterialTab extends JLabel public class MaterialTab extends JLabel
{ {
private static final Border SELECTED_BORDER = new CompoundBorder( private static final Border SELECTED_BORDER = new CompoundBorder(
BorderFactory.createMatteBorder(0, 0, 1, 0, ColorScheme.BRAND_ORANGE), BorderFactory.createMatteBorder(0, 0, 1, 0, ColorScheme.BRAND_BLUE),
BorderFactory.createEmptyBorder(5, 10, 4, 10)); BorderFactory.createEmptyBorder(5, 10, 4, 10));
private static final Border UNSELECTED_BORDER = BorderFactory private static final Border UNSELECTED_BORDER = BorderFactory

View File

@@ -34,6 +34,7 @@ import java.awt.image.BufferedImage;
import java.awt.image.DirectColorModel; import java.awt.image.DirectColorModel;
import java.awt.image.PixelGrabber; import java.awt.image.PixelGrabber;
import java.awt.image.RescaleOp; import java.awt.image.RescaleOp;
import java.awt.image.WritableRaster;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@@ -440,6 +441,23 @@ public class ImageUtil
return recoloredImage; return recoloredImage;
} }
public static BufferedImage recolorImage(BufferedImage image, final Color color) {
int width = image.getWidth();
int height = image.getHeight();
WritableRaster raster = image.getRaster();
for (int xx = 0; xx < width; xx++) {
for (int yy = 0; yy < height; yy++) {
int[] pixels = raster.getPixel(xx, yy, (int[]) null);
pixels[0] = color.getRed();
pixels[1] = color.getGreen();
pixels[2] = color.getBlue();
raster.setPixel(xx, yy, pixels);
}
}
return image;
}
/** /**
* Performs a rescale operation on the image's color components. * Performs a rescale operation on the image's color components.
* *

View File

@@ -98,15 +98,15 @@ public class SwingUtil
UIManager.put("MenuItem.foreground", Color.WHITE); UIManager.put("MenuItem.foreground", Color.WHITE);
UIManager.put("Panel.background", ColorScheme.DARK_GRAY_COLOR); UIManager.put("Panel.background", ColorScheme.DARK_GRAY_COLOR);
UIManager.put("ScrollBarUI", CustomScrollBarUI.class.getName()); UIManager.put("ScrollBarUI", CustomScrollBarUI.class.getName());
UIManager.put("TextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT); UIManager.put("TextField.selectionBackground", ColorScheme.BRAND_BLUE_TRANSPARENT);
UIManager.put("TextField.selectionForeground", Color.WHITE); UIManager.put("TextField.selectionForeground", Color.WHITE);
UIManager.put("FormattedTextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT); UIManager.put("FormattedTextField.selectionBackground", ColorScheme.BRAND_BLUE_TRANSPARENT);
UIManager.put("FormattedTextField.selectionForeground", Color.WHITE); UIManager.put("FormattedTextField.selectionForeground", Color.WHITE);
UIManager.put("TextArea.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT); UIManager.put("TextArea.selectionBackground", ColorScheme.BRAND_BLUE_TRANSPARENT);
UIManager.put("TextArea.selectionForeground", Color.WHITE); UIManager.put("TextArea.selectionForeground", Color.WHITE);
UIManager.put("ProgressBar.background", ColorScheme.BRAND_ORANGE_TRANSPARENT.darker()); UIManager.put("ProgressBar.background", ColorScheme.BRAND_BLUE_TRANSPARENT.darker());
UIManager.put("ProgressBar.foreground", ColorScheme.BRAND_ORANGE); UIManager.put("ProgressBar.foreground", ColorScheme.BRAND_BLUE);
UIManager.put("ProgressBar.selectionBackground", ColorScheme.BRAND_ORANGE); UIManager.put("ProgressBar.selectionBackground", ColorScheme.BRAND_BLUE);
UIManager.put("ProgressBar.selectionForeground", Color.BLACK); UIManager.put("ProgressBar.selectionForeground", Color.BLACK);
UIManager.put("ProgressBar.border", new EmptyBorder(0, 0, 0, 0)); UIManager.put("ProgressBar.border", new EmptyBorder(0, 0, 0, 0));
UIManager.put("ProgressBar.verticalSize", new Dimension(12, 10)); UIManager.put("ProgressBar.verticalSize", new Dimension(12, 10));
@@ -392,13 +392,13 @@ public class SwingUtil
stylizeJPanels(pane); stylizeJPanels(pane);
final Frame frame = component == null ? JOptionPane.getRootFrame() : JOptionPane.getFrameForComponent(component); final Frame frame = component == null ? JOptionPane.getRootFrame() : JOptionPane.getFrameForComponent(component);
final JDialog dialog = new JDialog(frame, "openosrs Error", true); final JDialog dialog = new JDialog(frame, "OpenOSRS Error", true);
dialog.setContentPane(pane); dialog.setContentPane(pane);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setAlwaysOnTop(true); dialog.setAlwaysOnTop(true);
dialog.setAutoRequestFocus(true); dialog.setAutoRequestFocus(true);
dialog.setLocationRelativeTo(null); dialog.setLocationRelativeTo(null);
dialog.setIconImage(ImageUtil.getResourceStreamFromClass(SwingUtil.class, "/openosrs_transparent.png")); dialog.setIconImage(ImageUtil.getResourceStreamFromClass(SwingUtil.class, "/openosrs.png"));
// Listen for value changes and close dialog when necessary // Listen for value changes and close dialog when necessary
pane.addPropertyChangeListener(e -> { pane.addPropertyChangeListener(e -> {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -16,7 +16,7 @@ include ':injector-plugin'
include ':injected-client' include ':injected-client'
include ':runelite-plugin-archetype' include ':runelite-plugin-archetype'
include ':http-service' include ':http-service'
include ':http-service-plus' include ':http-service-openosrs'
include ':wiki-scraper' include ':wiki-scraper'
project(':http-api').projectDir = "$rootDir/http-api" as File project(':http-api').projectDir = "$rootDir/http-api" as File
@@ -36,6 +36,6 @@ project(':injector-plugin').projectDir = "$rootDir/injector-plugin" as File
project(':injected-client').projectDir = "$rootDir/injected-client" as File project(':injected-client').projectDir = "$rootDir/injected-client" as File
project(':runelite-plugin-archetype').projectDir = "$rootDir/runelite-plugin-archetype" as File project(':runelite-plugin-archetype').projectDir = "$rootDir/runelite-plugin-archetype" as File
project(':http-service').projectDir = "$rootDir/http-service" as File project(':http-service').projectDir = "$rootDir/http-service" as File
project(':http-service-plus').projectDir = "$rootDir/http-service-plus" as File project(':http-service-openosrs').projectDir = "$rootDir/http-service-openosrs" as File
project(':wiki-scraper').projectDir = "$rootDir/wiki-scraper" as File project(':wiki-scraper').projectDir = "$rootDir/wiki-scraper" as File