Skip to content

Commit

Permalink
PCT and VPR base classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taurenkey committed Jun 26, 2024
1 parent 4411678 commit 11cc614
Show file tree
Hide file tree
Showing 11 changed files with 187 additions and 73 deletions.
53 changes: 53 additions & 0 deletions XIVSlothCombo/Combos/PvE/PCT.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
namespace XIVSlothCombo.Combos.PvE
{
internal class PCT
{
public const byte JobID = 42;

public const uint
AdventofChocobastion = 39215,
AeroinGreen = 39192,
BlizzardinCyan = 39194,
ClawMotif = 34666,
CometinBlack = 39199,
CreatureMotif = 34689,
LivingMuse = 35347,
MawMotif = 34667,
MogoftheAges = 39782,
PomMotif1 = 34664,
PomMotif2 = 39200,
PomMuse1 = 34670,
PomMuse2 = 39205,
RainbowDrip = 34688,
ReleaseSubtractivePalette = 39214,
RetributionoftheMadeen1 = 34677,
RetributionoftheMadeen2 = 39783,
ScenicMuse = 35349,
Smudge1 = 34684,
Smudge2 = 39210,
StarPrism = 34681,
SteelMuse = 35348,
SubtractivePalette = 39213,
ThunderIIinMagenta = 34661,
ThunderinMagenta1 = 34655,
ThunderinMagenta2 = 39196,
WaterinBlue = 34652,
WeaponMotif = 34690,
WingMotif = 34665;

public static class Buffs
{

}

public static class Debuffs
{

}

public static class Config
{

}
}
}
55 changes: 55 additions & 0 deletions XIVSlothCombo/Combos/PvE/VPR.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XIVSlothCombo.Combos.PvE
{
internal class VPR
{
public const byte JobID = 41;

public const uint
DreadFangs = 34607,
DreadMaw = 34615,
Dreadwinder = 34620,
HuntersCoil = 34621,
HuntersDen = 34624,
HuntersSnap = 39166,
PitofDread = 34623,
RattlingCoil = 39189,
Reawaken = 34626,
SerpentsIre = 34647,
SerpentsTail1 = 35920,
SerpentsTail2 = 39183,
Slither1 = 34646,
Slither2 = 39184,
SnakeScales = 39185,
SteelFangs = 34606,
SteelMaw = 34614,
SwiftskinsCoil = 34622,
SwiftskinsDen = 34625,
Twinblood = 35922,
Twinfang = 35921,
UncoiledFury1 = 34633,
UncoiledFury2 = 39168,
Worldswallower = 39190,
WrithingSnap = 34632;

public static class Buffs
{

}

public static class Debuffs
{

}

public static class Config
{

}
}
}
6 changes: 0 additions & 6 deletions XIVSlothCombo/Core/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public class PluginConfiguration : IPluginConfiguration

#endregion


#region Custom Float Values

[JsonProperty("CustomFloatValuesV6")]
Expand Down Expand Up @@ -234,11 +233,6 @@ public void ResetFeatures(string config, int[] values)

#endregion

#region UI Settings
public bool AutomaticallyOpenToCurrentJob { get; set; } = false;

#endregion

#region Other (SpecialEvent, MotD, Save)

/// <summary> Handles 'special event' feature naming. </summary>
Expand Down
2 changes: 1 addition & 1 deletion XIVSlothCombo/CustomCombo/Functions/Action.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal abstract partial class CustomComboFunctions
/// <summary> Checks if the player is high enough level to use the passed Action ID. </summary>
/// <param name="actionid"> ID of the action. </param>
/// <returns></returns>
public static bool LevelChecked(uint actionid) => LocalPlayer.Level >= GetLevel(actionid) && NoBlockingStatuses(actionid);
public static bool LevelChecked(uint actionid) => LocalPlayer.Level >= GetLevel(actionid) && NoBlockingStatuses(actionid) && IsActionUnlocked(actionid);

/// <summary> Checks if the player is high enough level to use the passed Trait ID. </summary>
/// <param name="traitid"> ID of the action. </param>
Expand Down
12 changes: 12 additions & 0 deletions XIVSlothCombo/CustomCombo/Functions/PlayerCharacter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.ClientState.Objects.SubKinds;
using ECommons.DalamudServices;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using Lumina.Excel.GeneratedSheets;
using XIVSlothCombo.Services;
using GameMain = FFXIVClientStructs.FFXIV.Client.Game.GameMain;

Expand Down Expand Up @@ -30,5 +33,14 @@ internal abstract partial class CustomComboFunctions
/// <summary> Checks if the player is in a PVP enabled zone. </summary>
/// <returns> A value indicating whether the player is in a PVP enabled zone. </returns>
public static bool InPvP() => GameMain.IsInPvPArea() || GameMain.IsInPvPInstance();

/// <summary> Checks if the player has completed the required job quest for the ability. </summary>
/// <returns> A value indicating a quest has been completed for a job action.</returns>
public static unsafe bool IsActionUnlocked(uint id)
{
var unlockLink = Svc.Data.GetExcelSheet<Action>().GetRow(id).UnlockLink;
if (unlockLink == 0) return true;
return UIState.Instance()->IsUnlockLinkUnlockedOrQuestCompleted(unlockLink);
}
}
}
17 changes: 15 additions & 2 deletions XIVSlothCombo/Window/ConfigWindow.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using Dalamud.Interface.Components;
using Dalamud.Interface.ManagedFontAtlas;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using Dalamud.Utility;
Expand Down Expand Up @@ -78,7 +80,18 @@ public ConfigWindow() : base($"{P.Name} {P.GetType().Assembly.GetName().Version}
RespectCloseHotkey = true;

SizeCondition = ImGuiCond.FirstUseEver;
Size = new Vector2(740, 490);
Size = new Vector2(800, 650);
SetMinSize();

Svc.PluginInterface.UiBuilder.DefaultFontHandle.ImFontChanged += SetMinSize;
}

private void SetMinSize(IFontHandle? fontHandle = null, ILockedImFont? lockedFont = null)
{
SizeConstraints = new()
{
MinimumSize = new Vector2(700f.Scale(), 10f.Scale())
};
}

public override void Draw()
Expand Down Expand Up @@ -252,7 +265,7 @@ public unsafe Vector2 GetNodeScale(AtkResNode* node)

public void Dispose()
{

Svc.PluginInterface.UiBuilder.DefaultFontHandle.ImFontChanged -= SetMinSize;
}
}

Expand Down
3 changes: 1 addition & 2 deletions XIVSlothCombo/Window/Functions/Presets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal unsafe static void DrawPreset(CustomComboPreset preset, CustomComboInfo
var parent = PresetStorage.GetParent(preset);
var blueAttr = preset.GetAttribute<BlueInactiveAttribute>();

ImGui.PushItemWidth(200);
ImGui.Spacing();

if (ImGui.Checkbox($"{info.FancyName}###{info.FancyName}{i}", ref enabled))
{
Expand All @@ -51,7 +51,6 @@ internal unsafe static void DrawPreset(CustomComboPreset preset, CustomComboInfo
Service.Configuration.Save();
}

ImGui.PopItemWidth();
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudGrey);

DrawReplaceAttribute(preset);
Expand Down
19 changes: 12 additions & 7 deletions XIVSlothCombo/Window/InfoBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Numerics;
using Dalamud.Interface;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using ImGuiNET;

namespace XIVSlothCombo.Window
Expand All @@ -10,7 +11,8 @@ internal class InfoBox
{
public Vector4 Color { get; set; } = Colors.White;
public Action ContentsAction { get; set; } = () => ImGui.Text("Action Not Set");
public float CurveRadius { get; set; } = 15.0f;
public float CurveRadius { get; set; } = 1f;
public float ContentsOffset { get; set; } = 0f;
public Vector2 Size { get; set; } = Vector2.Zero;
public float BorderThickness { get; set; } = 2.0f;
public int SegmentResolution { get; set; } = 10;
Expand Down Expand Up @@ -70,16 +72,19 @@ public void DrawCentered(float percentSize = 0.80f)

private void DrawContents()
{
Vector2 topLeftCurveCenter = new(StartPosition.X + CurveRadius, StartPosition.Y + CurveRadius);
Vector2 topLeftCurveCenter = new(StartPosition.X + CurveRadius + ContentsOffset, StartPosition.Y + CurveRadius + ContentsOffset);

ImGui.SetCursorScreenPos(topLeftCurveCenter);
ImGui.PushTextWrapPos(Size.X);

ImGui.BeginGroup();
ImGui.PushID(Label);
ContentsAction();
ImGui.PopID();
ImGui.EndGroup();
using (var group = ImRaii.Group())
{
ImGui.PushID(Label);
ContentsAction();
if (ContentsOffset > 0)
ImGuiHelpers.ScaledDummy(ContentsOffset);
ImGui.PopID();
}

ImGui.PopTextWrapPos();
}
Expand Down
45 changes: 22 additions & 23 deletions XIVSlothCombo/Window/Tabs/PvEFeatures.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using Dalamud.Interface.Internal;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii;
using ECommons.DalamudServices;
using ECommons.ImGuiMethods;
using ImGuiNET;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using XIVSlothCombo.Combos.PvE;
using XIVSlothCombo.Core;
using XIVSlothCombo.Services;
using XIVSlothCombo.Window.Functions;
Expand Down Expand Up @@ -35,14 +32,16 @@ internal class PvEFeatures : ConfigWindow
using (var scrolling = ImRaii.Child("scrolling", new Vector2(ImGui.GetContentRegionAvail().X, ImGui.GetContentRegionAvail().Y), true))
{
int i = 1;

var indentwidth = 12f.Scale();
var indentwidth2 = indentwidth + 42f.Scale();
if (OpenJob == string.Empty)
{
ImGuiEx.LineCentered("pveDesc", () => ImGuiEx.TextUnderlined("Select a job from below to enable and configure features for it."));
ImGui.Spacing();
ImGui.SameLine(indentwidth);
ImGuiEx.LineCentered(() =>
{
ImGuiEx.TextUnderlined("Select a job from below to enable and configure features for it.");
});

var indentwidth = ImGui.GetContentRegionAvail().X / 3.25f;
var indentwidth2 = ImGui.GetContentRegionAvail().X / 2.75f;
foreach (string? jobName in groupedPresets.Keys)
{
string abbreviation = groupedPresets[jobName].First().Info.JobShorthand;
Expand All @@ -67,26 +66,26 @@ internal class PvEFeatures : ConfigWindow
}
else
{
using (var headingTab = ImRaii.Child("HeadingTab", new Vector2(ImGui.GetContentRegionAvail().X, 24f.Scale())))
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)))
{
if (ImGui.Button("Back"))
{
OpenJob = "";
return;
}

var indentwidth = ImGui.GetContentRegionAvail().X / 3.25f;
var indentwidth2 = ImGui.GetContentRegionAvail().X / 2.75f;

var id = groupedPresets[OpenJob].First().Info.JobID;
IDalamudTextureWrap? icon = Icons.GetJobIcon(id);
ImGui.SameLine(indentwidth);
if (icon != null)
ImGui.SameLine();
ImGuiEx.LineCentered(() =>
{
ImGui.Image(icon.ImGuiHandle, (icon.Size / 2f) * ImGui.GetIO().FontGlobalScale);
ImGui.SameLine(indentwidth2);
}
ImGuiEx.Text($"{OpenJob}");
if (icon != null)
{
ImGui.Image(icon.ImGuiHandle, (icon.Size / 2f.Scale()));
ImGui.SameLine();
}
ImGuiEx.Text($"{OpenJob}");
});

}

Expand Down Expand Up @@ -159,7 +158,7 @@ internal static void DrawHeadingContents(string jobName, int i)
!PresetStorage.IsBozja(x.Preset) &&
!PresetStorage.IsEureka(x.Preset)))
{
InfoBox presetBox = new() { Color = Colors.Grey, BorderThickness = 1f, CurveRadius = 8f, ContentsAction = () => { Presets.DrawPreset(preset, info, ref i); } };
InfoBox presetBox = new() { Color = Colors.Grey, BorderThickness = 2f.Scale(), ContentsOffset = 5f.Scale(), ContentsAction = () => { Presets.DrawPreset(preset, info, ref i); } };

if (Service.Configuration.HideConflictedCombos)
{
Expand All @@ -182,7 +181,7 @@ internal static void DrawHeadingContents(string jobName, int i)
else
{
presetBox.Draw();
ImGuiHelpers.ScaledDummy(12.0f);

continue;
}
}
Expand Down
Loading

0 comments on commit 11cc614

Please sign in to comment.