Fix final animation
This commit is contained in:
parent
ef350183e2
commit
02fd60e67d
6 changed files with 29 additions and 8 deletions
|
|
@ -111,6 +111,7 @@ UiButtonType :: enum {
|
|||
PauseTransformation,
|
||||
ResumeTransformation,
|
||||
ResetTransformation,
|
||||
ResetGrid,
|
||||
MatrixDelete,
|
||||
MatrixMoveUp,
|
||||
MatrixMoveDown,
|
||||
|
|
@ -336,6 +337,8 @@ program_save_project :: proc(program: ^Program, path: string) -> ProjectWriteErr
|
|||
project := ProjectData {
|
||||
matrix_count = u32(program.matrix_count),
|
||||
matrices = program.matrix_float_pool,
|
||||
grid = program.grid,
|
||||
shapes = program.animation.shapes,
|
||||
}
|
||||
project_write(&project, path) or_return
|
||||
return nil
|
||||
|
|
@ -360,6 +363,8 @@ program_load_project :: proc(program: ^Program, path: string) -> ProjectReadErro
|
|||
project.matrices = program.matrix_float_pool
|
||||
project_read(&project, path) or_return
|
||||
program.matrix_count = int(project.matrix_count)
|
||||
program.grid = project.grid
|
||||
program.animation.shapes = project.shapes
|
||||
for val, i in program.matrix_float_pool[:program.matrix_count * 9] {
|
||||
fmt.bprint(program.matrix_value_string_pool[i][:], val)
|
||||
}
|
||||
|
|
@ -818,6 +823,12 @@ program_build_workspace_ui :: proc(ctx: ^ui.Context) -> (elements: []ui.Element,
|
|||
ui.same_line()
|
||||
ui.element(.Button, button_dimensions, button_config, button_data)
|
||||
|
||||
button_config = {margin = button_margin, label = RAYGUI_ICON_RESET, tooltip = "Reset\ngrid"}
|
||||
button_data = new(UiElementData_Button, context.temp_allocator)
|
||||
button_data^ = {type = .ResetGrid}
|
||||
ui.same_line()
|
||||
ui.element(.Button, button_dimensions, button_config, button_data)
|
||||
|
||||
button_config = {margin = button_margin, label = "1", tooltip = "Center\nanimation"}
|
||||
button_data = new(UiElementData_Button, context.temp_allocator)
|
||||
button_data^ = {type = .CenterView}
|
||||
|
|
@ -1089,6 +1100,10 @@ program_render_ui_and_handle_focus :: proc(ctx: ^ui.Context, focus_element_id: u
|
|||
case .ProjectLoad:
|
||||
program_show_dialog(&program, .LoadProject)
|
||||
case .ProjectNew:
|
||||
case .ResetGrid:
|
||||
program.grid.offset = program_screen_size() / 2.0
|
||||
program.grid.zoom = 1.0
|
||||
program.grid.cell_size_px = 50.0
|
||||
case .DismissError:
|
||||
program.state = .Normal
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue