diff --git a/README.md b/README.md index 57ff919d26..e00759a008 100644 --- a/README.md +++ b/README.md @@ -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) [![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](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 - [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-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 @@ -49,7 +49,7 @@ Disable Default World plugin if you have it enabled, this causes issues with cod ``` ## 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 diff --git a/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java b/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java index 94779595ac..623a1402b2 100644 --- a/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java +++ b/http-api/src/main/java/net/runelite/http/api/RuneLiteAPI.java @@ -70,7 +70,7 @@ public class RuneLiteAPI "http://repo.runelite.net/net/runelite/runelite-parent/maven-metadata.xml"; private static final Properties properties = new Properties(); private static String rlUserAgent; - private static String rlpUserAgent; + private static String openosrsUserAgent; static { @@ -83,7 +83,7 @@ public class RuneLiteAPI String rlpCommit = properties.getProperty("runelite.commit"); boolean dirty = Boolean.parseBoolean(properties.getProperty("runelite.dirty")); - rlpUserAgent = "openosrs/" + version + "-" + rlpCommit + (dirty ? "+" : ""); + openosrsUserAgent = "openosrs/" + version + "-" + rlpCommit + (dirty ? "+" : ""); rlUserAgent = "openosrs/" + version; rsVersion = Integer.parseInt(properties.getProperty("rs.version")); @@ -128,7 +128,7 @@ public class RuneLiteAPI { Request userAgentRequest = chain.request() .newBuilder() - .header("User-Agent", rlpUserAgent) + .header("User-Agent", openosrsUserAgent) .build(); return chain.proceed(userAgentRequest); } @@ -206,7 +206,7 @@ public class RuneLiteAPI byte[] chunk = new byte[4096]; int bytesRead; URLConnection conn = toDownload.openConnection(); - conn.setRequestProperty("User-Agent", rlpUserAgent); + conn.setRequestProperty("User-Agent", openosrsUserAgent); stream = conn.getInputStream(); while ((bytesRead = stream.read(chunk)) > 0) diff --git a/http-service-plus/build.gradle b/http-service-openosrs/build.gradle similarity index 97% rename from http-service-plus/build.gradle rename to http-service-openosrs/build.gradle index 3b3d4778d2..1aee171338 100644 --- a/http-service-plus/build.gradle +++ b/http-service-openosrs/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'war' -description = 'Web Service Plus' +description = 'Web Service OpenOSRS' dependencies { annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombok diff --git a/http-service-plus/src/main/java/net/runelite/http/service/SpringBootWebApplication.java b/http-service-openosrs/src/main/java/net/runelite/http/service/SpringBootWebApplication.java similarity index 98% rename from http-service-plus/src/main/java/net/runelite/http/service/SpringBootWebApplication.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/SpringBootWebApplication.java index 27562f09f5..cb935d1270 100644 --- a/http-service-plus/src/main/java/net/runelite/http/service/SpringBootWebApplication.java +++ b/http-service-openosrs/src/main/java/net/runelite/http/service/SpringBootWebApplication.java @@ -70,7 +70,7 @@ public class SpringBootWebApplication extends SpringBootServletInitializer @Override public void contextInitialized(ServletContextEvent sce) { - log.info("openosrs API started"); + log.info("OpenOSRS API started"); } @Override @@ -93,7 +93,7 @@ public class SpringBootWebApplication extends SpringBootServletInitializer log.warn(null, ex); } - log.info("openosrs API stopped"); + log.info("OpenOSRS API stopped"); } }; diff --git a/http-service-plus/src/main/java/net/runelite/http/service/SpringWebMvcConfigurer.java b/http-service-openosrs/src/main/java/net/runelite/http/service/SpringWebMvcConfigurer.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/SpringWebMvcConfigurer.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/SpringWebMvcConfigurer.java diff --git a/http-service-plus/src/main/java/net/runelite/http/service/animation/AnimationCache.java b/http-service-openosrs/src/main/java/net/runelite/http/service/animation/AnimationCache.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/animation/AnimationCache.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/animation/AnimationCache.java diff --git a/http-service-plus/src/main/java/net/runelite/http/service/animation/AnimationController.java b/http-service-openosrs/src/main/java/net/runelite/http/service/animation/AnimationController.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/animation/AnimationController.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/animation/AnimationController.java diff --git a/http-service-plus/src/main/java/net/runelite/http/service/animation/AnimationEndpoint.java b/http-service-openosrs/src/main/java/net/runelite/http/service/animation/AnimationEndpoint.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/animation/AnimationEndpoint.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/animation/AnimationEndpoint.java diff --git a/http-service-plus/src/main/java/net/runelite/http/service/animation/AnimationEntry.java b/http-service-openosrs/src/main/java/net/runelite/http/service/animation/AnimationEntry.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/animation/AnimationEntry.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/animation/AnimationEntry.java diff --git a/http-service-plus/src/main/java/net/runelite/http/service/chat/ChatController.java b/http-service-openosrs/src/main/java/net/runelite/http/service/chat/ChatController.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/chat/ChatController.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/chat/ChatController.java diff --git a/http-service-plus/src/main/java/net/runelite/http/service/chat/ChatService.java b/http-service-openosrs/src/main/java/net/runelite/http/service/chat/ChatService.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/chat/ChatService.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/chat/ChatService.java diff --git a/http-service-plus/src/main/java/net/runelite/http/service/xtea/XteaCache.java b/http-service-openosrs/src/main/java/net/runelite/http/service/xtea/XteaCache.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/xtea/XteaCache.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/xtea/XteaCache.java diff --git a/http-service-plus/src/main/java/net/runelite/http/service/xtea/XteaController.java b/http-service-openosrs/src/main/java/net/runelite/http/service/xtea/XteaController.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/xtea/XteaController.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/xtea/XteaController.java diff --git a/http-service-plus/src/main/java/net/runelite/http/service/xtea/XteaEndpoint.java b/http-service-openosrs/src/main/java/net/runelite/http/service/xtea/XteaEndpoint.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/xtea/XteaEndpoint.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/xtea/XteaEndpoint.java diff --git a/http-service-plus/src/main/java/net/runelite/http/service/xtea/XteaEntry.java b/http-service-openosrs/src/main/java/net/runelite/http/service/xtea/XteaEntry.java similarity index 100% rename from http-service-plus/src/main/java/net/runelite/http/service/xtea/XteaEntry.java rename to http-service-openosrs/src/main/java/net/runelite/http/service/xtea/XteaEntry.java diff --git a/http-service-plus/src/main/resources/application-dev.yaml b/http-service-openosrs/src/main/resources/application-dev.yaml similarity index 100% rename from http-service-plus/src/main/resources/application-dev.yaml rename to http-service-openosrs/src/main/resources/application-dev.yaml diff --git a/http-service-plus/src/main/resources/application.yaml b/http-service-openosrs/src/main/resources/application.yaml similarity index 100% rename from http-service-plus/src/main/resources/application.yaml rename to http-service-openosrs/src/main/resources/application.yaml diff --git a/http-service-plus/src/main/resources/net/runelite/http/service/xp/schema.sql b/http-service-openosrs/src/main/resources/net/runelite/http/service/xp/schema.sql similarity index 100% rename from http-service-plus/src/main/resources/net/runelite/http/service/xp/schema.sql rename to http-service-openosrs/src/main/resources/net/runelite/http/service/xp/schema.sql diff --git a/http-service-plus/src/main/templates/markdown.hbs b/http-service-openosrs/src/main/templates/markdown.hbs similarity index 100% rename from http-service-plus/src/main/templates/markdown.hbs rename to http-service-openosrs/src/main/templates/markdown.hbs diff --git a/http-service-plus/src/main/templates/operation.hbs b/http-service-openosrs/src/main/templates/operation.hbs similarity index 100% rename from http-service-plus/src/main/templates/operation.hbs rename to http-service-openosrs/src/main/templates/operation.hbs diff --git a/http-service-plus/src/main/templates/security.hbs b/http-service-openosrs/src/main/templates/security.hbs similarity index 100% rename from http-service-plus/src/main/templates/security.hbs rename to http-service-openosrs/src/main/templates/security.hbs diff --git a/http-service-plus/src/main/templates/template.html.hbs b/http-service-openosrs/src/main/templates/template.html.hbs similarity index 100% rename from http-service-plus/src/main/templates/template.html.hbs rename to http-service-openosrs/src/main/templates/template.html.hbs diff --git a/http-service-plus/src/main/webapp/WEB-INF/web.xml b/http-service-openosrs/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from http-service-plus/src/main/webapp/WEB-INF/web.xml rename to http-service-openosrs/src/main/webapp/WEB-INF/web.xml diff --git a/http-service-plus/src/test/resources/application-test.yaml b/http-service-openosrs/src/test/resources/application-test.yaml similarity index 100% rename from http-service-plus/src/test/resources/application-test.yaml rename to http-service-openosrs/src/test/resources/application-test.yaml diff --git a/http-service-plus/src/test/resources/net/runelite/http/service/worlds/worldlist b/http-service-openosrs/src/test/resources/net/runelite/http/service/worlds/worldlist similarity index 100% rename from http-service-plus/src/test/resources/net/runelite/http/service/worlds/worldlist rename to http-service-openosrs/src/test/resources/net/runelite/http/service/worlds/worldlist diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLite.java b/runelite-client/src/main/java/net/runelite/client/RuneLite.java index eee889f244..59598740a5 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -273,7 +273,7 @@ public class RuneLite 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(); diff --git a/runelite-client/src/main/java/net/runelite/client/config/openosrsConfig.java b/runelite-client/src/main/java/net/runelite/client/config/OpenOSRSConfig.java similarity index 100% rename from runelite-client/src/main/java/net/runelite/client/config/openosrsConfig.java rename to runelite-client/src/main/java/net/runelite/client/config/OpenOSRSConfig.java diff --git a/runelite-client/src/main/java/net/runelite/client/database/DatabaseManager.java b/runelite-client/src/main/java/net/runelite/client/database/DatabaseManager.java index 64258fbc40..d52a266cd3 100644 --- a/runelite-client/src/main/java/net/runelite/client/database/DatabaseManager.java +++ b/runelite-client/src/main/java/net/runelite/client/database/DatabaseManager.java @@ -17,7 +17,7 @@ import org.jooq.impl.DSL; @Slf4j 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 private static final String USER = "RLP"; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java index f3f3b7aab1..8012e2ae62 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java @@ -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 PINNED_PLUGINS_CONFIG_KEY = "pinnedPlugins"; 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 final PluginManager pluginManager; private final ConfigManager configManager; @@ -164,7 +164,7 @@ public class ConfigPanel extends PluginPanel BACK_ICON = new ImageIcon(backIcon); 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); SECTION_RETRACT_ICON = new ImageIcon(sectionRetractIcon); @@ -289,10 +289,10 @@ public class ConfigPanel extends PluginPanel runeLite.nameLabel.setForeground(Color.WHITE); 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, configManager.getConfigDescriptor(OpenOSRSConfig), - openosrs_PLUGIN, "openosrs client settings", "client"); + openosrs_PLUGIN, "OpenOSRS client settings", "client"); openosrs.setPinned(pinnedPlugins.contains(openosrs_PLUGIN)); openosrs.nameLabel.setForeground(Color.WHITE); pluginList.add(openosrs); @@ -578,11 +578,6 @@ public class ConfigPanel extends PluginPanel topPanelBackButton.setToolTipText("Back"); topPanel.add(topPanelBackButton, BorderLayout.WEST); - if (!listItem.getName().equals("openosrs")) - { - topPanel.add(listItem.createToggleButton(), BorderLayout.EAST); - } - String name = listItem.getName(); JLabel title = new JLabel(name); title.setForeground(Color.WHITE); @@ -607,7 +602,7 @@ public class ConfigPanel extends PluginPanel JLabel headerLabel = new JLabel(cs.name()); headerLabel.setFont(FontManager.getRunescapeFont()); - headerLabel.setForeground(ColorScheme.BRAND_ORANGE); + headerLabel.setForeground(ColorScheme.BRAND_BLUE); if (!description.equals("")) { headerLabel.setToolTipText("" + name + ":
" + description + ""); @@ -679,7 +674,7 @@ public class ConfigPanel extends PluginPanel JLabel configEntryName = new JLabel(cs.name()); 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); final JPanel sectionContents = new JPanel(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/config/PluginListItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/config/PluginListItem.java index 736aabca26..e93ed64257 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/config/PluginListItem.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/config/PluginListItem.java @@ -25,6 +25,7 @@ package net.runelite.client.plugins.config; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.image.BufferedImage; @@ -98,8 +99,8 @@ public class PluginListItem extends JPanel BufferedImage onSwitcher = ImageUtil.getResourceStreamFromClass(ConfigPanel.class, "switcher_on.png"); BufferedImage onStar = ImageUtil.getResourceStreamFromClass(ConfigPanel.class, "star_on.png"); CONFIG_ICON = new ImageIcon(configIcon); - ON_SWITCHER = new ImageIcon(onSwitcher); - ON_STAR = new ImageIcon(onStar); + ON_SWITCHER = new ImageIcon(ImageUtil.recolorImage(onSwitcher, new Color(0, 106, 221))); + ON_STAR = new ImageIcon(ImageUtil.recolorImage(onStar, new Color(0, 106, 221))); CONFIG_ICON_HOVER = new ImageIcon(ImageUtil.grayscaleOffset(configIcon, -100)); BufferedImage offSwitcherImage = ImageUtil.flipImage( ImageUtil.grayscaleOffset( @@ -199,7 +200,7 @@ public class PluginListItem extends JPanel toggleButton.setPreferredSize(new Dimension(25, 0)); attachToggleButtonListener(toggleButton); - if (name.equals("openosrs")) + if (name.equals("OpenOSRS")) { toggleButton.setVisible(false); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/WaveOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/WaveOverlay.java index 12beb81be2..d38920a976 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/WaveOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fightcave/WaveOverlay.java @@ -44,7 +44,7 @@ import net.runelite.client.ui.overlay.components.table.TableComponent; @Singleton 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 FightCavePlugin plugin; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/info/InfoPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/info/InfoPanel.java index df34ef3d50..632f9f248f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/info/InfoPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/info/InfoPanel.java @@ -113,7 +113,7 @@ public class InfoPanel extends PluginPanel JLabel version = new JLabel(htmlLabel("RuneLite version: ", RuneLiteProperties.getVersion())); version.setFont(smallFont); - JLabel plusVersion = new JLabel(htmlLabel("Openosrs version: ", RuneLiteProperties.getPlusVersion())); + JLabel plusVersion = new JLabel(htmlLabel("OpenOSRS version: ", RuneLiteProperties.getPlusVersion())); plusVersion.setFont(smallFont); 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(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(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()));*/ add(versionPanel, BorderLayout.NORTH); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/openosrs/OpenOSRSPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/openosrs/OpenOSRSPlugin.java index 05448c2497..526341633d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/openosrs/OpenOSRSPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/openosrs/OpenOSRSPlugin.java @@ -37,6 +37,7 @@ import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.api.widgets.WidgetID; import static net.runelite.api.widgets.WidgetInfo.*; import net.runelite.client.callback.ClientThread; +import net.runelite.client.config.ConfigManager; import net.runelite.client.config.Keybind; import net.runelite.client.config.OpenOSRSConfig; import net.runelite.client.eventbus.EventBus; @@ -49,7 +50,7 @@ import net.runelite.client.util.HotkeyListener; @PluginDescriptor( loadWhenOutdated = true, // prevent users from disabling hidden = true, // prevent users from disabling - name = "openosrs" + name = "OpenOSRS" ) @Singleton @Slf4j @@ -71,6 +72,9 @@ public class OpenOSRSPlugin extends Plugin @Inject private EventBus eventbus; + @Inject + private ConfigManager configManager; + private HotkeyListener hotkeyListener = new HotkeyListener(() -> this.keybind) { @Override @@ -90,6 +94,7 @@ public class OpenOSRSPlugin extends Plugin @Override protected void startUp() throws Exception { + migrateConfigs(); addSubscriptions(); 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); + } + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableHeader.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableHeader.java index 18b7fddbac..43e1aaa4b9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableHeader.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableHeader.java @@ -52,7 +52,7 @@ class WorldTableHeader extends JPanel private static final ImageIcon HIGHLIGHT_ARROW_UP; 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 { diff --git a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java index a573fab527..86c70afac9 100644 --- a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java +++ b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java @@ -81,7 +81,7 @@ public class ClientLoader catch (ClassNotFoundException e) { 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."); log.error("Error loading RS!", e); diff --git a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java index cbf904ffcf..1fa67ec575 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java @@ -536,7 +536,7 @@ public class ClientUI if (client != null && !(client instanceof Client)) { 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.", "RuneLite is outdated", INFORMATION_MESSAGE)); } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/ColorScheme.java b/runelite-client/src/main/java/net/runelite/client/ui/ColorScheme.java index 5be1250547..56bb0e5214 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/ColorScheme.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/ColorScheme.java @@ -31,11 +31,11 @@ import java.awt.Color; */ public class ColorScheme { - /* The orange color used for the branding's accents */ - public static final Color BRAND_ORANGE = new Color(220, 138, 0); + /* The blue color used for the branding's accents */ + public static final Color BRAND_BLUE = new Color(0, 106, 221); - /* The orange color used for the branding's accents, with lowered opacity */ - public static final Color BRAND_ORANGE_TRANSPARENT = new Color(220, 138, 0, 120); + /* The blue color used for the branding's accents, with lowered opacity */ + 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 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)*/ 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)*/ - public static final Color PROGRESS_INPROGRESS_COLOR = new Color(230, 150, 30); + /* The color for the blue progress bar (used in ge offers, farming tracker, etc)*/ + public static final Color PROGRESS_INPROGRESS_COLOR = new Color(0, 106, 221); /* The color for the price indicator in the ge search results */ public static final Color GRAND_EXCHANGE_PRICE = new Color(110, 225, 110); diff --git a/runelite-client/src/main/java/net/runelite/client/ui/RuneLiteSplashScreen.java b/runelite-client/src/main/java/net/runelite/client/ui/RuneLiteSplashScreen.java index 4dbe23db63..b64fb2355f 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/RuneLiteSplashScreen.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/RuneLiteSplashScreen.java @@ -48,7 +48,7 @@ public class RuneLiteSplashScreen extends JFrame private RuneLiteSplashScreen() { - this.setTitle("openosrs"); + this.setTitle("OpenOSRS"); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.setSize(FRAME_SIZE); this.setLayout(new BorderLayout()); diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/FlatTextField.java b/runelite-client/src/main/java/net/runelite/client/ui/components/FlatTextField.java index 2ab50132e4..265c8d8c7a 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/FlatTextField.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/FlatTextField.java @@ -67,7 +67,7 @@ public class FlatTextField extends JPanel this.textField.setBorder(null); this.textField.setOpaque(false); this.textField.setSelectedTextColor(Color.WHITE); - this.textField.setSelectionColor(ColorScheme.BRAND_ORANGE_TRANSPARENT); + this.textField.setSelectionColor(ColorScheme.BRAND_BLUE_TRANSPARENT); add(textField, BorderLayout.CENTER); diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/InfoPanel.java b/runelite-client/src/main/java/net/runelite/client/ui/components/InfoPanel.java index 5cee418ede..1de2c12093 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/InfoPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/InfoPanel.java @@ -59,7 +59,7 @@ public class InfoPanel extends JPanel 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 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); 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"); @@ -104,12 +104,8 @@ public class InfoPanel extends JPanel c.anchor = GridBagConstraints.SOUTH; c.weighty = 0; - // Version - this.add(createPanelTextButton("RuneLite Version: " + properties.getProperty(RUNELITE_VERSION)), c); - c.gridy++; - - // Plus version - this.add(createPanelTextButton("Plus Version: " + properties.getProperty(RUNELITE_PLUS_VERSION)), c); + // OpenOSRS version + this.add(createPanelTextButton("OpenOSRS Version: " + properties.getProperty(RUNELITE_PLUS_VERSION)), c); c.gridy++; // Build date @@ -138,7 +134,7 @@ public class InfoPanel extends JPanel final JLabel textButton = new JLabel(title); textButton.setFont(FontManager.getRunescapeSmallFont()); textButton.setHorizontalAlignment(JLabel.CENTER); - textButton.setForeground(ColorScheme.BRAND_ORANGE); + textButton.setForeground(ColorScheme.BRAND_BLUE); textButton.setBackground(null); textButton.setPreferredSize(VERSION_SIZE); textButton.setMinimumSize(VERSION_SIZE); diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/MessagePanel.java b/runelite-client/src/main/java/net/runelite/client/ui/components/MessagePanel.java index 3da446ec3d..3789fa67b9 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/MessagePanel.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/MessagePanel.java @@ -80,7 +80,7 @@ public class MessagePanel extends JPanel c.gridy++; // alternate message action - messageArea = new JLabel("
Fork of RuneLite that provides more functionality and less restrictions whilst staying open source.
") + messageArea = new JLabel("
Open-source client for Old School RuneScape with more functionality and less restrictions.
") { @Override public Dimension getPreferredSize() @@ -118,8 +118,8 @@ public class MessagePanel extends JPanel this.add(barLabel, c); c.gridy++; - bar.setBackground(ColorScheme.BRAND_ORANGE_TRANSPARENT.darker()); - bar.setForeground(ColorScheme.BRAND_ORANGE); + bar.setBackground(ColorScheme.BRAND_BLUE_TRANSPARENT.darker()); + bar.setForeground(ColorScheme.BRAND_BLUE); bar.setMinimumSize(BAR_SIZE); bar.setMaximumSize(BAR_SIZE); bar.setBorder(new MatteBorder(0, 0, 0, 0, Color.LIGHT_GRAY)); diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/materialtabs/MaterialTab.java b/runelite-client/src/main/java/net/runelite/client/ui/components/materialtabs/MaterialTab.java index f4e7e835fc..fec220bfcd 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/materialtabs/MaterialTab.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/materialtabs/MaterialTab.java @@ -51,7 +51,7 @@ import net.runelite.client.ui.ColorScheme; public class MaterialTab extends JLabel { 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)); private static final Border UNSELECTED_BORDER = BorderFactory diff --git a/runelite-client/src/main/java/net/runelite/client/util/ImageUtil.java b/runelite-client/src/main/java/net/runelite/client/util/ImageUtil.java index fdf214259f..f3e15a96cf 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/ImageUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/util/ImageUtil.java @@ -34,6 +34,7 @@ import java.awt.image.BufferedImage; import java.awt.image.DirectColorModel; import java.awt.image.PixelGrabber; import java.awt.image.RescaleOp; +import java.awt.image.WritableRaster; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -440,6 +441,23 @@ public class ImageUtil 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. * diff --git a/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java b/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java index 92fc0dad7b..30e1f38226 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java @@ -98,15 +98,15 @@ public class SwingUtil UIManager.put("MenuItem.foreground", Color.WHITE); UIManager.put("Panel.background", ColorScheme.DARK_GRAY_COLOR); 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("FormattedTextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT); + UIManager.put("FormattedTextField.selectionBackground", ColorScheme.BRAND_BLUE_TRANSPARENT); 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("ProgressBar.background", ColorScheme.BRAND_ORANGE_TRANSPARENT.darker()); - UIManager.put("ProgressBar.foreground", ColorScheme.BRAND_ORANGE); - UIManager.put("ProgressBar.selectionBackground", ColorScheme.BRAND_ORANGE); + UIManager.put("ProgressBar.background", ColorScheme.BRAND_BLUE_TRANSPARENT.darker()); + UIManager.put("ProgressBar.foreground", ColorScheme.BRAND_BLUE); + UIManager.put("ProgressBar.selectionBackground", ColorScheme.BRAND_BLUE); UIManager.put("ProgressBar.selectionForeground", Color.BLACK); UIManager.put("ProgressBar.border", new EmptyBorder(0, 0, 0, 0)); UIManager.put("ProgressBar.verticalSize", new Dimension(12, 10)); @@ -392,13 +392,13 @@ public class SwingUtil stylizeJPanels(pane); 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.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setAlwaysOnTop(true); dialog.setAutoRequestFocus(true); 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 pane.addPropertyChangeListener(e -> { diff --git a/runelite-client/src/main/resources/openosrs.png b/runelite-client/src/main/resources/openosrs.png index e4057a8084..2d7f2e15a5 100644 Binary files a/runelite-client/src/main/resources/openosrs.png and b/runelite-client/src/main/resources/openosrs.png differ diff --git a/runelite-client/src/main/resources/openosrs_transparent.png b/runelite-client/src/main/resources/openosrs_transparent.png deleted file mode 100644 index 60565f1b40..0000000000 Binary files a/runelite-client/src/main/resources/openosrs_transparent.png and /dev/null differ diff --git a/settings.gradle b/settings.gradle index 49532a3868..2d3e25eaaf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,7 +16,7 @@ include ':injector-plugin' include ':injected-client' include ':runelite-plugin-archetype' include ':http-service' -include ':http-service-plus' +include ':http-service-openosrs' include ':wiki-scraper' 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(':runelite-plugin-archetype').projectDir = "$rootDir/runelite-plugin-archetype" 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