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

Commit

Permalink
fix: default value changing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 16, 2023
1 parent cf82e38 commit e323ffa
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 24 deletions.
4 changes: 1 addition & 3 deletions Resources/downloadList.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[
"ArchiDog1998|FFXIVRotations|DefaultRotations",
"ArchiDog1998|FFXIVRotations|ExtraRotations",
"RiotNOR|CustomRotations|RiotsRotations",
"IncognitoWater|IncognitoWaterRotations|IcWaRotations",
"BrakusTapus|KirboRotations|KirboRotations",
"thunderebolt|BoltsRotations|BoltsRotations"
"BrakusTapus|KirboRotations|KirboRotations"
]
4 changes: 2 additions & 2 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ public enum PluginConfigFloat : byte
[Default(0.6f, 0.5f, 0.7f)] CountDownAhead,

[Default(24f)] MoveTargetAngle,
[Default(60, 10f, 1800f)] DeadTimeBoss,
[Default(10, 0f, 60)] DeadTimeDying,
[Default(60f, 10f, 1800f)] DeadTimeBoss,
[Default(10f, 0f, 60f)] DeadTimeDying,

[Default(16f, 9.6f, 96f)] CooldownFontSize,

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal static class DataCenter
/// <summary>
/// Only recorded 15s hps.
/// </summary>
public const int HP_RECORD_TIME = 150;
public const int HP_RECORD_TIME = 240;
internal static Queue<(DateTime time, SortedList<uint, float> hpRatios)> RecordedHP { get; } = new(HP_RECORD_TIME + 1);

internal static bool NoPoslock => Svc.Condition[ConditionFlag.OccupiedInEvent]
Expand Down
10 changes: 5 additions & 5 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@
"ConfigWindow_Param_UseStopCasting": "Stops casting when hostile target is dead.",
"ConfigWindow_Param_ShowTooltips": "Show tooltips",
"ConfigWindow_Param_InDebug": "Debug Mode",
"ConfigWindow_Param_ShowHealthRatio": "Show the health ratio for the check of Boss, Dying, Dot.",
"ConfigWindow_Param_HealthRatioBoss": "If target's max health ratio is higher than this, regard it as Boss.",
"ConfigWindow_Param_HealthRatioDying": "If target's current health ratio is lower than this, regard it is dying.",
"ConfigWindow_Param_HealthRatioDot": "If target's current health ratio is higher than this, regard it can be dot.",
"ConfigWindow_Param_ShowTargetDeadTime": "Show the targets' dead time.",
"ConfigWindow_Param_DeadTimeBoss": "If target's whole dead time is higher than this, regard it as Boss.",
"ConfigWindow_Param_DeadTimeDying": "If target's dead time is lower than this, regard it is dying.",
"ConfigWindow_Param_PoslockModifier": "Set the modifier key to unlock the movement temporary",
"ConfigWindow_Param_PoslockDescription": "LT is for gamepad player",
"ConfigWindow_Param_TeachingMode": "Teaching mode",
Expand Down Expand Up @@ -462,5 +461,6 @@
"ConfigWindow_Tab_UI": "Settings about user interface.",
"ConfigWindow_Tab_Auto": "About some general actions' usage and conditions.",
"ConfigWindow_Tab_Target": "The way to find the targets, hostiles or friends.",
"ConfigWindow_Tab_Extra": "Some features shouldn't be included by RS."
"ConfigWindow_Tab_Extra": "Some features shouldn't be included by RS.",
"ConfigWindow_List_AddPosition": "Add One territory position"
}
33 changes: 21 additions & 12 deletions RotationSolver/UI/PainterManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ECommons.DalamudServices;
using Dalamud.Game.ClientState.Objects.SubKinds;
using ECommons.DalamudServices;
using ECommons.GameHelpers;
using RotationSolver.Basic.Configuration;
using RotationSolver.Updaters;
Expand Down Expand Up @@ -55,7 +56,7 @@ class TargetDrawing : Drawing3DPoly

public TargetDrawing()
{
var TColor = ImGui.GetColorU32(Service.Config.GetValue(Basic.Configuration.PluginConfigVector4.TargetColor));
var TColor = ImGui.GetColorU32(Service.Config.GetValue(PluginConfigVector4.TargetColor));
_target = new Drawing3DCircularSector(default, 0, TColor, 3)
{
IsFill = false,
Expand All @@ -71,7 +72,7 @@ public override void UpdateOnFrame(XIVPainter.XIVPainter painter)
{
SubItems = Array.Empty<IDrawing3D>();

if (!Service.Config.GetValue(Basic.Configuration.PluginConfigBool.ShowTarget)) return;
if (!Service.Config.GetValue(PluginConfigBool.ShowTarget)) return;

if (ActionUpdater.NextAction is not BaseAction act) return;

Expand All @@ -81,23 +82,23 @@ public override void UpdateOnFrame(XIVPainter.XIVPainter painter)
var ratio = (float)DrawingExtensions.EaseFuncRemap(EaseFuncType.None, EaseFuncType.Cubic)(d);
List<IDrawing3D> subItems = new List<IDrawing3D>();

if(Service.Config.GetValue(Basic.Configuration.PluginConfigFloat.TargetIconSize) > 0)
if(Service.Config.GetValue(PluginConfigFloat.TargetIconSize) > 0)
{
_targetImage.Position = act.IsTargetArea ? act.Position : act.Target.Position;
if(act.GetTexture(out var texture, true)) _targetImage.SetTexture(texture, Service.Config.GetValue(Basic.Configuration.PluginConfigFloat.TargetIconSize));
if(act.GetTexture(out var texture, true)) _targetImage.SetTexture(texture, Service.Config.GetValue(PluginConfigFloat.TargetIconSize));
subItems.Add(_targetImage);
}
else
{
_target.Color = ImGui.GetColorU32(Service.Config.GetValue(Basic.Configuration.PluginConfigVector4.TargetColor));
_target.Color = ImGui.GetColorU32(Service.Config.GetValue(PluginConfigVector4.TargetColor));
_target.Center = act.IsTargetArea ? act.Position : act.Target.Position;
_target.Radius = targetRadius * ratio;
subItems.Add(_target);
}

if (DataCenter.HostileTargets.Contains(act.Target) || act.Target == Player.Object && !act.IsFriendly)
{
var SColor = ImGui.GetColorU32(Service.Config.GetValue(Basic.Configuration.PluginConfigVector4.SubTargetColor));
var SColor = ImGui.GetColorU32(Service.Config.GetValue(PluginConfigVector4.SubTargetColor));

foreach (var t in DataCenter.HostileTargets)
{
Expand Down Expand Up @@ -142,17 +143,25 @@ public override void UpdateOnFrame(XIVPainter.XIVPainter painter)
if (!Service.Config.GetValue(PluginConfigBool.ShowTargetDeadTime)) return;

int index = 0;
foreach (GameObject t in DataCenter.AllTargets.OrderBy(ObjectHelper.DistanceToPlayer))
foreach (GameObject t in DataCenter.AllHostileTargets.OrderBy(ObjectHelper.DistanceToPlayer))
{
if (t is not BattleChara b) continue;
if (t is PlayerCharacter) continue;

var item = (Drawing3DText)SubItems[index++];

item.Text = $"Health Ratio: {b.GetDeadTime():F2}s / {b.GetDeadTime(true):F2}s";
item.Color = HealthRatioColor;
item.Position = b.Position;
try
{
item.Text = $"DeadTime: {b.GetDeadTime():F2}s / {b.GetDeadTime(true):F2}s";
item.Color = HealthRatioColor;
item.Position = b.Position;
}
catch
{
continue;
}

if(index >= ItemsCount) break;
if (index >= ItemsCount) break;
}
base.UpdateOnFrame(painter);
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/TargetUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal unsafe static void UpdateTarget()
}

private static DateTime _lastUpdateDeadTime = DateTime.MinValue;
private static readonly TimeSpan _deadTimeSpan = TimeSpan.FromSeconds(0.1);
private static readonly TimeSpan _deadTimeSpan = TimeSpan.FromSeconds(0.5);
private static void UpdateDeadTime(IEnumerable<BattleChara> allTargets)
{
var now = DateTime.Now;
Expand Down

0 comments on commit e323ffa

Please sign in to comment.