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

Commit

Permalink
fix: change ClientState.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed May 18, 2023
1 parent c6b2185 commit a411c7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions RotationSolver.Basic/Service.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ public unsafe static IEnumerable<IntPtr> GetAddons<T>() where T : struct
.Where(ptr => ptr != IntPtr.Zero);
}

[PluginService]
public static ClientState ClientState { get; set; }

public static ExcelSheet<T> GetSheet<T>() where T : ExcelRow => DataManager.GetExcelSheet<T>();

internal static TextureWrap GetTextureIcon(uint id) => DataManager.GetImGuiTextureIcon(id);
Expand Down Expand Up @@ -156,6 +153,6 @@ public unsafe static IEnumerable<IntPtr> GetAddons<T>() where T : struct
[PluginService]
public static DutyState DutyState { get; private set; }

public static ClientLanguage Language => ClientState.ClientLanguage;
public static ClientLanguage Language => Svc.ClientState.ClientLanguage;

}
4 changes: 2 additions & 2 deletions RotationSolver/Updaters/SocialUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ internal static void Enable()
Service.DutyState.DutyStarted += DutyState_DutyStarted;
Service.DutyState.DutyWiped += DutyState_DutyWiped;
Service.DutyState.DutyCompleted += DutyState_DutyCompleted;
Service.ClientState.TerritoryChanged += ClientState_TerritoryChanged;
Svc.ClientState.TerritoryChanged += ClientState_TerritoryChanged;

HighEndDuties = Service.GetSheet<TerritoryType>()
.Where(t => t?.ContentFinderCondition?.Value?.HighEndDuty ?? false)
Expand Down Expand Up @@ -146,7 +146,7 @@ internal static void Disable()
Service.DutyState.DutyStarted -= DutyState_DutyStarted;
Service.DutyState.DutyWiped -= DutyState_DutyWiped;
Service.DutyState.DutyCompleted -= DutyState_DutyCompleted;
Service.ClientState.TerritoryChanged -= ClientState_TerritoryChanged;
Svc.ClientState.TerritoryChanged -= ClientState_TerritoryChanged;
}

static RandomDelay socialDelay = new(() => (3, 5));
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/TargetUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private static IEnumerable<BattleChara> GetHostileTargets(IEnumerable<BattleChar
allAttackableTargets = allAttackableTargets.Where(b =>
{
IEnumerable<string> names = Array.Empty<string>();
if(OtherConfiguration.NoHostileNames.TryGetValue(Service.ClientState.TerritoryType, out var ns1))
if(OtherConfiguration.NoHostileNames.TryGetValue(Svc.ClientState.TerritoryType, out var ns1))
names = names.Union(ns1);

if (OtherConfiguration.NoHostileNames.TryGetValue(0, out var ns2))
Expand Down

0 comments on commit a411c7e

Please sign in to comment.