Skip to content

Commit

Permalink
Fix timelines
Browse files Browse the repository at this point in the history
  • Loading branch information
AsgardXIV committed Nov 20, 2024
1 parent 89230c3 commit 2a070d2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 34 deletions.
38 changes: 19 additions & 19 deletions Brio/Resources/Sheets/BrioActionTimeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ readonly public struct BrioActionTimeline(ExcelPage page, uint offset, uint row)

public readonly ReadOnlySeString Key => page.ReadString(offset, offset);
public readonly RowRef<WeaponTimeline> WeaponTimeline => new(page.Module, (uint)page.ReadUInt16(offset + 4), page.Language);
public readonly byte Unknown_70 => page.ReadUInt8(offset + 6);
public readonly byte Type => page.ReadUInt8(offset + 7);
public readonly byte Priority => page.ReadUInt8(offset + 8);
public readonly byte Stance => page.ReadUInt8(offset + 9);
public readonly byte Slot => page.ReadUInt8(offset + 10);
public readonly byte LookAtMode => page.ReadUInt8(offset + 11);
public readonly byte ActionTimelineIDMode => page.ReadUInt8(offset + 12);
public readonly byte LoadType => page.ReadUInt8(offset + 13);
public readonly byte StartAttach => page.ReadUInt8(offset + 14);
public readonly byte ResidentPap => page.ReadUInt8(offset + 15);
public readonly byte Unknown6 => page.ReadUInt8(offset + 16);
public readonly byte Unknown1 => page.ReadUInt8(offset + 17);
public readonly bool Pause => page.ReadPackedBool(offset + 18, 0);
public readonly bool Resident => page.ReadPackedBool(offset + 18, 1);
public readonly bool IsMotionCanceledByMoving => page.ReadPackedBool(offset + 18, 2);
public readonly bool Unknown2 => page.ReadPackedBool(offset + 18, 3);
public readonly bool Unknown3 => page.ReadPackedBool(offset + 18, 4);
public readonly bool IsLoop => page.ReadPackedBool(offset + 18, 5);
public readonly bool Unknown4 => page.ReadPackedBool(offset + 18, 6);
public readonly ushort Unknown => page.ReadUInt16(offset + 6);
public readonly byte Type => page.ReadUInt8(offset + 8);
public readonly byte Priority => page.ReadUInt8(offset + 9);
public readonly byte Stance => page.ReadUInt8(offset + 10);
public readonly byte Slot => page.ReadUInt8(offset + 11);
public readonly byte LookAtMode => page.ReadUInt8(offset + 12);
public readonly byte ActionTimelineIDMode => page.ReadUInt8(offset + 13);
public readonly byte LoadType => page.ReadUInt8(offset + 14);
public readonly byte StartAttach => page.ReadUInt8(offset + 15);
public readonly byte ResidentPap => page.ReadUInt8(offset + 16);
public readonly byte Unknown6 => page.ReadUInt8(offset + 17);
public readonly byte Unknown1 => page.ReadUInt8(offset + 18);
public readonly bool Pause => page.ReadPackedBool(offset + 19, 0);
public readonly bool Resident => page.ReadPackedBool(offset + 19, 1);
public readonly bool IsMotionCanceledByMoving => page.ReadPackedBool(offset + 19, 2);
public readonly bool Unknown2 => page.ReadPackedBool(offset + 19, 3);
public readonly bool Unknown3 => page.ReadPackedBool(offset + 19, 4);
public readonly bool IsLoop => page.ReadPackedBool(offset + 19, 5);
public readonly bool Unknown4 => page.ReadPackedBool(offset + 19, 6);

static BrioActionTimeline IExcelRow<BrioActionTimeline>.Create(ExcelPage page, uint offset, uint row) =>
new(page, offset, row);
Expand Down
28 changes: 13 additions & 15 deletions Brio/UI/Controls/Selectors/ActionTimelineSelector.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Brio.Resources;
using Brio.Resources.Sheets;
using Brio.UI.Controls.Stateless;
using ImGuiNET;
using System;
Expand Down Expand Up @@ -43,38 +44,35 @@ protected override void PopulateList()
foreach(var emote in GameDataProvider.Instance.Emotes.Values)
{
// Loop
var timeline = emote.ActionTimeline[0];
if(timeline.ValueNullable != null && timeline.RowId != 0)
BrioActionTimeline timeline;

if(emote.ActionTimeline[0].RowId != 0 && GameDataProvider.Instance.ActionTimelines.TryGetValue(emote.ActionTimeline[0].RowId, out timeline))
{
AddItem(new ActionTimelineSelectorEntry(emote.Name.ToString(), (ushort)timeline.RowId, emote.RowId, timeline.Value.Key.ToString(), ActionTimelineSelectorEntry.OriginalType.Emote, ActionTimelineSelectorEntry.AnimationPurpose.Standard, (ActionTimelineSlots)timeline.Value.Slot, emote.Icon));
AddItem(new ActionTimelineSelectorEntry(emote.Name.ToString(), (ushort)timeline.RowId, emote.RowId, timeline.Key.ToString(), ActionTimelineSelectorEntry.OriginalType.Emote, ActionTimelineSelectorEntry.AnimationPurpose.Standard, (ActionTimelineSlots)timeline.Slot, emote.Icon));
}

// Intro
timeline = emote.ActionTimeline[1];
if(timeline.ValueNullable != null && timeline.RowId != 0)
if(emote.ActionTimeline[1].RowId != 0 && GameDataProvider.Instance.ActionTimelines.TryGetValue(emote.ActionTimeline[1].RowId, out timeline))
{
AddItem(new ActionTimelineSelectorEntry(emote.Name.ToString(), (ushort)timeline.RowId, emote.RowId, timeline.Value.Key.ToString(), ActionTimelineSelectorEntry.OriginalType.Emote, ActionTimelineSelectorEntry.AnimationPurpose.Intro, (ActionTimelineSlots)timeline.Value.Slot, emote.Icon));
AddItem(new ActionTimelineSelectorEntry(emote.Name.ToString(), (ushort)timeline.RowId, emote.RowId, timeline.Key.ToString(), ActionTimelineSelectorEntry.OriginalType.Emote, ActionTimelineSelectorEntry.AnimationPurpose.Intro, (ActionTimelineSlots)timeline.Slot, emote.Icon));
}

// Ground
timeline = emote.ActionTimeline[2];
if(timeline.ValueNullable != null && timeline.RowId != 0)
if(emote.ActionTimeline[2].RowId != 0 && GameDataProvider.Instance.ActionTimelines.TryGetValue(emote.ActionTimeline[2].RowId, out timeline))
{
AddItem(new ActionTimelineSelectorEntry(emote.Name.ToString(), (ushort)timeline.RowId, emote.RowId, timeline.Value.Key.ToString(), ActionTimelineSelectorEntry.OriginalType.Emote, ActionTimelineSelectorEntry.AnimationPurpose.Ground, (ActionTimelineSlots)timeline.Value.Slot, emote.Icon));
AddItem(new ActionTimelineSelectorEntry(emote.Name.ToString(), (ushort)timeline.RowId, emote.RowId, timeline.Key.ToString(), ActionTimelineSelectorEntry.OriginalType.Emote, ActionTimelineSelectorEntry.AnimationPurpose.Ground, (ActionTimelineSlots)timeline.Slot, emote.Icon));
}

// Chair
timeline = emote.ActionTimeline[3];
if(timeline.ValueNullable != null && timeline.RowId != 0)
if(emote.ActionTimeline[3].RowId != 0 && GameDataProvider.Instance.ActionTimelines.TryGetValue(emote.ActionTimeline[3].RowId, out timeline))
{
AddItem(new ActionTimelineSelectorEntry(emote.Name.ToString(), (ushort)timeline.RowId, emote.RowId, timeline.Value.Key.ToString(), ActionTimelineSelectorEntry.OriginalType.Emote, ActionTimelineSelectorEntry.AnimationPurpose.Chair, (ActionTimelineSlots)timeline.Value.Slot, emote.Icon));
AddItem(new ActionTimelineSelectorEntry(emote.Name.ToString(), (ushort)timeline.RowId, emote.RowId, timeline.Key.ToString(), ActionTimelineSelectorEntry.OriginalType.Emote, ActionTimelineSelectorEntry.AnimationPurpose.Chair, (ActionTimelineSlots)timeline.Slot, emote.Icon));
}

// Upper Body
timeline = emote.ActionTimeline[4];
if(timeline.ValueNullable != null && timeline.RowId != 0)
if(emote.ActionTimeline[4].RowId != 0 && GameDataProvider.Instance.ActionTimelines.TryGetValue(emote.ActionTimeline[4].RowId, out timeline))
{
AddItem(new ActionTimelineSelectorEntry(emote.Name.ToString(), (ushort)timeline.RowId, emote.RowId, timeline.Value.Key.ToString(), ActionTimelineSelectorEntry.OriginalType.Emote, ActionTimelineSelectorEntry.AnimationPurpose.Blend, (ActionTimelineSlots)timeline.Value.Slot, emote.Icon));
AddItem(new ActionTimelineSelectorEntry(emote.Name.ToString(), (ushort)timeline.RowId, emote.RowId, timeline.Key.ToString(), ActionTimelineSelectorEntry.OriginalType.Emote, ActionTimelineSelectorEntry.AnimationPurpose.Blend, (ActionTimelineSlots)timeline.Slot, emote.Icon));
}
}

Expand Down

0 comments on commit 2a070d2

Please sign in to comment.