7.1 Updates

This commit is contained in:
Asriel Camora
2024-11-24 01:01:06 -08:00
parent feb046bf7b
commit 100f430e39
17 changed files with 69 additions and 105 deletions
+4 -4
View File
@@ -17,10 +17,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.dotTrace" Version="0.13.10" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.10" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.163">
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.dotTrace" Version="0.14.0" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.179">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
+2 -5
View File
@@ -38,12 +38,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.13" />
<PackageReference Include="ExdSheets" Version="2.1.0" />
<PackageReference Include="Lumina" Version="4.1.1" ExcludeAssets="all" />
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="9.0.0-preview.1.24081.5" ExcludeAssets="all" />
<PackageReference Include="DalamudPackager" Version="11.0.0" />
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.163">
<PackageReference Include="Meziantou.Analyzer" Version="2.0.179">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
+18 -19
View File
@@ -1,27 +1,26 @@
using Dalamud.Utility;
using ExdSheets;
using ExdSheets.Sheets;
using Lumina.Data;
using Lumina.Excel;
using Lumina.Excel.Sheets;
namespace Craftimizer.Plugin;
public static class LuminaSheets
{
private static readonly Module Module = new(Service.DataManager.GameData, Service.DataManager.Language.ToLumina());
private static readonly ExcelModule Module = Service.DataManager.GameData.Excel;
public static readonly Sheet<Recipe> RecipeSheet = Module.GetSheet<Recipe>();
public static readonly Sheet<Action> ActionSheet = Module.GetSheet<Action>();
public static readonly Sheet<CraftAction> CraftActionSheet = Module.GetSheet<CraftAction>();
public static readonly Sheet<Status> StatusSheet = Module.GetSheet<Status>();
public static readonly Sheet<Addon> AddonSheet = Module.GetSheet<Addon>();
public static readonly Sheet<ClassJob> ClassJobSheet = Module.GetSheet<ClassJob>();
public static readonly Sheet<Item> ItemSheet = Module.GetSheet<Item>();
public static readonly Sheet<Item> ItemSheetEnglish = Module.GetSheet<Item>(Language.English)!;
public static readonly Sheet<ENpcResident> ENpcResidentSheet = Module.GetSheet<ENpcResident>();
public static readonly Sheet<Level> LevelSheet = Module.GetSheet<Level>();
public static readonly Sheet<Quest> QuestSheet = Module.GetSheet<Quest>();
public static readonly Sheet<Materia> MateriaSheet = Module.GetSheet<Materia>();
public static readonly Sheet<BaseParam> BaseParamSheet = Module.GetSheet<BaseParam>();
public static readonly Sheet<ItemFood> ItemFoodSheet = Module.GetSheet<ItemFood>();
public static readonly Sheet<SatisfactionSupply> SatisfactionSupplySheet = Module.GetSheet<SatisfactionSupply>();
public static readonly ExcelSheet<Recipe> RecipeSheet = Module.GetSheet<Recipe>();
public static readonly ExcelSheet<Action> ActionSheet = Module.GetSheet<Action>();
public static readonly ExcelSheet<CraftAction> CraftActionSheet = Module.GetSheet<CraftAction>();
public static readonly ExcelSheet<Status> StatusSheet = Module.GetSheet<Status>();
public static readonly ExcelSheet<Addon> AddonSheet = Module.GetSheet<Addon>();
public static readonly ExcelSheet<ClassJob> ClassJobSheet = Module.GetSheet<ClassJob>();
public static readonly ExcelSheet<Item> ItemSheet = Module.GetSheet<Item>();
public static readonly ExcelSheet<Item> ItemSheetEnglish = Module.GetSheet<Item>(Language.English)!;
public static readonly ExcelSheet<ENpcResident> ENpcResidentSheet = Module.GetSheet<ENpcResident>();
public static readonly ExcelSheet<Level> LevelSheet = Module.GetSheet<Level>();
public static readonly ExcelSheet<Quest> QuestSheet = Module.GetSheet<Quest>();
public static readonly ExcelSheet<Materia> MateriaSheet = Module.GetSheet<Materia>();
public static readonly ExcelSheet<BaseParam> BaseParamSheet = Module.GetSheet<BaseParam>();
public static readonly ExcelSheet<ItemFood> ItemFoodSheet = Module.GetSheet<ItemFood>();
public static readonly SubrowExcelSheet<SatisfactionSupply> SatisfactionSupplySheet = Module.GetSubrowSheet<SatisfactionSupply>();
}
+7 -7
View File
@@ -5,15 +5,15 @@ using System;
using System.Linq;
using System.Numerics;
using System.Text;
using Action = ExdSheets.Sheets.Action;
using Action = Lumina.Excel.Sheets.Action;
using ActionType = Craftimizer.Simulator.Actions.ActionType;
using ClassJob = Craftimizer.Simulator.ClassJob;
using Condition = Craftimizer.Simulator.Condition;
using Status = ExdSheets.Sheets.Status;
using Status = Lumina.Excel.Sheets.Status;
using Craftimizer.Utils;
using ExdSheets.Sheets;
using Lumina.Text.ReadOnly;
using Lumina.Text.Payloads;
using Lumina.Excel.Sheets;
namespace Craftimizer.Plugin;
@@ -29,7 +29,7 @@ internal static class ActionUtils
foreach (var actionType in actionTypes)
{
var actionId = actionType.Base().ActionId;
if (LuminaSheets.CraftActionSheet.TryGetRow(actionId) is { } baseCraftAction)
if (LuminaSheets.CraftActionSheet.GetRowOrDefault(actionId) is { } baseCraftAction)
{
foreach (var classJob in classJobs)
{
@@ -47,7 +47,7 @@ internal static class ActionUtils
}, null);
}
}
if (LuminaSheets.ActionSheet.TryGetRow(actionId) is { } baseAction)
if (LuminaSheets.ActionSheet.GetRowOrDefault(actionId) is { } baseAction)
{
var possibleActions = LuminaSheets.ActionSheet.Where(r =>
r.Icon == baseAction.Icon &&
@@ -327,13 +327,13 @@ internal static class EffectUtils
public static Status Status(this EffectType me) =>
LuminaSheets.StatusSheet.GetRow(me.StatusId())!;
public static ushort GetIconId(this EffectType me, int strength)
public static uint GetIconId(this EffectType me, int strength)
{
var status = me.Status();
var iconId = status.Icon;
if (status.MaxStacks != 0)
iconId += (uint)Math.Clamp(strength, 1, status.MaxStacks) - 1;
return (ushort)iconId;
return iconId;
}
public static ITextureIcon GetIcon(this EffectType me, int strength) =>
+1 -1
View File
@@ -11,7 +11,7 @@ public sealed unsafe class Chat
{
private delegate void SendChatDelegate(UIModule* @this, Utf8String* message, Utf8String* historyMessage, bool pushToHistory);
[Signature("48 89 5C 24 ?? 57 48 83 EC 20 48 8B FA 48 8B D9 45 84 C9")]
[Signature("48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 20 48 8B F2 48 8B F9 45 84 C9")]
private readonly SendChatDelegate sendChat = null!;
public Chat()
+2 -2
View File
@@ -1,5 +1,5 @@
using Craftimizer.Plugin;
using ExdSheets.Sheets;
using Lumina.Excel.Sheets;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.Immutable;
@@ -36,7 +36,7 @@ public static class FoodStatus
if (itemAction.Type is not (844 or 845 or 846))
continue;
if (LuminaSheets.ItemFoodSheet.TryGetRow(itemAction.Data[1]) is not { } itemFood)
if (LuminaSheets.ItemFoodSheet.GetRowOrDefault(itemAction.Data[1]) is not { } itemFood)
continue;
FoodStat? craftsmanship = null, control = null, cp = null;
+1 -1
View File
@@ -2,7 +2,7 @@ using Craftimizer.Simulator;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using ExdSheets.Sheets;
using Lumina.Excel.Sheets;
using System;
using System.Linq;
using Craftimizer.Plugin;
+2 -2
View File
@@ -37,7 +37,7 @@ public sealed unsafe class Hooks : IDisposable
var ret = UseActionHook.Original(manager, actionType, actionId, targetId, extraParam, mode, comboRouteId, optOutAreaTargeted);
if (canCast && ret && actionType is CSActionType.CraftAction or CSActionType.Action)
{
var classJob = ClassJobUtils.GetClassJobFromIdx((byte)(Service.ClientState.LocalPlayer?.ClassJob.Id ?? 0));
var classJob = ClassJobUtils.GetClassJobFromIdx((byte)(Service.ClientState.LocalPlayer?.ClassJob.RowId ?? 0));
if (classJob != null)
{
var simActionType = ActionUtils.GetActionTypeFromId(actionId, classJob.Value, actionType == CSActionType.CraftAction);
@@ -75,7 +75,7 @@ public sealed unsafe class Hooks : IDisposable
if (actionType is not (CSActionType.CraftAction or CSActionType.Action))
return ret;
var jobId = Service.ClientState.LocalPlayer?.ClassJob.Id;
var jobId = Service.ClientState.LocalPlayer?.ClassJob.RowId;
if (jobId == null)
return ret;
+1 -1
View File
@@ -183,7 +183,7 @@ public static class MacroCopy
var module = RaptureMacroModule.Instance();
var macro = module->GetMacro(set, (uint)idx);
if (macro->IsEmpty())
if (!macro->IsNotEmpty())
{
macro->Name.SetString($"Craftimizer Macro {macroIdx}");
macro->SetIcon((uint)(macroIdx > 10 ? 66161 : (66161 + macroIdx)));
+8 -10
View File
@@ -1,6 +1,6 @@
using Craftimizer.Plugin;
using Craftimizer.Simulator;
using ExdSheets.Sheets;
using Lumina.Excel.Sheets;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -27,7 +27,7 @@ public sealed record RecipeData
{
RecipeId = recipeId;
Recipe = LuminaSheets.RecipeSheet.TryGetRow(recipeId) ??
Recipe = LuminaSheets.RecipeSheet.GetRowOrDefault(recipeId) ??
throw new ArgumentException($"Invalid recipe id {recipeId}", nameof(recipeId));
Table = Recipe.RecipeLevelTable.Value;
@@ -47,9 +47,9 @@ public sealed record RecipeData
};
int[]? thresholds = null;
if (Recipe.CollectableMetadata.TryGetValue<CollectablesShopRefine>() is { } row)
if (Recipe.CollectableMetadata.GetValueOrDefault<CollectablesShopRefine>() is { } row)
thresholds = [row.LowCollectability, row.MidCollectability, row.HighCollectability];
else if (Recipe.CollectableMetadata.TryGetValue<HWDCrafterSupply>() is { } row2)
else if (Recipe.CollectableMetadata.GetValueOrDefault<HWDCrafterSupply>() is { } row2)
{
foreach (var entry in row2.HWDCrafterSupplyParams)
{
@@ -60,12 +60,10 @@ public sealed record RecipeData
}
}
}
else if (Recipe.CollectableMetadata.TryGetValue<SatisfactionSupply>() is { } row3)
else if (Recipe.CollectableMetadata.GetValueOrDefaultSubrow<SatisfactionSupply>() is { } row3)
{
var subrowCount = LuminaSheets.SatisfactionSupplySheet.GetSubrowCount(row3.RowId);
for (ushort i = 0; i < subrowCount; ++i)
foreach (var subrow in row3)
{
var subrow = LuminaSheets.SatisfactionSupplySheet.GetRow(row3.RowId, i);
if (subrow.Item.RowId == Recipe.ItemResult.RowId)
{
thresholds = [subrow.CollectabilityLow, subrow.CollectabilityMid, subrow.CollectabilityHigh];
@@ -73,7 +71,7 @@ public sealed record RecipeData
}
}
}
else if (Recipe.CollectableMetadata.TryGetValue<SharlayanCraftWorksSupply>() is { } row5)
else if (Recipe.CollectableMetadata.GetValueOrDefault<SharlayanCraftWorksSupply>() is { } row5)
{
foreach (var item in row5.Item)
{
@@ -84,7 +82,7 @@ public sealed record RecipeData
}
}
}
else if (Recipe.CollectableMetadata.TryGetValue<CollectablesRefine>() is { } row6)
else if (Recipe.CollectableMetadata.GetValueOrDefault<CollectablesRefine>() is { } row6)
{
if (row6.CollectabilityHigh != 0)
thresholds = [row6.CollectabilityLow, row6.CollectabilityMid, row6.CollectabilityHigh];
+2 -2
View File
@@ -22,7 +22,7 @@ using System.Threading;
using System.Threading.Tasks;
using Sim = Craftimizer.Simulator.Simulator;
using SimNoRandom = Craftimizer.Simulator.SimulatorNoRandom;
using Recipe = ExdSheets.Sheets.Recipe;
using Recipe = Lumina.Excel.Sheets.Recipe;
namespace Craftimizer.Windows;
@@ -586,7 +586,7 @@ public sealed class MacroEditor : Window, IDisposable
if (input.ItemId == 0)
return "None";
var name = LuminaSheets.ItemSheet.TryGetRow(input.ItemId)?.Name.ExtractText() ?? $"Unknown ({input.ItemId})";
var name = LuminaSheets.ItemSheet.GetRowOrDefault(input.ItemId)?.Name.ExtractText() ?? $"Unknown ({input.ItemId})";
return input.IsHQ ? $"{name} (HQ)" : name;
}
+3 -5
View File
@@ -1097,23 +1097,21 @@ public sealed unsafe class RecipeNote : Window, IDisposable
private static (string NpcName, string Territory, Vector2 MapLocation, MapLinkPayload Payload) ResolveLevelData(uint levelRowId)
{
var level = LuminaSheets.LevelSheet.TryGetRow(levelRowId) ??
throw new ArgumentNullException(nameof(levelRowId), $"Invalid level row {levelRowId}");
var level = LuminaSheets.LevelSheet.GetRow(levelRowId);
var territory = level.Territory.Value.PlaceName.Value.Name.ExtractText();
var location = WorldToMap2(new(level.X, level.Z), level.Map.Value!);
return (ResolveNpcResidentName(level.Object.RowId), territory, location, new(level.Territory.RowId, level.Map.RowId, location.X, location.Y));
}
private static Vector2 WorldToMap2(Vector2 worldCoordinates, ExdSheets.Sheets.Map map)
private static Vector2 WorldToMap2(Vector2 worldCoordinates, Lumina.Excel.Sheets.Map map)
{
return MapUtil.WorldToMap(worldCoordinates, map.OffsetX, map.OffsetY, map.SizeFactor);
}
private static string ResolveNpcResidentName(uint npcRowId)
{
var resident = LuminaSheets.ENpcResidentSheet.TryGetRow(npcRowId) ??
throw new ArgumentNullException(nameof(npcRowId), $"Invalid npc row {npcRowId}");
var resident = LuminaSheets.ENpcResidentSheet.GetRow(npcRowId);
return resident.Singular.ExtractText();
}
+2 -2
View File
@@ -451,7 +451,7 @@ public sealed class Settings : Window, IDisposable
v =>
{
Config.MacroCopy.IntermediateNotificationSound = v;
UIModule.PlayChatSoundEffect((uint)v);
UIGlobals.PlayChatSoundEffect((uint)v);
},
ref isDirty
);
@@ -466,7 +466,7 @@ public sealed class Settings : Window, IDisposable
v =>
{
Config.MacroCopy.EndNotificationSound = v;
UIModule.PlayChatSoundEffect((uint)v);
UIGlobals.PlayChatSoundEffect((uint)v);
},
ref isDirty
);
+9 -33
View File
@@ -4,27 +4,9 @@
"net8.0-windows7.0": {
"DalamudPackager": {
"type": "Direct",
"requested": "[2.1.13, )",
"resolved": "2.1.13",
"contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ=="
},
"ExdSheets": {
"type": "Direct",
"requested": "[2.1.0, )",
"resolved": "2.1.0",
"contentHash": "SfvLFyL8LYsW4AzPLFVfFwtKPl9xegGraIe9oFar3IlWW8Z4kf5dkM+1CiSr/J+PQt4xt2QZc/ydZ4ibs3RosA==",
"dependencies": {
"Lumina": "4.1.1"
}
},
"Lumina": {
"type": "Direct",
"requested": "[4.1.1, )",
"resolved": "4.1.1",
"contentHash": "Hd+iTtdaPACTpViXaJ/+sQ3ZQ8MEpApCSD+mxTXnUTYDSZOAipuC4LsZqhAkLMeQHSK/R/jiXEXaXS7e0mTXyA==",
"dependencies": {
"Microsoft.Extensions.ObjectPool": "9.0.0-preview.1.24081.5"
}
"requested": "[11.0.0, )",
"resolved": "11.0.0",
"contentHash": "bjT7XUlhIJSmsE/O76b7weUX+evvGQctbQB8aKXt94o+oPWxHpCepxAGMs7Thow3AzCyqWs7cOpp9/2wcgRRQA=="
},
"MathNet.Numerics": {
"type": "Direct",
@@ -34,20 +16,14 @@
},
"Meziantou.Analyzer": {
"type": "Direct",
"requested": "[2.0.163, )",
"resolved": "2.0.163",
"contentHash": "vN0YmOkuvPLukMsefLHYCWYaLPzpc6SfoR74aPwuLeK8QdxgxkavywQ1q/II0shLEEaN1RhlMjmL1RxMPW853w=="
},
"Microsoft.Extensions.ObjectPool": {
"type": "Direct",
"requested": "[9.0.0-preview.1.24081.5, )",
"resolved": "9.0.0-preview.1.24081.5",
"contentHash": "aAR7YW+pUUdvHk3vj7GtAi71dWGDIuY9270lsmQ6lKw23zzY+r8pLP3cGNbJdlnA9VWl+S+gnIVkBCqj2ROlEg=="
"requested": "[2.0.179, )",
"resolved": "2.0.179",
"contentHash": "F5zRPPi1A1lLq4AkBxKWk32gCo9xy8b46InSBUx47gj3DZFfAYi1TtYeChBJedkDETaVKX0+0YtXh/nVAJ/aQw=="
},
"DotNext": {
"type": "Transitive",
"resolved": "5.11.0",
"contentHash": "aLWtURne05gwWFFsOg9/X1g4V5yHyuWHX5paQIN7pJIDLCbaCDHcQlLeRRvzvksjAflZJ7tTHkowN/Xi1NXPrA==",
"resolved": "5.14.0",
"contentHash": "wyRjcjQISQJpLtKTKacLKUGP80AT28WVRHq0etmFJywdeHrUfjyLgrfnSA5sk1ZcdL/55jRalRfm6MyhXOImMw==",
"dependencies": {
"System.IO.Hashing": "8.0.0"
}
@@ -64,7 +40,7 @@
"type": "Project",
"dependencies": {
"Craftimizer.Simulator": "[1.0.0, )",
"DotNext": "[5.11.0, )"
"DotNext": "[5.14.0, )"
}
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="2.0.163">
<PackageReference Include="Meziantou.Analyzer" Version="2.0.179">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
+2 -2
View File
@@ -10,8 +10,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNext" Version="5.11.0" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.163">
<PackageReference Include="DotNext" Version="5.14.0" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.179">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
+4 -8
View File
@@ -11,17 +11,13 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="2.0.163">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="Meziantou.Analyzer" Version="2.0.179">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
</ItemGroup>
<ItemGroup>