feat: add novice network button
This commit is contained in:
@@ -7,6 +7,7 @@ using FFXIVClientStructs.FFXIV.Client.UI;
|
|||||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||||
using Lumina.Excel.GeneratedSheets;
|
using Lumina.Excel.GeneratedSheets;
|
||||||
|
using ValueType = FFXIVClientStructs.FFXIV.Component.GUI.ValueType;
|
||||||
|
|
||||||
namespace ChatTwo.GameFunctions;
|
namespace ChatTwo.GameFunctions;
|
||||||
|
|
||||||
@@ -254,6 +255,18 @@ internal unsafe class GameFunctions : IDisposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void ClickNoviceNetworkButton() {
|
||||||
|
var agent = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.ChatLog);
|
||||||
|
// case 3
|
||||||
|
var value = new AtkValue {
|
||||||
|
Type = ValueType.Int,
|
||||||
|
Int = 3,
|
||||||
|
};
|
||||||
|
int result = 0;
|
||||||
|
var vf0 = *(delegate* unmanaged<AgentInterface*, int*, AtkValue*, ulong, ulong, int*>*) agent->VTable;
|
||||||
|
vf0(agent, &result, &value, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
private readonly IntPtr _placeholderNamePtr = Marshal.AllocHGlobal(128);
|
private readonly IntPtr _placeholderNamePtr = Marshal.AllocHGlobal(128);
|
||||||
private readonly string _placeholder = $"<{Guid.NewGuid():N}>";
|
private readonly string _placeholder = $"<{Guid.NewGuid():N}>";
|
||||||
private string? _replacementName;
|
private string? _replacementName;
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ internal sealed class ChatLog : IUiComponent {
|
|||||||
var afterIcon = ImGui.GetCursorPos();
|
var afterIcon = ImGui.GetCursorPos();
|
||||||
|
|
||||||
var buttonWidth = afterIcon.X - beforeIcon.X;
|
var buttonWidth = afterIcon.X - beforeIcon.X;
|
||||||
var inputWidth = ImGui.GetContentRegionAvail().X - buttonWidth;
|
var inputWidth = ImGui.GetContentRegionAvail().X - buttonWidth * 2;
|
||||||
|
|
||||||
var inputType = this._tempChannel?.ToChatType() ?? activeTab?.Channel?.ToChatType() ?? this.Ui.Plugin.Functions.Chat.Channel.channel.ToChatType();
|
var inputType = this._tempChannel?.ToChatType() ?? activeTab?.Channel?.ToChatType() ?? this.Ui.Plugin.Functions.Chat.Channel.channel.ToChatType();
|
||||||
if (this.Chat.Trim().StartsWith('/')) {
|
if (this.Chat.Trim().StartsWith('/')) {
|
||||||
@@ -505,6 +505,12 @@ internal sealed class ChatLog : IUiComponent {
|
|||||||
this.Ui.SettingsVisible ^= true;
|
this.Ui.SettingsVisible ^= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.SameLine();
|
||||||
|
|
||||||
|
if (ImGuiUtil.IconButton(FontAwesomeIcon.Leaf)) {
|
||||||
|
this.Ui.Plugin.Functions.ClickNoviceNetworkButton();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.End();
|
ImGui.End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user