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

Commit

Permalink
fix: patch api 9.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Oct 3, 2023
1 parent 0ed5ec3 commit f21cfaa
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 22 deletions.
6 changes: 3 additions & 3 deletions RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO

if (!Service.Config.GetValue(PluginConfigBool.UseResourcesAction) && _option.HasFlag(ActionOption.UseResources)) return false;

if (ConfigurationHelper.BadStatus.Contains(ActionManager.Instance()->GetActionStatus(ActionType.Spell, AdjustedID)))
if (ConfigurationHelper.BadStatus.Contains(ActionManager.Instance()->GetActionStatus(ActionType.Action, AdjustedID)))
return false;

if (!EnoughLevel) return false;
Expand Down Expand Up @@ -218,15 +218,15 @@ public unsafe bool Use()
{
var loc = new FFXIVClientStructs.FFXIV.Common.Math.Vector3() { X = Position.X, Y = Position.Y, Z = Position.Z };

return ActionManager.Instance()->UseActionLocation(ActionType.Spell, ID, Player.Object.ObjectId, &loc);
return ActionManager.Instance()->UseActionLocation(ActionType.Action, ID, Player.Object.ObjectId, &loc);
}
else if(Svc.Objects.SearchById(_targetId) == null)
{
return false;
}
else
{
return ActionManager.Instance()->UseAction(ActionType.Spell, adjustId, _targetId);
return ActionManager.Instance()->UseAction(ActionType.Action, adjustId, _targetId);
}
}
}
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Actions/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public bool IsInCooldown
/// <summary>
/// Casting time.
/// </summary>
public unsafe float CastTime => ActionManager.GetAdjustedCastTime(ActionType.Spell, AdjustedID) / 1000f;
public unsafe float CastTime => ActionManager.GetAdjustedCastTime(ActionType.Action, AdjustedID) / 1000f;

/// <summary>
/// Action Positional.
Expand All @@ -176,7 +176,7 @@ public virtual unsafe uint MPNeed
{
get
{
var mp = (uint)ActionManager.GetActionCost(ActionType.Spell, AdjustedID, 0, 0, 0, 0);
var mp = (uint)ActionManager.GetActionCost(ActionType.Action, AdjustedID, 0, 0, 0, 0);
if (mp < 100) return 0;
return mp;
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/BaseAction_Cooldown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public bool WillHaveOneCharge(float remain)
///
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public float RecastTimeOneChargeRaw => ActionManager.GetAdjustedRecastTime(ActionType.Spell, AdjustedID) / 1000f;
public float RecastTimeOneChargeRaw => ActionManager.GetAdjustedRecastTime(ActionType.Action, AdjustedID) / 1000f;

/// <summary>
///
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ internal static unsafe void AddActionRec(Action act)
case ActionCate.Spell:
case ActionCate.WeaponSkill:
LastAction = LastGCD = id;
if (ActionManager.GetAdjustedCastTime(ActionType.Spell, (uint)id) == 0)
if (ActionManager.GetAdjustedCastTime(ActionType.Action, (uint)id) == 0)
{
FetchTime = WeaponElapsed;
}
Expand Down
4 changes: 3 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@
"ConfigWindow_About_Macros": "Macros",
"ConfigWindow_About_Links": "Links",
"ConfigWindow_About_Compatibility": "Compatibility",
"ConfigWindow_About_Supporters": "Supporters",
"ConfigWindow_About_Compatibility_Description": "Literally, Rotation Solver helps you to choose the target and then click the action. So any plugin that changes these will affect its decision.\n\nHere is a list of known incompatible plugins:",
"ConfigWindow_About_Compatibility_Others": "Please don't relog without closing the game. Crashes may occur.",
"ConfigWindow_About_Compatibility_Mistake": "Can't properly execute the behavior that RS wants to do.",
Expand Down Expand Up @@ -528,5 +529,6 @@
"ConfigWindow_Basic_SayHelloToUsersDesc": "It can only be disabled for users, not authors and contributors.\nIf you want to be greeted by other users, please DM ArchiTed in Discord Server with your Hash!",
"ConfigWindow_Basic_JustSayHelloOnce": "Just say hello once to the same user.",
"ConfigWindow_About_Clicking100k": "Well, you must be a lazy player!",
"ConfigWindow_About_Clicking500k": "You're tiring RS out, give it a break!"
"ConfigWindow_About_Clicking500k": "You're tiring RS out, give it a break!",
"ConfigWindow_About_ThanksToSupporters": "Many thanks to the sponsors."
}
2 changes: 1 addition & 1 deletion RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ private static unsafe void DrawActions()
{
#if DEBUG
ImGui.Text("Is Real GCD: " + action.IsRealGCD.ToString());
ImGui.Text("Status: " + FFXIVClientStructs.FFXIV.Client.Game.ActionManager.Instance()->GetActionStatus(FFXIVClientStructs.FFXIV.Client.Game.ActionType.Spell, action.AdjustedID).ToString());
ImGui.Text("Status: " + FFXIVClientStructs.FFXIV.Client.Game.ActionManager.Instance()->GetActionStatus(FFXIVClientStructs.FFXIV.Client.Game.ActionType.Action, action.AdjustedID).ToString());
ImGui.Text("Cast Time: " + action.CastTime.ToString());
ImGui.Text("MP: " + action.MPNeed.ToString());
#endif
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ private static unsafe void UpdateWeaponTime()

var castTotal = player.TotalCastTime;

var weaponTotal = instance->GetRecastTime(ActionType.Spell, 11);
var weaponTotal = instance->GetRecastTime(ActionType.Action, 11);
if (castTotal > 0) castTotal += 0.1f;
if (player.IsCasting) weaponTotal = Math.Max(castTotal, weaponTotal);

DataCenter.WeaponElapsed = instance->GetRecastTimeElapsed(ActionType.Spell, 11);
DataCenter.WeaponElapsed = instance->GetRecastTimeElapsed(ActionType.Action, 11);
DataCenter.WeaponRemain = DataCenter.WeaponElapsed == 0 ? player.TotalCastTime - player.CurrentCastTime
: Math.Max(weaponTotal - DataCenter.WeaponElapsed, player.TotalCastTime - player.CurrentCastTime);

Expand Down
15 changes: 9 additions & 6 deletions RotationSolver/Updaters/MajorUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ private unsafe static void FrameworkUpdate(IFramework framework)
{
_showed = true;

var warning = "Rotation Solver 未进行国服适配并不提供相关支持! 建议使用国服的插件,如";
Svc.Toasts.ShowError(warning + "AE Assist 2.0");
var warning = "Rotation Solver 未进行国服适配并不提供相关支持! 建议使用国服的插件,如";
Svc.Toasts.ShowError(warning + "AE Assist 2.0");

var seString = new SeString(new TextPayload(warning)
, Svc.PluginInterface.AddChatLinkHandler(2, (id, str) =>
Expand All @@ -56,8 +56,11 @@ private unsafe static void FrameworkUpdate(IFramework framework)
Util.OpenLink("http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=EyT0BfZWCVq8v2yiMjSqcb4lEqYuaF_P&authKey=UJFoVZ3OljlBhSilXpeLKIIzofI4ZUjJfjuqCgr%2BiaT3Y6HmQFVbXZ5xBOlSv5yZ&noverify=0&group_code=552689154");
}
}),
new UIForegroundPayload(31),
new TextPayload("AE Assist 2.0"),
RawPayload.LinkTerminator);
UIForegroundPayload.UIForegroundOff,
RawPayload.LinkTerminator,
new TextPayload("!"));

Svc.Chat.Print(new Dalamud.Game.Text.XivChatEntry()
{
Expand All @@ -71,15 +74,15 @@ private unsafe static void FrameworkUpdate(IFramework framework)
SocialUpdater.UpdateSocial();
PreviewUpdater.UpdatePreview();

if (Service.Config.GetValue(PluginConfigBool.TeachingMode) && ActionUpdater.NextAction!= null)
if (Service.Config.GetValue(PluginConfigBool.TeachingMode) && ActionUpdater.NextAction != null)
{
//Sprint action id is 3 however the id in hot bar is 4.
var id = ActionUpdater.NextAction.AdjustedID;
PainterManager.ActionIds.Add(id == (uint)ActionID.Sprint ? 4 : id);
}
ActionUpdater.UpdateActionInfo();

var canDoAction = ActionUpdater.CanDoAction();
var canDoAction = ActionUpdater.CanDoAction();
MovingUpdater.UpdateCanMove(canDoAction);
if (canDoAction)
{
Expand All @@ -93,7 +96,7 @@ private unsafe static void FrameworkUpdate(IFramework framework)
}
catch (Exception ex)
{
if(_threadException != ex)
if (_threadException != ex)
{
_threadException = ex;
Svc.Log.Error(ex, "Main Thread Exception");
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/MovingUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal unsafe static void UpdateCanMove(bool doNextAction)
? (ActionID)RSCommands._lastActionID
: doNextAction ? (ActionID)(ActionUpdater.NextAction?.AdjustedID ?? 0) : 0;

var specialActions = ActionManager.GetAdjustedCastTime(ActionType.Spell, (uint)action) > 0
var specialActions = ActionManager.GetAdjustedCastTime(ActionType.Action, (uint)action) > 0
|| actionList.Any(id => Service.GetAdjustedActionId(id) == action);

//Status
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/PreviewUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static class PreviewUpdater
{
internal static void UpdatePreview()
{
UpdateEntry();
//UpdateEntry();
UpdateCancelCast();
}

Expand Down
6 changes: 3 additions & 3 deletions RotationSolver/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private static void ActionFromEnemy(ActionEffectSet set)
}
}

if (set.Header.ActionType == ActionType.Spell && DataCenter.PartyMembers.Count() >= 4 && set.Action.Cast100ms > 0)
if (set.Header.ActionType == ActionType.Action && DataCenter.PartyMembers.Count() >= 4 && set.Action.Cast100ms > 0)
{
var type = set.Action.GetActionCate();

Expand All @@ -92,7 +92,7 @@ private static void ActionFromEnemy(ActionEffectSet set)
&& (effect.value > 0 || (effect.param0 & 6) == 6))
== DataCenter.PartyMembers.Count())
{
if (Service.Config.GetValue(Basic.Configuration.PluginConfigBool.RecordCastingArea))
if (Service.Config.GetValue(PluginConfigBool.RecordCastingArea))
{
OtherConfiguration.HostileCastingArea.Add(set.Action.RowId);
OtherConfiguration.SaveHostileCastingArea();
Expand All @@ -105,7 +105,7 @@ private static void ActionFromEnemy(ActionEffectSet set)
private static void ActionFromSelf(ActionEffectSet set)
{
if (set.Source.ObjectId != Player.Object.ObjectId) return;
if (set.Header.ActionType != ActionType.Spell && set.Header.ActionType != ActionType.Item) return;
if (set.Header.ActionType != ActionType.Action && set.Header.ActionType != ActionType.Item) return;
if (set.Action == null) return;
if ((ActionCate)set.Action.ActionCategory.Value.RowId == ActionCate.AutoAttack) return;

Expand Down

0 comments on commit f21cfaa

Please sign in to comment.