Merge pull request #9 from troy0h/main

Moved SPLASH_LIST to a seperate file
pull/21/head
Lojemiru 5 years ago committed by GitHub
commit 711a1b77a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,44 +52,6 @@ namespace AM2RLauncher
/// <summary> /// <summary>
/// A <see cref="string"/>-<see cref="Array"/> of custom splashes. /// A <see cref="string"/>-<see cref="Array"/> of custom splashes.
/// </summary> /// </summary>
static readonly private string[] SPLASH_LIST = {
"The real Ridley is the friends we made along the way.",
"Now with 100% more Septoggs!",
"Now with 100% more Blob Throwers!",
"Speedrun THIS, I dare you.",
"The broken pipe is a lie.",
"Overcommitting to April Fool's since 2018.",
"Also try Metroid II: Return of Samus!",
"Also try Metroid: Samus Returns!",
"Also try Prime 2D!",
"Trust me, it's an 'unintentional feature.'",
"Coming soon to a PC near you!",
"This ain't your parents' Metroid 2!",
"Now setting boss pattern to S P E E N",
"You S P E E N me right round, baby!",
"Wait, I thought Metroid was a guy!",
"jellyfish is helping yes",
"Why can't Metroid crawl?",
"When in doubt, blame GameMaker.",
"It just works™",
"Reject C++, return to ABSTRACTION",
"C# is just C++++ with Windows support.",
"Use of the Launcher has now been authorized!",
// GTK splashes begin here
"Sorry this is ugly, but at least it works.",
"GTK + QT = 💣",
"I hope you use Arch, btw",
"All your Ubuntu are belong to Arch btw.",
"Help, how do I quit vim!?",
"The bloat isn't our fault, YoYo Games forced 1GB dependencies!",
"The quieter you are, the more Metroids you can hear.",
"What you are referring to as AM2R, is in fact, GNU/AM2R.",
"GNOME be gone!",
"Go compile your own girlfriend. This one doesn't count, she's out of your league.",
"Year 3115, NVIDIA still doesn't support Wayland.",
"Was a mouse really that expensive, i3 users!?",
"Imagine using non-free software."
};
/// <summary> /// <summary>
/// The current Launcher version. /// The current Launcher version.
@ -157,9 +119,6 @@ namespace AM2RLauncher
Environment.Exit(0); Environment.Exit(0);
} }
log.Info("Mutex check passed. Entering main thread."); log.Info("Mutex check passed. Entering main thread.");
log.Info("Current Launcher Version: " + VERSION); log.Info("Current Launcher Version: " + VERSION);
log.Info("Current Platform-ID is: " + Platform.ID); log.Info("Current Platform-ID is: " + Platform.ID);
@ -199,9 +158,7 @@ namespace AM2RLauncher
} }
// Custom splash texts // Custom splash texts
Random rng = new Random(); string splash = Splash.GetSplash();
// Some fanciness so we can have Gtk-only quips, because Gtk visuals are lame.
string splash = SPLASH_LIST[rng.Next(0, SPLASH_LIST.Length - (Platform.IsGtk ? 0 : 13))];
log.Info("Randomly chosen splash: " + splash); log.Info("Randomly chosen splash: " + splash);
// Load bitmaps // Load bitmaps

@ -0,0 +1,80 @@
using Eto;
using System;
using System.Collections.Generic;
using System.Linq;
namespace AM2RLauncher
{
/// <summary>
/// Class only for providing Splashes
/// </summary>
static class Splash
{
/// <summary>
/// Cross-Platform splash strings
/// </summary>
static readonly string[] generalSplash =
{
"The real Ridley is the friends we made along the way.",
"Now with 100% more Septoggs!",
"Now with 100% more Blob Throwers!",
"Speedrun THIS, I dare you.",
"The broken pipe is a lie.",
"Overcommitting to April Fool's since 2018.",
"Also try Metroid II: Return of Samus!",
"Also try Metroid: Samus Returns!",
"Also try Prime 2D!",
"Trust me, it's an 'unintentional feature.'",
"Coming soon to a PC near you!",
"This ain't your parents' Metroid 2!",
"Now setting boss pattern to S P E E N",
"You S P E E N me right round, baby!",
"Wait, I thought Metroid was a guy!",
"jellyfish is helping yes",
"Why can't Metroid crawl?",
"When in doubt, blame GameMaker.",
"It just works™",
"Reject C++, return to ABSTRACTION",
"C# is just C++++ with Windows support.",
"Use of the Launcher has now been authorized!",
};
/// <summary>
/// Linux only splash strings
/// </summary>
static readonly string[] linuxSplash =
{
"Sorry this is ugly, but at least it works.",
"GTK + QT = 💣",
"I hope you use Arch, btw",
"All your Ubuntu are belong to Arch btw.",
"Help, how do I quit vim!?",
"The bloat isn't our fault, YoYo Games forced 1GB dependencies!",
"The quieter you are, the more Metroids you can hear.",
"What you are referring to as AM2R, is in fact, GNU/AM2R.",
"GNOME be gone!",
"Go compile your own girlfriend. This one doesn't count, she's out of your league.",
"Year 3115, NVIDIA still doesn't support Wayland.",
"Was a mouse really that expensive, i3 users!?",
"Imagine using non-free software."
};
/// <summary>
/// Get a random splash string, according to the current OS.
/// </summary>
/// <returns>The randomly chosen splash as a <see cref="string"/>.</returns>
static public string GetSplash()
{
string[] combinedSplash;
Random rng = new Random();
if (Platform.Instance.IsGtk)
combinedSplash = generalSplash.Concat(linuxSplash).ToArray();
else
combinedSplash = generalSplash;
string splashString = combinedSplash[rng.Next(0, combinedSplash.Length)];
return splashString;
}
}
}
Loading…
Cancel
Save