public SelectGameFolderPageControl()
        {
            InitializeComponent();

            Title = "Select exe to launch";
            Image = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "🔍");
        }
Пример #2
0
        public NoGamesInstalledPageControl()
        {
            InitializeComponent();

            this.Title = "No games installed";
            this.Image = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "🗋");
        }
Пример #3
0
        public void ChangeSelectedGame(UserGameInfo userGame)
        {
            this.userGame = userGame;

            panel_steps.Controls.Clear();

#if false
            string gameId = userGame.GameID;

            if (mainForm == null)
            {
                mainForm = MainForm.Instance;
                mainForm.BrowserBtns.OnBrowse += BrowserBtns_OnBrowse;
            }

            currentHandlers = GameManager.Instance.PackageManager.GetInstalledHandlers(gameId);
            if (currentHandlers.Length == 0)
            {
                // uninstalled package perhaps?
                return;
            }

            if (currentHandlers.Length > 1)
            {
                MainForm.Instance.ChangeTitle("Choose one handler to run game",
                                              FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "⤷"));

                panel_steps.Controls.Add(list_handlers);

                list_handlers.Width  = panel_steps.Width;
                list_handlers.Height = panel_steps.Height;
                list_handlers.Left   = 1;
                list_handlers.Controls.Clear();

                //TODO fix
                //for (var i = 0; i < currentHandlers.Length; i++) {
                //    GameHandlerMetadata metadata = currentHandlers[i];

                //    GameControl handlerControl = new GameControl();
                //    handlerControl.Width = list_handlers.Width;
                //    handlerControl.Click += HandlerControl_Click;

                //    handlerControl.SetHandlerMetadata(metadata);
                //    list_handlers.Controls.Add(handlerControl);
                //}
            }
            else
            {
                // create first step
                SetupSteps(currentHandlers[0]);
                GoToStep(0);
            }
#endif

            DPIManager.ForceUpdate();
        }
Пример #4
0
        public HandlerManagerControl()
        {
            InitializeComponent();

            titleBarWidth = list_left.Width + 1;
            bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);

            this.Title = "Settings";
            //this.Image = Resources.nucleus;
            this.Image = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "⚙");

            if (!designMode)
            {
                LoadInstalled();
            }
        }
Пример #5
0
        public HandlerManagerControl()
        {
            InitializeComponent();

            titleBarWidth = list_left.Width + 1;
            bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);

            this.Title = "Settings";
            this.Image = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "⚙");

            list_left.HorizontalScroll.Maximum = 0;
            list_left.AutoScroll             = false;
            list_left.VerticalScroll.Visible = false;
            list_left.VerticalScrollEnabled  = false;

            panel_disks.Visible            = false;
            list_storage.CanSelectControls = false;

            if (!designMode)
            {
                LoadInstalled();
            }
        }
Пример #6
0
        private void LoadInstalled()
        {
            var gm = GameManager.Instance;

            interrobang = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "🗋");
            list_left.Controls.Clear();

            //HorizontalLineControl line = new HorizontalLineControl();
            //list_left.Controls.Add(line);
            //line.LineHorizontalPc = 100;
            //line.Width = list_left.Width;
            //line.LineHeight = 1;
            //line.LineColor = Color.FromArgb(255, 41, 45, 47);

            TitleSeparator appSettings = new TitleSeparator();

            appSettings.SetTitle("APP SETTINGS");
            appSettings.Height = 20;
            this.list_left.Controls.Add(appSettings);

            GameControl hotkeySettings = new GameControl();

            hotkeySettings.Width = list_left.Width;
            hotkeySettings.UpdateTitleText("Hotkeys");
            hotkeySettings.Image = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "☒");
            //hotkeySettings.Click += InstallGame_Click;
            list_left.Controls.Add(hotkeySettings);

            GameControl controllerSettings = new GameControl();

            controllerSettings.Width = list_left.Width;
            controllerSettings.UpdateTitleText("Controllers");
            controllerSettings.Image = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "🎮");
            //controllerSettings.Click += InstallGame_Click;
            list_left.Controls.Add(controllerSettings);

            GameControl customPositionLayoutSettings = new GameControl();

            customPositionLayoutSettings.Width = list_left.Width;
            customPositionLayoutSettings.UpdateTitleText("Custom Position Layout");
            customPositionLayoutSettings.Image = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "📁");
            //controllerSettings.Click += InstallGame_Click;
            list_left.Controls.Add(customPositionLayoutSettings);

            GameControl miscelaneousSettings = new GameControl();

            miscelaneousSettings.Width = list_left.Width;
            miscelaneousSettings.UpdateTitleText("Miscelaneous");
            miscelaneousSettings.Image = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "⛏");
            //controllerSettings.Click += InstallGame_Click;
            list_left.Controls.Add(miscelaneousSettings);

            TitleSeparator gamesSep = new TitleSeparator();

            gamesSep.SetTitle("GAMES");
            gamesSep.Height = 20;
            this.list_left.Controls.Add(gamesSep);

            GameControl installGame = new GameControl();

            installGame.Width = list_left.Width;
            installGame.UpdateTitleText("Install game from exe");
            installGame.Image  = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "📁");
            installGame.Click += InstallGame_Click;
            list_left.Controls.Add(installGame);

            scanGames       = new GameControl();
            scanGames.Width = list_left.Width;
            scanGames.UpdateTitleText("Scan for game exes");
            scanGames.Image  = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "🔍");
            scanGames.Click += ScanGames_Click;
            list_left.Controls.Add(scanGames);

            listInstalled       = new GameControl();
            listInstalled.Width = list_left.Width;
            listInstalled.UpdateTitleText("Remove games from list");
            listInstalled.Image  = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "⌫", 0, 8);
            listInstalled.Click += ListInstalled_Click;
            list_left.Controls.Add(listInstalled);

            TitleSeparator sep = new TitleSeparator();

            sep.SetTitle("HANDLERS");
            sep.Height = 20;
            this.list_left.Controls.Add(sep);

            GameControl installFile = new GameControl();

            installFile.Width = list_left.Width;
            installFile.UpdateTitleText("Install handler from file");
            installFile.Image  = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "🔍");
            installFile.Click += InstallFile_Click;
            list_left.Controls.Add(installFile);

#if false
            var handlers = gm.User.InstalledHandlers;
            if (handlers.Count == 0)
            {
                GameControl noAvailable = new GameControl();
                noAvailable.Width = list_left.Width;
                noAvailable.UpdateTitleText("No installed game handlers");
                noAvailable.Image = interrobang;
                list_left.Controls.Add(noAvailable);
            }
            else
            {
                handlers.Sort(GameHandlerMetadata.CompareHandlerTitle);
                foreach (var handler in handlers)
                {
                    GameControl gameHandler = new GameControl();
                    gameHandler.Width = list_left.Width;
                    gameHandler.SetHandlerMetadata(handler);
                    gameHandler.Click += GameHandler_Click;
                    gameHandler.Image  = interrobang;
                    list_left.Controls.Add(gameHandler);
                }
            }
#endif

            DPI.DPIManager.ForceUpdate();
        }
Пример #7
0
        public override void Initialize(HandlerData handlerData, UserGameInfo game, GameProfile profile)
        {
            base.Initialize(handlerData, game, profile);

            this.Controls.Clear();

            int wid = 200;

            Image     = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "⚙");
            list      = new ControlListBox();
            list.Size = this.Size;

            List <GameOption>           options = handlerData.Options;
            Dictionary <string, object> vals    = profile.Options;

            for (int j = 0; j < options.Count; j++)
            {
                GameOption opt = options[j];
                if (opt.Hidden)
                {
                    continue;
                }

                object val;
                if (!vals.TryGetValue(opt.Key, out val))
                {
                    continue;
                }

                CoolListControl cool = new CoolListControl(false);
                cool.Title          = opt.Name;
                cool.Details        = opt.Description;
                cool.Width          = list.Width;
                cool.TitleFont      = nameFont;
                cool.DetailsFont    = detailsFont;
                cool.EnableClicking = false;

                list.Controls.Add(cool);

                // Check the value type and add a control for it
                if (opt.Value is Enum || opt.IsCollection())
                {
                    ComboBox box    = new ComboBox();
                    int      border = 10;

                    object value;
                    object defaultValue;
                    IList  values;
                    if (opt.Value is Enum)
                    {
                        value        = (Enum)val;
                        values       = Enum.GetValues(value.GetType());
                        defaultValue = opt.DefaultValue;
                    }
                    else
                    {
                        values       = opt.GetCollection();
                        value        = values[0];
                        defaultValue = opt.DefaultValue;
                    }

                    for (int i = 0; i < values.Count; i++)
                    {
                        box.Items.Add(values[i]);
                    }

                    if (defaultValue != null)
                    {
                        box.SelectedIndex = box.Items.IndexOf(defaultValue);
                        if (box.SelectedIndex == -1)
                        {
                            box.SelectedIndex = box.Items.IndexOf(value);
                        }
                    }
                    else
                    {
                        box.SelectedIndex = box.Items.IndexOf(value);
                    }

                    box.Width         = wid;
                    box.Height        = 40;
                    box.Left          = cool.Width - box.Width - border;
                    box.Top           = (cool.Height / 2) - (box.Height / 2);
                    box.Anchor        = AnchorStyles.Right;
                    box.DropDownStyle = ComboBoxStyle.DropDownList;
                    cool.Controls.Add(box);

                    box.Tag = opt;
                    box.SelectedValueChanged += box_SelectedValueChanged;
                    ChangeOption(box.Tag, box.SelectedItem);
                }
                else if (opt.Value is bool)
                {
                    SizeableCheckbox box = new SizeableCheckbox();
                    int border           = 10;

                    box.Checked = (bool)val;
                    box.Width   = 40;
                    box.Height  = 40;
                    box.Left    = cool.Width - box.Width - border;
                    box.Top     = (cool.Height / 2) - (box.Height / 2);
                    box.Anchor  = AnchorStyles.Right;
                    cool.Controls.Add(box);

                    box.Tag             = opt;
                    box.CheckedChanged += box_CheckedChanged;
                    ChangeOption(box.Tag, box.Checked);
                }
                else if (opt.Value is int || opt.Value is double)
                {
                    NumericUpDown num    = new NumericUpDown();
                    int           border = 10;

                    int value = int.Parse(val.ToString());
                    if (value < num.Minimum)
                    {
                        num.Minimum = value;
                    }

                    num.Value = value;

                    num.Width  = wid;
                    num.Height = 40;
                    num.Left   = cool.Width - num.Width - border;
                    num.Top    = (cool.Height / 2) - (num.Height / 2);
                    num.Anchor = AnchorStyles.Right;
                    cool.Controls.Add(num);

                    num.Tag           = opt;
                    num.ValueChanged += num_ValueChanged;
                    ChangeOption(num.Tag, num.Value);
                }
                else if (opt.Value is GameOptionValue)
                {
                    ComboBox box    = new ComboBox();
                    int      border = 10;

                    GameOptionValue value = (GameOptionValue)val;
                    PropertyInfo[]  props = value.GetType().GetProperties(BindingFlags.Public | BindingFlags.Static);

                    for (int i = 0; i < props.Length; i++)
                    {
                        PropertyInfo prop = props[i];
                        box.Items.Add(prop.GetValue(null, null));
                    }
                    box.SelectedIndex = box.Items.IndexOf(value);

                    box.Width  = wid;
                    box.Height = 40;
                    box.Left   = cool.Width - box.Width - border;
                    box.Top    = (cool.Height / 2) - (box.Height / 2);
                    box.Anchor = AnchorStyles.Right;
                    //box.DropDownStyle = ComboBoxStyle.DropDownList;
                    cool.Controls.Add(box);

                    box.Tag = opt;
                    box.SelectedValueChanged += box_SelectedValueChanged;
                    ChangeOption(box.Tag, box.SelectedItem);
                }

                UserControl bottomLine = new UserControl();
                bottomLine.Width     = cool.Width;
                bottomLine.Height    = 1;
                bottomLine.Top       = cool.Height - 1;
                bottomLine.Anchor    = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
                bottomLine.BackColor = Color.FromArgb(35, 39, 42);
                cool.Controls.Add(bottomLine);
            }

            this.Controls.Add(list);
            list.UpdateSizes();
            CanPlayUpdated(true, false);
        }
Пример #8
0
        private void LoadInstalled()
        {
            var gm       = GameManager.Instance;
            var handlers = gm.User.InstalledHandlers;

            interrobang = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "🗋");
            list_left.Controls.Clear();

            //HorizontalLineControl line = new HorizontalLineControl();
            //list_left.Controls.Add(line);
            //line.LineHorizontalPc = 100;
            //line.Width = list_left.Width;
            //line.LineHeight = 1;
            //line.LineColor = Color.FromArgb(255, 41, 45, 47);

            TitleSeparator gamesSep = new TitleSeparator();

            gamesSep.SetTitle("GAMES");
            gamesSep.Height = 20;
            this.list_left.Controls.Add(gamesSep);

            GameControl installGame = new GameControl();

            installGame.Width = list_left.Width;
            installGame.UpdateTitleText("Install game from exe");
            installGame.Image  = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "📁");
            installGame.Click += InstallGame_Click;
            list_left.Controls.Add(installGame);

            GameControl scanGames = new GameControl();

            scanGames.Width = list_left.Width;
            scanGames.UpdateTitleText("Scan for game exes");
            scanGames.Image  = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "🔍");
            scanGames.Click += ScanGames_Click;
            list_left.Controls.Add(scanGames);

            listInstalled       = new GameControl();
            listInstalled.Width = list_left.Width;
            listInstalled.UpdateTitleText("Remove games from list");
            listInstalled.Image  = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "⌫", 0, 8);
            listInstalled.Click += ListInstalled_Click;
            list_left.Controls.Add(listInstalled);

            TitleSeparator sep = new TitleSeparator();

            sep.SetTitle("HANDLERS");
            sep.Height = 20;
            this.list_left.Controls.Add(sep);

            GameControl installFile = new GameControl();

            installFile.Width = list_left.Width;
            installFile.UpdateTitleText("Install handler from file");
            //installFile.Image = Resources.nucleus;
            installFile.Image  = FormGraphicsUtil.BuildCharToBitmap(new Size(40, 40), 30, Color.FromArgb(240, 240, 240), "🔍");
            installFile.Click += InstallFile_Click;
            list_left.Controls.Add(installFile);

            if (handlers.Count == 0)
            {
                GameControl noAvailable = new GameControl();
                noAvailable.Width = list_left.Width;
                noAvailable.UpdateTitleText("No installed game handlers");
                noAvailable.Image = interrobang;
                list_left.Controls.Add(noAvailable);
            }
            else
            {
                handlers.Sort(GameHandlerMetadata.CompareHandlerTitle);
                foreach (var handler in handlers)
                {
                    GameControl gameHandler = new GameControl();
                    gameHandler.Width = list_left.Width;
                    gameHandler.SetHandlerMetadata(handler);
                    gameHandler.Click += GameHandler_Click;
                    gameHandler.Image  = interrobang;
                    list_left.Controls.Add(gameHandler);
                }
            }

            DPIManager.ForceUpdate();
        }