From 81f9be61e603f794d7af855f576cfcd420f15522 Mon Sep 17 00:00:00 2001 From: pointfeev Date: Mon, 7 Mar 2022 17:21:40 -0500 Subject: [PATCH] more shenanigans --- CreamInstaller/SelectForm.cs | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/CreamInstaller/SelectForm.cs b/CreamInstaller/SelectForm.cs index 8e91f33..1576751 100644 --- a/CreamInstaller/SelectForm.cs +++ b/CreamInstaller/SelectForm.cs @@ -654,8 +654,6 @@ internal partial class SelectForm : CustomForm selectionTreeView.NodeMouseClick += (sender, e) => { int cmi = ++contextMenuIndex; - do { Thread.Sleep(0); } while (!Program.Canceled && nodeContextMenu.Visible); - if (cmi != contextMenuIndex || Program.Canceled) return; TreeNode node = null; try { @@ -818,20 +816,23 @@ internal partial class SelectForm : CustomForm AddToContextMenu(cmi, new ContextMenuItem("Open SteamDB", "SteamDB", new EventHandler((sender, e) => Diagnostics.OpenUrlInInternetBrowser("https://steamdb.info/app/" + id)))); } - if (selection is not null && selection.IsSteam) + if (selection is not null) { - AddToContextMenu(cmi, new ContextMenuItem("Open Steam Store", "Steam Store", - new EventHandler((sender, e) => Diagnostics.OpenUrlInInternetBrowser(selection.ProductUrl)))); - AddToContextMenu(cmi, new ContextMenuItem("Open Steam Community", (id, selection.SubIconUrl, true), "Steam Community", - new EventHandler((sender, e) => Diagnostics.OpenUrlInInternetBrowser("https://steamcommunity.com/app/" + id)))); - } - else - { - AddToContextMenu(cmi, new ToolStripSeparator()); - AddToContextMenu(cmi, new ContextMenuItem("Open ScreamDB", "ScreamDB", - new EventHandler((sender, e) => Diagnostics.OpenUrlInInternetBrowser("https://scream-db.web.app/offers/" + id)))); - AddToContextMenu(cmi, new ContextMenuItem("Open Epic Games Store", "Epic Games", - new EventHandler((sender, e) => Diagnostics.OpenUrlInInternetBrowser(selection.ProductUrl)))); + if (selection.IsSteam) + { + AddToContextMenu(cmi, new ContextMenuItem("Open Steam Store", "Steam Store", + new EventHandler((sender, e) => Diagnostics.OpenUrlInInternetBrowser(selection.ProductUrl)))); + AddToContextMenu(cmi, new ContextMenuItem("Open Steam Community", (id, selection.SubIconUrl, true), "Steam Community", + new EventHandler((sender, e) => Diagnostics.OpenUrlInInternetBrowser("https://steamcommunity.com/app/" + id)))); + } + else + { + AddToContextMenu(cmi, new ToolStripSeparator()); + AddToContextMenu(cmi, new ContextMenuItem("Open ScreamDB", "ScreamDB", + new EventHandler((sender, e) => Diagnostics.OpenUrlInInternetBrowser("https://scream-db.web.app/offers/" + id)))); + AddToContextMenu(cmi, new ContextMenuItem("Open Epic Games Store", "Epic Games", + new EventHandler((sender, e) => Diagnostics.OpenUrlInInternetBrowser(selection.ProductUrl)))); + } } } if (cmi != contextMenuIndex) return;