Esempio n. 1
0
        private void SettingsForm_Load(object sender, EventArgs e)
        {
            checkUpdatesCB.Checked = Program.MainConfig.CheckForUpdates;

            // Load panels into an array
            Control.ControlCollection arrayPanelCollection = arrayPanel.Controls;
            panelList = new List <Panel>();
            //panelArray.OrderByDescending(x => x.Name);
            panelList.AddRange(arrayPanelCollection.OfType <Panel>());
            panelList.Sort((x, y) => string.Compare(x.Name, y.Name));
            for (int i = 0; i < panelList.Count; i++)
            {
                string path = GetPathByGame(SupportedDatabase.SupportedGames[i]);

                Game game = SupportedDatabase.SupportedGames[i];
                SettingsGameIconControl sgic = new SettingsGameIconControl(game, path, game.Icon);
                sgic.MainPB.MouseEnter += GameIcon_MouseEnter;
                panelList[i].Controls.Add(sgic);
            }

            // TODO: Minimize it to one function that takes care of all the paths and icons.

            /*ApplyGameIconRendererGrayscaleByPathValidation(Program.MainConfig.HP2DirPath, hp2PB);
             * ApplyGameIconRendererGrayscaleByPathValidation(Program.MainConfig.UGDirPath, ugPB);
             * ApplyGameIconRendererGrayscaleByPathValidation(Program.MainConfig.UG2DirPath, ug2PB);
             * ApplyGameIconRendererGrayscaleByPathValidation(Program.MainConfig.MWDirPath, mwPB);
             * ApplyGameIconRendererGrayscaleByPathValidation(Program.MainConfig.CarbonDirPath, carbonPB);
             * ApplyGameIconRendererGrayscaleByPathValidation(Program.MainConfig.ProStreetDirPath, psPB);
             * ApplyGameIconRendererGrayscaleByPathValidation(Program.MainConfig.UndercoverDirPath, ucPB);
             * ApplyGameIconRendererGrayscaleByPathValidation(Program.MainConfig.WorldDirPath, worldPB);*/
        }
Esempio n. 2
0
        private void GameIcon_MouseEnter(object sender, EventArgs e)
        {
            string setString = "not set.";

            Control c = (Control)sender;
            SettingsGameIconControl main = (SettingsGameIconControl)c.Parent;


            if (IsPathValid(main.DirectoryPath))
            {
                setString = main.DirectoryPath;
            }

            gameDirStatusLabel.Text = string.Format("{0} directory path is {1}", main.Game.Title, setString);
        }