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

Commit

Permalink
fix: timeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Mar 2, 2024
1 parent 795eb78 commit fd8f281
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
3 changes: 2 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -513,5 +513,6 @@
26072,
26064,
33445,
35218
35218,
32945
]
4 changes: 2 additions & 2 deletions Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ClickingCount": 93996,
"SayingHelloCount": 139,
"ClickingCount": 94766,
"SayingHelloCount": 141,
"SaidUsers": []
}
4 changes: 3 additions & 1 deletion RotationSolver.Basic/Data/TimelineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ private RaidLangs.Lang Lang

public float Time => time;

public float WindowMin => windowMin;
public float WindowMax => windowMax;
public JObject? Object => obj;

public string Name
Expand All @@ -50,7 +52,7 @@ public string Name
}
}

public bool IsInWindow => DataCenter.RaidTimeRaw >= Time - windowMin && DataCenter.RaidTimeRaw <= Time + windowMax;
public bool IsInWindow => DataCenter.RaidTimeRaw >= Time - WindowMin && DataCenter.RaidTimeRaw <= Time + WindowMax;

public bool IsShown => Name is not "--Reset--" and not "--sync--";

Expand Down
27 changes: 16 additions & 11 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,12 @@ static string GetName(TerritoryType? territory)
}
}


#if DEBUG
ImGui.SameLine();
ImGui.Text("Raid Time: " + TimeSpan.FromSeconds(DataCenter.RaidTimeRaw).ToString("hh\\:mm\\:ss\\.f"));
#endif

using var table = ImRaii.Table("Rotation Solver List Timeline", 3, ImGuiTableFlags.BordersInner | ImGuiTableFlags.Resizable | ImGuiTableFlags.SizingStretchProp | ImGuiTableFlags.ScrollY);
if (table)
{
Expand Down Expand Up @@ -747,21 +753,21 @@ static string GetName(TerritoryType? territory)

ImGui.TableNextColumn();

var str = TimeSpan.FromSeconds(item.Time).ToString("hh\\:mm\\:ss\\.f");
if(DataCenter.RaidTimeRaw < item.Time && DataCenter.RaidTimeRaw > item.Time - 3)
{
ImGui.TextColored(ImGuiColors.HealerGreen, str);
}
else
{
ImGui.Text(str);
}
IDisposable? color = item.IsInWindow ? ImRaii.PushColor(ImGuiCol.Text,
ImGuiColors.HealerGreen) : null;

ImGui.Text(TimeSpan.FromSeconds(item.Time).ToString("hh\\:mm\\:ss\\.f"));

ImGui.TableNextColumn();
AddButton();
ImGui.SameLine();

ImGui.TextWrapped(item.Name);
var itemName = item.Name;
#if DEBUG
itemName += $" ({item.WindowMin}, {item.WindowMax})";
#endif
ImGui.TextWrapped(itemName);
color?.Dispose();

ImGui.TableNextColumn();

Expand Down Expand Up @@ -2788,7 +2794,6 @@ private static void DrawLastAction()
private static unsafe void DrawOthers()
{
ImGui.Text("Combat Time: " + (DataCenter.CombatTimeRaw).ToString());
ImGui.Text("Raid Time: " + (DataCenter.RaidTimeRaw).ToString());
ImGui.Text("Limit Break: " + CustomRotation.LimitBreakLevel.ToString());
}

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/RaidTimeUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private static void OnEffect(IntPtr dataPtr, uint targetActorId)
if (!item["id", ReadUint(dataPtr, 28)]) continue;
if (!item["source", name]) continue;

if (DateTime.Now - _actionUpdateTime < TimeSpan.FromSeconds(2)) continue;
if (DateTime.Now - _actionUpdateTime < TimeSpan.FromSeconds(0.5)) continue;

item.UpdateRaidTimeOffset();
_actionUpdateTime = DateTime.Now;
Expand Down

0 comments on commit fd8f281

Please sign in to comment.