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

Commit

Permalink
fix: changed the way to show the sub targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Mar 3, 2024
1 parent 274ee2d commit 31c74a0
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 204 deletions.
4 changes: 3 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -514,5 +514,7 @@
26064,
33445,
35218,
32945
32945,
22247,
22238
]
4 changes: 2 additions & 2 deletions Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ClickingCount": 94943,
"SayingHelloCount": 148,
"ClickingCount": 97701,
"SayingHelloCount": 158,
"SaidUsers": []
}
7 changes: 0 additions & 7 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,6 @@ public const string
[Range(0, 600, ConfigUnitType.Seconds)]
public float AutoOffAfterCombatTime { get; set; } = 30;

[UI("The height of the drawing things.", Parent =nameof(UseOverlayWindow))]
[Range(0, 8, ConfigUnitType.Yalms, 0.02f)]
public float DrawingHeight { get; set; } = 3;

[UI("Drawing smoothness.", Parent = nameof(UseOverlayWindow))]
[Range(0.005f, 0.05f, ConfigUnitType.Yalms, 0.001f)]
public float SampleLength { get; set; } = 1;
Expand Down Expand Up @@ -635,9 +631,6 @@ public const string
[UI("Target color", Parent =nameof(TargetColor))]
public Vector4 TargetColor { get; set; } = new(1f, 0.2f, 0f, 0.8f);

[UI("Sub-target color", Parent = nameof(TargetColor))]
public Vector4 SubTargetColor { get; set; } = new(1f, 0.9f, 0f, 0.8f);

[UI("The color of beneficial AoE positions", Parent =nameof(ShowBeneficialPositions))]
public Vector4 BeneficialPositionColor { get; set; } = new(0.5f, 0.9f, 0.1f, 0.7f);

Expand Down
4 changes: 3 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,5 +355,7 @@
"UseGroundBeneficialAbilityName": "Use beneficial ground-targeted actions",
"UseDefenseAbilityDescription": "It is recommended to check this option if you are playing Raids or you can plan the heal and defense ability usage by yourself.",
"BeneficialAreaStrategyName": "Beneficial AoE strategy",
"UseGroundBeneficialAbilityWhenMovingName": "Use beneficial AoE actions when moving."
"UseGroundBeneficialAbilityWhenMovingName": "Use beneficial AoE actions when moving.",
"RotationSolver.Data.UiString.SpecialCommandType_TankStance": "Tank Stance",
"RotationSolver.Data.UiString.ConfigWindow_Actions_TTU": "Time to untargetable that this action needs the timeline be."
}
9 changes: 4 additions & 5 deletions RotationSolver/RotationSolverPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
using RotationSolver.Localization;
using RotationSolver.UI;
using RotationSolver.Updaters;
using System.Runtime.InteropServices;
using XIVPainter.Enum;
using XIVPainter.Vfx;

namespace RotationSolver;

Expand Down Expand Up @@ -92,11 +95,7 @@ public RotationSolverPlugin(DalamudPluginInterface pluginInterface)
await DownloadHelper.DownloadAsync();
await RotationUpdater.GetAllCustomRotationsAsync(DownloadOption.Download);
});
//VfxManager.OnGround("vfx/monster/m0095/eff/m0095sp_07c4m.avfx", false);
VfxManager.Remove();
var obj = VfxManager.OnGround("vfx/omen/eff/general_1bf.avfx", false);
//VfxManager.UpdateScale(obj, Vector3.One * 5);
//VfxManager.Test(obj);
//var vfx = new StaticVfx(GroundOmenFriendly.Rectangle02, Player.Object, Vector3.One);
}

internal static void ChangeUITranslation()
Expand Down
15 changes: 0 additions & 15 deletions RotationSolver/UI/PainterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,6 @@ public override void UpdateOnFrame(XIVPainter.XIVPainter painter)
subItems.Add(_target);
}

if (act.Target.HasValue && (DataCenter.AllHostileTargets.Contains(act.Target?.Target) || act.Target?.Target == Player.Object && !act.Setting.IsFriendly))
{
var SColor = ImGui.GetColorU32(Service.Config.SubTargetColor);

foreach (var t in act.Target!.Value.AffectedTargets)
{
if (t == act.Target?.Target) continue;
subItems.Add(new Drawing3DCircularSector(t.Position, targetRadius * ratio, SColor, 3)
{
IsFill = false,
});
}
}

SubItems = [.. subItems];

base.UpdateOnFrame(painter);
Expand Down Expand Up @@ -296,7 +282,6 @@ public static void Init()
public static void UpdateSettings()
{
if (_painter == null) return;
_painter.DrawingHeight = Service.Config.DrawingHeight;
_painter.SampleLength = Service.Config.SampleLength;
_painter.UseTaskToAccelerate = Service.Config.UseTasksForOverlay;
_painter.Enable = !Svc.Condition[ConditionFlag.OccupiedInCutSceneEvent] && Service.Config.UseOverlayWindow;
Expand Down
70 changes: 69 additions & 1 deletion RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
using Dalamud.Game.ClientState.Objects.SubKinds;
using ECommons.DalamudServices;
using ECommons.GameHelpers;
using ExCSS;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using RotationSolver.Commands;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using XIVPainter.Enum;
using XIVPainter.Vfx;

namespace RotationSolver.Updaters;

Expand All @@ -17,7 +20,72 @@ internal static class ActionUpdater
static RandomDelay _GCDDelay = new(() => Service.Config.WeaponDelay);

internal static IAction? NextAction { get; set; }
internal static IBaseAction? NextGCDAction { get; set; }

//private static StaticVfx? circle, sector, rectangle;
private static StaticVfx? drawer;
private static IBaseAction? _nextGCDAction;
const float gcdHeight = 5;
internal static IBaseAction? NextGCDAction
{
get => _nextGCDAction;
set
{
if (_nextGCDAction == value) return;
_nextGCDAction = value;


drawer?.Dispose();
if (!Service.Config.ShowTarget) return;

var player = Player.Object;
if (player == null) return;

//circle ??= new(GroundOmenFriendly.Circle1, player, new Vector3(0, gcdHeight, 0));
//sector ??= new(GroundOmenFriendly.CircularSector120, player, new Vector3(0, gcdHeight, 0));
//rectangle ??= new(GroundOmenType.Rectangle02, player, new Vector3(0, gcdHeight, 0));

//circle.Enable = sector.Enable = rectangle.Enable = false;
//circle.Owner = sector.Owner = rectangle.Owner = player;

if (value == null) return;
var target = value.Target?.Target;
if (target == null) return;

var range = value.Action.EffectRange;
var size = new Vector3(range, gcdHeight, range);
switch(value.Action.CastType)
{
//ase 1:
case 2:
drawer = new(GroundOmenFriendly.Circle1, target, size);
//circle.Owner = target;
//circle.UpdateScale(size);
//circle.Enable = true;
break;

case 3:
drawer = new(GroundOmenFriendly.CircularSector120, player, size)
{
Target = target
};
//sector.Target = target;
//sector.UpdateScale(size);
//sector.Enable = true;
break;

case 4:
size.X = 2;
drawer = new(GroundOmenFriendly.Rectangle02, player, size)
{
Target = target
};
//rectangle.Target = target;
//rectangle.UpdateScale(size);
//rectangle.Enable = true;
break;
}
}
}
internal static IAction? WrongAction { get; set; }
static readonly Random _wrongRandom = new();

Expand Down
98 changes: 0 additions & 98 deletions RotationSolver/VfxManager.cs

This file was deleted.

Loading

0 comments on commit 31c74a0

Please sign in to comment.