Add settings to export/show record properties

For legality analysis exports to clipboard, and hovering slots in encounter db, can show all properties if desired. Was previously a debug mode only thing, but why not.
This commit is contained in:
Kurt
2024-09-23 00:47:43 -05:00
parent 6317b7f552
commit 1c7bc9d455
3 changed files with 11 additions and 7 deletions

View File

@@ -58,7 +58,7 @@ public void Show(Control pb, IEncounterInfo enc)
}
if (Settings.HoverSlotShowText)
ShowSet.SetToolTip(pb, GetPreviewText(enc));
ShowSet.SetToolTip(pb, GetPreviewText(enc, Settings.HoverSlotShowEncounterVerbose));
if (Settings.HoverSlotPlayCry)
Cry.PlayCry(enc, enc.Context);
}
@@ -90,9 +90,9 @@ public static string GetPreviewText(PKM pk, LegalityAnalysis la)
return string.Join(Environment.NewLine, result);
}
private static string GetPreviewText(IEncounterInfo enc)
private static string GetPreviewText(IEncounterInfo enc, bool verbose = false)
{
var lines = enc.GetTextLines(GameInfo.Strings);
var lines = enc.GetTextLines(GameInfo.Strings, verbose);
return string.Join(Environment.NewLine, lines);
}
}

View File

@@ -1126,10 +1126,8 @@ private static void DisplayLegalityReport(LegalityAnalysis la)
var dr = WinFormsUtil.Prompt(MessageBoxButtons.YesNo, report, MsgClipboardLegalityExport);
if (dr != DialogResult.Yes)
return;
#if DEBUG
var enc = la.EncounterOriginal.GetTextLines();
var enc = la.EncounterOriginal.GetTextLines(Settings.Display.ExportLegalityVerboseProperties);
report += Environment.NewLine + Environment.NewLine + string.Join(Environment.NewLine, enc);
#endif
WinFormsUtil.SetClipboardText(report);
}
else if (Settings.Display.IgnoreLegalPopup && la.Valid)

View File

@@ -324,9 +324,12 @@ public sealed class HoverSettings
[LocalizedDescription("Show PKM Slot Preview on Hover")]
public bool HoverSlotShowPreview { get; set; } = true;
[LocalizedDescription("Show Encounter Info in on Hover")]
[LocalizedDescription("Show Encounter Info on Hover")]
public bool HoverSlotShowEncounter { get; set; } = true;
[LocalizedDescription("Show all Encounter Info properties on Hover")]
public bool HoverSlotShowEncounterVerbose { get; set; }
[LocalizedDescription("Show PKM Slot ToolTip on Hover")]
public bool HoverSlotShowText { get; set; } = true;
@@ -382,6 +385,9 @@ public sealed class DisplaySettings
[LocalizedDescription("Don't show the Legality popup if Legal!")]
public bool IgnoreLegalPopup { get; set; }
[LocalizedDescription("Display all properties of the encounter (auto-generated) when exporting a verbose report.")]
public bool ExportLegalityVerboseProperties { get; set; }
[LocalizedDescription("Flag Illegal Slots in Save File")]
public bool FlagIllegal { get; set; } = true;