Esempio n. 1
0
        void RefreshGames()
        {
            SetStatus( "Refreshing games..." );

            DebugLog.AppendText( "Steam - Refreshing Games..." );

            Steam.App[] apps = Steam.GetSubscribedApps( ( app ) =>
                {

                    // hide anything that isn't an installable game
                    if ( Settings.HideNonInstallable && Steam.GetAppData( app.uId, "gamedir" ) == "" )
                        return false;

                    string state = Steam.GetAppData( app.uId, "state" );

                    // hide sdks
                    if ( Settings.HideTools && state == "eStateTool" )
                        return false;

                    // hide unavailable
                    if ( Settings.HideUnavailable && state == "eStateUnAvailable" )
                        return false;

                    // hide demos
                    if ( Settings.HideDemos && Steam.GetAppData( app.uId, "DemoOfAppID" ) != "" )
                        return false;

                    // hide dlc
                    if ( Settings.HideDLC && Steam.GetAppData( app.uId, "DLCForAppID" ) != "" )
                        return false;

                    // hide movies
                    if ( Settings.HideMovies && Steam.GetAppData( app.uId, "IsMediaFile" ) == "1" )
                        return false;

                    return true;

                } );

            if ( apps == null || apps.Length == 0 )
            {
                DebugLog.AppendText( "Failed!{0}", Environment.NewLine );
                return;
            }

            gamePanel.SuspendLayout();

            gamePanel.Controls.Clear();

            foreach ( Steam.App app in apps )
            {
                GameControl gc = new GameControl()
                {
                    AppID = app.AppID,
                    GameName = app.Name,
                    Icon = app.Icon,
                };

                gc.RequestIcon();

                gamePanel.Controls.Add( gc );
            }

            gamePanel.ResumeLayout();

            DebugLog.AppendText( "Done!{0}", Environment.NewLine );

            SetStatus( "None" );
        }
Esempio n. 2
0
        void RefreshGames()
        {
            SetStatus("Refreshing games...");

            DebugLog.AppendText("Steam - Refreshing Games...");

            Steam.App[] apps = Steam.GetSubscribedApps((app) =>
            {
                // hide anything that isn't an installable game
                if (Settings.HideNonInstallable && Steam.GetAppData(app.uId, "gamedir") == "")
                {
                    return(false);
                }

                string state = Steam.GetAppData(app.uId, "state");

                // hide sdks
                if (Settings.HideTools && state == "eStateTool")
                {
                    return(false);
                }

                // hide unavailable
                if (Settings.HideUnavailable && state == "eStateUnAvailable")
                {
                    return(false);
                }

                // hide demos
                if (Settings.HideDemos && Steam.GetAppData(app.uId, "DemoOfAppID") != "")
                {
                    return(false);
                }

                // hide dlc
                if (Settings.HideDLC && Steam.GetAppData(app.uId, "DLCForAppID") != "")
                {
                    return(false);
                }

                // hide movies
                if (Settings.HideMovies && Steam.GetAppData(app.uId, "IsMediaFile") == "1")
                {
                    return(false);
                }

                return(true);
            });

            if (apps == null || apps.Length == 0)
            {
                DebugLog.AppendText("Failed!{0}", Environment.NewLine);
                return;
            }

            gamePanel.SuspendLayout();

            gamePanel.Controls.Clear();

            foreach (Steam.App app in apps)
            {
                GameControl gc = new GameControl()
                {
                    AppID    = app.AppID,
                    GameName = app.Name,
                    Icon     = app.Icon,
                };

                gc.RequestIcon();

                gamePanel.Controls.Add(gc);
            }

            gamePanel.ResumeLayout();

            DebugLog.AppendText("Done!{0}", Environment.NewLine);

            SetStatus("None");
        }