Skip to content

Commit

Permalink
Updated for Dalamud API 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspher0 committed Nov 19, 2024
1 parent 6ce889c commit 78af72f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 22 deletions.
10 changes: 5 additions & 5 deletions repo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
"Name": "FFXIV Vibe Plugin",
"Description": "Plugin that let you vibe your controller or toys",
"InternalName": "FFXIV_Vibe_Plugin",
"AssemblyVersion": "3.0.0.0",
"AssemblyVersion": "3.1.0.0",
"RepoUrl": "https://github.com/Aspher0/FFXIV_Vibe_Plugin",
"ApplicableVersion": "any",
"Tags": [
"vibe",
"vibration",
"wave"
],
"DalamudApiLevel": 10,
"DalamudApiLevel": 11,
"IconUrl": "https://github.com/Aspher0/FFXIV_Vibe_Plugin/raw/master/images/icon.png",
"IsHide": "False",
"IsTestingExclusive": "False",
"DownloadCount": 10900,
"DownloadLinkInstall": "https://github.com/Aspher0/FFXIV_Vibe_Plugin/releases/download/v3.0.0.0/latest.zip",
"DownloadLinkTesting": "https://github.com/Aspher0/FFXIV_Vibe_Plugin/releases/download/v3.0.0.0/latest.zip",
"DownloadLinkUpdate": "https://github.com/Aspher0/FFXIV_Vibe_Plugin/releases/download/v3.0.0.0/latest.zip"
"DownloadLinkInstall": "https://github.com/Aspher0/FFXIV_Vibe_Plugin/releases/download/v3.1.0.0/latest.zip",
"DownloadLinkTesting": "https://github.com/Aspher0/FFXIV_Vibe_Plugin/releases/download/v3.1.0.0/latest.zip",
"DownloadLinkUpdate": "https://github.com/Aspher0/FFXIV_Vibe_Plugin/releases/download/v3.1.0.0/latest.zip"
}
]
29 changes: 17 additions & 12 deletions src/FFXIV_Vibe_Plugin/App/Hooks/ActionEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using Dalamud.Plugin.Services;
using FFXIV_Vibe_Plugin.Commons;
using Lumina.Excel;
using Lumina.Excel.GeneratedSheets;
using Lumina.Text;
using Lumina.Text.ReadOnly;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
Expand All @@ -21,7 +21,7 @@ internal class ActionEffect
private readonly IClientState ClientState;
private readonly IObjectTable GameObjects;
private readonly IGameInteropProvider InteropProvider;
private readonly ExcelSheet<Lumina.Excel.GeneratedSheets.Action>? LuminaActionSheet;
private readonly ExcelSheet<Lumina.Excel.Sheets.Action>? LuminaActionSheet;
private Hook<ActionEffect.HOOK_ReceiveActionEffectDelegate> receiveActionEffectHook;

public event EventHandler<HookActionEffects_ReceivedEventArgs>? ReceivedEvent;
Expand All @@ -43,7 +43,7 @@ public ActionEffect(
this.InitHook();
if (this.DataManager == null)
return;
this.LuminaActionSheet = this.DataManager.GetExcelSheet<Lumina.Excel.GeneratedSheets.Action>();
this.LuminaActionSheet = this.DataManager.GetExcelSheet<Lumina.Excel.Sheets.Action>();
}

public void Dispose()
Expand Down Expand Up @@ -201,30 +201,35 @@ private string GetSpellName(uint actionId, bool withId)
this.Logger.Warn("HookActionEffect.GetSpellName: LuminaActionSheet is null");
return "***LUMINA ACTION SHEET NOT LOADED***";
}
Lumina.Excel.GeneratedSheets.Action row = this.LuminaActionSheet.GetRow(actionId); // A VERIFIER
string spellName = "";
if (row != null)

try
{
Lumina.Excel.Sheets.Action row = this.LuminaActionSheet.GetRow(actionId);
string spellName = "";

DefaultInterpolatedStringHandler interpolatedStringHandler;
if (withId)
{
interpolatedStringHandler = new DefaultInterpolatedStringHandler(1, 1);
interpolatedStringHandler.AppendFormatted<uint>(((ExcelRow)row).RowId);
interpolatedStringHandler.AppendFormatted<uint>(row.RowId);
interpolatedStringHandler.AppendLiteral(":");
spellName = interpolatedStringHandler.ToStringAndClear();
}
if (row.Name != null)
if (!row.Name.IsEmpty)
{
string str = spellName;
interpolatedStringHandler = new DefaultInterpolatedStringHandler(0, 1);
interpolatedStringHandler.AppendFormatted<SeString>(row.Name);
interpolatedStringHandler.AppendFormatted<ReadOnlySeString>(row.Name);
string stringAndClear = interpolatedStringHandler.ToStringAndClear();
spellName = str + stringAndClear;
}

return spellName;
}
catch (ArgumentOutOfRangeException)
{
return "!Unknown Spell Name!";
}
else
spellName = "!Unknown Spell Name!";
return spellName;
}

private string GetCharacterNameFromSourceId(int sourceId)
Expand Down
2 changes: 1 addition & 1 deletion src/FFXIV_Vibe_Plugin/App/UI/PluginUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public PluginUI(
TriggersController triggersController,
Patterns Patterns,
Premium premium)
: base("FFXIV_Vibe_Plugin_UI", (ImGuiWindowFlags)56, false)
: base("FFXIV Vibe Plugin", (ImGuiWindowFlags)56, false)
{
ImGui.SetNextWindowPos(new Vector2(100f, 100f), (ImGuiCond)8);
ImGui.SetNextWindowSize(new Vector2((float)this.WIDTH, (float)this.HEIGHT), (ImGuiCond)8);
Expand Down
2 changes: 1 addition & 1 deletion src/FFXIV_Vibe_Plugin/FFXIV_Vibe_Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<Authors>Kaciexx</Authors>
<Company></Company>
<Version>3.0.0.0</Version>
<Version>3.1.0.0</Version>
<Description>Plugin that let you vibe your controller or toys</Description>
<Copyright></Copyright>
<PackageProjectUrl>https://github.com/Aspher0/FFXIV_Vibe_Plugin</PackageProjectUrl>
Expand Down
6 changes: 3 additions & 3 deletions src/FFXIV_Vibe_Plugin/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
},
"DalamudPackager": {
"type": "Direct",
"requested": "[2.1.13, )",
"resolved": "2.1.13",
"contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ=="
"requested": "[11.0.0, )",
"resolved": "11.0.0",
"contentHash": "bjT7XUlhIJSmsE/O76b7weUX+evvGQctbQB8aKXt94o+oPWxHpCepxAGMs7Thow3AzCyqWs7cOpp9/2wcgRRQA=="
},
"DebounceThrottle": {
"type": "Direct",
Expand Down

0 comments on commit 78af72f

Please sign in to comment.