Add settings to bypass hotkey requirement

Legality context menu requires holding control when opening the menu -- with this option enabled, don't need to do the hotkey.
This commit is contained in:
Kurt 2025-01-11 17:36:03 -06:00
parent c17774f57c
commit 9f60ff9eb7
3 changed files with 16 additions and 2 deletions

View File

@ -123,7 +123,7 @@ private void MenuOpening(object sender, CancelEventArgs e)
bool canView = !info.IsEmpty() || Main.HaX;
bool canSet = info.CanWriteTo();
bool canDelete = canSet && canView;
bool canLegality = ModifierKeys == Keys.Control && canView && RequestEditorLegality != null;
bool canLegality = (ModifierKeys == Keys.Control || Main.Settings.Display.SlotLegalityAlwaysVisible) && canView && RequestEditorLegality != null;
ToggleItem(mnuView, canView);
ToggleItem(mnuSet, canSet);

View File

@ -1132,10 +1132,15 @@ private void ClickLegality(object sender, EventArgs e)
private static void DisplayLegalityReport(LegalityAnalysis la)
{
bool verbose = ModifierKeys == Keys.Control;
bool verbose = ModifierKeys == Keys.Control ^ Settings.Display.ExportLegalityAlwaysVerbose;
var report = la.Report(verbose);
if (verbose)
{
if (Settings.Display.ExportLegalityNeverClipboard)
{
WinFormsUtil.Alert(report);
return;
}
var dr = WinFormsUtil.Prompt(MessageBoxButtons.YesNo, report, MsgClipboardLegalityExport);
if (dr != DialogResult.Yes)
return;

View File

@ -385,6 +385,12 @@ public sealed class DisplaySettings
[LocalizedDescription("Display all properties of the encounter (auto-generated) when exporting a verbose report.")]
public bool ExportLegalityVerboseProperties { get; set; }
[LocalizedDescription("Always displays the verbose legality report, and inverts the hotkey behavior to instead disable.")]
public bool ExportLegalityAlwaysVerbose { get; set; }
[LocalizedDescription("Always skips the prompt option asking if you would like to export a legality report to clipboard.")]
public bool ExportLegalityNeverClipboard { get; set; }
[LocalizedDescription("Flag Illegal Slots in Save File")]
public bool FlagIllegal { get; set; } = true;
@ -393,6 +399,9 @@ public sealed class DisplaySettings
[LocalizedDescription("Disables the GUI scaling based on Dpi on program startup, falling back to font scaling.")]
public bool DisableScalingDpi { get; set; }
[LocalizedDescription("Skips the context menu hotkey requirement and instead always presents the option to check legality of a slot.")]
public bool SlotLegalityAlwaysVisible { get; set; }
}
public sealed class SpriteSettings : ISpriteSettings