Adds splash screen (#29)

* clock manager: wrap panel to run on swing thread

* Add splash screen to Runelite

Although RuneLite is still fast at loading, it's more user friendly
for at least something to pop up before the client.
There is also an option (-no-splash) to disable the splash screen.
This uses psikoi's design.

* splash screen/client ui: don't set up theme twice

Setting up the look and feel of RuneLite shouldn't happen twice, so
check to see if it has already been set up before setting up the look
and feel.
This commit is contained in:
James
2019-04-20 23:41:48 -07:00
committed by Kyleeld
parent 776734c51c
commit 2a7625f240
8 changed files with 286 additions and 11 deletions

View File

@@ -61,6 +61,7 @@ import net.runelite.client.plugins.PluginManager;
import net.runelite.client.rs.ClientUpdateCheckMode;
import net.runelite.client.ui.ClientUI;
import net.runelite.client.ui.DrawManager;
import net.runelite.client.ui.RuneLiteSplashScreen;
import net.runelite.client.ui.overlay.OverlayManager;
import net.runelite.client.ui.overlay.OverlayRenderer;
import net.runelite.client.ui.overlay.WidgetOverlay;
@@ -79,8 +80,10 @@ public class RuneLite
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 SCREENSHOT_DIR = new File(RUNELITE_DIR, "screenshots");
private static final RuneLiteSplashScreen splashScreen = new RuneLiteSplashScreen();
@Getter
@Getter
private static Injector injector;
@Inject
@@ -160,6 +163,7 @@ public class RuneLite
final OptionParser parser = new OptionParser();
parser.accepts("developer-mode", "Enable developer tools");
parser.accepts("debug", "Show extra debugging output");
parser.accepts("no-splash", "Do not show the splash screen");
final ArgumentAcceptingOptionSpec<ClientUpdateCheckMode> updateMode = parser
.accepts("rs", "Select client type")
@@ -213,6 +217,14 @@ public class RuneLite
}
});
if (!options.has("no-splash"))
{
splashScreen.open(4);
}
// The submessage is shown in case the connection is slow
splashScreen.setMessage("Loading client", "And checking for updates...");
final long start = System.currentTimeMillis();
injector = Guice.createInjector(new RuneLiteModule(
@@ -239,6 +251,7 @@ public class RuneLite
}
// Load user configuration
splashScreen.setMessage("Loading configuration");
configManager.load();
// Load the session, including saved configuration
@@ -252,6 +265,7 @@ public class RuneLite
// Load the plugins, but does not start them yet.
// This will initialize configuration
splashScreen.setMessage("Loading plugins and patches", "Starting session...");
pluginManager.loadCorePlugins();
// Plugins have provided their config, so set default config
@@ -261,9 +275,15 @@ public class RuneLite
// Start client session
clientSessionManager.start();
// Load the session, including saved configuration
splashScreen.setMessage("Loading interface");
// Initialize UI
clientUI.open(this);
// Close the splash screen
splashScreen.close();
// Initialize Discord service
discordService.init();