Show Full OSD if in Power Control mode

This commit is contained in:
Kamil Trzciński 2022-11-20 15:42:21 +01:00
parent e376b9dcc8
commit e12c00242b
7 changed files with 45 additions and 13 deletions

View file

@ -29,6 +29,12 @@ namespace CommonHelpers
No
}
public enum PowerControlVisible : uint
{
Yes = 371313,
No
}
[StructLayout(LayoutKind.Sequential)]
public struct FanModeSetting
{
@ -41,4 +47,10 @@ namespace CommonHelpers
public OverlayMode Current, Desired;
public OverlayEnabled CurrentEnabled, DesiredEnabled;
}
[StructLayout(LayoutKind.Sequential)]
public struct PowerControlSetting
{
public PowerControlVisible Current;
}
}

View file

@ -26,6 +26,9 @@
<setting name="CycleOSDShortcut" serializeAs="String">
<value>Shift+F11</value>
</setting>
<setting name="EnableFullOnPowerControl" serializeAs="String">
<value>True</value>
</setting>
</PerformanceOverlay.Settings>
</applicationSettings>
</configuration>

View file

@ -199,7 +199,16 @@ namespace PerformanceOverlay
sensors.Update();
var osdOverlay = Overlays.GetOSD(Settings.Default.OSDModeParsed, sensors);
var osdMode = Settings.Default.OSDModeParsed;
// If Power Control is visible use temporarily full OSD
if (Settings.Default.EnableFullOnPowerControl)
{
if (SharedData<PowerControlSetting>.GetExistingValue(out var value) && value.Current == PowerControlVisible.Yes)
osdMode = OverlayMode.Full;
}
var osdOverlay = Overlays.GetOSD(osdMode, sensors);
try
{

View file

@ -64,5 +64,14 @@ namespace PerformanceOverlay {
return ((string)(this["CycleOSDShortcut"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool EnableFullOnPowerControl {
get {
return ((bool)(this["EnableFullOnPowerControl"]));
}
}
}
}

View file

@ -14,5 +14,8 @@
<Setting Name="CycleOSDShortcut" Type="System.String" Scope="Application">
<Value Profile="(Default)">Shift+F11</Value>
</Setting>
<Setting Name="EnableFullOnPowerControl" Type="System.Boolean" Scope="Application">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>

View file

@ -35,6 +35,8 @@ namespace PowerControl
DateTime? neptuneDeviceNextKey;
System.Windows.Forms.Timer neptuneTimer;
SharedData<PowerControlSetting> sharedData = SharedData<PowerControlSetting>.CreateNew();
public Controller()
{
Instance.RunOnce(TitleWithVersion, "Global\\PowerControl");
@ -294,6 +296,11 @@ namespace PowerControl
public void updateOSD()
{
sharedData.SetValue(new PowerControlSetting()
{
Current = rootMenu.Visible ? PowerControlVisible.Yes : PowerControlVisible.No
});
if (!rootMenu.Visible)
{
osdClose();

View file

@ -1,21 +1,10 @@
- Adds Power Control
- Repeat keystrokes
- Allow to control OSD and Fan from Power Control
- Improve flickering of OSD
- Add Volume Up/Down controls (disable with `EnableVolumeControl` in `PowerControl.dll.config`)
- Add `0` brightness
- Support any battery model
- Add battery remaining
- Add FPSWithBattery overlay
- Add FPS Limit using RTSS
- Fix ryzenadj creating console window
- Swap icons of PerformanceOverlay and PowerControl
- Improve FanControl UI
- Make increments for Brightness and Volume in 5 (fixed)
- Press `3 dots + L4 + R4 + L5 + R5` to reset (TDP, Refresh Rate, FPS limit) to default
- Allow to disable SMT (second threads of each physical cores)
- Fix PowerControl crash on startup (introduced with SMT)
- Allow to change resolution (Experimental feature)
- PowerControl options are in cycle
- Show Full OSD if in PowerControl mode
If you found it useful buy me [Ko-fi](https://ko-fi.com/ayufan).