Updates for v9, begin ui rework
This commit is contained in:
@@ -2,6 +2,9 @@ using Craftimizer.Simulator;
|
||||
using Craftimizer.Simulator.Actions;
|
||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||
using Dalamud.Utility;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.UI;
|
||||
using ImGuiScene;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
using System;
|
||||
@@ -10,8 +13,10 @@ using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using Action = Lumina.Excel.GeneratedSheets.Action;
|
||||
using ActionType = Craftimizer.Simulator.Actions.ActionType;
|
||||
using ClassJob = Craftimizer.Simulator.ClassJob;
|
||||
using Condition = Craftimizer.Simulator.Condition;
|
||||
using Status = Lumina.Excel.GeneratedSheets.Status;
|
||||
|
||||
namespace Craftimizer.Plugin;
|
||||
|
||||
@@ -85,11 +90,11 @@ internal static class ActionUtils
|
||||
{
|
||||
var (craftAction, action) = GetActionRow(me, classJob);
|
||||
if (craftAction != null)
|
||||
return Icons.GetIconFromId(craftAction.Icon);
|
||||
return Service.IconManager.GetIcon(craftAction.Icon);
|
||||
if (action != null)
|
||||
return Icons.GetIconFromId(action.Icon);
|
||||
return Service.IconManager.GetIcon(action.Icon);
|
||||
// Old "Steady Hand" action icon
|
||||
return Icons.GetIconFromId(1953);
|
||||
return Service.IconManager.GetIcon(1953);
|
||||
}
|
||||
|
||||
public static ActionType? GetActionTypeFromId(uint actionId, ClassJob classJob, bool isCraftAction)
|
||||
@@ -145,12 +150,24 @@ internal static class ClassJobUtils
|
||||
public static sbyte GetExpArrayIdx(this ClassJob me) =>
|
||||
LuminaSheets.ClassJobSheet.GetRow(me.GetClassJobIndex())!.ExpArrayIndex;
|
||||
|
||||
public static string GetName(this ClassJob classJob)
|
||||
public static unsafe short GetPlayerLevel(this ClassJob me) =>
|
||||
PlayerState.Instance()->ClassJobLevelArray[me.GetExpArrayIdx()];
|
||||
|
||||
public static unsafe bool CanPlayerUseManipulation(this ClassJob me) =>
|
||||
ActionManager.CanUseActionOnTarget(ActionType.Manipulation.GetId(me), (GameObject*)Service.ClientState.LocalPlayer!.Address);
|
||||
|
||||
public static string GetName(this ClassJob me)
|
||||
{
|
||||
var job = LuminaSheets.ClassJobSheet.GetRow(classJob.GetClassJobIndex())!;
|
||||
var job = LuminaSheets.ClassJobSheet.GetRow(me.GetClassJobIndex())!;
|
||||
return CultureInfo.InvariantCulture.TextInfo.ToTitleCase(job.Name.ToDalamudString().TextValue);
|
||||
}
|
||||
|
||||
public static Quest GetUnlockQuest(this ClassJob me) =>
|
||||
LuminaSheets.QuestSheet.GetRow(65720 + (uint)me) ?? throw new ArgumentException($"Could not get unlock quest for {me}", nameof(me));
|
||||
|
||||
public static ushort GetIconId(this ClassJob me) =>
|
||||
(ushort)(62100 + me.GetClassJobIndex());
|
||||
|
||||
public static bool IsClassJob(this ClassJobCategory me, ClassJob classJob) =>
|
||||
classJob switch
|
||||
{
|
||||
@@ -303,7 +320,7 @@ internal static class EffectUtils
|
||||
}
|
||||
|
||||
public static TextureWrap GetIcon(this EffectType me, int strength) =>
|
||||
Icons.GetIconFromId(me.GetIconId(strength));
|
||||
Service.IconManager.GetIcon(me.GetIconId(strength));
|
||||
|
||||
public static string GetTooltip(this EffectType me, int strength, int duration)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user