mirror of
https://github.com/ayufan/steam-deck-tools.git
synced 2026-04-05 14:25:40 +00:00
PowerControl: Retain FPS Limit (proportion) on refresh rate change
This commit is contained in:
parent
bc9c3199b7
commit
5cd873b9a3
6 changed files with 58 additions and 24 deletions
|
|
@ -16,6 +16,7 @@ namespace PowerControl.Menu
|
|||
public Func<string?>? CurrentValue { get; set; }
|
||||
public Func<string[]?>? OptionsValues { get; set; }
|
||||
public Func<string, string?>? ApplyValue { get; set; }
|
||||
public Action<MenuItemWithOptions, string?, string>? ImpactedBy { get; set; }
|
||||
public Action? AfterApply { get; set; }
|
||||
public Func<string?>? ResetValue { get; set; }
|
||||
|
||||
|
|
@ -114,9 +115,6 @@ namespace PowerControl.Menu
|
|||
CommonHelpers.Log.TraceException("FinalizeSet", Name, e);
|
||||
Update();
|
||||
}
|
||||
|
||||
if (AfterApply != null && runAfterApply)
|
||||
AfterApply();
|
||||
}
|
||||
else
|
||||
ActiveOption = SelectedOption;
|
||||
|
|
@ -124,7 +122,19 @@ namespace PowerControl.Menu
|
|||
SelectedOption = null;
|
||||
|
||||
if (wasOption != ActiveOption && ActiveOption != null)
|
||||
{
|
||||
if (AfterApply != null)
|
||||
AfterApply();
|
||||
|
||||
foreach (var impact in Impacts)
|
||||
{
|
||||
if (impact.ImpactedBy is not null)
|
||||
impact.ImpactedBy(this, wasOption, ActiveOption);
|
||||
impact.Update();
|
||||
}
|
||||
|
||||
ValueChanged(this, wasOption, ActiveOption);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CreateMenu(System.Windows.Forms.ContextMenuStrip contextMenu)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue