From bf72a521424cd6388af119989d74a4e07919e8ed Mon Sep 17 00:00:00 2001 From: PS Date: Wed, 17 Mar 2021 22:56:52 -0700 Subject: [PATCH] Fixed backspacing condition in interface.h and added ui for renaming layers. --- src/app/editor/panels/foldhaus_panel_animation_timeline.h | 6 ++++++ src/app/interface.h | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/editor/panels/foldhaus_panel_animation_timeline.h b/src/app/editor/panels/foldhaus_panel_animation_timeline.h index 974dc04..9209ef0 100644 --- a/src/app/editor/panels/foldhaus_panel_animation_timeline.h +++ b/src/app/editor/panels/foldhaus_panel_animation_timeline.h @@ -851,8 +851,12 @@ AnimInfoView_Render(animation_timeline_state* TimelineState, animation* ActiveAn } ui_EndRow(Interface); + ui_Label(Interface, MakeString("Layer")); + u32 LayerIndex = TimelineState->SelectedAnimationLayer; anim_layer* SelectedLayer = ActiveAnim->Layers.Values + LayerIndex; + + ui_TextEntry(Interface, MakeString("Layer Name"), &SelectedLayer->Name); gs_string BlendStr = BlendModeStrings[SelectedLayer->BlendMode]; if (ui_BeginLabeledDropdown(Interface, MakeString("Blend Mode"), BlendStr)) { @@ -866,6 +870,8 @@ AnimInfoView_Render(animation_timeline_state* TimelineState, animation* ActiveAn } ui_EndLabeledDropdown(Interface); + ui_Label(Interface, MakeString("Pattern")); + animation_block* SelectedBlock = Animation_GetBlockFromHandle(ActiveAnim, TimelineState->SelectedBlockHandle); if (SelectedBlock) { diff --git a/src/app/interface.h b/src/app/interface.h index f0942a7..a54c669 100644 --- a/src/app/interface.h +++ b/src/app/interface.h @@ -1015,10 +1015,12 @@ ui_EvaluateWidget(ui_interface* Interface, ui_widget* Widget, rect2 Bounds) for (u32 i = 0; i < Interface->TempInputString.Length; i++) { - if (Interface->TempInputString.Str[i] == '\b' && - State->EditString.Length > 0) + if (Interface->TempInputString.Str[i] == '\b') { - State->EditString.Length -= 1; + if (State->EditString.Length > 0) + { + State->EditString.Length -= 1; + } } else {