From c5a60e71f9ed869467e2090f4b343641b021386a Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Sat, 26 Nov 2022 23:52:57 -0500 Subject: keybind refinement --- main.h | 122 ++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 63 insertions(+), 59 deletions(-) (limited to 'main.h') diff --git a/main.h b/main.h index b4f5cb5..b2f2ed3 100644 --- a/main.h +++ b/main.h @@ -176,61 +176,6 @@ enum timeline_mode timeline_mode_graph }; -struct ui -{ - ImVec2 CompZoom; // In screen pixels, not percentage. - ImVec2 CompPos; - - ImDrawListSplitter Test; - - // Under 1 is zoomed in! - ImVec2 TimelinePercentZoomed; - ImVec2 TimelinePercentOffset; - - ImVec2 GraphZoomSize; - ImVec2 GraphMoveSize; - - uint32 InteractTransformMode; // Whether a drag on the Shift+T UI is scale (1), rotation (2), or position (3). - - timeline_mode TimelineMode; - - bool32 BoxSelect; - - focused_window FocusedWindow; // Convenience for adding window-specific hotkeys. - - v2 TempZoomRatio = V2(1, 1); - - int32 Warp_X = 0; - int32 Warp_Y = 0; - bool32 Warp_WantSetPos = false; - ImVec2 Warp_PositionToSet; - real32 Warp_PositionInitial; - int32 Warp_Direction; - - v4 Color = {1, 1, 1, 1}; - v4 AltColor = {0, 0, 0, 1}; - bool32 IsPrimary; - - ImU32 LayerColors[16] = { - 0xff8b1f1f, - 0xffc25909, - 0xff57c20a, - 0xff8ee6da, - 0xffa48fb7, - 0xffd14061, - 0xff38b683, - 0xff3fdbe5, - 0xffc9c9c9, - 0xff978489, - 0xfffaf5ab, - 0xff101010, - 0xffa024ca, - 0xfffae920, - 0xff208dfa, - 0xfffa2051 - }; -}; - struct pen_state { bool32 IsActive; }; @@ -371,7 +316,8 @@ struct header_effect enum imgui_popups { popup_none, - popup_saveas + popup_saveas, + popup_keybinds }; struct project_state @@ -389,10 +335,8 @@ struct project_state brush_state Brush; #if STABLE - bool32 StableEnabled = 0; - sd_state SD; - char JSONPayload[1024*1024*4]; int32 CurlActive = 0; + char JSONPayload[1024*1024*4]; real32 SDPercentDone; real32 SDTimeEstimate; real64 SDTimer; @@ -439,8 +383,67 @@ struct project_state ImGuiTextFilter filter; // This filter API is pretty ballin'. bool32 RerouteEffects; // Allows shift+space hotkey to gain focus on the effects panel. + + ImDrawListSplitter Test; + + int32 Warp_X = 0; + int32 Warp_Y = 0; + bool32 Warp_WantSetPos = false; + ImVec2 Warp_PositionToSet; + real32 Warp_PositionInitial; + int32 Warp_Direction; + + uint32 InteractTransformMode; // Whether a drag on the Shift+T UI is scale (1), rotation (2), or position (3). + + timeline_mode TimelineMode; + + bool32 BoxSelect; + + focused_window FocusedWindow; // Convenience for adding window-specific hotkeys. + v2 TempZoomRatio = V2(1, 1); +}; + +// UI info that's saved to the file and is not part of the history tree +struct ui +{ + ImVec2 CompZoom; // In screen pixels, not percentage. + ImVec2 CompPos; + + // Under 1 is zoomed in! + ImVec2 TimelinePercentZoomed; + ImVec2 TimelinePercentOffset; + + ImVec2 GraphZoomSize; + ImVec2 GraphMoveSize; + + v4 Color = {1, 1, 1, 1}; + v4 AltColor = {0, 0, 0, 1}; + bool32 IsPrimary; + + sd_state SD; + bool32 StableEnabled = 0; + + ImU32 LayerColors[16] = { + 0xff8b1f1f, + 0xffc25909, + 0xff57c20a, + 0xff8ee6da, + 0xffa48fb7, + 0xffd14061, + 0xff38b683, + 0xff3fdbe5, + 0xffc9c9c9, + 0xff978489, + 0xfffaf5ab, + 0xff101010, + 0xffa024ca, + 0xfffae920, + 0xff208dfa, + 0xfffa2051 + }; }; + struct project_data { uint8 Occupied; @@ -448,6 +451,7 @@ struct project_data uint16 Source_Count; uint16 Comp_Count; uint16 PrincipalCompIndex; + ui UI; }; struct block_composition -- cgit v1.2.3