diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java b/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java index af5e7e2631..ee8486811b 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLiteModule.java @@ -41,6 +41,7 @@ import net.runelite.client.chat.ChatMessageManager; import net.runelite.client.config.ChatColorConfig; import net.runelite.client.config.ConfigManager; import net.runelite.client.config.RuneLiteConfig; +import net.runelite.client.config.RuneLitePlusConfig; import net.runelite.client.eventbus.EventBus; import net.runelite.client.game.ItemManager; import net.runelite.client.menus.MenuManager; @@ -117,6 +118,13 @@ public class RuneLiteModule extends AbstractModule return configManager.getConfig(RuneLiteConfig.class); } + @Provides + @Singleton + RuneLitePlusConfig providePlusConfig(ConfigManager configManager) + { + return configManager.getConfig(RuneLitePlusConfig.class); + } + @Provides @Singleton ChatColorConfig provideChatColorConfig(ConfigManager configManager) diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java b/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java index f5b5c56da0..1fd40987ad 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLiteProperties.java @@ -31,17 +31,18 @@ import javax.annotation.Nullable; import javax.inject.Inject; import javax.inject.Singleton; import lombok.extern.slf4j.Slf4j; -import net.runelite.client.plugins.runeliteplus.RuneLitePlusPlugin; +import net.runelite.client.config.RuneLitePlusConfig; @Singleton @Slf4j public class RuneLiteProperties { - public static String discordAppID = "409416265891971072"; private static final String RUNELITE_TITLE = "runelite.title"; private static final String RUNELITE_VERSION = "runelite.version"; + private static final String RUNELIT_VERSION = "runelit.version"; private static final String RUNESCAPE_VERSION = "runescape.version"; private static final String DISCORD_APP_ID = "runelite.discord.appid"; + private static final String DISCORD_APP_ID_PLUS = "runelite.plus.discord.appid"; private static final String DISCORD_INVITE = "runelite.discord.invite"; private static final String GITHUB_LINK = "runelite.github.link"; private static final String WIKI_LINK = "runelite.wiki.link"; @@ -50,9 +51,26 @@ public class RuneLiteProperties private final Properties properties = new Properties(); + private final RuneLitePlusConfig runeLitePlusConfig; + @Inject + public RuneLiteProperties(final RuneLitePlusConfig runeLiteConfig) + { + this.runeLitePlusConfig = runeLiteConfig; + + try (InputStream in = getClass().getResourceAsStream("runelite.properties")) + { + properties.load(in); + } + catch (IOException ex) + { + log.warn("unable to load propertries", ex); + } + } + public RuneLiteProperties() { + runeLitePlusConfig = null; try (InputStream in = getClass().getResourceAsStream("runelite.properties")) { properties.load(in); @@ -79,6 +97,11 @@ public class RuneLiteProperties return properties.getProperty(RUNELITE_VERSION); } + public String getRunelitVersion() + { + return properties.getProperty(RUNELIT_VERSION); + } + public String getRunescapeVersion() { return properties.getProperty(RUNESCAPE_VERSION); @@ -86,9 +109,14 @@ public class RuneLiteProperties public String getDiscordAppId() { - if (RuneLitePlusPlugin.customPresenceEnabled) + if (this.runeLitePlusConfig == null) { - return properties.getProperty(RuneLitePlusPlugin.rlPlusDiscordApp); + return properties.getProperty(DISCORD_APP_ID); + } + + if (this.runeLitePlusConfig.customPresence()) + { + return properties.getProperty(DISCORD_APP_ID_PLUS); } else { diff --git a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java index b7503fb616..069483865a 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java @@ -33,10 +33,10 @@ import net.runelite.client.ui.FontManager; public interface RuneLiteConfig extends Config { @ConfigItem( - keyName = "gameSize", - name = "Game size", - description = "The game will resize to this resolution upon starting the client", - position = 10 + keyName = "gameSize", + name = "Game size", + description = "The game will resize to this resolution upon starting the client", + position = 10 ) default Dimension gameSize() { @@ -44,10 +44,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "automaticResizeType", - name = "Resize type", - description = "Choose how the window should resize when opening and closing panels", - position = 11 + keyName = "automaticResizeType", + name = "Resize type", + description = "Choose how the window should resize when opening and closing panels", + position = 11 ) default ExpandResizeType automaticResizeType() { @@ -55,10 +55,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "lockWindowSize", - name = "Lock window size", - description = "Determines if the window resizing is allowed or not", - position = 12 + keyName = "lockWindowSize", + name = "Lock window size", + description = "Determines if the window resizing is allowed or not", + position = 12 ) default boolean lockWindowSize() { @@ -66,21 +66,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "enablePlugins", - name = "Enable loading of external plugins", - description = "Enable loading of external plugins", - position = 10 - ) - default boolean enablePlugins() - { - return false; - } - - @ConfigItem( - keyName = "containInScreen", - name = "Contain in screen", - description = "Makes the client stay contained in the screen when attempted to move out of it.
Note: Only works if custom chrome is enabled.", - position = 13 + keyName = "containInScreen", + name = "Contain in screen", + description = "Makes the client stay contained in the screen when attempted to move out of it.
Note: Only works if custom chrome is enabled.", + position = 13 ) default boolean containInScreen() { @@ -88,10 +77,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "rememberScreenBounds", - name = "Remember client position", - description = "Save the position and size of the client after exiting", - position = 14 + keyName = "rememberScreenBounds", + name = "Remember client position", + description = "Save the position and size of the client after exiting", + position = 14 ) default boolean rememberScreenBounds() { @@ -99,11 +88,11 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "uiEnableCustomChrome", - name = "Enable custom window chrome", - description = "Use Runelite's custom window title and borders.", - warning = "Please restart your client after changing this setting", - position = 15 + keyName = "uiEnableCustomChrome", + name = "Enable custom window chrome", + description = "Use Runelite's custom window title and borders.", + warning = "Please restart your client after changing this setting", + position = 15 ) default boolean enableCustomChrome() { @@ -111,10 +100,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "gameAlwaysOnTop", - name = "Enable client always on top", - description = "The game will always be on the top of the screen", - position = 16 + keyName = "gameAlwaysOnTop", + name = "Enable client always on top", + description = "The game will always be on the top of the screen", + position = 16 ) default boolean gameAlwaysOnTop() { @@ -122,10 +111,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "warningOnExit", - name = "Display warning on exit", - description = "Toggles a warning popup when trying to exit the client", - position = 17 + keyName = "warningOnExit", + name = "Display warning on exit", + description = "Toggles a warning popup when trying to exit the client", + position = 17 ) default WarningOnExit warningOnExit() { @@ -133,10 +122,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "usernameInTitle", - name = "Show display name in title", - description = "Toggles displaying of local player's display name in client title", - position = 18 + keyName = "usernameInTitle", + name = "Show display name in title", + description = "Toggles displaying of local player's display name in client title", + position = 18 ) default boolean usernameInTitle() { @@ -144,10 +133,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "notificationTray", - name = "Enable tray notifications", - description = "Enables tray notifications", - position = 20 + keyName = "notificationTray", + name = "Enable tray notifications", + description = "Enables tray notifications", + position = 20 ) default boolean enableTrayNotifications() { @@ -155,10 +144,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "notificationRequestFocus", - name = "Request focus on notification", - description = "Toggles window focus request", - position = 21 + keyName = "notificationRequestFocus", + name = "Request focus on notification", + description = "Toggles window focus request", + position = 21 ) default boolean requestFocusOnNotification() { @@ -166,10 +155,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "notificationSound", - name = "Enable sound on notifications", - description = "Enables the playing of a beep sound when notifications are displayed", - position = 22 + keyName = "notificationSound", + name = "Enable sound on notifications", + description = "Enables the playing of a beep sound when notifications are displayed", + position = 22 ) default boolean enableNotificationSound() { @@ -177,10 +166,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "notificationGameMessage", - name = "Enable game message notifications", - description = "Puts a notification message in the chatbox", - position = 23 + keyName = "notificationGameMessage", + name = "Enable game message notifications", + description = "Puts a notification message in the chatbox", + position = 23 ) default boolean enableGameMessageNotification() { @@ -188,10 +177,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "notificationFlash", - name = "Enable flash notification", - description = "Flashes the game frame as a notification", - position = 24 + keyName = "notificationFlash", + name = "Enable flash notification", + description = "Flashes the game frame as a notification", + position = 24 ) default FlashNotification flashNotification() { @@ -199,10 +188,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "notificationFocused", - name = "Send notifications when focused", - description = "Toggles all notifications for when the client is focused", - position = 25 + keyName = "notificationFocused", + name = "Send notifications when focused", + description = "Toggles all notifications for when the client is focused", + position = 25 ) default boolean sendNotificationsWhenFocused() { @@ -221,10 +210,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "fontType", - name = "Dynamic Overlay Font", - description = "Configures what font type is used for in-game overlays such as player name, ground items, etc.", - position = 30 + keyName = "fontType", + name = "Dynamic Overlay Font", + description = "Configures what font type is used for in-game overlays such as player name, ground items, etc.", + position = 30 ) default FontType fontType() { @@ -232,10 +221,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "tooltipFontType", - name = "Tooltip Font", - description = "Configures what font type is used for in-game tooltips such as food stats, NPC names, etc.", - position = 31 + keyName = "tooltipFontType", + name = "Tooltip Font", + description = "Configures what font type is used for in-game tooltips such as food stats, NPC names, etc.", + position = 31 ) default FontType tooltipFontType() { @@ -243,10 +232,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "interfaceFontType", - name = "Interface Overlay Font", - description = "Configures what font type is used for in-game interface overlays such as panels, opponent info, clue scrolls etc.", - position = 32 + keyName = "interfaceFontType", + name = "Interface Overlay Font", + description = "Configures what font type is used for in-game interface overlays such as panels, opponent info, clue scrolls etc.", + position = 32 ) default FontType interfaceFontType() { @@ -254,10 +243,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "menuEntryShift", - name = "Require Shift for overlay menu", - description = "Overlay right-click menu will require shift to be added", - position = 33 + keyName = "menuEntryShift", + name = "Require Shift for overlay menu", + description = "Overlay right-click menu will require shift to be added", + position = 33 ) default boolean menuEntryShift() { @@ -265,10 +254,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "infoBoxVertical", - name = "Display infoboxes vertically", - description = "Toggles the infoboxes to display vertically", - position = 40 + keyName = "infoBoxVertical", + name = "Display infoboxes vertically", + description = "Toggles the infoboxes to display vertically", + position = 40 ) default boolean infoBoxVertical() { @@ -276,10 +265,10 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "infoBoxWrap", - name = "Infobox wrap count", - description = "Configures the amount of infoboxes shown before wrapping", - position = 41 + keyName = "infoBoxWrap", + name = "Infobox wrap count", + description = "Configures the amount of infoboxes shown before wrapping", + position = 41 ) default int infoBoxWrap() { @@ -287,22 +276,22 @@ public interface RuneLiteConfig extends Config } @ConfigItem( - keyName = "infoBoxSize", - name = "Infobox size (px)", - description = "Configures the size of each infobox in pixels", - position = 42 + keyName = "infoBoxSize", + name = "Infobox size (px)", + description = "Configures the size of each infobox in pixels", + position = 42 ) default int infoBoxSize() { return 35; } - @Range( max = 100, min = 0 ) + @Range(max = 100, min = 0) @ConfigItem( - keyName = "volume", - name = "Runelite Volume", - description = "Sets the volume of custom Runelite sounds (not the client sounds)", - position = 43 + keyName = "volume", + name = "Runelite Volume", + description = "Sets the volume of custom Runelite sounds (not the client sounds)", + position = 43 ) default int volume() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusConfig.java b/runelite-client/src/main/java/net/runelite/client/config/RuneLitePlusConfig.java similarity index 91% rename from runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusConfig.java rename to runelite-client/src/main/java/net/runelite/client/config/RuneLitePlusConfig.java index 8db739148c..b70537e3de 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/config/RuneLitePlusConfig.java @@ -24,7 +24,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -package net.runelite.client.plugins.runeliteplus; +package net.runelite.client.config; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; @@ -81,4 +81,15 @@ public interface RuneLitePlusConfig extends Config { return false; } + + @ConfigItem( + keyName = "enablePlugins", + name = "Enable loading of external plugins", + description = "Enable loading of external plugins", + position = 10 + ) + default boolean enablePlugins() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/discord/DiscordService.java b/runelite-client/src/main/java/net/runelite/client/discord/DiscordService.java index dbf3c36ba2..8ff303b6d0 100644 --- a/runelite-client/src/main/java/net/runelite/client/discord/DiscordService.java +++ b/runelite-client/src/main/java/net/runelite/client/discord/DiscordService.java @@ -106,7 +106,7 @@ public class DiscordService implements AutoCloseable discordEventHandlers.joinGame = this::joinGame; discordEventHandlers.spectateGame = this::spectateGame; discordEventHandlers.joinRequest = this::joinRequest; - discordRPC.Discord_Initialize(RuneLiteProperties.discordAppID, discordEventHandlers, true, null); + discordRPC.Discord_Initialize(runeLiteProperties.getDiscordAppId(), discordEventHandlers, true, null); executorService.scheduleAtFixedRate(discordRPC::Discord_RunCallbacks, 0, 2, TimeUnit.SECONDS); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/PluginType.java b/runelite-client/src/main/java/net/runelite/client/plugins/PluginType.java index 8199cf0502..7061b6a439 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/PluginType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/PluginType.java @@ -2,7 +2,6 @@ package net.runelite.client.plugins; public enum PluginType { - RUNELITPLUS, PVM, PVP, SKILLING, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/PluginWatcher.java b/runelite-client/src/main/java/net/runelite/client/plugins/PluginWatcher.java index a5af91fee5..870ccaaaf7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/PluginWatcher.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/PluginWatcher.java @@ -45,7 +45,7 @@ import lombok.extern.slf4j.Slf4j; import net.runelite.client.RuneLite; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigManager; -import net.runelite.client.config.RuneLiteConfig; +import net.runelite.client.config.RuneLitePlusConfig; @Singleton @Slf4j @@ -53,7 +53,7 @@ public class PluginWatcher extends Thread { private static final File BASE = RuneLite.PLUGIN_DIR; - private final RuneLiteConfig runeliteConfig; + private final RuneLitePlusConfig runelitePlusConfig; private final PluginManager pluginManager; private final WatchService watchService; private final WatchKey watchKey; @@ -62,9 +62,9 @@ public class PluginWatcher extends Thread private ConfigManager configManager; @Inject - public PluginWatcher(RuneLiteConfig runeliteConfig, PluginManager pluginManager) throws IOException + public PluginWatcher(RuneLitePlusConfig runelitePlusConfig, PluginManager pluginManager) throws IOException { - this.runeliteConfig = runeliteConfig; + this.runelitePlusConfig = runelitePlusConfig; this.pluginManager = pluginManager; setName("Plugin Watcher"); @@ -84,7 +84,7 @@ public class PluginWatcher extends Thread @Override public void run() { - if (runeliteConfig.enablePlugins()) + if (runelitePlusConfig.enablePlugins()) { scan(); } @@ -96,7 +96,7 @@ public class PluginWatcher extends Thread WatchKey key = watchService.take(); Thread.sleep(50); - if (!runeliteConfig.enablePlugins()) + if (!runelitePlusConfig.enablePlugins()) { key.reset(); continue; 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 9b4e60135b..b328842794 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 @@ -93,6 +93,7 @@ import net.runelite.client.config.Keybind; import net.runelite.client.config.ModifierlessKeybind; import net.runelite.client.config.Range; import net.runelite.client.config.RuneLiteConfig; +import net.runelite.client.config.RuneLitePlusConfig; import net.runelite.client.config.Stub; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; @@ -126,11 +127,13 @@ 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 RUNELITEPLUS_PLUGIN = "RuneLitePlus"; private static final String CHAT_COLOR_PLUGIN = "Chat Color"; private final PluginManager pluginManager; private final ConfigManager configManager; private final ScheduledExecutorService executorService; private final RuneLiteConfig runeLiteConfig; + private final RuneLitePlusConfig runeLitePlusConfig; private final ChatColorConfig chatColorConfig; public static List pluginList = new ArrayList<>(); @@ -150,13 +153,14 @@ public class ConfigPanel extends PluginPanel } ConfigPanel(PluginManager pluginManager, ConfigManager configManager, ScheduledExecutorService executorService, - RuneLiteConfig runeLiteConfig, ChatColorConfig chatColorConfig) + RuneLiteConfig runeLiteConfig, RuneLitePlusConfig runeLitePlusConfig, ChatColorConfig chatColorConfig) { super(false); this.pluginManager = pluginManager; this.configManager = configManager; this.executorService = executorService; this.runeLiteConfig = runeLiteConfig; + this.runeLitePlusConfig = runeLitePlusConfig; this.chatColorConfig = chatColorConfig; searchBar.setIcon(IconTextField.Icon.SEARCH); @@ -261,22 +265,13 @@ public class ConfigPanel extends PluginPanel runeLite.nameLabel.setForeground(Color.WHITE); pluginList.add(runeLite); - List runeLitePlus = new ArrayList<>(); - // populate pluginList with all external Plugins - pluginManager.getPlugins().stream() - .filter(plugin -> plugin.getClass().getAnnotation(PluginDescriptor.class).type().equals(PluginType.RUNELITPLUS)) - .forEach(plugin -> - { - final PluginDescriptor descriptor = plugin.getClass().getAnnotation(PluginDescriptor.class); - final Config config = pluginManager.getPluginConfigProxy(plugin); - final ConfigDescriptor configDescriptor = config == null ? null : configManager.getConfigDescriptor(config); - - final PluginListItem listItem = new PluginListItem(this, configManager, plugin, descriptor, config, configDescriptor); - listItem.setPinned(pinnedPlugins.contains(listItem.getName())); - runeLitePlus.add(listItem); - }); - runeLitePlus.sort(Comparator.comparing(PluginListItem::getName)); - pluginList.addAll(runeLitePlus); + // set RuneLitePlus config on top, as it should always have been + final PluginListItem runeLitePlus = new PluginListItem(this, configManager, runeLitePlusConfig, + configManager.getConfigDescriptor(runeLitePlusConfig), + RUNELITEPLUS_PLUGIN, "RuneLitePlus client settings", "client"); + runeLitePlus.setPinned(pinnedPlugins.contains(RUNELITEPLUS_PLUGIN)); + runeLitePlus.nameLabel.setForeground(Color.WHITE); + pluginList.add(runeLitePlus); List externalPlugins = new ArrayList<>(); // populate pluginList with all external Plugins @@ -418,15 +413,18 @@ public class ConfigPanel extends PluginPanel void refreshPluginList() { - // update enabled / disabled status of all items - pluginList.forEach(listItem -> + if (pluginManager != null) { - final Plugin plugin = listItem.getPlugin(); - if (plugin != null) + // update enabled / disabled status of all items + pluginList.forEach(listItem -> { - listItem.setPluginEnabled(pluginManager.isPluginEnabled(plugin)); - } - }); + final Plugin plugin = listItem.getPlugin(); + if (plugin != null) + { + listItem.setPluginEnabled(pluginManager.isPluginEnabled(plugin)); + } + }); + } if (showingPluginList) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPlugin.java index a4520ebbd1..0996eed283 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPlugin.java @@ -33,6 +33,7 @@ import net.runelite.api.MenuAction; import net.runelite.client.config.ChatColorConfig; import net.runelite.client.config.ConfigManager; import net.runelite.client.config.RuneLiteConfig; +import net.runelite.client.config.RuneLitePlusConfig; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.events.OverlayMenuClicked; import net.runelite.client.events.PluginChanged; @@ -69,6 +70,9 @@ public class ConfigPlugin extends Plugin @Inject private RuneLiteConfig runeLiteConfig; + @Inject + private RuneLitePlusConfig runeLitePlusConfig; + @Inject private ChatColorConfig chatColorConfig; @@ -78,7 +82,7 @@ public class ConfigPlugin extends Plugin @Override protected void startUp() throws Exception { - configPanel = new ConfigPanel(pluginManager, configManager, executorService, runeLiteConfig, chatColorConfig); + configPanel = new ConfigPanel(pluginManager, configManager, executorService, runeLiteConfig, runeLitePlusConfig, chatColorConfig); final BufferedImage icon = ImageUtil.getResourceStreamFromClass(getClass(), "config_icon.png"); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pluginsorter/PluginSorterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/pluginsorter/PluginSorterPlugin.java index 320475b887..3ad3f06a4e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/pluginsorter/PluginSorterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pluginsorter/PluginSorterPlugin.java @@ -177,9 +177,15 @@ public class PluginSorterPlugin extends Plugin private void showPlugins() { - List tempList = new ArrayList<>(); - tempList.addAll(ConfigPanel.pluginList); - tempList.addAll(1, removedPlugins); + List tempList = new ArrayList<>(ConfigPanel.pluginList); + if (tempList.size() > 0) + { + tempList.addAll(1, removedPlugins); + } + else + { + tempList.addAll(removedPlugins); + } ConfigPanel.pluginList = tempList; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusPlugin.java index a3940747de..769266f69c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusPlugin.java @@ -26,8 +26,6 @@ */ package net.runelite.client.plugins.runeliteplus; -import com.google.inject.Provides; - import java.awt.event.KeyEvent; import javax.inject.Inject; @@ -40,22 +38,19 @@ import net.runelite.api.widgets.WidgetID; import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.RuneLiteProperties; import net.runelite.client.callback.ClientThread; -import net.runelite.client.config.ConfigManager; +import net.runelite.client.config.RuneLitePlusConfig; import net.runelite.client.discord.DiscordService; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.input.KeyListener; import net.runelite.client.input.KeyManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; -import net.runelite.client.plugins.PluginType; import net.runelite.client.ui.ClientUI; @PluginDescriptor( - loadWhenOutdated = true, // prevent users from disabling - hidden = true, // prevent users from disabling - name = "RuneLitePlus", - description = "Configures various aspects of RuneLitePlus", - type = PluginType.RUNELITPLUS + loadWhenOutdated = true, // prevent users from disabling + hidden = true, // prevent users from disabling + name = "RunelitePlus" ) @Singleton @Slf4j @@ -96,38 +91,14 @@ public class RuneLitePlusPlugin extends Plugin } } - /* Can't feed this as args to runscript? - private static final int[] widgetArgs = new int[] - { - WidgetInfo.BANK_PIN_EXIT_BUTTON.getId(), - WidgetInfo.BANK_PIN_FORGOT_BUTTON.getId(), - WidgetInfo.BANK_PIN_1.getId(), - WidgetInfo.BANK_PIN_2.getId(), - WidgetInfo.BANK_PIN_3.getId(), - WidgetInfo.BANK_PIN_4.getId(), - WidgetInfo.BANK_PIN_5.getId(), - WidgetInfo.BANK_PIN_6.getId(), - WidgetInfo.BANK_PIN_7.getId(), - WidgetInfo.BANK_PIN_8.getId(), - WidgetInfo.BANK_PIN_9.getId(), - WidgetInfo.BANK_PIN_0.getId(), - WidgetInfo.BANK_PIN_EXIT_BUTTON.getId(), - WidgetInfo.BANK_PIN_FORGOT_BUTTON.getId(), - WidgetInfo.BANK_PIN_FIRST_ENTERED.getId(), - WidgetInfo.BANK_PIN_SECOND_ENTERED.getId(), - WidgetInfo.BANK_PIN_THIRD_ENTERED.getId(), - WidgetInfo.BANK_PIN_FOURTH_ENTERED.getId(), - WidgetInfo.BANK_PIN_INSTRUCTION_TEXT.getId() - };*/ - public static boolean customPresenceEnabled = false; - public static final String rlPlusDiscordApp = "560644885250572289"; - private static final String rlDiscordApp = "409416265891971072"; + @Inject + private RuneLiteProperties runeLiteProperties; @Inject - public RuneLitePlusConfig config; + private RuneLitePlusConfig config; @Inject - public DiscordService discordService; + private DiscordService discordService; @Inject private KeyManager keyManager; @@ -138,12 +109,6 @@ public class RuneLitePlusPlugin extends Plugin @Inject private ClientThread clientThread; - @Provides - RuneLitePlusConfig getConfig(ConfigManager configManager) - { - return configManager.getConfig(RuneLitePlusConfig.class); - } - private RuneLitePlusKeyListener keyListener = new RuneLitePlusKeyListener(); private int entered = -1; private int enterIdx; @@ -156,11 +121,11 @@ public class RuneLitePlusPlugin extends Plugin { ClientUI.currentPresenceName = ("RuneLitePlus"); ClientUI.frame.setTitle(ClientUI.currentPresenceName); - RuneLiteProperties.discordAppID = rlPlusDiscordApp; - discordService.close(); - discordService.init(); } + discordService.close(); + discordService.init(); + entered = -1; enterIdx = 0; expectInput = false; @@ -180,7 +145,6 @@ public class RuneLitePlusPlugin extends Plugin { ClientUI.currentPresenceName = ("RuneLitePlus"); ClientUI.frame.setTitle(ClientUI.currentPresenceName); - RuneLiteProperties.discordAppID = rlPlusDiscordApp; discordService.close(); discordService.init(); } @@ -188,7 +152,6 @@ public class RuneLitePlusPlugin extends Plugin { ClientUI.currentPresenceName = ("RuneLite"); ClientUI.frame.setTitle(ClientUI.currentPresenceName); - RuneLiteProperties.discordAppID = rlDiscordApp; discordService.close(); discordService.init(); } 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 8dbc86a701..895df62c0e 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 @@ -40,7 +40,6 @@ import javax.swing.JProgressBar; import javax.swing.SwingUtilities; import javax.swing.plaf.basic.BasicProgressBarUI; import lombok.extern.slf4j.Slf4j; -import net.runelite.client.RuneLite; import net.runelite.client.RuneLiteProperties; import net.runelite.client.util.SwingUtil; import org.pushingpixels.substance.internal.SubstanceSynapse; @@ -57,11 +56,9 @@ public class RuneLiteSplashScreen public JFrame frame; public JPanel panel = new JPanel(); - public JLabel messageLabel; - public JLabel subMessageLabel; - public JProgressBar progressBar = new JProgressBar(); - - private int currentStep; + private JLabel messageLabel; + private JLabel subMessageLabel; + private JProgressBar progressBar = new JProgressBar(); /** * This is not done in the constructor in order to avoid processing in case the user chooses to not load @@ -130,7 +127,7 @@ public class RuneLiteSplashScreen panel.add(version, versionConstraints); // version - final JLabel litVersion = new JLabel("Plus Version : " + RuneLite.RUNELIT_VERSION); + final JLabel litVersion = new JLabel("Plus Version : " + runeLiteProperties.getRunelitVersion()); litVersion.setForeground(Color.GREEN); litVersion.setFont(FontManager.getRunescapeSmallFont()); litVersion.setForeground(litVersion.getForeground().darker()); diff --git a/runelite-client/src/main/resources/net/runelite/client/runelite.properties b/runelite-client/src/main/resources/net/runelite/client/runelite.properties index 1867b78407..95807daaf6 100644 --- a/runelite-client/src/main/resources/net/runelite/client/runelite.properties +++ b/runelite-client/src/main/resources/net/runelite/client/runelite.properties @@ -2,7 +2,9 @@ runelite.title=RuneLite runelite.version=${project.version} runescape.version=${rs.version} runelite.discord.appid=409416265891971072 +runelite.plus.discord.appid=560644885250572289 runelite.discord.invite=https://discord.gg/HN5gf3m runelite.github.link=https://github.com/runelite-extended/runelite runelite.wiki.link=https://github.com/runelite-extended/runelite/wiki -runelite.patreon.link=https://www.patreon.com/RuneLitePlus \ No newline at end of file +runelite.patreon.link=https://www.patreon.com/RuneLitePlus +runelit.version =2.0.1-1 \ No newline at end of file diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPluginTest.java index c30c8a4e9e..b9655c884e 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/chatnotifications/ChatNotificationsPluginTest.java @@ -36,6 +36,7 @@ import net.runelite.api.MessageNode; import net.runelite.api.events.ChatMessage; import net.runelite.client.Notifier; import net.runelite.client.chat.ChatMessageManager; +import net.runelite.client.config.RuneLitePlusConfig; import net.runelite.client.util.Text; import static org.junit.Assert.assertEquals; import org.junit.Before; @@ -66,6 +67,10 @@ public class ChatNotificationsPluginTest @Bind private Notifier notifier; + @Mock + @Bind + private RuneLitePlusConfig runeLitePlusConfig; + @Inject private ChatNotificationsPlugin chatNotificationsPlugin;