Add adventurer plate context option
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>1.19.2</Version>
|
<Version>1.19.3</Version>
|
||||||
<TargetFramework>net8.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|||||||
@@ -273,6 +273,20 @@ internal unsafe class GameFunctions : IDisposable {
|
|||||||
return this._inInstance() != 0;
|
return this._inInstance() != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal bool TryOpenAdventurerPlate(ulong playerId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AgentCharaCard.Instance()->OpenCharaCard(playerId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Plugin.Log.Warning(e, "Unable to open adventurer plate");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal void ClickNoviceNetworkButton() {
|
internal void ClickNoviceNetworkButton() {
|
||||||
var agent = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.ChatLog);
|
var agent = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.ChatLog);
|
||||||
// case 3
|
// case 3
|
||||||
|
|||||||
+99
-91
@@ -7,6 +7,7 @@ using Dalamud.Game.ClientState.Objects.SubKinds;
|
|||||||
using Dalamud.Game.Text.SeStringHandling;
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
|
using Dalamud.Interface.Internal.Notifications;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
@@ -31,30 +32,30 @@ internal sealed class PayloadHandler {
|
|||||||
private uint _lastHoverCounter;
|
private uint _lastHoverCounter;
|
||||||
|
|
||||||
internal PayloadHandler(PluginUi ui, ChatLog log) {
|
internal PayloadHandler(PluginUi ui, ChatLog log) {
|
||||||
this.Ui = ui;
|
Ui = ui;
|
||||||
this.Log = log;
|
Log = log;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void Draw() {
|
internal void Draw() {
|
||||||
this.DrawPopups();
|
DrawPopups();
|
||||||
|
|
||||||
if (this._handleTooltips && ++this._hoverCounter - this._lastHoverCounter > 1) {
|
if (_handleTooltips && ++_hoverCounter - _lastHoverCounter > 1) {
|
||||||
GameFunctions.GameFunctions.CloseItemTooltip();
|
GameFunctions.GameFunctions.CloseItemTooltip();
|
||||||
this._hoveredItem = 0;
|
_hoveredItem = 0;
|
||||||
this._hoverCounter = this._lastHoverCounter = 0;
|
_hoverCounter = _lastHoverCounter = 0;
|
||||||
this._handleTooltips = false;
|
_handleTooltips = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawPopups() {
|
private void DrawPopups() {
|
||||||
if (this.Popup == null) {
|
if (Popup == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var (chunk, payload) = this.Popup.Value;
|
var (chunk, payload) = Popup.Value;
|
||||||
|
|
||||||
if (!ImGui.BeginPopup(PopupId)) {
|
if (!ImGui.BeginPopup(PopupId)) {
|
||||||
this.Popup = null;
|
Popup = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,26 +64,26 @@ internal sealed class PayloadHandler {
|
|||||||
var drawn = false;
|
var drawn = false;
|
||||||
switch (payload) {
|
switch (payload) {
|
||||||
case PlayerPayload player: {
|
case PlayerPayload player: {
|
||||||
this.DrawPlayerPopup(chunk, player);
|
DrawPlayerPopup(chunk, player);
|
||||||
drawn = true;
|
drawn = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ItemPayload item: {
|
case ItemPayload item: {
|
||||||
this.DrawItemPopup(item);
|
DrawItemPopup(item);
|
||||||
drawn = true;
|
drawn = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ContextFooter(drawn, chunk);
|
ContextFooter(drawn, chunk);
|
||||||
this.Integrations(chunk, payload);
|
Integrations(chunk, payload);
|
||||||
|
|
||||||
ImGui.PopID();
|
ImGui.PopID();
|
||||||
ImGui.EndPopup();
|
ImGui.EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Integrations(Chunk chunk, Payload? payload) {
|
private void Integrations(Chunk chunk, Payload? payload) {
|
||||||
var registered = this.Ui.Plugin.Ipc.Registered;
|
var registered = Ui.Plugin.Ipc.Registered;
|
||||||
if (registered.Count == 0) {
|
if (registered.Count == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -97,7 +98,7 @@ internal sealed class PayloadHandler {
|
|||||||
|
|
||||||
foreach (var id in registered) {
|
foreach (var id in registered) {
|
||||||
try {
|
try {
|
||||||
this.Ui.Plugin.Ipc.Invoke(id, sender, contentId, payload, chunk.Message?.SenderSource, chunk.Message?.ContentSource);
|
Ui.Plugin.Ipc.Invoke(id, sender, contentId, payload, chunk.Message?.SenderSource, chunk.Message?.ContentSource);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Plugin.Log.Error(ex, "Error executing integration");
|
Plugin.Log.Error(ex, "Error executing integration");
|
||||||
}
|
}
|
||||||
@@ -122,10 +123,10 @@ internal sealed class PayloadHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Checkbox(Language.Context_ScreenshotMode, ref this.Ui.ScreenshotMode);
|
ImGui.Checkbox(Language.Context_ScreenshotMode, ref Ui.ScreenshotMode);
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_HideChat)) {
|
if (ImGui.Selectable(Language.Context_HideChat)) {
|
||||||
this.Log.UserHide();
|
Log.UserHide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chunk.Message is { } message) {
|
if (chunk.Message is { } message) {
|
||||||
@@ -148,9 +149,12 @@ internal sealed class PayloadHandler {
|
|||||||
|
|
||||||
var col = ImGui.GetStyle().Colors[(int) ImGuiCol.TextDisabled];
|
var col = ImGui.GetStyle().Colors[(int) ImGuiCol.TextDisabled];
|
||||||
ImGui.PushStyleColor(ImGuiCol.Text, col);
|
ImGui.PushStyleColor(ImGuiCol.Text, col);
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
ImGui.TextUnformatted(message.Code.Type.Name());
|
ImGui.TextUnformatted(message.Code.Type.Name());
|
||||||
} finally {
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
ImGui.PopStyleColor();
|
ImGui.PopStyleColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,10 +165,10 @@ internal sealed class PayloadHandler {
|
|||||||
internal void Click(Chunk chunk, Payload? payload, ImGuiMouseButton button) {
|
internal void Click(Chunk chunk, Payload? payload, ImGuiMouseButton button) {
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case ImGuiMouseButton.Left:
|
case ImGuiMouseButton.Left:
|
||||||
this.LeftClickPayload(chunk, payload);
|
LeftClickPayload(chunk, payload);
|
||||||
break;
|
break;
|
||||||
case ImGuiMouseButton.Right:
|
case ImGuiMouseButton.Right:
|
||||||
this.RightClickPayload(chunk, payload);
|
RightClickPayload(chunk, payload);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,25 +178,25 @@ internal sealed class PayloadHandler {
|
|||||||
|
|
||||||
switch (payload) {
|
switch (payload) {
|
||||||
case StatusPayload status: {
|
case StatusPayload status: {
|
||||||
this.DoHover(() => this.HoverStatus(status), hoverSize);
|
DoHover(() => HoverStatus(status), hoverSize);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ItemPayload item: {
|
case ItemPayload item: {
|
||||||
if (this.Ui.Plugin.Config.NativeItemTooltips) {
|
if (Ui.Plugin.Config.NativeItemTooltips) {
|
||||||
GameFunctions.GameFunctions.OpenItemTooltip(item.RawItemId);
|
GameFunctions.GameFunctions.OpenItemTooltip(item.RawItemId);
|
||||||
|
|
||||||
this._handleTooltips = true;
|
_handleTooltips = true;
|
||||||
if (this._hoveredItem != item.RawItemId) {
|
if (_hoveredItem != item.RawItemId) {
|
||||||
this._hoveredItem = item.RawItemId;
|
_hoveredItem = item.RawItemId;
|
||||||
this._hoverCounter = this._lastHoverCounter = 0;
|
_hoverCounter = _lastHoverCounter = 0;
|
||||||
} else {
|
} else {
|
||||||
this._lastHoverCounter = this._hoverCounter;
|
_lastHoverCounter = _hoverCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.DoHover(() => this.HoverItem(item), hoverSize);
|
DoHover(() => HoverItem(item), hoverSize);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -203,11 +207,14 @@ internal sealed class PayloadHandler {
|
|||||||
|
|
||||||
ImGui.BeginTooltip();
|
ImGui.BeginTooltip();
|
||||||
ImGui.PushTextWrapPos();
|
ImGui.PushTextWrapPos();
|
||||||
|
ImGui.PushStyleColor(ImGuiCol.Text, Ui.DefaultText);
|
||||||
|
|
||||||
ImGui.PushStyleColor(ImGuiCol.Text, this.Ui.DefaultText);
|
try
|
||||||
try {
|
{
|
||||||
inside();
|
inside();
|
||||||
} finally {
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
ImGui.PopStyleColor();
|
ImGui.PopStyleColor();
|
||||||
ImGui.PopTextWrapPos();
|
ImGui.PopTextWrapPos();
|
||||||
ImGui.EndTooltip();
|
ImGui.EndTooltip();
|
||||||
@@ -225,21 +232,21 @@ internal sealed class PayloadHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void HoverStatus(StatusPayload status) {
|
private void HoverStatus(StatusPayload status) {
|
||||||
if (this.Ui.Plugin.TextureCache.GetStatus(status.Status) is { } icon) {
|
if (Ui.Plugin.TextureCache.GetStatus(status.Status) is { } icon) {
|
||||||
InlineIcon(icon);
|
InlineIcon(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
var name = ChunkUtil.ToChunks(status.Status.Name.ToDalamudString(), ChunkSource.None, null);
|
var name = ChunkUtil.ToChunks(status.Status.Name.ToDalamudString(), ChunkSource.None, null);
|
||||||
this.Log.DrawChunks(name.ToList());
|
Log.DrawChunks(name.ToList());
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
var desc = ChunkUtil.ToChunks(status.Status.Description.ToDalamudString(), ChunkSource.None, null);
|
var desc = ChunkUtil.ToChunks(status.Status.Description.ToDalamudString(), ChunkSource.None, null);
|
||||||
this.Log.DrawChunks(desc.ToList());
|
Log.DrawChunks(desc.ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HoverItem(ItemPayload item) {
|
private void HoverItem(ItemPayload item) {
|
||||||
if (item.Kind == ItemPayload.ItemKind.EventItem) {
|
if (item.Kind == ItemPayload.ItemKind.EventItem) {
|
||||||
this.HoverEventItem(item);
|
HoverEventItem(item);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,16 +254,16 @@ internal sealed class PayloadHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Ui.Plugin.TextureCache.GetItem(item.Item, item.IsHQ) is { } icon) {
|
if (Ui.Plugin.TextureCache.GetItem(item.Item, item.IsHQ) is { } icon) {
|
||||||
InlineIcon(icon);
|
InlineIcon(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
var name = ChunkUtil.ToChunks(item.Item.Name.ToDalamudString(), ChunkSource.None, null);
|
var name = ChunkUtil.ToChunks(item.Item.Name.ToDalamudString(), ChunkSource.None, null);
|
||||||
this.Log.DrawChunks(name.ToList());
|
Log.DrawChunks(name.ToList());
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
var desc = ChunkUtil.ToChunks(item.Item.Description.ToDalamudString(), ChunkSource.None, null);
|
var desc = ChunkUtil.ToChunks(item.Item.Description.ToDalamudString(), ChunkSource.None, null);
|
||||||
this.Log.DrawChunks(desc.ToList());
|
Log.DrawChunks(desc.ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HoverEventItem(ItemPayload payload) {
|
private void HoverEventItem(ItemPayload payload) {
|
||||||
@@ -265,18 +272,18 @@ internal sealed class PayloadHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Ui.Plugin.TextureCache.GetEventItem(item) is { } icon) {
|
if (Ui.Plugin.TextureCache.GetEventItem(item) is { } icon) {
|
||||||
InlineIcon(icon);
|
InlineIcon(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
var name = ChunkUtil.ToChunks(item.Name.ToDalamudString(), ChunkSource.None, null);
|
var name = ChunkUtil.ToChunks(item.Name.ToDalamudString(), ChunkSource.None, null);
|
||||||
this.Log.DrawChunks(name.ToList());
|
Log.DrawChunks(name.ToList());
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
var help = Plugin.DataManager.GetExcelSheet<EventItemHelp>()?.GetRow(payload.RawItemId);
|
var help = Plugin.DataManager.GetExcelSheet<EventItemHelp>()?.GetRow(payload.RawItemId);
|
||||||
if (help != null) {
|
if (help != null) {
|
||||||
var desc = ChunkUtil.ToChunks(help.Description.ToDalamudString(), ChunkSource.None, null);
|
var desc = ChunkUtil.ToChunks(help.Description.ToDalamudString(), ChunkSource.None, null);
|
||||||
this.Log.DrawChunks(desc.ToList());
|
Log.DrawChunks(desc.ToList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,28 +294,28 @@ internal sealed class PayloadHandler {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QuestPayload quest: {
|
case QuestPayload quest: {
|
||||||
this.Ui.Plugin.Common.Functions.Journal.OpenQuest(quest.Quest);
|
Ui.Plugin.Common.Functions.Journal.OpenQuest(quest.Quest);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DalamudLinkPayload link: {
|
case DalamudLinkPayload link: {
|
||||||
this.ClickLinkPayload(chunk, payload, link);
|
ClickLinkPayload(chunk, payload, link);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DalamudPartyFinderPayload pf: {
|
case DalamudPartyFinderPayload pf: {
|
||||||
if (pf.LinkType == DalamudPartyFinderPayload.PartyFinderLinkType.PartyFinderNotification) {
|
if (pf.LinkType == DalamudPartyFinderPayload.PartyFinderLinkType.PartyFinderNotification) {
|
||||||
GameFunctions.GameFunctions.OpenPartyFinder();
|
GameFunctions.GameFunctions.OpenPartyFinder();
|
||||||
} else {
|
} else {
|
||||||
this.Ui.Plugin.Functions.OpenPartyFinder(pf.ListingId);
|
Ui.Plugin.Functions.OpenPartyFinder(pf.ListingId);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ChatTwoPartyFinderPayload pf: {
|
case ChatTwoPartyFinderPayload pf: {
|
||||||
this.Ui.Plugin.Functions.OpenPartyFinder(pf.Id);
|
Ui.Plugin.Functions.OpenPartyFinder(pf.Id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AchievementPayload achievement: {
|
case AchievementPayload achievement: {
|
||||||
this.Ui.Plugin.Functions.OpenAchievement(achievement.Id);
|
Ui.Plugin.Functions.OpenAchievement(achievement.Id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RawPayload raw: {
|
case RawPayload raw: {
|
||||||
@@ -335,7 +342,7 @@ internal sealed class PayloadHandler {
|
|||||||
var payloads = source.Payloads.Skip(start).Take(end - start + 1).ToList();
|
var payloads = source.Payloads.Skip(start).Take(end - start + 1).ToList();
|
||||||
if (!Plugin.ChatGui.RegisteredLinkHandlers.TryGetValue((link.Plugin, link.CommandId), out var value))
|
if (!Plugin.ChatGui.RegisteredLinkHandlers.TryGetValue((link.Plugin, link.CommandId), out var value))
|
||||||
{
|
{
|
||||||
Plugin.Log.Warning("could not find dalamudLinkHandlers");
|
Plugin.Log.Warning("Could not find DalamudLinkHandlers");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -349,13 +356,13 @@ internal sealed class PayloadHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void RightClickPayload(Chunk chunk, Payload? payload) {
|
private void RightClickPayload(Chunk chunk, Payload? payload) {
|
||||||
this.Popup = (chunk, payload);
|
Popup = (chunk, payload);
|
||||||
ImGui.OpenPopup(PopupId);
|
ImGui.OpenPopup(PopupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawItemPopup(ItemPayload payload) {
|
private void DrawItemPopup(ItemPayload payload) {
|
||||||
if (payload.Kind == ItemPayload.ItemKind.EventItem) {
|
if (payload.Kind == ItemPayload.ItemKind.EventItem) {
|
||||||
this.DrawEventItemPopup(payload);
|
DrawEventItemPopup(payload);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +373,7 @@ internal sealed class PayloadHandler {
|
|||||||
|
|
||||||
var hq = payload.Kind == ItemPayload.ItemKind.Hq;
|
var hq = payload.Kind == ItemPayload.ItemKind.Hq;
|
||||||
|
|
||||||
if (this.Ui.Plugin.TextureCache.GetItem(item, hq) is { } icon) {
|
if (Ui.Plugin.TextureCache.GetItem(item, hq) is { } icon) {
|
||||||
InlineIcon(icon);
|
InlineIcon(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,33 +385,32 @@ internal sealed class PayloadHandler {
|
|||||||
name.Payloads.Add(new TextPayload(" "));
|
name.Payloads.Add(new TextPayload(" "));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Log.DrawChunks(ChunkUtil.ToChunks(name, ChunkSource.None, null).ToList(), false);
|
Log.DrawChunks(ChunkUtil.ToChunks(name, ChunkSource.None, null).ToList(), false);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
var realItemId = payload.RawItemId;
|
var realItemId = payload.RawItemId;
|
||||||
|
|
||||||
if (item.EquipSlotCategory.Row != 0) {
|
if (item.EquipSlotCategory.Row != 0) {
|
||||||
if (ImGui.Selectable(Language.Context_TryOn)) {
|
if (ImGui.Selectable(Language.Context_TryOn)) {
|
||||||
this.Ui.Plugin.Functions.Context.TryOn(realItemId, 0);
|
Ui.Plugin.Functions.Context.TryOn(realItemId, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_ItemComparison)) {
|
if (ImGui.Selectable(Language.Context_ItemComparison)) {
|
||||||
this.Ui.Plugin.Functions.Context.OpenItemComparison(realItemId);
|
Ui.Plugin.Functions.Context.OpenItemComparison(realItemId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.ItemSearchCategory.Value?.Category == 3) {
|
if (item.ItemSearchCategory.Value?.Category == 3) {
|
||||||
if (ImGui.Selectable(Language.Context_SearchRecipes)) {
|
if (ImGui.Selectable(Language.Context_SearchRecipes)) {
|
||||||
this.Ui.Plugin.Functions.Context.SearchForRecipesUsingItem(payload.ItemId);
|
Ui.Plugin.Functions.Context.SearchForRecipesUsingItem(payload.ItemId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_SearchForItem)) {
|
if (ImGui.Selectable(Language.Context_SearchForItem)) {
|
||||||
this.Ui.Plugin.Functions.Context.SearchForItem(realItemId);
|
Ui.Plugin.Functions.Context.SearchForItem(realItemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_Link)) {
|
if (ImGui.Selectable(Language.Context_Link)) {
|
||||||
this.Ui.Plugin.Functions.Context.LinkItem(realItemId);
|
Ui.Plugin.Functions.Context.LinkItem(realItemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_CopyItemName)) {
|
if (ImGui.Selectable(Language.Context_CopyItemName)) {
|
||||||
@@ -422,18 +428,17 @@ internal sealed class PayloadHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Ui.Plugin.TextureCache.GetEventItem(item) is { } icon) {
|
if (Ui.Plugin.TextureCache.GetEventItem(item) is { } icon) {
|
||||||
InlineIcon(icon);
|
InlineIcon(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
var name = item.Name.ToDalamudString();
|
var name = item.Name.ToDalamudString();
|
||||||
this.Log.DrawChunks(ChunkUtil.ToChunks(name, ChunkSource.None, null).ToList(), false);
|
Log.DrawChunks(ChunkUtil.ToChunks(name, ChunkSource.None, null).ToList(), false);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
var realItemId = payload.RawItemId;
|
var realItemId = payload.RawItemId;
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_Link)) {
|
if (ImGui.Selectable(Language.Context_Link)) {
|
||||||
this.Ui.Plugin.Functions.Context.LinkItem(realItemId);
|
Ui.Plugin.Functions.Context.LinkItem(realItemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_CopyItemName)) {
|
if (ImGui.Selectable(Language.Context_CopyItemName)) {
|
||||||
@@ -448,7 +453,6 @@ internal sealed class PayloadHandler {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var world = player.World;
|
var world = player.World;
|
||||||
|
|
||||||
if (chunk.Message?.Code.Type == ChatType.FreeCompanyLoginLogout) {
|
if (chunk.Message?.Code.Type == ChatType.FreeCompanyLoginLogout) {
|
||||||
if (Plugin.ClientState.LocalPlayer?.HomeWorld.GameData is { } homeWorld) {
|
if (Plugin.ClientState.LocalPlayer?.HomeWorld.GameData is { } homeWorld) {
|
||||||
world = homeWorld;
|
world = homeWorld;
|
||||||
@@ -463,40 +467,41 @@ internal sealed class PayloadHandler {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Log.DrawChunks(name, false);
|
Log.DrawChunks(name, false);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_SendTell)) {
|
if (ImGui.Selectable(Language.Context_SendTell)) {
|
||||||
this.Log.Chat = $"/tell {player.PlayerName}";
|
Log.Chat = $"/tell {player.PlayerName}";
|
||||||
if (world.IsPublic) {
|
if (world.IsPublic) {
|
||||||
this.Log.Chat += $"@{world.Name}";
|
Log.Chat += $"@{world.Name}";
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Log.Chat += " ";
|
Log.Chat += " ";
|
||||||
this.Log.Activate = true;
|
Log.Activate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var validContentId = chunk.Message?.ContentId is not (null or 0);
|
||||||
if (world.IsPublic) {
|
if (world.IsPublic) {
|
||||||
var party = Plugin.PartyList;
|
var party = Plugin.PartyList;
|
||||||
var leader = (ulong?) party[(int) party.PartyLeaderIndex]?.ContentId;
|
var leader = (ulong?) party[(int) party.PartyLeaderIndex]?.ContentId;
|
||||||
var isLeader = party.Length == 0 || Plugin.ClientState.LocalContentId == leader;
|
var isLeader = party.Length == 0 || Plugin.ClientState.LocalContentId == leader;
|
||||||
var member = party.FirstOrDefault(member => member.Name.TextValue == player.PlayerName && member.World.Id == world.RowId);
|
var member = party.FirstOrDefault(member => member.Name.TextValue == player.PlayerName && member.World.Id == world.RowId);
|
||||||
var isInParty = member != default;
|
var isInParty = member != default;
|
||||||
var inInstance = this.Ui.Plugin.Functions.IsInInstance();
|
var inInstance = Ui.Plugin.Functions.IsInInstance();
|
||||||
var inPartyInstance = Plugin.DataManager.GetExcelSheet<TerritoryType>()!.GetRow(Plugin.ClientState.TerritoryType)?.TerritoryIntendedUse is (41 or 47 or 48 or 52 or 53);
|
var inPartyInstance = Plugin.DataManager.GetExcelSheet<TerritoryType>()!.GetRow(Plugin.ClientState.TerritoryType)?.TerritoryIntendedUse is (41 or 47 or 48 or 52 or 53);
|
||||||
if (isLeader) {
|
if (isLeader) {
|
||||||
if (!isInParty) {
|
if (!isInParty) {
|
||||||
if (inInstance && inPartyInstance) {
|
if (inInstance && inPartyInstance) {
|
||||||
if (chunk.Message?.ContentId is not (null or 0) && ImGui.Selectable(Language.Context_InviteToParty)) {
|
if (validContentId && ImGui.Selectable(Language.Context_InviteToParty)) {
|
||||||
this.Ui.Plugin.Functions.Party.InviteInInstance(chunk.Message!.ContentId);
|
Ui.Plugin.Functions.Party.InviteInInstance(chunk.Message!.ContentId);
|
||||||
}
|
}
|
||||||
} else if (!inInstance && ImGui.BeginMenu(Language.Context_InviteToParty)) {
|
} else if (!inInstance && ImGui.BeginMenu(Language.Context_InviteToParty)) {
|
||||||
if (ImGui.Selectable(Language.Context_InviteToParty_SameWorld)) {
|
if (ImGui.Selectable(Language.Context_InviteToParty_SameWorld)) {
|
||||||
this.Ui.Plugin.Functions.Party.InviteSameWorld(player.PlayerName, (ushort) world.RowId, chunk.Message?.ContentId ?? 0);
|
Ui.Plugin.Functions.Party.InviteSameWorld(player.PlayerName, (ushort) world.RowId, chunk.Message?.ContentId ?? 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chunk.Message?.ContentId is not (null or 0) && ImGui.Selectable(Language.Context_InviteToParty_DifferentWorld)) {
|
if (validContentId && ImGui.Selectable(Language.Context_InviteToParty_DifferentWorld)) {
|
||||||
this.Ui.Plugin.Functions.Party.InviteOtherWorld(chunk.Message!.ContentId);
|
Ui.Plugin.Functions.Party.InviteOtherWorld(chunk.Message!.ContentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.EndMenu();
|
ImGui.EndMenu();
|
||||||
@@ -505,55 +510,58 @@ internal sealed class PayloadHandler {
|
|||||||
|
|
||||||
if (isInParty && member != null && (!inInstance || (inInstance && inPartyInstance))) {
|
if (isInParty && member != null && (!inInstance || (inInstance && inPartyInstance))) {
|
||||||
if (ImGui.Selectable(Language.Context_Promote)) {
|
if (ImGui.Selectable(Language.Context_Promote)) {
|
||||||
this.Ui.Plugin.Functions.Party.Promote(player.PlayerName, (ulong) member.ContentId);
|
Ui.Plugin.Functions.Party.Promote(player.PlayerName, (ulong) member.ContentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_KickFromParty)) {
|
if (ImGui.Selectable(Language.Context_KickFromParty)) {
|
||||||
this.Ui.Plugin.Functions.Party.Kick(player.PlayerName, (ulong) member.ContentId);
|
Ui.Plugin.Functions.Party.Kick(player.PlayerName, (ulong) member.ContentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var isFriend = this.Ui.Plugin.Common.Functions.FriendList.List.Any(friend => friend.Name.TextValue == player.PlayerName && friend.HomeWorld == world.RowId);
|
var isFriend = Ui.Plugin.Common.Functions.FriendList.List.Any(friend => friend.Name.TextValue == player.PlayerName && friend.HomeWorld == world.RowId);
|
||||||
if (!isFriend && ImGui.Selectable(Language.Context_SendFriendRequest)) {
|
if (!isFriend && ImGui.Selectable(Language.Context_SendFriendRequest)) {
|
||||||
this.Ui.Plugin.Functions.SendFriendRequest(player.PlayerName, (ushort) world.RowId);
|
Ui.Plugin.Functions.SendFriendRequest(player.PlayerName, (ushort) world.RowId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_AddToBlacklist)) {
|
if (ImGui.Selectable(Language.Context_AddToBlacklist)) {
|
||||||
this.Ui.Plugin.Functions.AddToBlacklist(player.PlayerName, (ushort) world.RowId);
|
Ui.Plugin.Functions.AddToBlacklist(player.PlayerName, (ushort) world.RowId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.Ui.Plugin.Functions.IsMentor() && ImGui.Selectable(Language.Context_InviteToNoviceNetwork)) {
|
if (Ui.Plugin.Functions.IsMentor() && ImGui.Selectable(Language.Context_InviteToNoviceNetwork)) {
|
||||||
this.Ui.Plugin.Functions.Context.InviteToNoviceNetwork(player.PlayerName, (ushort) world.RowId);
|
Ui.Plugin.Functions.Context.InviteToNoviceNetwork(player.PlayerName, (ushort) world.RowId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var inputChannel = chunk.Message?.Code.Type.ToInputChannel();
|
var inputChannel = chunk.Message?.Code.Type.ToInputChannel();
|
||||||
if (inputChannel != null && ImGui.Selectable(Language.Context_ReplyInSelectedChatMode)) {
|
if (inputChannel != null && ImGui.Selectable(Language.Context_ReplyInSelectedChatMode)) {
|
||||||
this.Ui.Plugin.Functions.Chat.SetChannel(inputChannel.Value);
|
Ui.Plugin.Functions.Chat.SetChannel(inputChannel.Value);
|
||||||
this.Log.Activate = true;
|
Log.Activate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.Selectable(Language.Context_Target) && this.FindCharacterForPayload(player) is { } obj) {
|
if (ImGui.Selectable(Language.Context_Target) && FindCharacterForPayload(player) is { } obj) {
|
||||||
Plugin.TargetManager.Target = obj;
|
Plugin.TargetManager.Target = obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (validContentId && ImGui.Selectable(Language.Context_AdventurerPlate))
|
||||||
|
{
|
||||||
|
if (!Ui.Plugin.Functions.TryOpenAdventurerPlate(chunk.Message!.ContentId))
|
||||||
|
WrapperUtil.AddNotification(Language.Context_AdventurerPlateError, NotificationType.Warning);
|
||||||
|
}
|
||||||
|
|
||||||
// View Party Finder 0x2E
|
// View Party Finder 0x2E
|
||||||
}
|
}
|
||||||
|
|
||||||
private PlayerCharacter? FindCharacterForPayload(PlayerPayload payload) {
|
private PlayerCharacter? FindCharacterForPayload(PlayerPayload payload) {
|
||||||
foreach (var obj in Plugin.ObjectTable) {
|
foreach (var obj in Plugin.ObjectTable) {
|
||||||
if (obj is not PlayerCharacter character) {
|
if (obj is not PlayerCharacter character)
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if (character.Name.TextValue != payload.PlayerName) {
|
if (character.Name.TextValue != payload.PlayerName)
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if (payload.World.IsPublic && character.HomeWorld.Id != payload.World.RowId) {
|
if (payload.World.IsPublic && character.HomeWorld.Id != payload.World.RowId)
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
return character;
|
return character;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public sealed class Plugin : IDalamudPlugin {
|
|||||||
[PluginService] internal static ITextureProvider TextureProvider { get; private set; } = null!;
|
[PluginService] internal static ITextureProvider TextureProvider { get; private set; } = null!;
|
||||||
[PluginService] internal static IGameInteropProvider GameInteropProvider { get; private set; } = null!;
|
[PluginService] internal static IGameInteropProvider GameInteropProvider { get; private set; } = null!;
|
||||||
[PluginService] internal static IGameConfig GameConfig { get; private set; } = null!;
|
[PluginService] internal static IGameConfig GameConfig { get; private set; } = null!;
|
||||||
|
[PluginService] internal static INotificationManager Notification { get; private set; } = null!;
|
||||||
|
|
||||||
internal Configuration Config { get; }
|
internal Configuration Config { get; }
|
||||||
internal Commands Commands { get; }
|
internal Commands Commands { get; }
|
||||||
|
|||||||
Generated
+2017
-1244
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</resheader>
|
<resheader name="version">2.0</resheader>
|
||||||
@@ -26,36 +26,36 @@
|
|||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
value : The object must be serialized into a byte array
|
value : The object must be serialized into a byte array
|
||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
@@ -862,4 +862,10 @@
|
|||||||
<data name="Migration_Line4">
|
<data name="Migration_Line4">
|
||||||
<value>Do not close FFXIV, unload Dalamud, or turn off your computer during this time.</value>
|
<value>Do not close FFXIV, unload Dalamud, or turn off your computer during this time.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Context_AdventurerPlate" xml:space="preserve">
|
||||||
|
<value>View Adventurer Plate</value>
|
||||||
|
</data>
|
||||||
|
<data name="Context_AdventurerPlateError" xml:space="preserve">
|
||||||
|
<value>Unable to open adventurer plate at this moment</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
|
using Dalamud.Interface.Internal.Notifications;
|
||||||
|
|
||||||
|
namespace ChatTwo.Util;
|
||||||
|
|
||||||
|
public static class WrapperUtil
|
||||||
|
{
|
||||||
|
public static void AddNotification(string content, NotificationType type, bool minimized = true)
|
||||||
|
{
|
||||||
|
Plugin.Notification.AddNotification(new Notification { Content = content, Type = type, Minimized = minimized });
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user