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

Commit

Permalink
fix: update drawing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jun 6, 2023
1 parent bd7b6b7 commit 896ebdb
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 15 deletions.
4 changes: 3 additions & 1 deletion Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"116": 0.6,
"117": 0.6,
"118": 0.6,
"120": 0.1,
"121": 0.6,
"124": 0.1,
"125": 0.6,
Expand Down Expand Up @@ -294,13 +295,14 @@
"22411": 1.1,
"22605": 2.1,
"23036": 2.1,
"23317": 2.1,
"23915": 0.1,
"24222": 2.1,
"24283": 0.1,
"24284": 0.1,
"24285": 0.6,
"24289": 0.6,
"24290": 0.6,
"24290": 2.1,
"24291": 0.6,
"24292": 0.6,
"24294": 0.6,
Expand Down
2 changes: 2 additions & 0 deletions Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[
458,
1038,
1365,
1688,
2225,
2375,
2398,
Expand Down
8 changes: 7 additions & 1 deletion RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,13 @@ public unsafe bool CanUseTo(BattleChara tar)
var point = Player.Object.Position + Vector3.UnitY * Player.GameObject->Height;
var tarPt = tar.Position + Vector3.UnitY * tar.GetAddress()->Height;
var direction = tarPt - point;
if(BGCollisionModule.Raycast(point, direction, out var _, direction.Length())) return false;

int* unknown = stackalloc int[] { 0x4000, 0, 0x4000, 0 };

RaycastHit hit = default;

if( FFXIVClientStructs.FFXIV.Client.System.Framework.Framework.Instance()->BGCollisionModule
->RaycastEx(&hit, point, direction, direction.Length(), 1, unknown)) return false;

return true;
}
Expand Down
1 change: 0 additions & 1 deletion RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public class PluginConfiguration : IPluginConfiguration
public Vector3 TargetColor = new(1f, 0.2f, 0f);
public Vector3 SubTargetColor = new(1f, 0.9f, 0f);

public int CircleSegment = 100;
public float DrawingHeight = 3;
public float SampleLength = 0.2f;

Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
"ConfigWindow_Events_DutyStart": "Duty Start: ",
"ConfigWindow_Events_DutyEnd": "Duty End: ",
"ConfigWindow_Params_Description": "In this window, you can set the parameters about the using way of actions.",
"ConfigWindow_Param_UseOverlayWindow": "Display Top Overlay",
"ConfigWindow_Param_UseOverlayWindowDesc": "This top window is used to display some extra information on your game window, such as target's positional, target and sub-target, etc.",
"ConfigWindow_Param_Basic": "Basic",
"ConfigWindow_Param_ActionAhead": "Set the time advance of using actions",
"ConfigWindow_Param_MinLastAbilityAdvanced": "Set min the time advance of using the last 0gcd.",
Expand Down Expand Up @@ -90,6 +88,8 @@
"ConfigWindow_Param_MovingTargetColor": "Prompt box color of moving target",
"ConfigWindow_Param_TargetColor": "Target color",
"ConfigWindow_Param_SubTargetColor": "Sub-target color",
"ConfigWindow_Param_DrawingHeight": "The height of drawing.",
"ConfigWindow_Param_SampleLength": "The sample length of the line.",
"ConfigWindow_Param_KeyBoardNoise": "Simulate the effect of pressing",
"ConfigWindow_Param_KeyBoardNoiseTimes": "Effect times",
"ConfigWindow_Param_ToastPositional": "Hint positional anticipation by Toast",
Expand Down
1 change: 0 additions & 1 deletion RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ internal partial class Strings
public string ConfigWindow_Param_MovingTargetColor { get; set; } = "Prompt box color of moving target";
public string ConfigWindow_Param_TargetColor { get; set; } = "Target color";
public string ConfigWindow_Param_SubTargetColor { get; set; } = "Sub-target color";
public string ConfigWindow_Param_CircleSegment { get; set; } = "The segment count of circle.";
public string ConfigWindow_Param_DrawingHeight { get; set; } = "The height of drawing.";
public string ConfigWindow_Param_SampleLength { get; set; } = "The sample length of the line.";
public string ConfigWindow_Param_KeyBoardNoise { get; set; } = "Simulate the effect of pressing";
Expand Down
7 changes: 4 additions & 3 deletions RotationSolver/UI/PainterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public TargetDrawing()
IsFill = false,
};
}

const float targetRadius = 0.15f;
public override void UpdateOnFrame(XIVPainter.XIVPainter painter)
{
SubItems = Array.Empty<IDrawing3D>();
Expand All @@ -106,7 +108,7 @@ public override void UpdateOnFrame(XIVPainter.XIVPainter painter)

List<IDrawing3D> subItems = new List<IDrawing3D>() { _target };
_target.Center = act.Target.Position;
_target.Radius = (act.Target.HitboxRadius + act.EffectRange) * ratio;
_target.Radius = targetRadius * ratio;

if (DataCenter.HostileTargets.Contains(act.Target) || act.Target == Player.Object && !act.IsFriendly)
{
Expand All @@ -118,7 +120,7 @@ public override void UpdateOnFrame(XIVPainter.XIVPainter painter)
if (t == act.Target) continue;
if (act.CanGetTarget(act.Target, t))
{
subItems.Add(new Drawing3DCircularSector(t.Position, t.HitboxRadius * ratio, Scolor, 3)
subItems.Add(new Drawing3DCircularSector(t.Position, targetRadius * ratio, Scolor, 3)
{
IsFill = false,
});
Expand Down Expand Up @@ -181,7 +183,6 @@ public static void Init()
{
_painter = Svc.PluginInterface.Create<XIVPainter.XIVPainter>("RotationSolverOverlay");

_painter.CircleSegment = (ushort)Service.Config.CircleSegment;
_painter.DrawingHeight = Service.Config.DrawingHeight;
_painter.SampleLength = Service.Config.SampleLength;

Expand Down
5 changes: 0 additions & 5 deletions RotationSolver/UI/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,6 @@ private void DrawParamDisplay()
ref Service.Config.SubTargetColor, Service.Default.SubTargetColor);
}

DrawIntNumber(LocalizationManager.RightLang.ConfigWindow_Param_CircleSegment, ref Service.Config.CircleSegment, Service.Default.CircleSegment, otherThing: () =>
{
PainterManager._painter.CircleSegment = (ushort)Service.Config.CircleSegment;
});

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_DrawingHeight, ref Service.Config.DrawingHeight, Service.Default.DrawingHeight, otherThing: () =>
{
PainterManager._painter.DrawingHeight = Service.Config.DrawingHeight;
Expand Down
2 changes: 1 addition & 1 deletion XIVPainter

0 comments on commit 896ebdb

Please sign in to comment.