示例#1
0
        public void SelectGame( GameControl gameControl )
        {
            foreach ( GameControl gc in this.Controls )
            {
                if ( gc.Selected )
                {
                    gc.Selected = false;
                    gc.Invalidate();
                }
            }

            this.SelectedGame = gameControl;

            MainForm mf = Form.ActiveForm as MainForm;

            if ( mf == null )
            {
                DebugLog.AppendText( "GamePanel::SelectGame() - ActiveForm is not MainForm!!!" );
                return;
            }


            mf.UpdateSelected( gameControl );

            if ( gameControl == null )
                return;

            gameControl.Selected = true;
            gameControl.Invalidate();
        }
示例#2
0
        public void UpdateSelected( GameControl gc )
        {
            if ( gc == null )
            {
                gameToolStripMenuItem.Visible = false;
                return;
            }

            gameToolStripMenuItem.Text = string.Format( "[{0}]", gc.GameName );
            gameToolStripMenuItem.Visible = true;
        }
示例#3
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" );
        }
示例#4
0
 public void ShowContextMenu( GameControl gc, Point pos )
 {
     gameContextMenu.Show( gc, pos );
 }
示例#5
0
        AddInMenuItem[] BuildMenuItems( GameControl gc )
        {
            AddIn[] addIns = addInManager.GetAddIns();
            AddInMenuItem[] menuItems = new AddInMenuItem[ addIns.Length ];

            for ( int x = 0 ; x < addIns.Length ; ++x )
                menuItems[ x ] = new AddInMenuItem( addInManager, addIns[ x ], gc.AppID );

            return menuItems;
        }
示例#6
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");
        }
示例#7
0
 public void ShowContextMenu(GameControl gc, Point pos)
 {
     gameContextMenu.Show(gc, pos);
 }