Skip to content

Commit

Permalink
Merge pull request open-osrs#2497 from xKylee/YEEEEEEEEEEEEEEEEEEEEET
Browse files Browse the repository at this point in the history
project: remove legacy loader
  • Loading branch information
ThatGamerBlue authored Apr 11, 2020
2 parents 64e4e75 + e0416bd commit 0e49cba
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 244 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public class RuneLite
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
public static final File CACHE_DIR = new File(RUNELITE_DIR, "cache");
public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles");
public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins");
public static final File EXTERNALPLUGIN_DIR = new File(RUNELITE_DIR, "externalmanager");
public static final File SCREENSHOT_DIR = new File(RUNELITE_DIR, "screenshots");
public static final File LOGS_DIR = new File(RUNELITE_DIR, "logs");
Expand Down Expand Up @@ -401,9 +400,6 @@ private void start() throws Exception
pluginManager.loadCorePlugins();
externalPluginManager.loadPlugins();

// Load external plugins
pluginManager.loadExternalPlugins();

RuneLiteSplashScreen.stage(.76, "Finalizing configuration");

// Plugins have provided their config, so set default config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,45 +252,6 @@ default Color gamemodeColor()
return new Color(244, 239, 211, 255);
}

@Alpha
@ConfigItem(
position = 14,
keyName = "externalColor",
name = "External color",
description = "Configure the color of external plugins",
titleSection = "pluginsColorTitle",
hidden = true,
unhide = "enabledColors"
)
default Color externalColor()
{
return new Color(177, 156, 217, 255);
}

@ConfigTitleSection(
keyName = "externalPluginsTitle",
name = "External",
description = "",
position = 15,
titleSection = "pluginsTitle"
)
default Title externalPluginsTitle()
{
return new Title();
}

@ConfigItem(
keyName = "enablePlugins",
name = "Enable loading of legacy external plugins",
description = "Enable loading of legacy external plugins",
position = 16,
titleSection = "externalPluginsTitle"
)
default boolean enablePlugins()
{
return false;
}

@ConfigTitleSection(
keyName = "opacityTitle",
name = "Opacity",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,6 @@ else if (clazz.getSuperclass() != Plugin.class)
log.warn("Class {} has plugin descriptor, but is not a plugin", clazz);
continue;
}
else if (pluginDescriptor.type() == PluginType.EXTERNAL)
{
log.error("Class {} is using the the new external plugin loader, it should not use PluginType.EXTERNAL",
clazz);
continue;
}

List<Future<?>> curGroup = new ArrayList<>();
curGroup.add(exec.submit(() ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ public class PluginManager
private final Groups groups;
private final File settingsFileInput;

@Inject
ExternalPluginLoader externalPluginLoader;

@Setter
boolean isOutdated;

Expand Down Expand Up @@ -289,12 +286,6 @@ public void loadFakePluginConfiguration()
log.warn("Unable to reset plugin configuration", ex);
}
}

public void loadExternalPlugins()
{
externalPluginLoader.scanAndLoad();
}

public void loadCorePlugins() throws IOException
{
plugins.addAll(scanAndInstantiate(getClass().getClassLoader(), PLUGIN_PACKAGE, false));
Expand Down Expand Up @@ -380,12 +371,6 @@ List<Plugin> scanAndInstantiate(ClassLoader classLoader, String packageName, boo
continue;
}

if (external && pluginDescriptor.type() != PluginType.EXTERNAL)
{
log.error("Class {} is using the external plugin loader but doesn't have PluginType.EXTERNAL", clazz);
continue;
}

if (!pluginDescriptor.loadWhenOutdated() && isOutdated)
{
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public enum PluginType
SKILLING("Skilling"),
UTILITY("Utilities"),
MISCELLANEOUS("Miscellaneous"),
EXTERNAL("Legacy External"),
IMPORTANT("System"),
MINIGAME("Minigame"),
GAMEMODE("Gamemode"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class PluginListPanel extends PluginPanel
private static final String PINNED_PLUGINS_CONFIG_KEY = "pinnedPlugins";

private static final List<String> colorOptions = Arrays.asList("enabledColors", "pvmColor", "pvpColor", "skillingColor", "utilityColor", "minigameColor", "miscellaneousColor", "gamemodeColor");
private static final List<PluginType> definedOrder = List.of(PluginType.IMPORTANT, PluginType.PVM, PluginType.SKILLING, PluginType.PVP, PluginType.UTILITY, PluginType.MINIGAME, PluginType.MISCELLANEOUS, PluginType.GAMEMODE, PluginType.EXTERNAL, PluginType.UNCATEGORIZED);
private static final List<PluginType> definedOrder = List.of(PluginType.IMPORTANT, PluginType.PVM, PluginType.SKILLING, PluginType.PVP, PluginType.UTILITY, PluginType.MINIGAME, PluginType.MISCELLANEOUS, PluginType.GAMEMODE, PluginType.UNCATEGORIZED);
private static final Comparator<PluginListItem> categoryComparator = Comparator.comparing(plugin -> definedOrder.indexOf(plugin.getPluginType()));

private final ConfigManager configManager;
Expand Down Expand Up @@ -617,8 +617,6 @@ private Color getColorByCategory(PluginType pluginType)

switch (pluginType)
{
case EXTERNAL:
return openOSRSConfig.externalColor();
case PVM:
return openOSRSConfig.pvmColor();
case PVP:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
import javax.swing.border.EmptyBorder;
import net.runelite.api.Client;
import static net.runelite.client.RuneLite.LOGS_DIR;
import static net.runelite.client.RuneLite.PLUGINS_DIR;
import static net.runelite.client.RuneLite.RUNELITE_DIR;
import static net.runelite.client.RuneLite.SCREENSHOT_DIR;
import static net.runelite.client.RuneLite.EXTERNALPLUGIN_DIR;
import net.runelite.client.RuneLiteProperties;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.ui.ColorScheme;
Expand Down Expand Up @@ -157,7 +157,7 @@ public InfoPanel(final InfoPlugin plugin, final Client client)
actionsContainer.add(buildLinkPanel(IMPORT_ICON, "Launcher Download", "for the latest launcher", "https://github.com/open-osrs/launcher/releases"));
actionsContainer.add(buildLinkPanel(FOLDER_ICON, "Open Runelite Directory", "for your .properties file", RUNELITE_DIR));
actionsContainer.add(buildLinkPanel(FOLDER_ICON, "Open Logs Directory", "for bug reports", LOGS_DIR));
actionsContainer.add(buildLinkPanel(FOLDER_ICON, "Open Plugins Directory", "for plugins", PLUGINS_DIR));
actionsContainer.add(buildLinkPanel(FOLDER_ICON, "Open ExternalManager Directory", "to see your plugins", EXTERNALPLUGIN_DIR));
actionsContainer.add(buildLinkPanel(FOLDER_ICON, "Open Screenshots Directory", "for your screenshots", SCREENSHOT_DIR));

JPanel pathPanel = new JPanel();
Expand Down

0 comments on commit 0e49cba

Please sign in to comment.