Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1396 from Taurenkey/main
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
Taurenkey authored Jun 29, 2024
2 parents 5f65c24 + a089e2e commit 977bc7f
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 8 deletions.
10 changes: 10 additions & 0 deletions XIVSlothCombo/Attributes/CustomComboInfoAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ internal CustomComboInfoAttribute(string fancyName, string description, byte job
/// <summary> Gets the job role. </summary>
public int Role => JobIDToRole(JobID);

public uint ClassJobCategory => JobIDToClassJobCategory(JobID);

private int JobIDToRole(byte jobID)
{
if (Svc.Data.GetExcelSheet<ClassJob>().HasRow(jobID))
Expand All @@ -57,6 +59,14 @@ private int JobIDToRole(byte jobID)
return 0;
}

private uint JobIDToClassJobCategory(byte jobID)
{
if (Svc.Data.GetExcelSheet<ClassJob>().HasRow(jobID))
return Svc.Data.GetExcelSheet<ClassJob>().GetRow(jobID).ClassJobCategory.Row;

return 0;
}

/// <summary> Gets the display order. </summary>
public int Order { get; }

Expand Down
1 change: 1 addition & 0 deletions XIVSlothCombo/Core/IconReplacer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Reflection;
using Dalamud.Hooking;
using ECommons.DalamudServices;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using XIVSlothCombo.CustomComboNS;
Expand Down
6 changes: 6 additions & 0 deletions XIVSlothCombo/Core/PluginAddressResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ internal class PluginAddressResolver
/// <summary> Gets the address of the member LastComboMove. </summary>
public IntPtr LastComboMove => ComboTimer + 0x4;

/// <summary> Gets the address of fpIsIconReplacable. </summary>
public IntPtr IsActionIdReplaceable { get; private set; }

/// <inheritdoc/>
public unsafe void Setup(ISigScanner scanner)
{
ComboTimer = new IntPtr(&ActionManager.Instance()->Combo.Timer);

//IsActionIdReplaceable = scanner.ScanText("E8 ?? ?? ?? ?? 84 C0 74 4C 8B D3");

Service.PluginLog.Verbose("===== X I V S L O T H C O M B O =====");
Service.PluginLog.Verbose($"{nameof(IsActionIdReplaceable)} 0x{IsActionIdReplaceable:X}");
Service.PluginLog.Verbose($"{nameof(ComboTimer)} 0x{ComboTimer:X}");
Service.PluginLog.Verbose($"{nameof(LastComboMove)} 0x{LastComboMove:X}");
}
Expand Down
8 changes: 8 additions & 0 deletions XIVSlothCombo/Data/ActionWatching.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ public static void Disable()
public static int GetActionEffectRange(uint id) => ActionSheet.TryGetValue(id, out var action) ? action.EffectRange : -1;
public static int GetTraitLevel(uint id) => TraitSheet.TryGetValue(id, out var trait) ? trait.Level : 255;
public static string GetActionName(uint id) => ActionSheet.TryGetValue(id, out var action) ? (string)action.Name : "UNKNOWN ABILITY";

public static string GetBLUIndex(uint id)
{
var aozKey = Svc.Data.GetExcelSheet<AozAction>()!.First(x => x.Action.Row == id).RowId;
var index = Svc.Data.GetExcelSheet<AozActionTransient>().GetRow(aozKey).Number;

return $"#{index} ";
}
public static string GetStatusName(uint id) => StatusSheet.TryGetValue(id, out var status) ? (string)status.Name : "Unknown Status";

public static List<uint>? GetStatusesByName(string status)
Expand Down
2 changes: 2 additions & 0 deletions XIVSlothCombo/Window/ConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -42,6 +43,7 @@ internal class ConfigWindow : Dalamud.Interface.Windowing.Window
.ThenByDescending(tpl => tpl.Info.Role == 4)
.ThenByDescending(tpl => tpl.Info.Role == 2)
.ThenByDescending(tpl => tpl.Info.Role == 3)
.ThenBy(tpl => tpl.Info.ClassJobCategory)
.ThenBy(tpl => tpl.Info.JobName)
.ThenBy(tpl => tpl.Info.Order)
.GroupBy(tpl => tpl.Info.JobName)
Expand Down
2 changes: 1 addition & 1 deletion XIVSlothCombo/Window/Functions/Presets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ internal unsafe static void DrawPreset(CustomComboPreset preset, CustomComboInfo
if (blueAttr.Actions.Count > 0)
{
ImGui.PushStyleColor(ImGuiCol.Text, blueAttr.NoneSet ? ImGuiColors.DPSRed : ImGuiColors.DalamudOrange);
ImGui.Text($"{(blueAttr.NoneSet ? "No Required Spells Active:" : "Missing active spells:")} {string.Join(", ", blueAttr.Actions.Select(x => ActionWatching.GetActionName(x)))}");
ImGui.Text($"{(blueAttr.NoneSet ? "No Required Spells Active:" : "Missing active spells:")} {string.Join(", ", blueAttr.Actions.Select(x => ActionWatching.GetBLUIndex(x) + ActionWatching.GetActionName(x)))}");
ImGui.PopStyleColor();
}

Expand Down
2 changes: 1 addition & 1 deletion XIVSlothCombo/Window/Tabs/PvEFeatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ internal class PvEFeatures : ConfigWindow
var id = groupedPresets[OpenJob].First().Info.JobID;
IDalamudTextureWrap? icon = Icons.GetJobIcon(id);

using (var headingTab = ImRaii.Child("HeadingTab", new Vector2(ImGui.GetContentRegionAvail().X, (icon.Size.Y / 2f.Scale()) + 4f)))
using (var headingTab = ImRaii.Child("HeadingTab", new Vector2(ImGui.GetContentRegionAvail().X, icon is null ? 24f.Scale() : (icon.Size.Y / 2f.Scale()) + 4f)))
{
if (ImGui.Button("Back"))
{
Expand Down
2 changes: 1 addition & 1 deletion XIVSlothCombo/Window/Tabs/PvPFeatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ internal class PvPFeatures : ConfigWindow
var id = groupedPresets[OpenJob].First().Info.JobID;
IDalamudTextureWrap? icon = Icons.GetJobIcon(id);

using (var headingTab = ImRaii.Child("HeadingTab", new Vector2(ImGui.GetContentRegionAvail().X, (icon.Size.Y / 2f.Scale()) + 4f)))
using (var headingTab = ImRaii.Child("PvPHeadingTab", new Vector2(ImGui.GetContentRegionAvail().X, icon is null ? 24f.Scale() : (icon.Size.Y / 2f.Scale()) + 4f)))
{
if (ImGui.Button("Back"))
{
Expand Down
10 changes: 5 additions & 5 deletions XIVSlothCombo/XIVSlothCombo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public sealed partial class XIVSlothCombo : IDalamudPlugin
public static readonly List<uint> DisabledJobsPVE = new List<uint>()
{
ADV.JobID,
//AST.JobID,
AST.JobID,
BLM.JobID,
BLU.JobID,
//BLU.JobID,
BRD.JobID,
DNC.JobID,
DOL.JobID,
Expand All @@ -69,11 +69,11 @@ public sealed partial class XIVSlothCombo : IDalamudPlugin

public static readonly List<uint> DisabledJobsPVP = new List<uint>()
{
ADV.JobID,
//ADV.JobID,
AST.JobID,
BLM.JobID,
BLU.JobID,
//BRD.JobID,
//BLU.JobID,
BRD.JobID,
DNC.JobID,
DOL.JobID,
DRG.JobID,
Expand Down

0 comments on commit 977bc7f

Please sign in to comment.