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

Commit

Permalink
fix: removed the casting bar color changing feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 16, 2023
1 parent 9d5cec0 commit 1989db2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 34 deletions.
11 changes: 10 additions & 1 deletion Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"141": 0.1,
"147": 0.1,
"149": 0.6,
"152": 0.1,
"152": 0.6,
"153": 0.6,
"154": 0.1,
"156": 0.6,
Expand All @@ -80,6 +80,7 @@
"185": 0.1,
"190": 0.1,
"260": 0.6,
"265": 0.6,
"266": 0.6,
"2240": 0.6,
"2242": 0.6,
Expand Down Expand Up @@ -149,15 +150,19 @@
"3613": 0.6,
"3614": 0.6,
"3615": 0.1,
"3625": 0.6,
"4262": 0.6,
"4401": 0.6,
"4402": 0.6,
"4403": 0.6,
"4404": 0.6,
"4405": 0.6,
"4406": 0.6,
"4551": 1.1,
"4574": 0.6,
"4594": 1.1,
"4639": 0.6,
"4643": 0.6,
"4868": 2.1,
"6993": 2.1,
"7381": 0.6,
Expand Down Expand Up @@ -195,6 +200,7 @@
"7431": 0.1,
"7432": 0.6,
"7433": 0.6,
"7436": 0.6,
"7439": 0.6,
"7442": 0.1,
"7443": 0.6,
Expand Down Expand Up @@ -347,6 +353,7 @@
"16500": 0.6,
"16501": 0.6,
"16505": 0.1,
"16506": 0.6,
"16507": 0.6,
"16508": 0.6,
"16510": 0.6,
Expand Down Expand Up @@ -381,8 +388,10 @@
"18881": 0.6,
"19002": 0.6,
"19004": 0.6,
"19008": 0.6,
"19010": 0.6,
"19012": 0.6,
"19016": 0.6,
"19297": 0.6,
"20243": 0.1,
"20250": 0.1,
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 @@ -50,7 +50,6 @@ public class PluginConfiguration : IPluginConfiguration
public bool HealOutOfCombat = false;
public bool ShowInfoOnToast = true;
public bool RaiseAll = false;
public bool CastingDisplay = true;
public bool PoslockCasting = false;
public int PoslockModifier = 0;
public bool PosPassageOfArms = false;
Expand Down
1 change: 0 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"ConfigWindow_Param_HealthRatioDot": "If target's current health ratio is higher than this, regard it can be dot.",
"ConfigWindow_Param_PoslockModifier": "Set the modifier key to unlock the movement temporary",
"ConfigWindow_Param_PoslockDescription": "LT is for gamepad player",
"ConfigWindow_Param_CastingDisplay": "Enhance cast bar with casting status",
"ConfigWindow_Param_TeachingMode": "Teaching mode",
"ConfigWindow_Param_TeachingModeColor": "Prompt box color of teaching mode",
"ConfigWindow_Param_MovingTargetColor": "Prompt box color of moving target",
Expand Down
1 change: 0 additions & 1 deletion RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ internal partial class Strings
public string ConfigWindow_Param_HealthRatioDot { get; set; } = "If target's current health ratio is higher than this, regard it can be dot.";
public string ConfigWindow_Param_PoslockModifier { get; set; } = "Set the modifier key to unlock the movement temporary";
public string ConfigWindow_Param_PoslockDescription { get; set; } = "LT is for gamepad player";
public string ConfigWindow_Param_CastingDisplay { get; set; } = "Enhance cast bar with casting status";
public string ConfigWindow_Param_TeachingMode { get; set; } = "Teaching mode";
public string ConfigWindow_Param_TeachingModeColor { get; set; } = "Prompt box color of teaching mode";
public string ConfigWindow_Param_MovingTargetColor { get; set; } = "Prompt box color of moving target";
Expand Down
3 changes: 0 additions & 3 deletions RotationSolver/UI/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,6 @@ private void DrawParamDisplay()

ImGui.Spacing();

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_CastingDisplay,
ref Service.Config.CastingDisplay, Service.Default.CastingDisplay);

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_ToastPositional,
ref Service.Config.ToastPositional, Service.Default.ToastPositional);
}
Expand Down
31 changes: 5 additions & 26 deletions RotationSolver/Updaters/PreviewUpdater.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Game.Gui.Dtr;
using Dalamud.Game.Gui.Dtr;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using ECommons.DalamudServices;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using FFXIVClientStructs.FFXIV.Client.Graphics;
using FFXIVClientStructs.FFXIV.Client.System.Framework;
using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using FFXIVClientStructs.FFXIV.Component.GUI;
using RotationSolver.Commands;

namespace RotationSolver.Updaters;
Expand All @@ -19,7 +16,7 @@ internal static class PreviewUpdater
internal static void UpdatePreview()
{
UpdateEntry();
UpdateCastBar();
UpdateCancelCast();
}

static DtrBarEntry _dtrEntry;
Expand Down Expand Up @@ -53,34 +50,16 @@ private static void UpdateEntry()
static RandomDelay _tarStopCastDelay = new(() =>
(Service.Config.StopCastingDelayMin, Service.Config.StopCastingDelayMax));
static bool _showCanMove;
static readonly ByteColor _redColor = new() { A = 255, R = 120, G = 0, B = 60 };
static readonly ByteColor _greenColor = new() { A = 255, R = 60, G = 120, B = 30 };
private static unsafe void UpdateCastBar()
private static unsafe void UpdateCancelCast()
{
var tardead = Service.Config.UseStopCasting
var tarDead = Service.Config.UseStopCasting
&& Svc.Objects.SearchById(Player.Object.CastTargetObjectId) is BattleChara b
&& b.IsNPCEnemy() && b.CurrentHp == 0;

if (_tarStopCastDelay.Delay(tardead))
if (_tarStopCastDelay.Delay(tarDead))
{
UIState.Instance()->Hotbar.CancelCast();
}

var nowMove = Service.CanMove && Service.Config.CastingDisplay;
if (nowMove == _showCanMove) return;
_showCanMove = nowMove;

ByteColor c = _showCanMove ? _greenColor : _redColor;

var castBars = Service.GetAddons<AddonCastBar>();
if (!castBars.Any()) return;
var castBar = castBars.FirstOrDefault();

AtkResNode* progressBar = ((AtkUnitBase*)castBar)->UldManager.NodeList[5];

progressBar->AddRed = c.R;
progressBar->AddGreen = c.G;
progressBar->AddBlue = c.B;
}


Expand Down
2 changes: 1 addition & 1 deletion XIVPainter

0 comments on commit 1989db2

Please sign in to comment.