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

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taurenkey committed Jul 11, 2024
1 parent 46aaf5e commit c6955e6
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
4 changes: 2 additions & 2 deletions XIVSlothCombo/Combos/CustomComboPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public enum CustomComboPreset

#region Healing
[ReplaceSkill(AST.Benefic2)]
[CustomComboInfo("Simple Heals (Single Target)", "Replaces Benefic 2 with a one button healing replacement.", AST.JobID, 2)]
[CustomComboInfo("Simple Heals (Single Target)", "Replaces Benefic II with a one button healing replacement.", AST.JobID, 2)]
AST_ST_SimpleHeals = 1023,

[ParentCombo(AST_ST_SimpleHeals)]
Expand Down Expand Up @@ -288,7 +288,7 @@ public enum CustomComboPreset
#endregion

#region Cards
[CustomComboInfo("Quick Target Damage Cards", "When you play the Balance or Spear, this will automatically apply the buff to a party member. It will look at DPS that suit the card first, if none found or they have buffs already, will look at the other DPS instead..", AST.JobID)]
[CustomComboInfo("Quick Target Damage Cards", "When you play the Balance or Spear, this will automatically apply the buff to a party member. It will look at DPS that suit the card first, if none found or they have buffs already, will look at the other DPS instead.", AST.JobID)]
AST_Cards_QuickTargetCards = 1029,

[ParentCombo(AST_Cards_QuickTargetCards)]
Expand Down
3 changes: 2 additions & 1 deletion XIVSlothCombo/Combos/PvE/AST.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Dalamud.Game.ClientState.JobGauge.Types;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Game.ClientState.Statuses;
using ECommons.DalamudServices;
using System.Collections.Generic;
using System.Linq;
using XIVSlothCombo.Combos.PvE.Content;
Expand Down Expand Up @@ -291,13 +292,13 @@ protected override uint Invoke(uint actionID, uint lastComboMove, float comboTim
var canHoroscope = (Config.AST_AoE_SimpleHeals_Horoscope && CanSpellWeave(actionID)) || !Config.AST_AoE_SimpleHeals_Horoscope;
var canOppose = (Config.AST_AoE_SimpleHeals_Opposition && CanSpellWeave(actionID)) || !Config.AST_AoE_SimpleHeals_Opposition;


//Level check to exit if we can't use
if (!LevelChecked(AspectedHelios))
return Helios;

if (IsEnabled(CustomComboPreset.AST_AoE_SimpleHeals_LazyLady) &&
ActionReady(MinorArcana) &&
InCombat() &&
Gauge.DrawnCrownCard is CardType.LADY
&& canLady)
return OriginalHook(MinorArcana);
Expand Down
2 changes: 2 additions & 0 deletions XIVSlothCombo/CustomCombo/Functions/Misc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class JobIDs
DRG.JobID, DRG.ClassID,
MNK.JobID, MNK.ClassID,
NIN.JobID, NIN.ClassID,
VPR.JobID,
RPR.JobID,
SAM.JobID
];
Expand All @@ -34,6 +35,7 @@ public class JobIDs
BLM.JobID, BLM.ClassID,
BRD.JobID, BRD.ClassID,
SMN.JobID, SMN.ClassID,
PCT.JobID,
MCH.JobID,
RDM.JobID,
DNC.JobID,
Expand Down
42 changes: 37 additions & 5 deletions XIVSlothCombo/Window/Icons.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,50 @@
using Dalamud.Interface.Internal;
using Dalamud.Interface.Textures;
using Dalamud.Interface.Textures.TextureWraps;
using Dalamud.Utility;
using ECommons.DalamudServices;
using Lumina.Data.Files;
using System.Collections.Generic;

namespace XIVSlothCombo.Window
{
internal static class Icons
{
public static Dictionary<uint, IDalamudTextureWrap> CachedModdedIcons = new();
public static IDalamudTextureWrap? GetJobIcon(uint jobId)
{
if (jobId == 0 || jobId > 42) return null;
var icon = Svc.Texture.GetFromGameIcon(62100 + jobId);
if (!icon.TryGetWrap(out var wrap, out _))
return null;
return wrap;
var icon = GetTextureFromIconId(62100 + jobId);

return icon;
}

private static string ResolvePath(string path) => Svc.TextureSubstitution.GetSubstitutedPath(path);

public static IDalamudTextureWrap? GetTextureFromIconId(uint iconId, uint stackCount = 0, bool hdIcon = true)
{
GameIconLookup lookup = new GameIconLookup(iconId + stackCount, false, hdIcon);
string path = Svc.Texture.GetIconPath(lookup);
string resolvePath = ResolvePath(path);

var wrap = Svc.Texture.GetFromFile(resolvePath);
if (wrap.TryGetWrap(out var icon, out _))
return icon;

try
{
if (CachedModdedIcons.ContainsKey(iconId)) return CachedModdedIcons[iconId];
var tex = Svc.Data.GameData.GetFileFromDisk<TexFile>(resolvePath);
var output = Svc.Texture.CreateFromRaw(RawImageSpecification.Rgba32(tex.Header.Width, tex.Header.Width), tex.GetRgbaImageData());
if (output != null)
{
CachedModdedIcons[iconId] = output;
return output;
}
}
catch { }


return Svc.Texture.GetFromGame(path).GetWrapOrDefault();
}
}
}

0 comments on commit c6955e6

Please sign in to comment.