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

Commit

Permalink
fix: territory id and drawing fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Mar 16, 2024
1 parent f230e72 commit 501e846
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 13 deletions.
6 changes: 6 additions & 0 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@
"11427": 0.6,
"12260": 0.1,
"12669": 1.1,
"12911": 0.6,
"14083": 2.1,
"14100": 2.1,
"14234": 2.1,
Expand Down Expand Up @@ -521,6 +522,10 @@
"24398": 0.1,
"24399": 0.6,
"24405": 0.6,
"24619": 0.6,
"24620": 0.6,
"24621": 0.6,
"24622": 0.6,
"24628": 2.1,
"24955": 0.1,
"25063": 2.1,
Expand Down Expand Up @@ -632,6 +637,7 @@
"31929": 0.1,
"31930": 0.1,
"31931": 0.1,
"32066": 0.6,
"32068": 0.6,
"33041": 2.1,
"33218": 0.1,
Expand Down
5 changes: 4 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -519,5 +519,8 @@
22238,
33077,
34694,
34695
34695,
12923,
13143,
13166
]
4 changes: 2 additions & 2 deletions Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ClickingCount": 100914,
"SayingHelloCount": 168,
"ClickingCount": 104219,
"SayingHelloCount": 173,
"SaidUsers": []
}
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Rotations/Duties/BozjaRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// The bozja action.
/// </summary>
[DutyTerritory] //TODO: the bozja territory ids!
[DutyTerritory(920, 975)] //TODO: the bozja territory ids!
public abstract class BozjaRotation : DutyRotation
{
}
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -393,5 +393,6 @@
"RotationSolver.Data.UiString.TimelinePlaceOnTarget": "Place On Target",
"RotationSolver.Data.UiString.TimelinePositionOffset": "Position Offset",
"RotationSolver.Data.UiString.ConfigWindow_List_NoCastingStatus": "No Casting debuffs",
"RotationSolver.Data.UiString.ConfigWindow_List_NoCastingStatusDesc": "No Casting debuffs List"
"RotationSolver.Data.UiString.ConfigWindow_List_NoCastingStatusDesc": "No Casting debuffs List",
"RotationSolver.Data.UiString.ConfigWindow_Actions_CheckStatus": "Should this action check the stauts."
}
10 changes: 8 additions & 2 deletions RotationSolver/RotationSolverPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public RotationSolverPlugin(DalamudPluginInterface pluginInterface)
windowSystem.AddWindow(_cooldownWindow);

Svc.PluginInterface.UiBuilder.OpenConfigUi += OnOpenConfigUi;
Svc.PluginInterface.UiBuilder.Draw += windowSystem.Draw;
Svc.PluginInterface.UiBuilder.Draw += OnDraw;

PainterManager.Init();
MajorUpdater.Enable();
Expand Down Expand Up @@ -103,6 +103,12 @@ public RotationSolverPlugin(DalamudPluginInterface pluginInterface)
#endif
}

private void OnDraw()
{
if (Svc.GameGui.GameUiHidden) return;
windowSystem.Draw();
}

internal static void ChangeUITranslation()
{
_rotationConfigWindow!.WindowName = UiString.ConfigWindowHeader.Local()
Expand All @@ -118,7 +124,7 @@ public async void Dispose()
Watcher.Disable();

Svc.PluginInterface.UiBuilder.OpenConfigUi -= OnOpenConfigUi;
Svc.PluginInterface.UiBuilder.Draw -= windowSystem.Draw;
Svc.PluginInterface.UiBuilder.Draw -= OnDraw;

foreach (var item in _dis)
{
Expand Down
9 changes: 5 additions & 4 deletions RotationSolver/UI/PainterManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,13 @@ private static void UpdateTarget()

private static unsafe void UpdateHostileIcons()
{
foreach (var item in TargetsDrawings)
{
item.Enable = false;
}

if (!Service.Config.ShowHostilesIcons)
{
foreach (var item in TargetsDrawings)
{
item.Enable = false;
}
return;
}

Expand Down
4 changes: 3 additions & 1 deletion RotationSolver/UI/TimelineDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ void AddOneCondition<T>() where T : ITimelineCondition
else if (con is TimelineConditionAction action)
{
var index = Array.IndexOf(timelineItem.ActionIDs, action.ActionID);
var actionNames = timelineItem.ActionIDs.Select(i => Svc.Data.GetExcelSheet<Lumina.Excel.GeneratedSheets.Action>()?.GetRow(i)?.Name.RawString ?? "Unnamed Action").ToArray();
var actionNames = timelineItem.ActionIDs.Select(i => (Svc.Data.GetExcelSheet<Lumina.Excel.GeneratedSheets.Action>()?.GetRow(i)?.Name.RawString ?? "Unnamed Action") + $" ({i})").ToArray();

ImGui.SameLine();
if (ImGuiHelper.SelectableCombo("Action ##Select Action" + action.GetHashCode(), actionNames, ref index))
Expand Down Expand Up @@ -1008,6 +1008,8 @@ private static void DrawObjectGetter(ObjectGetter getter, string getterName)
getter.TimeDuration = duration;
}

if (!ImGui.CollapsingHeader("Effect##" + getter.GetHashCode())) return;

var vfx = getter.VfxPath;
ImGui.SetNextItemWidth(300 * Scale);
if (ImGui.InputText("Vfx ## " + getter.GetHashCode(), ref vfx, 256))
Expand Down
18 changes: 18 additions & 0 deletions RotationSolver/Updaters/RaidTimeUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,28 @@ private static void OnCast(IntPtr dataPtr, uint targetActorId)
{
var name = GetNameFromObjectId(targetActorId);
var actionId = ReadUshort(dataPtr, 0);
var castingTime = Svc.Data.GetExcelSheet<Lumina.Excel.GeneratedSheets.Action>()?
.GetRow(actionId)?.Cast100ms / 10f;

for (int i = 0; i < DataCenter.TimelineItems.Length; i++)
{
var item = DataCenter.TimelineItems[i];

if (item.Type is TimelineType.Ability
&& item["id", actionId]
&& item["source", name])
{
var t = DataCenter.RaidTimeRaw + castingTime;

if (t >= item.Time - item.WindowMin && t <= item.Time + item.WindowMax)
{
item.LastActionID = actionId;
#if DEBUG
Svc.Log.Debug($"Set the timeline {item.Time} action to {actionId}");
#endif
}
}

if (!item.IsInWindow) continue;
if (item.Type is not TimelineType.StartsUsing) continue;

Expand Down
2 changes: 1 addition & 1 deletion XIVPainter

0 comments on commit 501e846

Please sign in to comment.