DS - change to incrmeent/decrement view hotkeys instead of just one that increments
This commit is contained in:
parent
a58e7a17a6
commit
7c2802b4c3
|
@ -257,7 +257,8 @@ namespace BizHawk.Client.Common
|
|||
|
||||
Bind("Tools", "Toggle All Cheats"),
|
||||
|
||||
Bind("DS", "Toggle View")
|
||||
Bind("DS", "Increment View"),
|
||||
Bind("DS", "Decrement View"),
|
||||
};
|
||||
|
||||
// set ordinals based on order in list
|
||||
|
|
|
@ -756,28 +756,42 @@ namespace BizHawk.Client.EmuHawk
|
|||
break;
|
||||
|
||||
// DS
|
||||
case "Toggle View":
|
||||
if (Emulator is MelonDS ds)
|
||||
{
|
||||
var settings = ds.GetSettings();
|
||||
var num = (int)settings.ScreenOptions;
|
||||
num++;
|
||||
var next = (MelonDS.VideoScreenOptions)Enum.Parse(typeof(MelonDS.VideoScreenOptions), num.ToString());
|
||||
if (!typeof(MelonDS.VideoScreenOptions).IsEnumDefined(next))
|
||||
{
|
||||
next = default;
|
||||
}
|
||||
|
||||
settings.ScreenOptions = next;
|
||||
ds.PutSettings(settings);
|
||||
}
|
||||
|
||||
case "Increment View":
|
||||
ToggleDSView();
|
||||
break;
|
||||
case "Decrement View":
|
||||
ToggleDSView(true);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void ToggleDSView(bool decrement = false)
|
||||
{
|
||||
if (Emulator is MelonDS ds)
|
||||
{
|
||||
var settings = ds.GetSettings();
|
||||
var num = (int)settings.ScreenOptions;
|
||||
if (decrement)
|
||||
{
|
||||
num--;
|
||||
}
|
||||
else
|
||||
{
|
||||
num++;
|
||||
}
|
||||
var next = (MelonDS.VideoScreenOptions)Enum.Parse(typeof(MelonDS.VideoScreenOptions), num.ToString());
|
||||
if (!typeof(MelonDS.VideoScreenOptions).IsEnumDefined(next))
|
||||
{
|
||||
next = default;
|
||||
}
|
||||
|
||||
settings.ScreenOptions = next;
|
||||
ds.PutSettings(settings);
|
||||
}
|
||||
}
|
||||
|
||||
// Determines if the value is a hotkey that would be handled outside of the CheckHotkey method
|
||||
private bool IsInternalHotkey(string trigger)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue