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

Commit

Permalink
fix: fixed some dungeon enter crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 19, 2024
1 parent 521be06 commit 4365fc8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ClickingCount": 63570,
"SayingHelloCount": 36,
"SayingHelloCount": 41,
"SaidUsers": []
}
24 changes: 23 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,27 @@
"RotationSolver.Basic.Data.TargetHostileType.TargetsHaveTarget": "Previously engaged targets (engages on countdown timer)",
"RotationSolver.Data.UiString.ActionAbility": "Ability",
"RotationSolver.Data.UiString.ActionAttack": "Attack",
"RotationSolver.Data.UiString.ActionFriendly": "Friendly"
"RotationSolver.Data.UiString.ActionFriendly": "Friendly",
"RotationSolver.Data.UiString.ConfigWindow_About_Punchline": "Analyses PvE combat information in every frame and finds the best action.",
"RotationSolver.Data.UiString.ConfigWindow_About_Clicking100k": "Well, you must be a lazy player!",
"RotationSolver.Data.UiString.ConfigWindow_About_Clicking500k": "You're tiring RS out, give it a break!",
"RotationSolver.Data.UiString.ConfigWindow_Helper_GameVersion": "Game",
"RotationSolver.Data.UiString.ConfigWindow_Helper_SwitchRotation": "Click to switch rotations",
"RotationSolver.Data.UiString.ConfigWindow_ConditionSetDesc": "The condition set you chose, click to modify.",
"RotationSolver.Data.UiString.ConfigWindow_Searching": "Search... ",
"RotationSolver.Data.UiString.ConfigWindow_About_Description": "This means almost all the information available in one frame in combat, including the status of all players in the party, the status of any hostile targets, skill cooldowns, the MP and HP of characters, the location of characters, casting status of the hostile target, combo, combat duration, player level, etc.\n\nThen, it will highlight the best action on the hot bar, or help you to click on it.",
"RotationSolver.Data.UiString.ConfigWindow_About_Warning": "It is designed for GENERAL COMBAT, not for savage or ultimate. Use it carefully.",
"RotationSolver.Data.UiString.ConfigWindow_About_ClickingCount": "Rotation Solver helped you by clicking actions {0:N0} times.",
"RotationSolver.Data.UiString.ConfigWindow_About_SayHelloCount": "You have said hello to other users {0:N0} times!",
"RotationSolver.Data.UiString.ConfigWindow_About_Macros": "Macro",
"RotationSolver.Data.UiString.ConfigWindow_About_Compatibility": "Compatibility",
"RotationSolver.Data.UiString.ConfigWindow_About_Supporters": "Supporters",
"RotationSolver.Data.UiString.ConfigWindow_About_Links": "Links",
"RotationSolver.Data.UiString.ConfigWindow_Rotation_Description": "Description",
"RotationSolver.Data.UiString.ConfigWindow_Rotation_Status": "Status",
"RotationSolver.Data.UiString.ConfigWindow_Rotation_Configuration": "Configuration",
"RotationSolver.Data.UiString.ConfigWindow_Rotation_Rating": "Rating",
"RotationSolver.Data.UiString.ConfigWindow_Rotation_Information": "Information",
"RotationSolver.Data.UiString.ConfigWindow_Rotation_InvalidRotation": "Invalid Rotation! \nPlease update to the latest version or contact to the {0}!",
"RotationSolver.UI.RotationConfigWindowTab.Actions": "The abilities and custom conditions that your selected job has."
}
29 changes: 23 additions & 6 deletions RotationSolver/UI/PainterManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.ClientState.Objects.SubKinds;
using ECommons.DalamudServices;
using ECommons.GameHelpers;
using RotationSolver.Basic.Configuration;
Expand Down Expand Up @@ -83,7 +84,7 @@ class TargetDrawing : Drawing3DPoly
{
readonly Drawing3DCircularSector _target;
readonly Drawing3DImage _targetImage;

DateTime _time = DateTime.Now;
public TargetDrawing()
{
var TColor = ImGui.GetColorU32(Service.Config.TargetColor);
Expand Down Expand Up @@ -114,9 +115,25 @@ public override void UpdateOnFrame(XIVPainter.XIVPainter painter)

if (Service.Config.TargetIconSize > 0)
{
_targetImage.Position = act.Target?.Position ?? Player.Object.Position;
if (act.GetTexture(out var texture, true)) _targetImage.SetTexture(texture, Service.Config.TargetIconSize);
subItems.Add(_targetImage);
var canDraw = !Svc.Condition[ConditionFlag.BetweenAreas]
&& !Svc.Condition[ConditionFlag.BetweenAreas51]
&& !Svc.Condition[ConditionFlag.OccupiedInCutSceneEvent];

if (!canDraw)
{
_time = DateTime.Now;
}

if (canDraw && DateTime.Now - _time > TimeSpan.FromSeconds(5))
// why crashing? why? the handle of the texture is fine.
{
_targetImage.Position = act.Target?.Position ?? Player.Object.Position;
if (act.GetTexture(out var texture, true))
{
_targetImage.SetTexture(texture, Service.Config.TargetIconSize);
subItems.Add(_targetImage);
}
}
}
else
{
Expand Down Expand Up @@ -283,7 +300,7 @@ public static void Init()
};

_painter.AddDrawings(
_highLight, _stateImage,new TargetDrawing(), annulus, movingTarget,
_highLight, _stateImage, new TargetDrawing(), annulus, movingTarget,
new TargetsDrawing(), new TargetText(), new BeneficialPositionDrawing()
);
}
Expand Down
2 changes: 1 addition & 1 deletion XIVPainter

0 comments on commit 4365fc8

Please sign in to comment.