Skip to content

Commit

Permalink
7.1 / API 11 update.
Browse files Browse the repository at this point in the history
  • Loading branch information
awgil committed Nov 16, 2024
1 parent 3f138d7 commit fd55441
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Download Dalamud Latest
run: |
wget https://goatcorp.github.io/dalamud-distrib/latest.zip -O ${{ env.DALAMUD_HOME }}.zip
wget https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -O ${{ env.DALAMUD_HOME }}.zip
unzip ${{ env.DALAMUD_HOME }}.zip -d ${{ env.DALAMUD_HOME }}
- name: Restore Project
Expand All @@ -44,6 +44,6 @@ jobs:
version_number: ${{ env.tag }}
path: "vnavmesh/bin/Release/vnavmesh/latest.zip"
type: "latest"
dalamud_version: "10"
dalamud_version: "11"
env:
PUBLISHER_KEY: ${{ secrets.PUBLISHER_KEY }}
2 changes: 1 addition & 1 deletion FFXIVClientStructs
4 changes: 0 additions & 4 deletions vnavmesh/Debug/DebugContourSet.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using DotRecast.Recast;
using Lumina.Models.Models;
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using System.Numerics;
using System.Runtime.InteropServices;

namespace Navmesh.Debug;

Expand Down
2 changes: 0 additions & 2 deletions vnavmesh/Debug/DebugDrawer.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using Dalamud.Interface.Utility;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Common.Component.BGCollision.Math;
using ImGuiNET;
using Navmesh.Render;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Runtime.InteropServices;

namespace Navmesh.Debug;

Expand Down
1 change: 0 additions & 1 deletion vnavmesh/Debug/DebugGameCollision.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Dalamud.Hooking;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.LayoutEngine;
using FFXIVClientStructs.FFXIV.Client.System.Framework;
using FFXIVClientStructs.FFXIV.Common.Component.BGCollision;
Expand Down
11 changes: 5 additions & 6 deletions vnavmesh/Debug/DebugLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using FFXIVClientStructs.FFXIV.Common.Component.BGCollision;
using FFXIVClientStructs.Interop;
using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -47,9 +46,9 @@ public void Dispose()
public void Draw()
{
DrawWorld(LayoutWorld.Instance());
var terr = Service.LuminaRow<TerritoryType>(Service.ClientState.TerritoryType);
var terr = Service.LuminaRow<Lumina.Excel.Sheets.TerritoryType>(Service.ClientState.TerritoryType);
if (terr != null)
DrawFile($"Territory {Service.ClientState.TerritoryType}", $"bg/{terr.Bg}.lvb");
DrawFile($"Territory {Service.ClientState.TerritoryType}", $"bg/{terr.Value.Bg}.lvb");
DrawComparison(LayoutWorld.Instance()->ActiveLayout);
_insts.Clear();
}
Expand Down Expand Up @@ -478,15 +477,15 @@ private void DrawComparison(LayoutManager* layout)
var terrId = activeFilter != null ? activeFilter->TerritoryTypeId : layout->TerritoryTypeId;
var cfcId = activeFilter != null ? activeFilter->CfcId : layout->CfcId;

var terr = Service.LuminaRow<TerritoryType>(terrId);
var terr = Service.LuminaRow<Lumina.Excel.Sheets.TerritoryType>(terrId);
if (terr == null || layout == null)
return;

using var n = _tree.Node($"Comparison: Territory {terrId}/{cfcId} '{terr.Bg}'###comparison");
using var n = _tree.Node($"Comparison: Territory {terrId}/{cfcId} '{terr.Value.Bg}'###comparison");
if (!n.Opened)
return;

var lvb = Service.DataManager.GetFile($"bg/{terr.Bg}.lvb");
var lvb = Service.DataManager.GetFile($"bg/{terr.Value.Bg}.lvb");
if (lvb != null)
fixed (byte* lvbData = &lvb.Data[0])
FillInstancesFromFileScene(FindSection<FileSceneHeader>((FileHeader*)lvbData, 0x314E4353), activeFilter != null ? activeFilter->Key : 0, layout->ActiveFestivals);
Expand Down
7 changes: 1 addition & 6 deletions vnavmesh/NavVolume/VoxelStraighten.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;

namespace Navmesh.NavVolume;
namespace Navmesh.NavVolume;

// utility to build a 'straight' path (funnel/string-pulling) from the path returned by query
// we exploit heavily the axis-oriented nature of voxel map
Expand Down
2 changes: 1 addition & 1 deletion vnavmesh/NavmeshCustomization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class NavmeshCustomization

public NavmeshSettings Settings = new();

public virtual bool IsFlyingSupported(SceneDefinition definition) => Service.LuminaRow<Lumina.Excel.GeneratedSheets.TerritoryType>(definition.TerritoryID)?.TerritoryIntendedUse is 1 or 49 or 47; // 1 is normal outdoor, 49 is island, 47 is Diadem
public virtual bool IsFlyingSupported(SceneDefinition definition) => Service.LuminaRow<Lumina.Excel.Sheets.TerritoryType>(definition.TerritoryID)?.TerritoryIntendedUse.RowId is 1 or 49 or 47; // 1 is normal outdoor, 49 is island, 47 is Diadem

// this is a customization point to add or remove colliders in the scene
public virtual void CustomizeScene(SceneExtractor scene) { }
Expand Down
4 changes: 2 additions & 2 deletions vnavmesh/NavmeshManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private unsafe string GetCurrentKey()

var filter = LayoutUtils.FindFilter(layout);
var filterKey = filter != null ? filter->Key : 0;
var terrRow = Service.LuminaRow<Lumina.Excel.GeneratedSheets.TerritoryType>(filter != null ? filter->TerritoryTypeId : layout->TerritoryTypeId);
var terrRow = Service.LuminaRow<Lumina.Excel.Sheets.TerritoryType>(filter != null ? filter->TerritoryTypeId : layout->TerritoryTypeId);
return $"{terrRow?.Bg}//{filterKey:X}//{LayoutUtils.FestivalsString(layout->ActiveFestivals)}";
}

Expand All @@ -168,7 +168,7 @@ private unsafe string GetCacheKey(SceneDefinition scene)
var layout = LayoutWorld.Instance()->ActiveLayout;
var filter = LayoutUtils.FindFilter(layout);
var filterKey = filter != null ? filter->Key : 0;
var terrRow = Service.LuminaRow<Lumina.Excel.GeneratedSheets.TerritoryType>(filter != null ? filter->TerritoryTypeId : layout->TerritoryTypeId);
var terrRow = Service.LuminaRow<Lumina.Excel.Sheets.TerritoryType>(filter != null ? filter->TerritoryTypeId : layout->TerritoryTypeId);
return $"{terrRow?.Bg.ToString().Replace('/', '_')}__{filterKey:X}__{string.Join('.', scene.FestivalLayers.Select(id => id.ToString("X")))}";
}

Expand Down
3 changes: 2 additions & 1 deletion vnavmesh/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class Service
[PluginService] public static IGameConfig GameConfig { get; private set; } = null!;

public static Lumina.GameData LuminaGameData => DataManager.GameData;
public static T? LuminaRow<T>(uint row) where T : Lumina.Excel.ExcelRow => LuminaGameData.GetExcelSheet<T>(Lumina.Data.Language.English)?.GetRow(row);
public static Lumina.Excel.ExcelSheet<T>? LuminaSheet<T>() where T : struct, Lumina.Excel.IExcelRow<T> => LuminaGameData?.GetExcelSheet<T>(Lumina.Data.Language.English);
public static T? LuminaRow<T>(uint row) where T : struct, Lumina.Excel.IExcelRow<T> => LuminaSheet<T>()?.GetRowOrDefault(row);

public static Config Config = new();
}
6 changes: 3 additions & 3 deletions vnavmesh/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"net8.0-windows7.0": {
"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=="
},
"SharpDX.D3DCompiler": {
"type": "Direct",
Expand Down
2 changes: 1 addition & 1 deletion vnavmesh/vnavmesh.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.13" />
<PackageReference Include="DalamudPackager" Version="11.0.0" />
<PackageReference Include="SharpDX.D3DCompiler" Version="4.2.0" />
<PackageReference Include="SharpDX.Direct3D11" Version="4.2.0" />
<PackageReference Include="SharpDX.Mathematics" Version="4.2.0" />
Expand Down

0 comments on commit fd55441

Please sign in to comment.