Skip to content

Commit

Permalink
zzre: ActorEditor correctly overwrites duplicate animations and shows…
Browse files Browse the repository at this point in the history
… warning
  • Loading branch information
Helco committed Jan 25, 2024
1 parent cabffbc commit 078ed68
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions zzre/tools/ActorEditor.Part.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Numerics;
using Veldrid;
using zzio;
using zzio.rwbs;
using zzio.vfs;
using zzre.materials;
using zzre.rendering;
Expand Down Expand Up @@ -131,8 +130,10 @@ public bool PlaybackContent()
{
foreach (var ((type, _, ani), index) in animations.Indexed())
{
PushID((int)type);
if (Selectable(type.ToString(), index == currentAnimationI))
PushID(index);
var isOverwritten = animations.Skip(index + 1).Any(a => a.type == type);
var name = (isOverwritten ? "(!!!) " : "") + type;
if (Selectable(name, index == currentAnimationI))
{
currentAnimationI = index;
skeleton.JumpToAnimation(ani);
Expand Down Expand Up @@ -209,8 +210,8 @@ public bool AnimationsContent()
PopItemWidth();
NextColumn();


var nameDummy = filename;
var isOverwritten = animations.Skip(index + 1).Any(a => a.type == curType);
var nameDummy = (isOverwritten ? "(!!!) " : "") + filename;
InputText("##name", ref nameDummy, 256, ImGuiNET.ImGuiInputTextFlags.ReadOnly);
SameLine();
PushStyleVar(ImGuiNET.ImGuiStyleVar.Alpha, 0.6f);
Expand Down

0 comments on commit 078ed68

Please sign in to comment.