示例#1
0
        private void SettingsButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            SwitcherSettings switcherSettings = new SwitcherSettings();

            switcherSettings.Show();
            this.Close();
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();

            //Creates A Switcher Directory in Local Appdata
            var localAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            var localPath        = System.IO.Path.Combine(localAppDataPath, @"Switcher");

            if (!System.IO.Directory.Exists(localPath))
            {
                System.IO.Directory.CreateDirectory(localPath);
            }

            //Initiates Other Needed Functions
            try
            {
                SwitcherSettings.readLauncherSettings();
                SwitcherSettings.readSettings();
                SwitcherCheck.switcherModCheck_Epic(SwitcherCore.LocationModded);
                updateStatus();
            }
            catch (Exception)
            {
                //Console.WriteLine("Something Went Wrong");
                MessageBox.Show("An unknown issue occured, and Switcher was not able to resolve it!", "Something Went Wrong");
                throw;
            }

            //Updates UI With User Settings and Preferences
            if (SwitcherCore.LauncherSelect == "EpicGames")
            {
                LauncherStatus.Text = "Epic Games";
            }
            else if (SwitcherCore.LauncherSelect == "Steam")
            {
                LauncherStatus.Text = "Steam";
            }

            //Checks If Current Install Is Modded Or Clean And Adjusts InstallSwitch's Properties Accordingly
            if (!SwitcherCheck.SwitcherPresence)
            {
                InstallSwitch.switchRail.Fill     = InstallSwitch.switchOffFill;
                InstallSwitch.switchSlider.Margin = InstallSwitch.switchOffPos;
                InstallSwitch.SwitchOn            = false;
            }
            else if (SwitcherCheck.SwitcherPresence)
            {
                InstallSwitch.switchRail.Fill     = InstallSwitch.switchOnFill;
                InstallSwitch.switchSlider.Margin = InstallSwitch.switchOnPos;
                InstallSwitch.SwitchOn            = true;
            }

            //Checks If Current Install Is Modded Or Clean And Adjusts Status Text Accordingly
            if (!SwitcherCheck.SwitcherPresence)
            {
                textInstallStatus.Text        = textUnmodded;
                textInstallStatus.Foreground  = textColorUnmodded;
                InstallStatusContainer.Stroke = textColorUnmodded;
            }
            else
            {
                textInstallStatus.Text        = textModded;
                textInstallStatus.Foreground  = textColorModded;
                InstallStatusContainer.Stroke = textColorModded;
            }
        }