summaryrefslogtreecommitdiff
path: root/src/imgui_ui_timeline.cpp
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2023-02-07 00:21:06 -0500
committerFox Caminiti <fox@foxcam.net>2023-02-07 00:21:06 -0500
commitee654e9217487f6fca12356ec8af82319c309592 (patch)
tree7b87b83ed9087b73b733555243a66d3d0c93e900 /src/imgui_ui_timeline.cpp
parente2e0e630ca51a4fd80a8186c5795c96693a2815b (diff)
good changes
Diffstat (limited to 'src/imgui_ui_timeline.cpp')
-rw-r--r--src/imgui_ui_timeline.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/imgui_ui_timeline.cpp b/src/imgui_ui_timeline.cpp
index dcb3bc2..f8c5258 100644
--- a/src/imgui_ui_timeline.cpp
+++ b/src/imgui_ui_timeline.cpp
@@ -468,9 +468,15 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
block_string *String = (block_string *)Memory_Block_AddressAtIndex(Memory, F_Strings, Layer->Block_String_Index);
char buf[128];
#if DEBUG
- sprintf(buf, "%s, (idx: %i so: %.1f di: %.1f", String->Char, Index_Physical, SortEntry.SortedOffset, SortEntry. DisplayOffset);
+ if (SortEntry.IsFake)
+ sprintf(buf, "%s (duplicate), (idx: %i so: %.1f di: %.1f", String->Char, Index_Physical, SortEntry.SortedOffset, SortEntry. DisplayOffset);
+ else
+ sprintf(buf, "%s, (idx: %i so: %.1f di: %.1f", String->Char, Index_Physical, SortEntry.SortedOffset, SortEntry. DisplayOffset);
#else
- sprintf(buf, "%s", String->Char);
+ if (SortEntry.IsFake)
+ sprintf(buf, "%s (duplicate)", String->Char);
+ else
+ sprintf(buf, "%s", String->Char);
#endif
if (UI->TimelinePercentZoomed.y <= 1.0f) {
real32 TextX = (Layer_ScreenPos_Min.x > TimelineAbsolutePos.x) ? Layer_ScreenPos_Min.x : TimelineAbsolutePos.x;
@@ -522,7 +528,11 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
ImGui::Button("##layer_resize", ResizeSize);
if (ImGui::IsItemHovered()) {
- ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeEW);
+ if (Layer->IsLocked) {
+ ImGui::SetMouseCursor(ImGuiMouseCursor_NotAllowed);
+ } else {
+ ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeEW);
+ }
}
if (ImGui::IsItemActivated()) {
if (!Layer->IsSelected && !Layer->IsLocked) {
@@ -568,6 +578,12 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
ImGui::SetCursorScreenPos(Layer_ScreenPos_Min);
ImGui::InvisibleButton("##layer_mid", Layer_ScreenSize, ImGuiMouseButton_Left);
+ if (ImGui::IsItemHovered()) {
+ if (Layer->IsLocked) {
+ ImGui::SetMouseCursor(ImGuiMouseCursor_NotAllowed);
+ }
+ }
+
if (ImGui::IsItemActivated()) {
if (!Layer->IsSelected && !Layer->IsLocked) {
if (!io.KeyShift) Layer_DeselectAll(File, State, Memory);
@@ -602,7 +618,7 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
int h = 0, z = 0, i = 0;
while (Block_Loop(Memory, F_Layers, File->Layer_Count, &h, &z, &i)) {
block_layer *Layer = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, i);
- if (Layer->IsSelected) {
+ if (Layer->IsSelected == 1 || Layer->IsLocked) {
if (!Commit) {
History_Entry_Commit(Memory, "Toggle lock");
Commit = true;
@@ -621,10 +637,10 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
State->UpdateKeyframes = true;
}
if (ImGui::MenuItem("Duplicate layer")) {
- Precomp_UIDuplicate(File, State, Memory, CompIndex, SortedCompStart, SortedLayerStart);
+ State->HotkeyInput = hotkey_duplicatelayer;
}
if (ImGui::MenuItem("Delete layer")) {
- Precomp_UICreateButton(File, State, Memory, CompIndex, SortedCompStart, SortedLayerStart);
+ State->HotkeyInput = hotkey_deletelayer;
State->UpdateKeyframes = true;
}
if (ImGui::BeginMenu("Layer color"))
@@ -639,7 +655,7 @@ ImGui_Timeline_DrawPrecomp(project_data *File, project_state *State, memory *Mem
int h = 0, z = 0, i = 0;
while (Block_Loop(Memory, F_Layers, File->Layer_Count, &h, &z, &i)) {
block_layer *Layer = (block_layer *)Memory_Block_AddressAtIndex(Memory, F_Layers, i);
- if (Layer->IsSelected) {
+ if (Layer->IsSelected == 1) {
Layer->ColIndex = c;
}
}