Self-Test Window improvements (#2298)

* Move Logout self-test to the bottom of the list

* Increase self-test result and make it scrollable

* Allow text wrapping for some strings in self-tests

* Fix context menu self-test not working properly on HQ items
This commit is contained in:
Haselnussbomber 2025-06-17 19:48:40 +02:00 committed by GitHub
parent 6a42568073
commit b1986bd3d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 9 deletions

View file

@ -57,8 +57,8 @@ internal class SelfTestWindow : Window
new SheetRedirectResolverSelfTestStep(), new SheetRedirectResolverSelfTestStep(),
new NounProcessorSelfTestStep(), new NounProcessorSelfTestStep(),
new SeStringEvaluatorSelfTestStep(), new SeStringEvaluatorSelfTestStep(),
new LogoutEventSelfTestStep(), new CompletionSelfTestStep(),
new CompletionSelfTestStep() new LogoutEventSelfTestStep()
]; ];
private readonly Dictionary<int, (SelfTestStepResult Result, TimeSpan? Duration)> testIndexToResult = new(); private readonly Dictionary<int, (SelfTestStepResult Result, TimeSpan? Duration)> testIndexToResult = new();
@ -152,6 +152,9 @@ internal class SelfTestWindow : Window
return; return;
} }
using var resultChild = ImRaii.Child("SelfTestResultChild", ImGui.GetContentRegionAvail());
if (!resultChild) return;
var step = this.steps[this.currentStep]; var step = this.steps[this.currentStep];
ImGui.TextUnformatted($"Current: {step.Name}"); ImGui.TextUnformatted($"Current: {step.Name}");
@ -184,7 +187,7 @@ internal class SelfTestWindow : Window
var tableSize = ImGui.GetContentRegionAvail(); var tableSize = ImGui.GetContentRegionAvail();
if (this.selfTestRunning) if (this.selfTestRunning)
tableSize -= new Vector2(0, 150); tableSize -= new Vector2(0, 200);
tableSize.Y = Math.Min(tableSize.Y, ImGui.GetWindowViewport().Size.Y * 0.5f); tableSize.Y = Math.Min(tableSize.Y, ImGui.GetWindowViewport().Size.Y * 0.5f);

View file

@ -32,7 +32,7 @@ internal class CompletionSelfTestStep : ISelfTestStep
case 1: case 1:
ImGui.Text("[Chat Log]"); ImGui.Text("[Chat Log]");
ImGui.Text("Use the category menus to navigate to [Dalamud], then complete a command from the list. Did it work?"); ImGui.TextWrapped("Use the category menus to navigate to [Dalamud], then complete a command from the list. Did it work?");
if (ImGui.Button("Yes")) if (ImGui.Button("Yes"))
this.step++; this.step++;
ImGui.SameLine(); ImGui.SameLine();

View file

@ -145,7 +145,7 @@ internal class ContextMenuSelfTestStep : ISelfTestStep
var targetItem = (a.Target as MenuTargetInventory)!.TargetItem; var targetItem = (a.Target as MenuTargetInventory)!.TargetItem;
if (targetItem is { } item) if (targetItem is { } item)
{ {
name = (this.itemSheet.GetRowOrDefault(item.ItemId)?.Name.ExtractText() ?? $"Unknown ({item.ItemId})") + (item.IsHq ? $" {SeIconChar.HighQuality.ToIconString()}" : string.Empty); name = (this.itemSheet.GetRowOrDefault(item.BaseItemId)?.Name.ExtractText() ?? $"Unknown ({item.BaseItemId})") + (item.IsHq ? $" {SeIconChar.HighQuality.ToIconString()}" : string.Empty);
count = item.Quantity; count = item.Quantity;
} }
else else

View file

@ -1,4 +1,4 @@
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using Dalamud.Game.MarketBoard; using Dalamud.Game.MarketBoard;
@ -109,7 +109,7 @@ internal class MarketBoardSelfTestStep : ISelfTestStep
} }
else else
{ {
ImGui.Text("Does this information match the purchase you made? This is testing the request to the server."); ImGui.TextWrapped("Does this information match the purchase you made? This is testing the request to the server.");
ImGui.Separator(); ImGui.Separator();
ImGui.Text($"Quantity: {this.marketBoardPurchaseRequest.ItemQuantity.ToString()}"); ImGui.Text($"Quantity: {this.marketBoardPurchaseRequest.ItemQuantity.ToString()}");
ImGui.Text($"Item ID: {this.marketBoardPurchaseRequest.CatalogId}"); ImGui.Text($"Item ID: {this.marketBoardPurchaseRequest.CatalogId}");
@ -135,7 +135,7 @@ internal class MarketBoardSelfTestStep : ISelfTestStep
} }
else else
{ {
ImGui.Text("Does this information match the purchase you made? This is testing the response from the server."); ImGui.TextWrapped("Does this information match the purchase you made? This is testing the response from the server.");
ImGui.Separator(); ImGui.Separator();
ImGui.Text($"Quantity: {this.marketBoardPurchase.ItemQuantity.ToString()}"); ImGui.Text($"Quantity: {this.marketBoardPurchase.ItemQuantity.ToString()}");
ImGui.Text($"Item ID: {this.marketBoardPurchase.CatalogId}"); ImGui.Text($"Item ID: {this.marketBoardPurchase.CatalogId}");
@ -156,7 +156,7 @@ internal class MarketBoardSelfTestStep : ISelfTestStep
case SubStep.Taxes: case SubStep.Taxes:
if (this.marketTaxRate == null) if (this.marketTaxRate == null)
{ {
ImGui.Text("Goto a Retainer Vocate and talk to then. Click the 'View market tax rates' menu item."); ImGui.TextWrapped("Goto a Retainer Vocate and talk to then. Click the 'View market tax rates' menu item.");
} }
else else
{ {