From d19bcff30a403e1d6e46ab18b43b8059935e2e8c Mon Sep 17 00:00:00 2001 From: Victor Date: Sat, 4 May 2024 11:35:25 +0400 Subject: [PATCH] UI: Move Trace Logger tooltip strings to resources --- .../ViewModels/TraceLoggerViewModel.cs | 39 ++++++++++--------- UI/Localization/resources.en.xml | 23 +++++++++++ 2 files changed, 43 insertions(+), 19 deletions(-) diff --git a/UI/Debugger/ViewModels/TraceLoggerViewModel.cs b/UI/Debugger/ViewModels/TraceLoggerViewModel.cs index 6ba46890d..26e9872e5 100644 --- a/UI/Debugger/ViewModels/TraceLoggerViewModel.cs +++ b/UI/Debugger/ViewModels/TraceLoggerViewModel.cs @@ -616,30 +616,31 @@ private Control GetFormatTooltip() void addRow(string text) { panel.Children.Add(new TextBlock() { Text = text }); } void addBoldRow(string text) { panel.Children.Add(new TextBlock() { Text = text, FontWeight = Avalonia.Media.FontWeight.Bold }); } + string getResourceString(string id) { return ResourceHelper.GetViewLabel(nameof(TraceLoggerWindow), "tipFormat" + id); } - addBoldRow("Notes"); - addRow("You can customize the output by enabling the 'Use custom format' option and manually editing the format."); + addBoldRow(getResourceString("NotesLine")); + addRow(getResourceString("CustomFormatDescLine")); addRow(" "); - addRow("Tags can have their display format configured by using a comma and specifying the format options. e.g:"); - addRow(" [Scanline,3] - display scanline in decimal, pad to always be 3 characters wide"); - addRow(" [Scanline,h] - display scanline in hexadecimal"); - addRow(" [Scanline,3h] - display scanline in decimal, pad to always be 3 characters wide"); + addRow(getResourceString("TagDisplayFormatDescLine")); + addRow(" [Scanline,3] - " + getResourceString("TagDisplayDecimalPaddedDesc")); + addRow(" [Scanline,h] - " + getResourceString("TagDisplayHexadecimalDesc")); + addRow(" [Scanline,3h] - " + getResourceString("TagDisplayHexadecimalPaddedDesc")); addRow(" "); - addBoldRow("Common tags (all CPUs)"); - addRow(" [ByteCode] - byte code for the instruction (1 to 3 bytes)"); - addRow(" [Disassembly] - disassembly for the current instruction"); - addRow(" [EffectiveAddress] - effective address used for indirect addressing modes"); - addRow(" [MemoryValue] - value stored at the memory location referred to by the instruction"); - addRow(" [PC] - program counter"); - addRow(" [Cycle] - current horizontal cycle (H)"); - addRow(" [HClock] - current horizontal cycle (H, in master clocks)"); - addRow(" [Scanline] - current scanline (V)"); - addRow(" [FrameCount] - current frame number"); - addRow(" [CycleCount] - current CPU cycle (64-bit unsigned value)"); - addRow(" [Align,X] - add spaces to ensure the line is X characters long"); + addBoldRow(getResourceString("CommonTagsDescLine")); + addRow(" [ByteCode] - " + getResourceString("ByteCodeTagDesc")); + addRow(" [Disassembly] - " + getResourceString("DisassemblyTagDesc")); + addRow(" [EffectiveAddress] - " + getResourceString("EffectiveAddressTagDesc")); + addRow(" [MemoryValue] - " + getResourceString("MemoryValueTagDesc")); + addRow(" [PC] - " + getResourceString("PCTagDesc")); + addRow(" [Cycle] - " + getResourceString("CycleTagDesc")); + addRow(" [HClock] - " + getResourceString("HClockTagDesc")); + addRow(" [Scanline] - " + getResourceString("ScanlineTagDesc")); + addRow(" [FrameCount] - " + getResourceString("FrameCountTagDesc")); + addRow(" [CycleCount] - " + getResourceString("CycleCountTagDesc")); + addRow(" [Align,X] - " + getResourceString("AlignXTagDesc")); addRow(" "); - addBoldRow("CPU-specific tags (" + ResourceHelper.GetEnumText(CpuType) + ")"); + addBoldRow(getResourceString("CpuSpecificTagsDesc") + " (" + ResourceHelper.GetEnumText(CpuType) + ")"); string[] tokens = CpuType switch { CpuType.Snes or CpuType.Sa1 => new string[] { "A", "X", "Y", "D", "DB", "P", "SP" }, diff --git a/UI/Localization/resources.en.xml b/UI/Localization/resources.en.xml index b51f233bb..662de24c7 100644 --- a/UI/Localization/resources.en.xml +++ b/UI/Localization/resources.en.xml @@ -1121,6 +1121,29 @@ Log to file... Stop logging Clear log + + Notes + You can customize the output by enabling the 'Use custom format' option and manually editing the format. + + Tags can have their display format configured by using a comma and specifying the format options. e.g: + display scanline in decimal, pad to always be 3 characters wide + display scanline in hexadecimal + display scanline in hexadecimal, pad to always be 3 characters wide + + Common tags (all CPUs) + byte code for the instruction (1 to 3 bytes) + disassembly for the current instruction + effective address used for indirect addressing modes + value stored at the memory location referred to by the instruction + program counter + current horizontal cycle (H) + current horizontal cycle (H, in master clocks) + current scanline (V) + current frame number + current CPU cycle (64-bit unsigned value) + add spaces to ensure the line is X characters long + + CPU-specific tags