Example #1
0
 /// <summary>
 /// FrmRepBuilder class constructor.
 /// </summary>
 /// <param name="A">Path to app's user directory.</param>
 /// <param name="FS">Full path to Steam client directory.</param>
 /// <param name="SG">Instance of SourceGame class, selected in main window.</param>
 public FrmRepBuilder(string A, string FS, SourceGame SG)
 {
     InitializeComponent();
     AppUserDir    = A;
     FullSteamPath = FS;
     SelectedGame  = SG;
 }
Example #2
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     foreach (var game in Games)
     {
         if (game.Name == comboBox1.Text)
         {
             CurrentGame = game;
             loadTracks();
             return;
         }
     }
     CurrentGame = null;
 }
        /// <summary>
        /// Scans a Steam App to check if it's a Source game.
        /// </summary>
        private static SourceGame ScanSteamApp(string steamApp, string contentDir = null)
        {
            if (contentDir == null)
            {
                contentDir = steamApp;
            }

            foreach (var file in Directory.GetFiles(contentDir))
            {
                if (Path.GetFileName(file) != "steam.inf")
                {
                    continue;
                }

                // different steam.inf format for Source2
                var appIdName = "appID";
                var isSource2 = IsSource2(contentDir);
                if (isSource2)
                {
                    appIdName = "AppID";
                }

                var game = new SourceGame
                {
                    ProductName = Path.GetFileName(steamApp),
                    ContentDir  = contentDir,
                    AppId       = SteamParser.ParseSteamInf(File.ReadAllLines(file))[appIdName],
                    IsSource2   = isSource2
                };

                return(game);
            }

            return(Directory.GetDirectories(contentDir)
                   .Select(subFolder => ScanSteamApp(steamApp, subFolder))
                   .FirstOrDefault(app => app != null));
        }
Example #4
0
 /// <summary>
 /// Opens reports generation window.
 /// </summary>
 /// <param name="AppUserDir">App's user directory.</param>
 /// <param name="FullSteamPath">Full path to Steam client directory.</param>
 /// <param name="SelectedGame">Instance of SourceGame class, selected in main window.</param>
 public static void FormShowRepBuilder(string AppUserDir, string FullSteamPath, SourceGame SelectedGame)
 {
     using (FrmRepBuilder RBF = new FrmRepBuilder(AppUserDir, FullSteamPath, SelectedGame))
     {
         RBF.ShowDialog();
     }
 }