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_EndRow(Interface);
ui_Label(Interface, MakeString("Layer"));
u32 LayerIndex = TimelineState->SelectedAnimationLayer; u32 LayerIndex = TimelineState->SelectedAnimationLayer;
anim_layer* SelectedLayer = ActiveAnim->Layers.Values + LayerIndex; anim_layer* SelectedLayer = ActiveAnim->Layers.Values + LayerIndex;
ui_TextEntry(Interface, MakeString("Layer Name"), &SelectedLayer->Name);
gs_string BlendStr = BlendModeStrings[SelectedLayer->BlendMode]; gs_string BlendStr = BlendModeStrings[SelectedLayer->BlendMode];
if (ui_BeginLabeledDropdown(Interface, MakeString("Blend Mode"), BlendStr)) if (ui_BeginLabeledDropdown(Interface, MakeString("Blend Mode"), BlendStr))
{ {
@ -866,6 +870,8 @@ AnimInfoView_Render(animation_timeline_state* TimelineState, animation* ActiveAn
} }
ui_EndLabeledDropdown(Interface); ui_EndLabeledDropdown(Interface);
ui_Label(Interface, MakeString("Pattern"));
animation_block* SelectedBlock = Animation_GetBlockFromHandle(ActiveAnim, TimelineState->SelectedBlockHandle); animation_block* SelectedBlock = Animation_GetBlockFromHandle(ActiveAnim, TimelineState->SelectedBlockHandle);
if (SelectedBlock) if (SelectedBlock)
{ {

View File

@ -1015,11 +1015,13 @@ ui_EvaluateWidget(ui_interface* Interface, ui_widget* Widget, rect2 Bounds)
for (u32 i = 0; i < Interface->TempInputString.Length; i++) for (u32 i = 0; i < Interface->TempInputString.Length; i++)
{ {
if (Interface->TempInputString.Str[i] == '\b' && if (Interface->TempInputString.Str[i] == '\b')
State->EditString.Length > 0) {
if (State->EditString.Length > 0)
{ {
State->EditString.Length -= 1; State->EditString.Length -= 1;
} }
}
else else
{ {
OutChar(&State->EditString, Interface->TempInputString.Str[i]); OutChar(&State->EditString, Interface->TempInputString.Str[i]);