[jasper/world/studio/worldobjectseteditor] Disable Interval for objects with only 1 frame

This commit is contained in:
Gary Talent 2025-01-13 00:20:13 -06:00
parent d5d22372e1
commit d33eef2be6

View File

@ -188,11 +188,15 @@ void WorldObjectSetEditorImGui::drawObjEditor() noexcept {
std::ignore = pushCommand<EditObjectFrames>(
m_doc, m_selectedObj, static_cast<uint8_t>(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<EditObjectInterval>(
m_doc, m_selectedObj, static_cast<uint16_t>(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<EditObjectInterval>(
m_doc, m_selectedObj, static_cast<uint16_t>(m_objEditor.interval));
}
}
ImGui::EndDisabled();
ImGui::Separator();
ImGui::Text("Subsheet:");
ImGui::BeginChild("SubsheetSelector", {300, 300});