mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-03-06 21:13:55 +01:00
CommonHelpers: Show Missing RTSS button
This commit is contained in:
parent
5cd873b9a3
commit
d0c45a1474
|
|
@ -86,11 +86,7 @@ namespace CommonHelpers
|
|||
if (footnote is not null)
|
||||
page.Footnote.Text += "\n" + footnote;
|
||||
|
||||
page.HelpRequest += delegate
|
||||
{
|
||||
try { System.Diagnostics.Process.Start("explorer.exe", HelpURL); }
|
||||
catch { }
|
||||
};
|
||||
page.HelpRequest += delegate { Dependencies.OpenLink(HelpURL); };
|
||||
|
||||
var result = TaskDialog.ShowDialog(new Form { TopMost = true }, page, TaskDialogStartupLocation.CenterScreen);
|
||||
if (result != continueButton)
|
||||
|
|
|
|||
|
|
@ -25,8 +25,9 @@ namespace CommonHelpers
|
|||
"RTSSHooks64.dll"
|
||||
};
|
||||
|
||||
private static string VCRuntimeURL = "https://aka.ms/vs/17/release/vc_redist.x64.exe";
|
||||
private static string RTSSURL = "https://www.guru3d.com/files-details/rtss-rivatuner-statistics-server-download.html";
|
||||
public static string SDTURL = "https://steam-deck-tools.ayufan.dev";
|
||||
public static string VCRuntimeURL = "https://aka.ms/vs/17/release/vc_redist.x64.exe";
|
||||
public static string RTSSURL = "https://www.guru3d.com/files-details/rtss-rivatuner-statistics-server-download.html";
|
||||
|
||||
public static void ValidateHidapi(string title)
|
||||
{
|
||||
|
|
@ -107,7 +108,7 @@ namespace CommonHelpers
|
|||
);
|
||||
|
||||
if (result == downloadButton)
|
||||
ExecuteLink(url);
|
||||
OpenLink(url);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -136,7 +137,7 @@ namespace CommonHelpers
|
|||
|
||||
if (result == downloadButton)
|
||||
{
|
||||
ExecuteLink(url);
|
||||
OpenLink(url);
|
||||
Environment.Exit(1);
|
||||
}
|
||||
else if (result == exitButton)
|
||||
|
|
@ -189,7 +190,7 @@ namespace CommonHelpers
|
|||
|
||||
page.HelpRequest += delegate
|
||||
{
|
||||
try { ExecuteLink(url); }
|
||||
try { OpenLink(url); }
|
||||
catch { }
|
||||
};
|
||||
}
|
||||
|
|
@ -197,7 +198,7 @@ namespace CommonHelpers
|
|||
return TaskDialog.ShowDialog(new Form { TopMost = true }, page, TaskDialogStartupLocation.CenterScreen);
|
||||
}
|
||||
|
||||
private static void ExecuteLink(string link)
|
||||
public static void OpenLink(string link)
|
||||
{
|
||||
try { Process.Start("explorer.exe", link); }
|
||||
catch { }
|
||||
|
|
|
|||
|
|
@ -27,6 +27,15 @@ namespace CommonHelpers
|
|||
return Applications.Instance.FindForeground(out processId, out processName);
|
||||
}
|
||||
|
||||
public static bool IsLoaded
|
||||
{
|
||||
get
|
||||
{
|
||||
Applications.Instance.Refresh();
|
||||
return Applications.Instance.IsLoaded;
|
||||
}
|
||||
}
|
||||
|
||||
public class Applications
|
||||
{
|
||||
public readonly static Applications Instance = new Applications();
|
||||
|
|
@ -45,6 +54,7 @@ namespace CommonHelpers
|
|||
}
|
||||
|
||||
public IDictionary<int, Entry> IDs { get; private set; } = new Dictionary<int, Entry>();
|
||||
public bool IsLoaded { get; private set; }
|
||||
|
||||
private const int FrameTimeoutMs = 5000;
|
||||
|
||||
|
|
@ -60,8 +70,16 @@ namespace CommonHelpers
|
|||
var oldIDs = IDs;
|
||||
var newIDs = new Dictionary<int, Entry>();
|
||||
|
||||
try { appEntries = OSD.GetAppEntries(AppFlags.MASK); }
|
||||
catch { return; }
|
||||
try
|
||||
{
|
||||
appEntries = OSD.GetAppEntries(AppFlags.MASK);
|
||||
IsLoaded = true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
IsLoaded = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ namespace FanControl
|
|||
|
||||
private void help_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("explorer.exe", "https://steam-deck-tools.ayufan.dev");
|
||||
Dependencies.OpenLink(Dependencies.SDTURL);
|
||||
}
|
||||
|
||||
private void toolStripMenuItemAlwaysOnTop_Click(object sender, EventArgs e)
|
||||
|
|
|
|||
|
|
@ -45,6 +45,10 @@ namespace PerformanceOverlay
|
|||
if (Instance.WantsRunOnStartup)
|
||||
startupManager.Startup = true;
|
||||
|
||||
var notRunningRTSSItem = contextMenu.Items.Add("&RTSS is not running");
|
||||
notRunningRTSSItem.Enabled = false;
|
||||
contextMenu.Opening += delegate { notRunningRTSSItem.Visible = Dependencies.EnsureRTSS(null) && !OSDHelpers.IsLoaded; };
|
||||
|
||||
showItem = new ToolStripMenuItem("&Show OSD");
|
||||
showItem.Click += ShowItem_Click;
|
||||
showItem.Checked = Settings.Default.ShowOSD;
|
||||
|
|
@ -84,11 +88,15 @@ namespace PerformanceOverlay
|
|||
contextMenu.Items.Add(startupItem);
|
||||
}
|
||||
|
||||
var missingRTSSItem = contextMenu.Items.Add("&Install missing RTSS");
|
||||
missingRTSSItem.Click += delegate { Dependencies.OpenLink(Dependencies.RTSSURL); };
|
||||
contextMenu.Opening += delegate { missingRTSSItem.Visible = !Dependencies.EnsureRTSS(null); };
|
||||
|
||||
var checkForUpdatesItem = contextMenu.Items.Add("&Check for Updates");
|
||||
checkForUpdatesItem.Click += delegate { Instance.RunUpdater(TitleWithVersion, true); };
|
||||
|
||||
var helpItem = contextMenu.Items.Add("&Help");
|
||||
helpItem.Click += delegate { System.Diagnostics.Process.Start("explorer.exe", "https://steam-deck-tools.ayufan.dev"); };
|
||||
helpItem.Click += delegate { Dependencies.OpenLink(Dependencies.SDTURL); };
|
||||
|
||||
contextMenu.Items.Add(new ToolStripSeparator());
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,10 @@ namespace PowerControl
|
|||
|
||||
var contextMenu = new System.Windows.Forms.ContextMenuStrip(components);
|
||||
|
||||
var notRunningRTSSItem = contextMenu.Items.Add("&RTSS is not running");
|
||||
notRunningRTSSItem.Enabled = false;
|
||||
contextMenu.Opening += delegate { notRunningRTSSItem.Visible = Dependencies.EnsureRTSS(null) && !OSDHelpers.IsLoaded; };
|
||||
|
||||
rootMenu.Init();
|
||||
rootMenu.Visible = false;
|
||||
rootMenu.Update();
|
||||
|
|
@ -77,11 +81,15 @@ namespace PowerControl
|
|||
contextMenu.Items.Add(startupItem);
|
||||
}
|
||||
|
||||
var missingRTSSItem = contextMenu.Items.Add("&Install missing RTSS");
|
||||
missingRTSSItem.Click += delegate { Dependencies.OpenLink(Dependencies.RTSSURL); };
|
||||
contextMenu.Opening += delegate { missingRTSSItem.Visible = !Dependencies.EnsureRTSS(null); };
|
||||
|
||||
var checkForUpdatesItem = contextMenu.Items.Add("&Check for Updates");
|
||||
checkForUpdatesItem.Click += delegate { Instance.RunUpdater(TitleWithVersion, true); };
|
||||
|
||||
var helpItem = contextMenu.Items.Add("&Help");
|
||||
helpItem.Click += delegate { System.Diagnostics.Process.Start("explorer.exe", "https://steam-deck-tools.ayufan.dev"); };
|
||||
helpItem.Click += delegate { Dependencies.OpenLink(Dependencies.SDTURL); };
|
||||
contextMenu.Items.Add(new ToolStripSeparator());
|
||||
|
||||
var exitItem = contextMenu.Items.Add("&Exit");
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
## 0.6.x
|
||||
|
||||
- All: Show `Missing RTSS` button to install RTSS
|
||||
- PowerControl: Retain FPS Limit (proportion) on refresh rate change
|
||||
- PowerControl: Support RTSS in custom folder
|
||||
- SteamController: Fix Steam Big Picture detection for non-english
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace SteamController
|
|||
settingsItem.Click += Settings_Click;
|
||||
|
||||
var shortcutsItem = contextMenu.Items.Add("&Shortcuts");
|
||||
shortcutsItem.Click += delegate { Process.Start("explorer.exe", "https://steam-deck-tools.ayufan.dev/shortcuts.html"); };
|
||||
shortcutsItem.Click += delegate { Dependencies.OpenLink(Dependencies.SDTURL + "/shortcuts.html"); };
|
||||
|
||||
contextMenu.Items.Add(new ToolStripSeparator());
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ namespace SteamController
|
|||
checkForUpdatesItem.Click += delegate { Instance.RunUpdater(TitleWithVersion, true); };
|
||||
|
||||
var helpItem = contextMenu.Items.Add("&Help");
|
||||
helpItem.Click += delegate { Process.Start("explorer.exe", "https://steam-deck-tools.ayufan.dev"); };
|
||||
helpItem.Click += delegate { Dependencies.OpenLink(Dependencies.SDTURL); };
|
||||
|
||||
contextMenu.Items.Add(new ToolStripSeparator());
|
||||
|
||||
|
|
@ -338,11 +338,7 @@ namespace SteamController
|
|||
page.Footnote.Text += "Close Steam before confirming as otherwise Steam will be forcefully closed.";
|
||||
page.Footnote.Icon = TaskDialogIcon.Warning;
|
||||
|
||||
page.HelpRequest += delegate
|
||||
{
|
||||
try { System.Diagnostics.Process.Start("explorer.exe", "https://steam-deck-tools.ayufan.dev/steam-controller"); }
|
||||
catch { }
|
||||
};
|
||||
page.HelpRequest += delegate { Dependencies.OpenLink(Dependencies.SDTURL + "/steam-controller"); };
|
||||
|
||||
var result = TaskDialog.ShowDialog(new Form { TopMost = true }, page, TaskDialogStartupLocation.CenterScreen);
|
||||
if (result != continueButton)
|
||||
|
|
@ -414,7 +410,7 @@ namespace SteamController
|
|||
Dock = DockStyle.Top,
|
||||
Font = new Font("Segoe UI", 9F, FontStyle.Bold | FontStyle.Underline),
|
||||
ForeColor = SystemColors.HotTrack,
|
||||
Text = "https://steam-deck-tools.ayufan.dev",
|
||||
Text = Dependencies.SDTURL,
|
||||
TextAlign = ContentAlignment.MiddleCenter
|
||||
};
|
||||
|
||||
|
|
@ -432,8 +428,8 @@ namespace SteamController
|
|||
Height = 100
|
||||
};
|
||||
|
||||
helpLabel.Click += delegate { Process.Start("explorer.exe", "https://steam-deck-tools.ayufan.dev"); };
|
||||
donateLabel.Click += delegate { Process.Start("explorer.exe", "https://steam-deck-tools.ayufan.dev/#help-this-project"); };
|
||||
helpLabel.Click += delegate { Dependencies.OpenLink(Dependencies.SDTURL); };
|
||||
donateLabel.Click += delegate { Dependencies.OpenLink(Dependencies.SDTURL + "/#help-this-project"); };
|
||||
propertyGrid.ExpandAllGridItems();
|
||||
|
||||
form.Controls.Add(propertyGrid);
|
||||
|
|
|
|||
Loading…
Reference in a new issue