Fixed backspacing condition in interface.h and added ui for renaming layers.

This commit is contained in:
PS 2021-03-17 22:56:52 -07:00
parent 01d960ca8f
commit bf72a52142
2 changed files with 11 additions and 3 deletions

View File

@ -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)
{

View File

@ -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
{