Fix linkshell rotation

This commit is contained in:
Infi
2024-11-17 19:16:21 +01:00
parent bf27d3e853
commit a648bcf60d
5 changed files with 12 additions and 13 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<Version>1.29.6</Version> <Version>1.29.7</Version>
<TargetFramework>net8.0-windows</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
+1 -1
View File
@@ -39,7 +39,7 @@ internal static unsafe class Party
return; return;
} }
InfoProxyPartyInvite.Instance()->InviteToPartyInInstance(contentId); InfoProxyPartyInvite.Instance()->InviteToPartyInInstanceByContentId(contentId);
} }
internal static void Kick(string name, ulong contentId) internal static void Kick(string name, ulong contentId)
+2 -1
View File
@@ -20,6 +20,7 @@ using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET; using ImGuiNET;
using Lumina.Excel.Sheets; using Lumina.Excel.Sheets;
using Action = System.Action; using Action = System.Action;
using DalamudPartyFinderPayload = Dalamud.Game.Text.SeStringHandling.Payloads.PartyFinderPayload; using DalamudPartyFinderPayload = Dalamud.Game.Text.SeStringHandling.Payloads.PartyFinderPayload;
using ChatTwoPartyFinderPayload = ChatTwo.Util.PartyFinderPayload; using ChatTwoPartyFinderPayload = ChatTwo.Util.PartyFinderPayload;
@@ -200,7 +201,7 @@ public sealed class PayloadHandler {
internal void Click(Chunk chunk, Payload? payload, ImGuiMouseButton button) internal void Click(Chunk chunk, Payload? payload, ImGuiMouseButton button)
{ {
if (Plugin.Config.PlaySounds) if (Plugin.Config.PlaySounds)
UIModule.PlaySound(PopupSfx); UIGlobals.PlaySoundEffect(PopupSfx);
switch (button) switch (button)
{ {
+7 -9
View File
@@ -19,7 +19,6 @@ using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface.Windowing; using Dalamud.Interface.Windowing;
using Dalamud.Memory; using Dalamud.Memory;
using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using ImGuiNET; using ImGuiNET;
using Lumina.Excel.Sheets; using Lumina.Excel.Sheets;
@@ -133,7 +132,7 @@ public sealed class ChatLogWindow : Window
Activate = true; Activate = true;
PlayedClosingSound = false; PlayedClosingSound = false;
if (Plugin.Config.PlaySounds) if (Plugin.Config.PlaySounds)
UIModule.PlaySound(ChatOpenSfx); UIGlobals.PlaySoundEffect(ChatOpenSfx);
// Don't set the channel or text content when activating a disabled tab. // Don't set the channel or text content when activating a disabled tab.
if (Plugin.CurrentTab.InputDisabled) if (Plugin.CurrentTab.InputDisabled)
@@ -182,20 +181,21 @@ public sealed class ChatLogWindow : Window
if (info.Channel is InputChannel.Linkshell1 or InputChannel.CrossLinkshell1 && info.Rotate != RotateMode.None) if (info.Channel is InputChannel.Linkshell1 or InputChannel.CrossLinkshell1 && info.Rotate != RotateMode.None)
{ {
var module = UIModule.Instance();
// If any of these operations fail, do nothing. // If any of these operations fail, do nothing.
targetChannel = null;
if (info.Permanent) if (info.Permanent)
{ {
// Rotate using the game's code. // Rotate using the game's code.
if (info.Channel == InputChannel.Linkshell1) if (info.Channel == InputChannel.Linkshell1)
{ {
GameFunctions.Chat.RotateLinkshellHistory(info.Rotate); GameFunctions.Chat.RotateLinkshellHistory(info.Rotate);
targetChannel = (InputChannel) AgentChatLog.Instance()->CurrentChannel; targetChannel = info.Channel + (uint)module->LinkshellCycle;
} }
else else
{ {
GameFunctions.Chat.RotateCrossLinkshellHistory(info.Rotate); GameFunctions.Chat.RotateCrossLinkshellHistory(info.Rotate);
targetChannel = (InputChannel)AgentChatLog.Instance()->CurrentChannel; targetChannel = info.Channel + (uint)module->CrossWorldLinkshellCycle;
} }
} }
else else
@@ -211,9 +211,7 @@ public sealed class ChatLogWindow : Window
} }
if (info.Permanent) if (info.Permanent)
{
SetChannel(targetChannel); SetChannel(targetChannel);
}
else else
Plugin.CurrentTab.CurrentChannel.TempChannel = targetChannel.Value; Plugin.CurrentTab.CurrentChannel.TempChannel = targetChannel.Value;
} }
@@ -658,7 +656,7 @@ public sealed class ChatLogWindow : Window
if (Plugin.Config.PlaySounds && !PlayedClosingSound) if (Plugin.Config.PlaySounds && !PlayedClosingSound)
{ {
PlayedClosingSound = true; PlayedClosingSound = true;
UIModule.PlaySound(ChatCloseSfx); UIGlobals.PlaySoundEffect(ChatCloseSfx);
} }
if (Plugin.CurrentTab.CurrentChannel.UseTempChannel) if (Plugin.CurrentTab.CurrentChannel.UseTempChannel)
@@ -1529,7 +1527,7 @@ public sealed class ChatLogWindow : Window
if (Plugin.Config.PlaySounds && PlayedClosingSound) if (Plugin.Config.PlaySounds && PlayedClosingSound)
{ {
PlayedClosingSound = false; PlayedClosingSound = false;
UIModule.PlaySound(ChatOpenSfx); UIGlobals.PlaySoundEffect(ChatOpenSfx);
} }
var ptr = new ImGuiInputTextCallbackDataPtr(data); var ptr = new ImGuiInputTextCallbackDataPtr(data);
+1 -1
View File
@@ -36,7 +36,7 @@ public static class GlobalParametersCache
Cache = new int[gp.MySize]; Cache = new int[gp.MySize];
for (ulong i = 0; i < gp.MySize; i++) for (ulong i = 0; i < gp.MySize; i++)
{ {
var p = gp.Get(i); var p = gp[(long)i];
if (p.Type == TextParameterType.Integer) if (p.Type == TextParameterType.Integer)
Cache[(int)i] = p.IntValue; Cache[(int)i] = p.IntValue;
else else