client: fix load when outdated
This commit is contained in:
@@ -351,6 +351,7 @@ public class RuneLite
|
|||||||
oprsExternalPluginManager.setupInstance();
|
oprsExternalPluginManager.setupInstance();
|
||||||
oprsExternalPluginManager.startExternalUpdateManager();
|
oprsExternalPluginManager.startExternalUpdateManager();
|
||||||
oprsExternalPluginManager.startExternalPluginManager();
|
oprsExternalPluginManager.startExternalPluginManager();
|
||||||
|
oprsExternalPluginManager.setOutdated(isOutdated);
|
||||||
|
|
||||||
// Update external plugins
|
// Update external plugins
|
||||||
oprsExternalPluginManager.update(); //TODO: Re-enable after fixing actions for new repo
|
oprsExternalPluginManager.update(); //TODO: Re-enable after fixing actions for new repo
|
||||||
@@ -400,6 +401,10 @@ public class RuneLite
|
|||||||
|
|
||||||
// legacy method, i cant figure out how to make it work without garbage
|
// legacy method, i cant figure out how to make it work without garbage
|
||||||
eventBus.register(xpDropManager.get());
|
eventBus.register(xpDropManager.get());
|
||||||
|
|
||||||
|
//Set the world if specified via CLI args - will not work until clientUI.init is called
|
||||||
|
Optional<Integer> worldArg = Optional.ofNullable(System.getProperty("cli.world")).map(Integer::parseInt);
|
||||||
|
worldArg.ifPresent(this::setWorld);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start plugins
|
// Start plugins
|
||||||
@@ -408,10 +413,6 @@ public class RuneLite
|
|||||||
SplashScreen.stop();
|
SplashScreen.stop();
|
||||||
|
|
||||||
clientUI.show();
|
clientUI.show();
|
||||||
|
|
||||||
//Set the world if specified via CLI args - will not work until clientUI.init is called
|
|
||||||
Optional<Integer> worldArg = Optional.ofNullable(System.getProperty("cli.world")).map(Integer::parseInt);
|
|
||||||
worldArg.ifPresent(this::setWorld);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class WorldService
|
|||||||
private WorldResult worlds;
|
private WorldResult worlds;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private WorldService(Client client, ScheduledExecutorService scheduledExecutorService, OkHttpClient okHttpClient,
|
private WorldService(@Nullable Client client, ScheduledExecutorService scheduledExecutorService, OkHttpClient okHttpClient,
|
||||||
EventBus eventBus)
|
EventBus eventBus)
|
||||||
{
|
{
|
||||||
this.client = client;
|
this.client = client;
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ import javax.inject.Singleton;
|
|||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.RuneLite;
|
import net.runelite.client.RuneLite;
|
||||||
import net.runelite.client.config.Config;
|
import net.runelite.client.config.Config;
|
||||||
@@ -127,6 +128,8 @@ public class OPRSExternalPluginManager
|
|||||||
@Inject
|
@Inject
|
||||||
@Named("safeMode")
|
@Named("safeMode")
|
||||||
private boolean safeMode;
|
private boolean safeMode;
|
||||||
|
@Setter
|
||||||
|
boolean isOutdated;
|
||||||
|
|
||||||
public void setupInstance()
|
public void setupInstance()
|
||||||
{
|
{
|
||||||
@@ -456,6 +459,11 @@ public class OPRSExternalPluginManager
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!pluginDescriptor.loadWhenOutdated() && isOutdated)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (safeMode && !pluginDescriptor.loadInSafeMode())
|
if (safeMode && !pluginDescriptor.loadInSafeMode())
|
||||||
{
|
{
|
||||||
log.debug("Disabling {} due to safe mode", clazz);
|
log.debug("Disabling {} due to safe mode", clazz);
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ package net.runelite.client.plugins.openosrs;
|
|||||||
|
|
||||||
import ch.qos.logback.classic.Logger;
|
import ch.qos.logback.classic.Logger;
|
||||||
import com.openosrs.client.config.OpenOSRSConfig;
|
import com.openosrs.client.config.OpenOSRSConfig;
|
||||||
import net.runelite.client.plugins.openosrs.externals.ExternalPluginManagerPanel;
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -40,6 +40,7 @@ import net.runelite.client.events.ConfigChanged;
|
|||||||
import net.runelite.client.input.KeyManager;
|
import net.runelite.client.input.KeyManager;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
|
import net.runelite.client.plugins.openosrs.externals.ExternalPluginManagerPanel;
|
||||||
import net.runelite.client.ui.ClientToolbar;
|
import net.runelite.client.ui.ClientToolbar;
|
||||||
import net.runelite.client.ui.NavigationButton;
|
import net.runelite.client.ui.NavigationButton;
|
||||||
import net.runelite.client.util.HotkeyListener;
|
import net.runelite.client.util.HotkeyListener;
|
||||||
@@ -61,6 +62,7 @@ public class OpenOSRSPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private KeyManager keyManager;
|
private KeyManager keyManager;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
@@ -89,6 +91,11 @@ public class OpenOSRSPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp()
|
protected void startUp()
|
||||||
{
|
{
|
||||||
|
if (client == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ExternalPluginManagerPanel panel = injector.getInstance(ExternalPluginManagerPanel.class);
|
ExternalPluginManagerPanel panel = injector.getInstance(ExternalPluginManagerPanel.class);
|
||||||
|
|
||||||
final BufferedImage icon = ImageUtil.loadImageResource(getClass(), "externalmanager_icon.png");
|
final BufferedImage icon = ImageUtil.loadImageResource(getClass(), "externalmanager_icon.png");
|
||||||
@@ -108,7 +115,10 @@ public class OpenOSRSPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
protected void shutDown()
|
protected void shutDown()
|
||||||
{
|
{
|
||||||
clientToolbar.removeNavigation(navButton);
|
if (navButton != null)
|
||||||
|
{
|
||||||
|
clientToolbar.removeNavigation(navButton);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|||||||
Reference in New Issue
Block a user