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

Commit

Permalink
Merge branch 'refs/heads/main' into SMN_Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Genesis-Nova committed Jul 5, 2024
2 parents 78ee0a9 + 7da115b commit 37d845a
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace XIVSlothCombo.Attributes
{
/// <summary> Attribute designating secret combos. </summary>
[AttributeUsage(AttributeTargets.Field)]
internal class SecretCustomComboAttribute : Attribute
internal class PvPCustomComboAttribute : Attribute
{
}
}
124 changes: 62 additions & 62 deletions XIVSlothCombo/Combos/CustomComboPreset.cs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions XIVSlothCombo/Core/Presets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace XIVSlothCombo.Core
{
internal static class PresetStorage
{
private static HashSet<CustomComboPreset>? SecretCombos;
private static HashSet<CustomComboPreset>? PvPCombos;
private static HashSet<CustomComboPreset>? VariantCombos;
private static HashSet<CustomComboPreset>? BozjaCombos;
private static HashSet<CustomComboPreset>? EurekaCombos;
Expand All @@ -20,8 +20,8 @@ internal static class PresetStorage
public static void Init()
{
// Secret combos
SecretCombos = Enum.GetValues<CustomComboPreset>()
.Where(preset => preset.GetAttribute<SecretCustomComboAttribute>() != default)
PvPCombos = Enum.GetValues<CustomComboPreset>()
.Where(preset => preset.GetAttribute<PvPCustomComboAttribute>() != default)
.ToHashSet();

VariantCombos = Enum.GetValues<CustomComboPreset>()
Expand Down Expand Up @@ -58,7 +58,7 @@ public static void Init()
/// <summary> Gets a value indicating whether a preset is secret. </summary>
/// <param name="preset"> Preset to check. </param>
/// <returns> The boolean representation. </returns>
public static bool IsSecret(CustomComboPreset preset) => SecretCombos.Contains(preset);
public static bool IsPvP(CustomComboPreset preset) => PvPCombos.Contains(preset);

/// <summary> Gets a value indicating whether a preset is secret. </summary>
/// <param name="preset"> Preset to check. </param>
Expand Down
4 changes: 3 additions & 1 deletion XIVSlothCombo/CustomCombo/Functions/Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.ClientState.Objects.Types;
using ECommons.DalamudServices;
using FFXIVClientStructs.FFXIV.Client.System.Framework;
using XIVSlothCombo.Data;
using XIVSlothCombo.Services;
using StructsObject = FFXIVClientStructs.FFXIV.Client.Game.Object;
Expand Down Expand Up @@ -129,7 +131,7 @@ public static bool HasFriendlyTarget(IGameObject? OurTarget = null)
//if (checkMO && HasFriendlyTarget(tm.MouseOverTarget)) healTarget = tm.MouseOverTarget;
if (checkMOPartyUI)
{
StructsObject.GameObject* t = PartyTargetingService.UITarget;
StructsObject.GameObject* t = Framework.Instance()->GetUIModule()->GetPronounModule()->UiMouseOverTarget;
if (t != null && t->GetGameObjectId().ObjectId != 0)
{
IGameObject? uiTarget = Service.ObjectTable.Where(x => x.GameObjectId == t->GetGameObjectId().ObjectId).FirstOrDefault();
Expand Down
3 changes: 0 additions & 3 deletions XIVSlothCombo/Services/PartyTargetingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ public static ulong GetObjectID(GameObject* o)
return id.ObjectId;
}

private static readonly delegate* unmanaged<long, GameObject*> getGameObjectFromObjectID = (delegate* unmanaged<long, GameObject*>)Service.SigScanner.ScanText("E8 ?? ?? ?? ?? 44 0F B6 C3 48 8B D0");
public static GameObject* GetGameObjectFromObjectID(long id) => getGameObjectFromObjectID(id);

private static readonly delegate* unmanaged<IntPtr, uint, GameObject*> getGameObjectFromPronounID = (delegate* unmanaged<IntPtr, uint, GameObject*>)Service.SigScanner.ScanText("E8 ?? ?? ?? ?? 48 8B D8 48 85 C0 0F 85 ?? ?? ?? ?? 8D 4F DD");
public static GameObject* GetGameObjectFromPronounID(uint id) => getGameObjectFromPronounID(pronounModule, id);
}
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 @@ -21,7 +21,7 @@ internal class Presets : ConfigWindow
internal unsafe static void DrawPreset(CustomComboPreset preset, CustomComboInfoAttribute info, ref int i)
{
var enabled = PresetStorage.IsEnabled(preset);
var secret = PresetStorage.IsSecret(preset);
var secret = PresetStorage.IsPvP(preset);
var conflicts = PresetStorage.GetConflicts(preset);
var parent = PresetStorage.GetParent(preset);
var blueAttr = preset.GetAttribute<BlueInactiveAttribute>();
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 @@ -154,7 +154,7 @@ internal static void DrawHeadingContents(string jobName, int i)
{
if (!Messages.PrintBLUMessage(jobName)) return;

foreach (var (preset, info) in groupedPresets[jobName].Where(x => !PresetStorage.IsSecret(x.Preset) &&
foreach (var (preset, info) in groupedPresets[jobName].Where(x => !PresetStorage.IsPvP(x.Preset) &&
!PresetStorage.IsVariant(x.Preset) &&
!PresetStorage.IsBozja(x.Preset) &&
!PresetStorage.IsEureka(x.Preset)))
Expand Down
4 changes: 2 additions & 2 deletions XIVSlothCombo/Window/Tabs/PvPFeatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ internal class PvPFeatures : ConfigWindow
});
ImGui.Spacing();

foreach (string? jobName in groupedPresets.Keys)
foreach (string? jobName in groupedPresets.Where(x => x.Value.Any(y => PresetStorage.IsPvP(y.Preset))).Select(x => x.Key))
{
string abbreviation = groupedPresets[jobName].First().Info.JobShorthand;
string header = string.IsNullOrEmpty(abbreviation) ? jobName : $"{jobName} - {abbreviation}";
Expand Down Expand Up @@ -118,7 +118,7 @@ internal class PvPFeatures : ConfigWindow

private static void DrawHeadingContents(string jobName, int i)
{
foreach (var (preset, info) in groupedPresets[jobName].Where(x => PresetStorage.IsSecret(x.Preset)))
foreach (var (preset, info) in groupedPresets[jobName].Where(x => PresetStorage.IsPvP(x.Preset)))
{
InfoBox presetBox = new() { Color = Colors.Grey, BorderThickness = 1f, CurveRadius = 8f, ContentsAction = () => { Presets.DrawPreset(preset, info, ref i); } };

Expand Down
40 changes: 20 additions & 20 deletions XIVSlothCombo/XIVSlothCombo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,27 @@ public sealed partial class XIVSlothCombo : IDalamudPlugin
public static readonly List<uint> DisabledJobsPVP = new List<uint>()
{
//ADV.JobID,
AST.JobID,
BLM.JobID,
//AST.JobID,
//BLM.JobID,
//BLU.JobID,
BRD.JobID,
DNC.JobID,
DOL.JobID,
DRG.JobID,
DRK.JobID,
GNB.JobID,
MCH.JobID,
MNK.JobID,
NIN.JobID,
PLD.JobID,
RDM.JobID,
RPR.JobID,
SAM.JobID,
SCH.JobID,
SGE.JobID,
SMN.JobID,
WAR.JobID,
WHM.JobID
//BRD.JobID,
//DNC.JobID,
//DOL.JobID,
//DRG.JobID,
//DRK.JobID,
//GNB.JobID,
//MCH.JobID,
//MNK.JobID,
//NIN.JobID,
//PLD.JobID,
//RDM.JobID,
//RPR.JobID,
//SAM.JobID,
//SCH.JobID,
//SGE.JobID,
//SMN.JobID,
//WAR.JobID,
//WHM.JobID
};

public static uint? JobID
Expand Down

0 comments on commit 37d845a

Please sign in to comment.