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

Commit

Permalink
fix: add an TerritoryContentType property for rotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 9, 2023
1 parent 7f453af commit 8b983a6
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 3 deletions.
32 changes: 32 additions & 0 deletions RotationSolver.Basic/Data/TerritoryContentType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace RotationSolver.Basic.Data;

public enum TerritoryContentType : uint
{
None = 0,
DutyRoulette = 1,
Dungeons = 2,
Guildhests = 3,
Trials = 4,
Raids = 5,
PvP = 6,
QuestBattles = 7,
FATEs = 8,
TreasureHunt = 9,
Levequests = 10,
GrandCompany = 11,
Companions = 12,
TribalQuests = 13,
OverallCompletion = 14,
PlayerCommendation = 15,
DisciplesOfTheLand = 16,
DisciplesOfTheHand = 17,
RetainerVentures = 18,
GoldSaucer = 19,
DeepDungeons = 21,
WondrousTails = 24,
CustomDeliveries = 25,
Eureka = 26,
UltimateRaids = 28,
VCDungeonFinder = 30,
\
}
2 changes: 2 additions & 0 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace RotationSolver.Basic;
public static class DataCenter
{
public static bool InHighEndDuty { get; set; } = false;
public static TerritoryContentType TerritoryContentType { get; set; } = TerritoryContentType.None;

public static AutoStatus AutoStatus { get; private set; } = AutoStatus.None;
public static bool SetAutoStatus(AutoStatus status, bool keep)
{
Expand Down
1 change: 1 addition & 0 deletions RotationSolver.Basic/Rotations/CustomRotation_OtherInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public abstract partial class CustomRotation
#endregion

protected static ClientLanguage Language => Service.Language;
protected static TerritoryContentType TerritoryContentType => DataCenter.TerritoryContentType;


public static uint AdjustId(uint id) => Service.GetAdjustedActionId(id);
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/UI/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ private unsafe void DrawStatus()
{
ImGui.Text("Fate: " + DataCenter.FateId.ToString());
}
ImGui.Text("TerritoryType: " + DataCenter.TerritoryContentType.ToString());

ImGui.Text("Have pet: " + DataCenter.HasPet.ToString());
ImGui.Text("Hostile Near: " + DataCenter.HasHostilesInRange.ToString());
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Updaters/InputUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static void KeyDown(KeyRecord key)
return;
}

if (!Service.Config.UseKeyboardCommand || SocialUpdater.InPvp) return;
if (!Service.Config.UseKeyboardCommand) return;

if (Service.Config.KeyState.ContainsValue(key))
{
Expand Down Expand Up @@ -128,7 +128,7 @@ private static void ButtonDown(ButtonRecord button)
return;
}

if (!Service.Config.UseGamepadCommand || SocialUpdater.InPvp) return;
if (!Service.Config.UseGamepadCommand) return;

if (Service.Config.ButtonState.ContainsValue(button))
{
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/MajorUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace RotationSolver.Updaters;

internal static class MajorUpdater
{
public static bool IsValid => Service.Conditions.Any() && Service.Player != null;
public static bool IsValid => Service.Conditions.Any() && Service.Player != null && !SocialUpdater.InPvp;

#if DEBUG
private static readonly Dictionary<int, bool> _valus = new Dictionary<int, bool>();
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Updaters/SocialUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ static void ClientState_TerritoryChanged(object sender, ushort e)
_canSaying = true;
}
InPvp = territory.IsPvpZone;
DataCenter.TerritoryContentType = (TerritoryContentType)(territory?.ContentFinderCondition?.Value?.ContentType?.Value?.RowId ?? 0);
DataCenter.InHighEndDuty = HighEndDuties.Any(t => t.RowId == territory.RowId);
}

Expand Down

0 comments on commit 8b983a6

Please sign in to comment.