From 9b0c275b8b143aded0fcb556fede9c2edb676fc9 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Mon, 22 Sep 2025 23:29:40 +0200 Subject: [PATCH 1/7] Fix ExpressionType.Weekday being off by 1 --- Dalamud/Game/Text/Evaluator/SeStringEvaluator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Game/Text/Evaluator/SeStringEvaluator.cs b/Dalamud/Game/Text/Evaluator/SeStringEvaluator.cs index 6ad58ccd8..4fd42efb3 100644 --- a/Dalamud/Game/Text/Evaluator/SeStringEvaluator.cs +++ b/Dalamud/Game/Text/Evaluator/SeStringEvaluator.cs @@ -2061,7 +2061,7 @@ internal class SeStringEvaluator : IServiceType, ISeStringEvaluator value = (uint)MacroDecoder.GetMacroTime()->tm_mday; return true; case ExpressionType.Weekday: - value = (uint)MacroDecoder.GetMacroTime()->tm_wday; + value = (uint)MacroDecoder.GetMacroTime()->tm_wday + 1; return true; case ExpressionType.Month: value = (uint)MacroDecoder.GetMacroTime()->tm_mon + 1; From e2e3a01cc3ba63f172d875e437ef99af49b2db90 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Mon, 22 Sep 2025 23:33:30 +0200 Subject: [PATCH 2/7] Fix SeString Creator input length cutting off long macro strings --- .../Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs index d2d0cb3b2..a153d3c2f 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs @@ -696,7 +696,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget ImGui.TableNextColumn(); // Text var message = entry.Message; ImGui.SetNextItemWidth(-1); - if (ImGui.InputText($"##{i}_Message", ref message, 255)) + if (ImGui.InputText($"##{i}_Message", ref message, 2048)) { entry.Message = message; updateString |= true; From 9447708058ce94d0a7a0c75a928ef6bcd7ccb6e3 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Mon, 22 Sep 2025 23:36:39 +0200 Subject: [PATCH 3/7] Fix Copy MacroString button --- .../Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs index a153d3c2f..465d64370 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs @@ -510,7 +510,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget } } - ImGui.SetClipboardText(sb.ToReadOnlySeString().ToString()); + ImGui.SetClipboardText(sb.ToReadOnlySeString().ToMacroString()); } ImGui.SameLine(); From 69a8bdd63808eaf5bed8be5628711b1e2aa168e1 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Mon, 22 Sep 2025 23:37:27 +0200 Subject: [PATCH 4/7] Update GlobalParameters list --- .../Data/Widgets/SeStringCreatorWidget.cs | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs index 465d64370..4f2369e3b 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs @@ -4,7 +4,6 @@ using System.Numerics; using System.Text; using Dalamud.Bindings.ImGui; -using Dalamud.Configuration.Internal; using Dalamud.Data; using Dalamud.Game; using Dalamud.Game.ClientState; @@ -13,12 +12,13 @@ using Dalamud.Game.Text.Noun.Enums; using Dalamud.Game.Text.SeStringHandling; using Dalamud.Interface.Utility; using Dalamud.Interface.Utility.Raii; -using Dalamud.Memory; using Dalamud.Utility; + using FFXIVClientStructs.FFXIV.Client.System.String; using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI.Misc; using FFXIVClientStructs.FFXIV.Component.Text; + using Lumina.Data; using Lumina.Data.Files.Excel; using Lumina.Data.Structs.Excel; @@ -313,13 +313,13 @@ internal class SeStringCreatorWidget : IDataWindowWidget ImGui.Text(i switch { 0 => "Player Name", - 1 => "Temp Player 1 Name", - 2 => "Temp Player 2 Name", + 1 => "Temp Entity 1: Name", + 2 => "Temp Entity 2: Name", 3 => "Player Sex", - 4 => "Temp Player 1 Sex", - 5 => "Temp Player 2 Sex", - 6 => "Temp Player 1 Unk 1", - 7 => "Temp Player 2 Unk 1", + 4 => "Temp Entity 1: Sex", + 5 => "Temp Entity 2: Sex", + 6 => "Temp Entity 1: ObjStrId", + 7 => "Temp Entity 2: ObjStrId", 10 => "Eorzea Time Hours", 11 => "Eorzea Time Minutes", 12 => "ColorSay", @@ -368,14 +368,19 @@ internal class SeStringCreatorWidget : IDataWindowWidget 62 => "ColorLoot", 63 => "ColorCraft", 64 => "ColorGathering", - 65 => "Temp Player 1 Unk 2", - 66 => "Temp Player 2 Unk 2", + 65 => "Temp Entity 1: Name starts with Vowel", + 66 => "Temp Entity 2: Name starts with Vowel", 67 => "Player ClassJobId", 68 => "Player Level", + 69 => "Player StartTown", 70 => "Player Race", 71 => "Player Synced Level", - 77 => "Client/Plattform?", + 73 => "Quest#66047: Has met Alphinaud and Alisaie", + 74 => "PlayStation Generation", + 75 => "Is Legacy Player", + 77 => "Client/Platform?", 78 => "Player BirthMonth", + 79 => "PadMode", 82 => "Datacenter Region", 83 => "ColorCWLS2", 84 => "ColorCWLS3", @@ -396,6 +401,11 @@ internal class SeStringCreatorWidget : IDataWindowWidget 100 => "LogSetRoleColor 1: LogColorOtherClass", 101 => "LogSetRoleColor 2: LogColorOtherClass", 102 => "Has Login Security Token", + 103 => "Is subscribed to PlayStation Plus", + 104 => "PadMouseMode", + 106 => "Preferred World Bonus Max Level", + 107 => "Occult Crescent Support Job Level", + 108 => "Deep Dungeon Id", _ => string.Empty, }); } From 2625f51021b1d170eabb556004d0f97f71aa40a1 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Mon, 22 Sep 2025 23:55:16 +0200 Subject: [PATCH 5/7] Fix missing macro strings in AddFromSheetPopup --- .../Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs index 4f2369e3b..86225a63b 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs @@ -635,7 +635,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget ImGui.Text(i.ToString()); ImGui.TableNextColumn(); - if (ImGui.Selectable($"{value.ToString().Truncate(100)}###Column{i}")) + if (ImGui.Selectable($"{value.ToMacroString().Truncate(100)}###Column{i}")) { foreach (var payload in value) { From dceeccb242332e33c2f40b5336018a42308a5a39 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Mon, 22 Sep 2025 23:56:28 +0200 Subject: [PATCH 6/7] Load valid sheets for AddFromSheetPopup asynchronously --- .../Data/Widgets/SeStringCreatorWidget.cs | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs index 86225a63b..a88f576f9 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/SeStringCreatorWidget.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Numerics; using System.Text; +using System.Threading.Tasks; using Dalamud.Bindings.ImGui; using Dalamud.Data; @@ -146,6 +147,7 @@ internal class SeStringCreatorWidget : IDataWindowWidget private SeStringParameter[]? localParameters = [Util.GetScmVersion()]; private ReadOnlySeString input; private ClientLanguage? language; + private Task? validImportSheetNamesTask; private int importSelectedSheetName; private int importRowId; private string[]? validImportSheetNames; @@ -565,22 +567,31 @@ internal class SeStringCreatorWidget : IDataWindowWidget var dataManager = Service.Get(); - this.validImportSheetNames ??= dataManager.Excel.SheetNames.Where(sheetName => + this.validImportSheetNamesTask ??= Task.Run(() => { - try + this.validImportSheetNames = dataManager.Excel.SheetNames.Where(sheetName => { - var headerFile = dataManager.GameData.GetFile($"exd/{sheetName}.exh"); - if (headerFile.Header.Variant != ExcelVariant.Default) - return false; + try + { + var headerFile = dataManager.GameData.GetFile($"exd/{sheetName}.exh"); + if (headerFile.Header.Variant != ExcelVariant.Default) + return false; - var sheet = dataManager.Excel.GetSheet(Language.English, sheetName); - return sheet.Columns.Any(col => col.Type == ExcelColumnDataType.String); - } - catch - { - return false; - } - }).OrderBy(sheetName => sheetName, StringComparer.InvariantCulture).ToArray(); + var sheet = dataManager.Excel.GetSheet(Language.English, sheetName); + return sheet.Columns.Any(col => col.Type == ExcelColumnDataType.String); + } + catch + { + return false; + } + }).OrderBy(sheetName => sheetName, StringComparer.InvariantCulture).ToArray(); + }); + + if (this.validImportSheetNames == null) + { + ImGui.Text("Loading sheets..."u8); + return; + } var sheetChanged = ImGui.Combo("Sheet Name", ref this.importSelectedSheetName, this.validImportSheetNames); From 1633e68b76ef859286c26387746e09360ffb3cac Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Tue, 23 Sep 2025 13:16:39 +0200 Subject: [PATCH 7/7] Fix/simplify range handling --- Dalamud/Game/Text/Evaluator/SeStringEvaluator.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dalamud/Game/Text/Evaluator/SeStringEvaluator.cs b/Dalamud/Game/Text/Evaluator/SeStringEvaluator.cs index 4fd42efb3..9f898bcca 100644 --- a/Dalamud/Game/Text/Evaluator/SeStringEvaluator.cs +++ b/Dalamud/Game/Text/Evaluator/SeStringEvaluator.cs @@ -1643,13 +1643,15 @@ internal class SeStringEvaluator : IServiceType, ISeStringEvaluator if (entryEnd == -1) entryEnd = ranges.Length; + var entry = ranges.AsSpan(0, entryEnd); + if (ranges.StartsWith("noun", StringComparison.Ordinal)) { isNoun = true; } else if (ranges.StartsWith("col", StringComparison.Ordinal) && colIndex < cols.Length) { - cols[colIndex++] = int.Parse(ranges.AsSpan(4, entryEnd - 4)); + cols[colIndex++] = int.Parse(entry[4..]); } else if (ranges.StartsWith("tail", StringComparison.Ordinal)) { @@ -1659,18 +1661,18 @@ internal class SeStringEvaluator : IServiceType, ISeStringEvaluator } else { - var dash = ranges.IndexOf('-'); + var dash = entry.IndexOf('-'); hasRanges |= true; if (dash == -1) { - isInRange |= int.Parse(ranges.AsSpan(0, entryEnd)) == rowId; + isInRange |= int.Parse(entry) == rowId; } else { - isInRange |= rowId >= int.Parse(ranges.AsSpan(0, dash)) - && rowId <= int.Parse(ranges.AsSpan(dash + 1, entryEnd - dash - 1)); + isInRange |= rowId >= int.Parse(entry[..dash]) + && rowId <= int.Parse(entry[(dash + 1)..]); } }