-
Notifications
You must be signed in to change notification settings - Fork 9
/
yuzu-Early-Access-Launcher.cs
87 lines (81 loc) · 3.49 KB
/
yuzu-Early-Access-Launcher.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.IO;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
namespace yuzu_Early_Access_Launcher
{
static class yuzu_Early_Access_Launcher
{
static readonly Mutex mutex = new Mutex(true, "{29a9daa1-8bad-45c8-a05c-0d6724836e59}");
[STAThread]
static int Main()
{
String theme = "", version = "2.1.0", UserProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), path = Path.GetDirectoryName(Application.ExecutablePath);
Directory.SetCurrentDirectory(path);
if (mutex.WaitOne(TimeSpan.Zero, true))
{
Color Fore, Back, ConBack, ConBackBox;
if (File.Exists("installed.ini"))
{
File.Move("installed.ini", "launcher.ini");
}
if (File.Exists("launcher.ini"))
{
Ini ini = new Ini("launcher.ini");
theme = ini.Read("theme", "settings");
}
if(theme == "Same as yuzu" || theme == "")
{
if (File.Exists(UserProfile + "\\AppData\\Roaming\\yuzu\\config\\qt-config.ini"))
{
Ini yini = new Ini(UserProfile + "\\AppData\\Roaming\\yuzu\\config\\qt-config.ini");
theme = yini.Read("theme", "UI");
}
else
{
theme = "Light";
}
}
Fore = Color.Black;
Back = Color.FromArgb(249, 249, 249);
ConBack = Color.FromArgb(255, 255, 255);
ConBackBox = ConBack;
if (theme == "qdarkstyle" || theme == "colorful_dark" || theme == "Dark")
{
Fore = Color.White;
Back = Color.FromArgb(49, 54, 59);
ConBack = Color.FromArgb(35, 38, 41);
ConBackBox = ConBack;
theme = "Dark";
}
if (theme == "qdarkstyle_midnight_blue" || theme == "colorful_midnight_blue" || theme == "Midnight Blue")
{
Fore = Color.White;
Back = Color.FromArgb(25, 35, 45);
ConBack = Color.FromArgb(80, 95, 105);
ConBackBox = Color.FromArgb(15, 25, 34);
theme = "Midnight Blue";
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form yuzuEarlyAccessLauncher = new Form_yuzuEarlyAccessLauncher(version, theme, Back, Fore, ConBack, ConBackBox);
yuzuEarlyAccessLauncher.Text = "yuzu Early Access Launcher Version " + version.Replace('-', ' ') + " by Himprakash Deka";
yuzuEarlyAccessLauncher.BackColor = Back;
yuzuEarlyAccessLauncher.ForeColor = Fore;
Application.Run(yuzuEarlyAccessLauncher);
mutex.ReleaseMutex();
}
else
{
// send our Win32 message to make the currently running instanc jump on top of all the other windows
NativeMethods.PostMessage(
(IntPtr)NativeMethods.HWND_BROADCAST,
NativeMethods.WM_SHOWME,
IntPtr.Zero,
IntPtr.Zero);
}
return 0;
}
}
}