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

Commit

Permalink
fix: add hp item icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 18, 2023
1 parent 8985779 commit 1329f76
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
4 changes: 2 additions & 2 deletions ActionTimelineEx/Helpers/DrawHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public static void DrawDamage(this ImDrawListPtr drawList, Vector2 position, flo
_uv1, _uv2, lightCol);
}

public static void DrawActionIcon(this ImDrawListPtr drawList, uint iconId, Vector2 position, float size)
public static void DrawActionIcon(this ImDrawListPtr drawList, uint iconId, bool isHq, Vector2 position, float size)
{
TextureWrap? texture = GetTextureFromIconId(iconId);
TextureWrap? texture = GetTextureFromIconId(iconId, isHq);
if (texture == null) return;

var pixPerUnit = size / 82;
Expand Down
4 changes: 2 additions & 2 deletions ActionTimelineEx/Timeline/TimelineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class TimelineItem : ITimelineItem
{
public string? Name { get; set; }
public ushort Icon { get; set; }

public bool IsHq { get; set; }
public DateTime StartTime { get; init; }

public float AnimationLockTime { get; set; }
Expand Down Expand Up @@ -88,7 +88,7 @@ private void DrawItemWithCenter(ImDrawListPtr drawList, Vector2 centerPos, Vecto
switch (icon)
{
case TimelineLayer.Icon:
drawList.DrawActionIcon(Icon, new Vector2(centerPos.X, centerPos.Y - iconSize / 2), iconSize);
drawList.DrawActionIcon(Icon, IsHq, new Vector2(centerPos.X, centerPos.Y - iconSize / 2), iconSize);
return;

case TimelineLayer.Status when setting.ShowStatus:
Expand Down
21 changes: 8 additions & 13 deletions ActionTimelineEx/Timeline/TimelineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,33 +265,28 @@ private void ActionFromSelfAsync(ActionEffectSet set)
if (_lastItem != null && _lastItem.CastingTime > 0 && type == TimelineItemType.GCD
&& _lastItem.State == TimelineItemState.Casting) // Finish the casting.
{
_lastItem.State = TimelineItemState.Finished;
_lastItem.AnimationLockTime = set.Header.AnimationLockTime;
_lastItem.Name = set.Name;
_lastItem.Icon = set.IconId;
_lastItem.Damage = damage;
}
else
{
var item = new TimelineItem()
AddItem(new TimelineItem()
{
Name = set.Name,
Icon = set.IconId,
StartTime = DateTime.Now,
AnimationLockTime = type == TimelineItemType.AutoAttack ? 0 : set.Header.AnimationLockTime,
GCDTime = type == TimelineItemType.GCD ? GCD : 0,
Type = type,
State = TimelineItemState.Finished,
Damage = damage,
};

AddItem(item);
});
}
var effectItem = _lastItem;


if (effectItem == null) return;

effectItem.Name = set.Name;
effectItem.Icon = set.IconId;
effectItem.State = TimelineItemState.Finished;
effectItem.Damage = damage;
effectItem.IsHq = set.Header.ActionType == ActionType.Item && set.Header.ActionID > 1000000;

foreach (var i in statusGain)
{
effectItem.StatusGainIcon.Add(i);
Expand Down

0 comments on commit 1329f76

Please sign in to comment.