Represents a complete collection of games and categories.
Beispiel #1
0
 /// <summary>
 /// Construct a new GameInfo with no categories set.
 /// </summary>
 /// <param name="id">ID of the new game. Positive means it's the game's Steam ID, negative means it's a non-steam game.</param>
 /// <param name="name">Game title</param>
 public GameInfo( int id, string name, GameList list ) {
     Id = id;
     Name = name;
     Hidden = false;
     Categories = new SortedSet<Category>();
     this.GameList = list;
 }
Beispiel #2
0
 public DlgGame( GameList data, GameInfo game = null )
     : this()
 {
     this.Data = data;
     Game = game;
     editMode = Game != null;
 }
        public AutoCatConfigPanel_Tags(GameList ownedGames ) {
            this.ownedGames = ownedGames;

            InitializeComponent();

            ttHelp.Ext_SetToolTip( helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix );
            ttHelp.Ext_SetToolTip( list_helpMinScore, GlobalStrings.DlgAutoCat_Help_ListMinScore );
            ttHelp.Ext_SetToolTip( list_helpOwnedOnly, GlobalStrings.DlgAutoCat_Help_ListOwnedOnly );
            ttHelp.Ext_SetToolTip( helpTagsPerGame, GlobalStrings.DlgAutoCat_Help_ListTagsPerGame );
            ttHelp.Ext_SetToolTip( helpWeightFactor, GlobalStrings.DlgAutoCat_Help_ListWeightFactor );
            ttHelp.Ext_SetToolTip( list_helpScoreSort, GlobalStrings.DlgAutoCat_Help_ListScoreSort );
            ttHelp.Ext_SetToolTip( helpExcludeGenres, GlobalStrings.DlgAutoCat_Help_ListExcludeGenres );
        }
        public FormMain()
        {
            gameData = new GameList();
            InitializeComponent();

            chkFavorite.Checked = false;

            // Set up list sorting
            listSorter.AddIntCol( 0 );
            listSorter.AddRevCol( 3 );
            listSorter.AddRevCol( 4 );
            listSorter.SetSortCol( 1, 1 );
            lstGames.ListViewItemSorter = listSorter;
            lstGames.SetSortIcon( listSorter.GetSortCol(), ( listSorter.GetSortDir() == 1 ) ? SortOrder.Ascending : SortOrder.Descending );

            FullListRefresh();
        }
        public AutoCatConfigPanel_Tags(GameList ownedGames ) {
            this.ownedGames = ownedGames;

            InitializeComponent();

            ttHelp.Ext_SetToolTip( helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix );
            ttHelp.Ext_SetToolTip( list_helpMinScore, GlobalStrings.DlgAutoCat_Help_ListMinScore );
            ttHelp.Ext_SetToolTip( list_helpOwnedOnly, GlobalStrings.DlgAutoCat_Help_ListOwnedOnly );
            ttHelp.Ext_SetToolTip( helpTagsPerGame, GlobalStrings.DlgAutoCat_Help_ListTagsPerGame );
            ttHelp.Ext_SetToolTip( helpWeightFactor, GlobalStrings.DlgAutoCat_Help_ListWeightFactor );
            ttHelp.Ext_SetToolTip( helpExcludeGenres, GlobalStrings.DlgAutoCat_Help_ListExcludeGenres );

            clbTags.DisplayMember = "text";

            //Hide count column
            lstIncluded.Columns[1].Width = 0;
        }
        public AutoCatConfigPanel_Manual(GameList gamelist) {
            
            InitializeComponent();

            ownedGames = gamelist;

            ttHelp.Ext_SetToolTip( helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix );

            FillRemoveList();
            FillAddList();

            clbRemoveSelected.DisplayMember = "text";
            clbAddSelected.DisplayMember = "text";

            //Hide count columns
            lstRemove.Columns[1].Width = 0;
            lstAdd.Columns[1].Width = 0;
        }
        public DlgAutoCat( List<AutoCat> autoCats, GameList ownedGames, AutoCat selected, string profile ) {
            InitializeComponent();

            AutoCatList = new List<AutoCat>();

            profilePath = profile;

            foreach (AutoCat c in autoCats) {
                AutoCat clone = c.Clone();
                AutoCatList.Add(clone);
                if (c.Equals(selected))
                {
                    initial = clone;
                }
            }

            this.ownedGames = ownedGames;
        }
        public CDlgUpdateProfile( GameList data, string customUrl, bool overwrite, SortedSet<int> ignore, bool inclUnknown )
            : base( GlobalStrings.CDlgUpdateProfile_UpdatingGameList, true ) {
            custom = true;
            this.customUrl = customUrl;

            Added = 0;
            Fetched = 0;
            UseHtml = false;
            Failover = false;

            this.data = data;

            this.overwrite = overwrite;
            this.ignore = ignore;

            this.includeUnknown = inclUnknown;

            SetText( GlobalStrings.CDlgFetch_DownloadingGameList );
        }
        public AutoCatConfigPanel_DevPub(GameList g) {
            
            InitializeComponent();

            ownedGames = g;

            ttHelp.Ext_SetToolTip( helpPrefix, GlobalStrings.DlgAutoCat_Help_Prefix );
            ttHelp.Ext_SetToolTip(list_helpScore, GlobalStrings.DlgAutoCat_Help_MinScore);
            ttHelp.Ext_SetToolTip(list_helpOwnedOnly, GlobalStrings.DlgAutoCat_Help_ListOwnedOnly);
            ttHelp.Ext_SetToolTip(btnDevSelected, GlobalStrings.DlgAutoCat_Help_DevSelected);
            ttHelp.Ext_SetToolTip(btnPubSelected, GlobalStrings.DlgAutoCat_Help_PubSelected);

            clbDevelopersSelected.DisplayMember = "text";
            clbPublishersSelected.DisplayMember = "text";

            //Hide count columns
            lstDevelopers.Columns[1].Width = 0;
            lstPublishers.Columns[1].Width = 0;

        }
        public CDlgUpdateProfile( GameList data, string customUrl, bool overwrite, SortedSet<int> ignore, bool ignoreDlc, bool ignoreExternal )
            : base(GlobalStrings.CDlgUpdateProfile_UpdatingGameList, true)
        {
            custom = true;
            this.customUrl = customUrl;

            Added = 0;
            Fetched = 0;
            UseHtml = false;
            Failover = false;

            this.data = data;

            this.overwrite = overwrite;
            this.ignore = ignore;
            this.ignoreDlc = ignoreDlc;

            //jpodadera. Non-Steam games
            this.ignoreExternal = ignoreExternal;

            SetText(GlobalStrings.CDlgFetch_DownloadingGameList);
        }
 public override void DeProcess()
 {
     base.DeProcess();
     gamelist = null;
 }
 /// <summary>
 /// Prepares to categorize games. Prepares a list of genre categories to remove. Does nothing if removeothergenres is false.
 /// </summary>
 public override void PreProcess(GameList games, GameDB db)
 {
     base.PreProcess(games, db);
     gamelist = games;
     devList = Program.GameDB.CalculateSortedDevList(OwnedOnly ? gamelist : null, MinCount);
     pubList = Program.GameDB.CalculateSortedPubList(OwnedOnly ? gamelist : null, MinCount);
 }
        /// <summary>
        /// Prompts user to create a new profile.
        /// </summary>
        void CreateProfile()
        {
            DlgProfile dlg = new DlgProfile();
            DialogResult res = dlg.ShowDialog();
            if( res == System.Windows.Forms.DialogResult.OK ) {
                Cursor = Cursors.WaitCursor;
                currentProfile = dlg.Profile;
                gameData = currentProfile.GameData;
                AddStatus( GlobalStrings.MainForm_ProfileCreated );
                if( dlg.DownloadNow ) {
                    UpdateProfileDownload( false );
                }

                if( dlg.ImportNow ) {
                    UpdateProfileImport( false );
                }
                if( dlg.SetStartup ) {
                    settings.StartupAction = StartupAction.Load;
                    settings.ProfileToLoad = currentProfile.FilePath;
                    settings.Save();
                }

                FullListRefresh();

                Cursor = Cursors.Default;
            }
            OnProfileChange();
        }
        /// <summary>
        /// Unloads the current profile or game list, making sure the user gets the option to save any changes.
        /// </summary>
        /// <param name="updateUI">If true, will redraw the UI. Otherwise, will leave it up to the caller to do so.</param>
        /// <returns>True if there is now no loaded profile, false otherwise.</returns>
        void Unload( bool updateUI = true )
        {
            if( !CheckForUnsaved() ) {
                return;
            }

            AddStatus( GlobalStrings.MainForm_ClearedData );
            currentProfile = null;
            gameData = new GameList();
            MakeChange( false );
            OnProfileChange();
            if( updateUI ) {
                FullListRefresh();
            }
        }
        /// <summary>
        /// Loads the given profile file.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="checkForChanges"></param>
        void LoadProfile( string path, bool checkForChanges = true )
        {
            if( checkForChanges && !CheckForUnsaved() ) return;

            try {
                currentProfile = Profile.Load( path );
                AddStatus( GlobalStrings.MainForm_ProfileLoaded );
            } catch( ApplicationException e ) {
                MessageBox.Show( e.Message, GlobalStrings.MainForm_ErrorLoadingProfile, MessageBoxButtons.OK, MessageBoxIcon.Warning );
                AddStatus( GlobalStrings.MainForm_FailedLoadProfile );
                return;
            }

            gameData = currentProfile.GameData;

            if( currentProfile.AutoDownload ) {
                UpdateProfileDownload();
            }
            if( currentProfile.AutoImport ) {
                UpdateProfileImport();
            }

            FullListRefresh();

            OnProfileChange();
        }
Beispiel #16
0
 public virtual void DeProcess() {
     games = null;
     db = null;
 }
Beispiel #17
0
        /// <summary>
        /// Prepares to categorize games. Prepares a list of genre categories to remove. Does nothing if removeothergenres is false.
        /// </summary>
        public override void PreProcess( GameList games, GameDB db )
        {
            base.PreProcess( games, db );
            if( removeOtherGenres ) {
                SortedSet<string> catStrings = new SortedSet<string>();
                char[] sep = new char[] { ',' };
                foreach( GameDBEntry dbEntry in db.Games.Values ) {
                    if( !String.IsNullOrEmpty( dbEntry.Genre ) ) {
                        string[] cats = dbEntry.Genre.Split( sep );
                        foreach( string cStr in cats ) {
                            catStrings.Add( cStr.Trim() );
                        }
                    }
                }

                genreCategories = new SortedSet<Category>();
                foreach( string cStr in catStrings ) {
                    if( games.CategoryExists( cStr ) ) {
                        genreCategories.Add( games.GetCategory( cStr ) );
                    }
                }
            }
        }
        /// <summary>
        /// Prepares to categorize games. Prepares a list of genre categories to remove. Does nothing if removeothergenres is false.
        /// </summary>
        public override void PreProcess( GameList games, GameDB db ) {
            base.PreProcess( games, db );
            if( RemoveOtherGenres ) {

                SortedSet<string> genreStrings = db.GetAllGenres();
                genreCategories = new SortedSet<Category>();

                foreach( string cStr in genreStrings ) {
                    if( games.CategoryExists( String.IsNullOrEmpty( Prefix ) ? ( cStr ) : ( Prefix + cStr ) ) && !IgnoredGenres.Contains( cStr ) ) {
                        genreCategories.Add( games.GetCategory( cStr ) );
                    }
                }
            }
        }
Beispiel #19
0
 /// <summary>
 /// Construct a new GameInfo with no categories set.
 /// </summary>
 /// <param name="id">ID of the new game. Positive means it's the game's Steam ID, negative means it's a non-steam game.</param>
 /// <param name="name">Game title</param>
 public GameInfo( int id, string name, GameList list, string executable = null )
 {
     Id = id;
     Name = name;
     Hidden = false;
     Categories = new SortedSet<Category>();
     this.GameList = list;
     Executable = executable;
 }
Beispiel #20
0
 public DBEditDlg( GameList owned = null ) {
     InitializeComponent();
     ownedList = owned;
 }
Beispiel #21
0
 /// <summary>
 /// Must be called before any categorizations are done. Should be overridden to perform any necessary database analysis or other preparation.
 /// After this is called, no configuration options should be changed before using CategorizeGame.
 /// </summary>
 public virtual void PreProcess( GameList games, GameDB db ) {
     this.games = games;
     this.db = db;
 }
 /// <summary>
 /// Prepares to categorize games. Prepares a list of genre categories to remove. Does nothing if removeothergenres is false.
 /// </summary>
 public override void PreProcess(GameList games, GameDB db)
 {
     base.PreProcess(games, db);
     gamelist = games;
 }