From d33eef2be6d3a3b5ed62df654b610dc11d34e2e2 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Mon, 13 Jan 2025 00:20:13 -0600 Subject: [PATCH] [jasper/world/studio/worldobjectseteditor] Disable Interval for objects with only 1 frame --- .../worldobjectseteditor-imgui.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp b/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp index de9b97b..b25828e 100644 --- a/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp +++ b/src/jasper/modules/world/src/studio/worldobjectseteditor/worldobjectseteditor-imgui.cpp @@ -188,11 +188,15 @@ void WorldObjectSetEditorImGui::drawObjEditor() noexcept { std::ignore = pushCommand( m_doc, m_selectedObj, static_cast(m_objEditor.frames)); } - if (ImGui::InputInt("Interval (ms)", &m_objEditor.interval, 50, 1000)) { - m_objEditor.interval = ox::clamp(m_objEditor.interval, 50, 65535); - std::ignore = pushCommand( - m_doc, m_selectedObj, static_cast(m_objEditor.interval)); + ImGui::BeginDisabled(m_objEditor.frames < 2); + { + if (ImGui::InputInt("Interval (ms)", &m_objEditor.interval, 50, 1000)) { + m_objEditor.interval = ox::clamp(m_objEditor.interval, 50, 65535); + std::ignore = pushCommand( + m_doc, m_selectedObj, static_cast(m_objEditor.interval)); + } } + ImGui::EndDisabled(); ImGui::Separator(); ImGui::Text("Subsheet:"); ImGui::BeginChild("SubsheetSelector", {300, 300});