add brand color, hook our splash into theirs

This commit is contained in:
TheRealNull
2020-12-24 14:14:41 -05:00
parent eba3866e1a
commit cc026314ac
7 changed files with 552 additions and 2 deletions

View File

@@ -74,6 +74,7 @@ import net.runelite.client.rs.ClientUpdateCheckMode;
import net.runelite.client.ui.ClientUI;
import net.runelite.client.ui.DrawManager;
import net.runelite.client.ui.FatalErrorDialog;
import com.openosrs.client.ui.OpenOSRSSplashScreen;
import net.runelite.client.ui.SplashScreen;
import net.runelite.client.ui.overlay.OverlayManager;
import net.runelite.client.ui.overlay.OverlayRenderer;
@@ -248,6 +249,7 @@ public class RuneLite
final OkHttpClient okHttpClient = okHttpClientBuilder.build();
SplashScreen.init();
OpenOSRSSplashScreen.init();
SplashScreen.stage(0, "Retrieving client", "");
try
@@ -466,6 +468,6 @@ public class RuneLite
//Fixes win10 scaling when not 100% while using Anti-Aliasing with GPU
System.setProperty("sun.java2d.uiScale", "1.0");
System.setProperty("runelite.launcher.version", "OpenOSRS Injected");
System.setProperty("runelite.launcher.version", "" + RuneLiteAPI.getVersion());
}
}

View File

@@ -31,6 +31,12 @@ import java.awt.Color;
*/
public class ColorScheme
{
/* The blue color used for the branding's accents */
public static final Color BRAND_BLUE = new Color(25, 194, 255);
/* The blue color used for the branding's accents, with lowered opacity */
public static final Color BRAND_BLUE_TRANSPARENT = new Color(25, 194, 255, 120);
/* The orange color used for the branding's accents */
public static final Color BRAND_ORANGE = new Color(220, 138, 0);

View File

@@ -24,6 +24,7 @@
*/
package net.runelite.client.ui;
import com.openosrs.client.ui.OpenOSRSSplashScreen;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
@@ -130,7 +131,7 @@ public class SplashScreen extends JFrame implements ActionListener
timer.setRepeats(true);
timer.start();
setVisible(true);
//setVisible(true);
}
@Override
@@ -207,11 +208,13 @@ public class SplashScreen extends JFrame implements ActionListener
INSTANCE.dispose();
INSTANCE = null;
});
OpenOSRSSplashScreen.close();
}
public static void stage(double overallProgress, @Nullable String actionText, String subActionText)
{
stage(overallProgress, actionText, subActionText, null);
OpenOSRSSplashScreen.stage(overallProgress, subActionText);
}
public static void stage(double startProgress, double endProgress,
@@ -230,6 +233,7 @@ public class SplashScreen extends JFrame implements ActionListener
progress = done + " / " + total;
}
stage(startProgress + ((endProgress - startProgress) * done / total), actionText, subActionText, progress);
OpenOSRSSplashScreen.stage(startProgress, endProgress, subActionText, done, total);
}
public static void stage(double overallProgress, @Nullable String actionText, String subActionText, @Nullable String progressText)

View File

@@ -207,4 +207,55 @@ public class LinkBrowser
}
});
}
/**
* Tries to open the specified {@code File} with the systems default text editor. If operation fails
* an error message is displayed with the option to copy the absolute file path to clipboard.
*
* @param file the File instance of the log file
* @return did the file open successfully?
*/
public static boolean openLocalFile(final File file)
{
if (file == null || !file.exists())
{
return false;
}
if (attemptOpenLocalFile(file))
{
log.debug("Opened log file through Desktop#edit to {}", file);
return true;
}
showMessageBox("Unable to open log file. Press 'OK' and the file path will be copied to your clipboard", file.getAbsolutePath());
return false;
}
private static boolean attemptOpenLocalFile(final File file)
{
if (!Desktop.isDesktopSupported())
{
return false;
}
final Desktop desktop = Desktop.getDesktop();
if (!desktop.isSupported(Desktop.Action.OPEN))
{
return false;
}
try
{
desktop.open(file);
return true;
}
catch (IOException ex)
{
log.warn("Failed to open Desktop#edit {}", file, ex);
return false;
}
}
}