minor improvements
This commit is contained in:
zeruth
2019-04-28 19:50:58 -04:00
parent 0ca0f728e1
commit 1af505ed47
4 changed files with 32 additions and 16 deletions

View File

@@ -243,7 +243,7 @@ public class RuneLite
developerMode));
injector.getInstance(RuneLite.class).start();
splashScreen.setProgress(1, 4);
splashScreen.setProgress(1, 5);
final long end = System.currentTimeMillis();
final RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean();
final long uptime = rb.getUptime();
@@ -264,10 +264,12 @@ public class RuneLite
// Load user configuration
splashScreen.setMessage("Loading configuration");
configManager.load();
splashScreen.setProgress(2, 4);
// Load the session, including saved configuration
sessionManager.loadSession();
splashScreen.setProgress(2, 5);
splashScreen.setMessage("Loading plugins");
// Begin watching for new plugins
pluginManager.watch();
@@ -277,21 +279,21 @@ public class RuneLite
// Load the plugins, but does not start them yet.
// This will initialize configuration
splashScreen.setMessage("Loading plugins and patches");
splashScreen.setSubMessage("Starting session...");
pluginManager.loadCorePlugins();
splashScreen.setProgress(3, 4);
// Plugins have provided their config, so set default config
// to main settings
pluginManager.loadDefaultPluginConfiguration();
splashScreen.setProgress(3, 5);
splashScreen.setMessage("Starting Session");
// Start client session
clientSessionManager.start();
splashScreen.setProgress(4, 5);
// Load the session, including saved configuration
splashScreen.setMessage("Loading interface");
splashScreen.setProgress(4, 4);
splashScreen.setProgress(5, 5);
// Initialize UI
clientUI.open(this);

View File

@@ -421,11 +421,11 @@ public class ClientLoader
}
for (Method m : methods) {
RuneLite.splashScreen.setSubMessage("Checked "+m.getName());
RuneLite.splashScreen.setProgress(currentStep, stepCount);
if (m.getName().contains("$")) {
protectedStuff.add(classToLoad.getName()+"."+m.getName());
}
}
RuneLite.splashScreen.setProgress(currentStep, stepCount);
} catch (FileNotFoundException e) {
e.printStackTrace();
}

View File

@@ -74,6 +74,7 @@ public class ByteCodePatcher {
ErrorTransform et = new ErrorTransform();
et.modify(null);
RuneLite.splashScreen.setProgress(5, 5);
RuneLite.splashScreen.setSubMessage("");
ByteCodeUtils.updateHijackedJar();
} catch (Exception e) {
e.printStackTrace();
@@ -85,7 +86,7 @@ public class ByteCodePatcher {
}
public static void findHooks(String jf) {
RuneLite.splashScreen.setMessage("Intercepting Classes");
RuneLite.splashScreen.setMessage("Hijacking Classes");
try {
classPool = new ClassPool(true);
classPool.appendClassPath(RuneLite.RUNELITE_DIR+"/injectedClient-"+ RuneLiteAPI.getVersion() +"-.jar");

View File

@@ -35,6 +35,8 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
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;
@@ -52,9 +54,10 @@ public class RuneLiteSplashScreen
private RuneLiteProperties runeLiteProperties = new RuneLiteProperties();
public JFrame frame;
public JPanel panel = new JPanel();
public JLabel messageLabel;
public JLabel subMessageLabel;
public JProgressBar progressBar;
public JProgressBar progressBar = new JProgressBar();
private int currentStep;
@@ -71,7 +74,9 @@ public class RuneLiteSplashScreen
frame = new JFrame("RuneLitePlus Loading");
messageLabel = new JLabel("Loading...");
subMessageLabel = new JLabel();
progressBar = new JProgressBar(0, estimatedSteps);
progressBar.setUI(new BasicProgressBarUI());
progressBar.setMinimum(0);
progressBar.setMaximum(estimatedSteps);
// frame setup
frame.setSize(220, 290);
@@ -79,7 +84,6 @@ public class RuneLiteSplashScreen
frame.setUndecorated(true);
// main panel setup
final JPanel panel = new JPanel();
// To reduce substance's colorization (tinting)
panel.putClientProperty(SubstanceSynapse.COLORIZATION_FACTOR, 1.0);
panel.setBackground(ColorScheme.DARKER_GRAY_COLOR);
@@ -132,9 +136,9 @@ public class RuneLiteSplashScreen
litVersionConstraints.weightx = 4;
panel.add(litVersion, litVersionConstraints);
// progressbar
final GridBagConstraints progressConstraints = new GridBagConstraints();
progressConstraints.insets = new Insets(0, 30, 5, 30);
progressConstraints.fill = GridBagConstraints.HORIZONTAL;
progressConstraints.anchor = GridBagConstraints.SOUTH;
progressConstraints.gridy = 4;
@@ -147,12 +151,11 @@ public class RuneLiteSplashScreen
panel.add(messageLabel, messageConstraints);
// alternate message
final GridBagConstraints subMessageConstraints = new GridBagConstraints();
subMessageLabel.setForeground(subMessageLabel.getForeground().darker());
subMessageLabel.setFont(FontManager.getRunescapeSmallFont());
final GridBagConstraints altConstrains = new GridBagConstraints();
altConstrains.anchor = GridBagConstraints.NORTH;
altConstrains.gridy = 6;
panel.add(subMessageLabel, altConstrains);
subMessageConstraints.gridy = 6;
panel.add(subMessageLabel, subMessageConstraints);
frame.setContentPane(panel);
}
@@ -223,6 +226,16 @@ public class RuneLiteSplashScreen
{
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.setValue(currentProgress);
});