Skip to content

Commit

Permalink
setnodetext
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed May 2, 2024
1 parent 3c61785 commit efcec6e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/auto merge community scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Auto Merge Community Scripts

on:
pull_request:
branches: [master]
paths:
- 'Community Scripts/**'
4 changes: 4 additions & 0 deletions SomethingNeedDoing/Interface/HelpWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ static void DisplayChangelog(string date, string changes, bool separator = true)

ImGui.PushFont(UiBuilder.MonoFont);

DisplayChangelog(
"2024-04-18",
"- Added SetNodeText()\n");

DisplayChangelog(
"2024-04-22",
"- IsNodeVisible() supports checking arbitrarily nested nodes.\n" +
Expand Down
12 changes: 12 additions & 0 deletions SomethingNeedDoing/Misc/Commands/AddonCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,18 @@ public unsafe string GetNodeText(string addonName, params int[] nodeNumbers)
return textNode->NodeText.ToString();
}

public unsafe void SetNodeText(string addonName, string text, params int[] ids)
{
var ptr = Service.GameGui.GetAddonByName(addonName, 1);
if (ptr == nint.Zero)
return;

var addon = (AtkUnitBase*)ptr;
var node = GetNodeByIDChain(addon->GetRootNode(), ids);
if (node != null && node->Type == NodeType.Text)
node->GetAsAtkTextNode()->NodeText = new FFXIVClientStructs.FFXIV.Client.System.String.Utf8String(text);
}

public unsafe string GetSelectStringText(int index)
{
var ptr = Service.GameGui.GetAddonByName("SelectString", 1);
Expand Down

0 comments on commit efcec6e

Please sign in to comment.