Exemple #1
0
        public async Task Initialize()
        {
            // Config
            string cs = await ConfigHelper.ReadConfigFile();

            config = ConfigHelper.LoadConfig(cs);
            if (!ConfigHelper.VerifyConfig(config))
            {
                MessageBox.Show("Failed to validate JSON Schema in Config file! Did you have a typo?", "Failed to load config.json!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                config = new Config();
            }
            if (config.NeosPath == String.Empty)
            {
                SteamInstallPath    = SteamHelper.FindSteamPath();
                NeosInstallLocation = SteamHelper.FindNeosDir(SteamHelper.CreateSteamAppsManager(SteamInstallPath));
            }
            else
            {
                NeosInstallLocation = config.NeosPath;
            }
            DirectoryTextBox.Text = PrettyFormat.Directory(NeosInstallLocation);
            // Data Path
            if (config.DataPath != String.Empty)
            {
                DataPathTextBox.Text = config.DataPath;
            }
            else
            {
                DataPathTextBox.Text = "";
            }
            // Cache Path
            if (config.CachePath != String.Empty)
            {
                CachePathTextBox.Text = config.CachePath;
            }
            else
            {
                CachePathTextBox.Text = "";
            }
            // SRanipal
            if (config.SRanipalPath != String.Empty)
            {
                SRanipalPathTextBox.Text = config.SRanipalPath;
            }
            else
            {
                SRanipalPathTextBox.Text = SRAHelper.GetSRAnipalEXE();
            }
            // Launch Options
            if (config.OtherLaunchOptions != String.Empty)
            {
                LaunchOptionsTextBox.Text = config.OtherLaunchOptions;
            }
            else
            {
                LaunchOptionsTextBox.Text = "";
            }
        }
Exemple #2
0
 private void LaunchSRAButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (config.SRanipalPath == string.Empty)
         {
             Process.Start(SRAHelper.GetSRAnipalEXE());
         }
         else
         {
             Process.Start(config.SRanipalPath);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Could not find the SRanipal application!", "SRAHelper", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }