From 3eaf910eb239ed42ea496ee3d1329a0030d118bf Mon Sep 17 00:00:00 2001 From: Chris Collins <29593332+christides11@users.noreply.github.com> Date: Thu, 21 Jul 2022 11:42:50 -0700 Subject: [PATCH] feat: Changed negative number frame meanings BREAKING CHANGE: For state frame ranges, -1 now means the last frame, -2 means the onchange frame. --- .../StateEditor/StateTimelineEditorWindow.cs | 24 ++++++------ .../Fighters/ADV/States/ADV.State.Jump.asset | 2 +- .../Shared/States/Base.State.Idle.asset | 3 +- .../Shared/States/Base.State.Jump.asset | 19 +++++++++- HnSF.csproj | 4 +- UserSettings/Layouts/default-2021.dwlt | 38 +++++++++---------- 6 files changed, 54 insertions(+), 36 deletions(-) diff --git a/Assets/HnSF/Editor/StateEditor/StateTimelineEditorWindow.cs b/Assets/HnSF/Editor/StateEditor/StateTimelineEditorWindow.cs index 0df3fac0..5e13904e 100644 --- a/Assets/HnSF/Editor/StateEditor/StateTimelineEditorWindow.cs +++ b/Assets/HnSF/Editor/StateEditor/StateTimelineEditorWindow.cs @@ -368,20 +368,15 @@ public virtual void DataBarsDrawParentAndChildren(List dbs, int d { for (int j = 0; j < stateTimeline.data[index].FrameRanges.Length; j++) { - int framebarStart = stateTimeline.data[index].FrameRanges[j].x < 0 - ? 1 - : (int)stateTimeline.data[index].FrameRanges[j].x; - int framebarWidth = stateTimeline.data[index].FrameRanges[j].x < 0 - ? this.stateTimeline.totalFrames-1 - : (int)stateTimeline.data[index].FrameRanges[j].y - - (int)stateTimeline.data[index].FrameRanges[j].x; + int frx = ConvertFrameNumber((int)stateTimeline.data[index].FrameRanges[j].x); + int fry = ConvertFrameNumber((int)stateTimeline.data[index].FrameRanges[j].y); + int framebarStart = frx; + int framebarWidth = fry - frx; mainFrameBarLabel.CloneTree(dbs[incr]); var thisMainFrameBarLabel = dbs[incr].Query(name: mainFrameBarLabel.name).Build().Last(); thisMainFrameBarLabel.style.left = GetFrameWidth() * framebarStart; - thisMainFrameBarLabel.style.width = new StyleLength(GetFrameWidth() * - (framebarWidth + 1)); - thisMainFrameBarLabel.Q