private void ListInstalled_Click(object sender, EventArgs e) { MainForm.Instance.ChangeTitle("Remove Game From List", listInstalled.Image); panel_disks.Visible = false; panel_installedGames.Visible = true; panel_gameData.Visible = false; GameManager gm = GameManager.Instance; list_installedGames.Controls.Clear(); // force a collect? GC.Collect(); #if false var installedGames = gm.GetInstalledGamesOrdered(); foreach (var pair in installedGames) { List <UserGameInfo> games = pair.Value; string gameTitle = gm.MetadataManager.GetGameName(pair.Key); TitleSeparator sep = new TitleSeparator(); sep.SetTitle(gameTitle); sep.Height = 20; this.list_installedGames.Controls.Add(sep); // get all Repository Game Infos for (int i = 0; i < games.Count; i++) { GameControl con = new GameControl(); UserGameInfo game = games[i]; con.SetUserGameExe(game); con.Width = list_installedGames.Width; con.Click += Installed_Game_Click; gm.MetadataManager.GetIcon(game, (Bitmap bmp) => { con.Image = bmp; }); this.list_installedGames.Controls.Add(con); } } #endif DPI.DPIManager.ForceUpdate(); DPI.DPIManager.ForceUpdate(); }
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(); }
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(); }