Splash
minor improvements
This commit is contained in:
@@ -243,7 +243,7 @@ public class RuneLite
|
|||||||
developerMode));
|
developerMode));
|
||||||
|
|
||||||
injector.getInstance(RuneLite.class).start();
|
injector.getInstance(RuneLite.class).start();
|
||||||
splashScreen.setProgress(1, 4);
|
splashScreen.setProgress(1, 5);
|
||||||
final long end = System.currentTimeMillis();
|
final long end = System.currentTimeMillis();
|
||||||
final RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean();
|
final RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean();
|
||||||
final long uptime = rb.getUptime();
|
final long uptime = rb.getUptime();
|
||||||
@@ -264,10 +264,12 @@ public class RuneLite
|
|||||||
// Load user configuration
|
// Load user configuration
|
||||||
splashScreen.setMessage("Loading configuration");
|
splashScreen.setMessage("Loading configuration");
|
||||||
configManager.load();
|
configManager.load();
|
||||||
splashScreen.setProgress(2, 4);
|
|
||||||
|
|
||||||
// Load the session, including saved configuration
|
// Load the session, including saved configuration
|
||||||
sessionManager.loadSession();
|
sessionManager.loadSession();
|
||||||
|
splashScreen.setProgress(2, 5);
|
||||||
|
|
||||||
|
splashScreen.setMessage("Loading plugins");
|
||||||
|
|
||||||
// Begin watching for new plugins
|
// Begin watching for new plugins
|
||||||
pluginManager.watch();
|
pluginManager.watch();
|
||||||
@@ -277,21 +279,21 @@ public class RuneLite
|
|||||||
|
|
||||||
// Load the plugins, but does not start them yet.
|
// Load the plugins, but does not start them yet.
|
||||||
// This will initialize configuration
|
// This will initialize configuration
|
||||||
splashScreen.setMessage("Loading plugins and patches");
|
|
||||||
splashScreen.setSubMessage("Starting session...");
|
|
||||||
pluginManager.loadCorePlugins();
|
pluginManager.loadCorePlugins();
|
||||||
splashScreen.setProgress(3, 4);
|
|
||||||
|
|
||||||
// Plugins have provided their config, so set default config
|
// Plugins have provided their config, so set default config
|
||||||
// to main settings
|
// to main settings
|
||||||
pluginManager.loadDefaultPluginConfiguration();
|
pluginManager.loadDefaultPluginConfiguration();
|
||||||
|
splashScreen.setProgress(3, 5);
|
||||||
|
|
||||||
|
splashScreen.setMessage("Starting Session");
|
||||||
// Start client session
|
// Start client session
|
||||||
clientSessionManager.start();
|
clientSessionManager.start();
|
||||||
|
splashScreen.setProgress(4, 5);
|
||||||
|
|
||||||
// Load the session, including saved configuration
|
// Load the session, including saved configuration
|
||||||
splashScreen.setMessage("Loading interface");
|
splashScreen.setMessage("Loading interface");
|
||||||
splashScreen.setProgress(4, 4);
|
splashScreen.setProgress(5, 5);
|
||||||
|
|
||||||
// Initialize UI
|
// Initialize UI
|
||||||
clientUI.open(this);
|
clientUI.open(this);
|
||||||
|
|||||||
@@ -421,11 +421,11 @@ public class ClientLoader
|
|||||||
}
|
}
|
||||||
for (Method m : methods) {
|
for (Method m : methods) {
|
||||||
RuneLite.splashScreen.setSubMessage("Checked "+m.getName());
|
RuneLite.splashScreen.setSubMessage("Checked "+m.getName());
|
||||||
RuneLite.splashScreen.setProgress(currentStep, stepCount);
|
|
||||||
if (m.getName().contains("$")) {
|
if (m.getName().contains("$")) {
|
||||||
protectedStuff.add(classToLoad.getName()+"."+m.getName());
|
protectedStuff.add(classToLoad.getName()+"."+m.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RuneLite.splashScreen.setProgress(currentStep, stepCount);
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ public class ByteCodePatcher {
|
|||||||
ErrorTransform et = new ErrorTransform();
|
ErrorTransform et = new ErrorTransform();
|
||||||
et.modify(null);
|
et.modify(null);
|
||||||
RuneLite.splashScreen.setProgress(5, 5);
|
RuneLite.splashScreen.setProgress(5, 5);
|
||||||
|
RuneLite.splashScreen.setSubMessage("");
|
||||||
ByteCodeUtils.updateHijackedJar();
|
ByteCodeUtils.updateHijackedJar();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -85,7 +86,7 @@ public class ByteCodePatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void findHooks(String jf) {
|
public static void findHooks(String jf) {
|
||||||
RuneLite.splashScreen.setMessage("Intercepting Classes");
|
RuneLite.splashScreen.setMessage("Hijacking Classes");
|
||||||
try {
|
try {
|
||||||
classPool = new ClassPool(true);
|
classPool = new ClassPool(true);
|
||||||
classPool.appendClassPath(RuneLite.RUNELITE_DIR+"/injectedClient-"+ RuneLiteAPI.getVersion() +"-.jar");
|
classPool.appendClassPath(RuneLite.RUNELITE_DIR+"/injectedClient-"+ RuneLiteAPI.getVersion() +"-.jar");
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ import javax.swing.JLabel;
|
|||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JProgressBar;
|
import javax.swing.JProgressBar;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
import javax.swing.plaf.basic.BasicProgressBarUI;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.RuneLite;
|
import net.runelite.client.RuneLite;
|
||||||
import net.runelite.client.RuneLiteProperties;
|
import net.runelite.client.RuneLiteProperties;
|
||||||
@@ -52,9 +54,10 @@ public class RuneLiteSplashScreen
|
|||||||
private RuneLiteProperties runeLiteProperties = new RuneLiteProperties();
|
private RuneLiteProperties runeLiteProperties = new RuneLiteProperties();
|
||||||
|
|
||||||
public JFrame frame;
|
public JFrame frame;
|
||||||
|
public JPanel panel = new JPanel();
|
||||||
public JLabel messageLabel;
|
public JLabel messageLabel;
|
||||||
public JLabel subMessageLabel;
|
public JLabel subMessageLabel;
|
||||||
public JProgressBar progressBar;
|
public JProgressBar progressBar = new JProgressBar();
|
||||||
|
|
||||||
private int currentStep;
|
private int currentStep;
|
||||||
|
|
||||||
@@ -71,7 +74,9 @@ public class RuneLiteSplashScreen
|
|||||||
frame = new JFrame("RuneLitePlus Loading");
|
frame = new JFrame("RuneLitePlus Loading");
|
||||||
messageLabel = new JLabel("Loading...");
|
messageLabel = new JLabel("Loading...");
|
||||||
subMessageLabel = new JLabel();
|
subMessageLabel = new JLabel();
|
||||||
progressBar = new JProgressBar(0, estimatedSteps);
|
progressBar.setUI(new BasicProgressBarUI());
|
||||||
|
progressBar.setMinimum(0);
|
||||||
|
progressBar.setMaximum(estimatedSteps);
|
||||||
|
|
||||||
// frame setup
|
// frame setup
|
||||||
frame.setSize(220, 290);
|
frame.setSize(220, 290);
|
||||||
@@ -79,7 +84,6 @@ public class RuneLiteSplashScreen
|
|||||||
frame.setUndecorated(true);
|
frame.setUndecorated(true);
|
||||||
|
|
||||||
// main panel setup
|
// main panel setup
|
||||||
final JPanel panel = new JPanel();
|
|
||||||
// To reduce substance's colorization (tinting)
|
// To reduce substance's colorization (tinting)
|
||||||
panel.putClientProperty(SubstanceSynapse.COLORIZATION_FACTOR, 1.0);
|
panel.putClientProperty(SubstanceSynapse.COLORIZATION_FACTOR, 1.0);
|
||||||
panel.setBackground(ColorScheme.DARKER_GRAY_COLOR);
|
panel.setBackground(ColorScheme.DARKER_GRAY_COLOR);
|
||||||
@@ -132,9 +136,9 @@ public class RuneLiteSplashScreen
|
|||||||
litVersionConstraints.weightx = 4;
|
litVersionConstraints.weightx = 4;
|
||||||
panel.add(litVersion, litVersionConstraints);
|
panel.add(litVersion, litVersionConstraints);
|
||||||
|
|
||||||
|
|
||||||
// progressbar
|
// progressbar
|
||||||
final GridBagConstraints progressConstraints = new GridBagConstraints();
|
final GridBagConstraints progressConstraints = new GridBagConstraints();
|
||||||
progressConstraints.insets = new Insets(0, 30, 5, 30);
|
|
||||||
progressConstraints.fill = GridBagConstraints.HORIZONTAL;
|
progressConstraints.fill = GridBagConstraints.HORIZONTAL;
|
||||||
progressConstraints.anchor = GridBagConstraints.SOUTH;
|
progressConstraints.anchor = GridBagConstraints.SOUTH;
|
||||||
progressConstraints.gridy = 4;
|
progressConstraints.gridy = 4;
|
||||||
@@ -147,12 +151,11 @@ public class RuneLiteSplashScreen
|
|||||||
panel.add(messageLabel, messageConstraints);
|
panel.add(messageLabel, messageConstraints);
|
||||||
|
|
||||||
// alternate message
|
// alternate message
|
||||||
|
final GridBagConstraints subMessageConstraints = new GridBagConstraints();
|
||||||
subMessageLabel.setForeground(subMessageLabel.getForeground().darker());
|
subMessageLabel.setForeground(subMessageLabel.getForeground().darker());
|
||||||
subMessageLabel.setFont(FontManager.getRunescapeSmallFont());
|
subMessageLabel.setFont(FontManager.getRunescapeSmallFont());
|
||||||
final GridBagConstraints altConstrains = new GridBagConstraints();
|
subMessageConstraints.gridy = 6;
|
||||||
altConstrains.anchor = GridBagConstraints.NORTH;
|
panel.add(subMessageLabel, subMessageConstraints);
|
||||||
altConstrains.gridy = 6;
|
|
||||||
panel.add(subMessageLabel, altConstrains);
|
|
||||||
|
|
||||||
frame.setContentPane(panel);
|
frame.setContentPane(panel);
|
||||||
}
|
}
|
||||||
@@ -223,6 +226,16 @@ public class RuneLiteSplashScreen
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (progressGoal!=progressBar.getMaximum()) {
|
||||||
|
panel.remove(progressBar);
|
||||||
|
panel.validate();
|
||||||
|
final GridBagConstraints progressConstraints = new GridBagConstraints();
|
||||||
|
progressConstraints.fill = GridBagConstraints.HORIZONTAL;
|
||||||
|
progressConstraints.anchor = GridBagConstraints.SOUTH;
|
||||||
|
progressConstraints.gridy = 4;
|
||||||
|
panel.add(progressBar, progressConstraints);
|
||||||
|
panel.validate();
|
||||||
|
}
|
||||||
progressBar.setMaximum(progressGoal);
|
progressBar.setMaximum(progressGoal);
|
||||||
progressBar.setValue(currentProgress);
|
progressBar.setValue(currentProgress);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user