diff options
-rw-r--r-- | editor/inspect-types.cpp | 4 | ||||
-rw-r--r-- | editor/inspect.cpp | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/editor/inspect-types.cpp b/editor/inspect-types.cpp index 432d9582..235ee72e 100644 --- a/editor/inspect-types.cpp +++ b/editor/inspect-types.cpp @@ -22,8 +22,8 @@ template<> struct entity_accessors<scenery_ref> { }, entity::type<Vector2b>::field{"offset"_s, [](const scenery_ref& x) { return x.frame.offset; }, - [](scenery_ref& x, Vector2b value) { x.frame.offset = value; } - //constantly(constraints::range{Vector2b(iTILE_SIZE2/-2), Vector2b(iTILE_SIZE2/2)}) + [](scenery_ref& x, Vector2b value) { x.frame.offset = value; }, + constantly(constraints::range{Vector2b(iTILE_SIZE2/-2), Vector2b(iTILE_SIZE2/2)}) }, entity::type<pass_mode>::field{"pass-mode"_s, [](const scenery_ref& x) { return x.frame.passability; }, diff --git a/editor/inspect.cpp b/editor/inspect.cpp index f0a55748..165fa877 100644 --- a/editor/inspect.cpp +++ b/editor/inspect.cpp @@ -103,7 +103,7 @@ void do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r switch (repr) { default: fm_warn_once("invalid repr enum value '%zu'", (std::size_t)repr); break; - case field_repr::input: ret = ImGui::InputScalar(label.data(), igdt, &value, &step_); break; + case field_repr::input: ret = ImGui::InputScalar(label.data(), igdt, &value, step_); break; case field_repr::slider: ret = ImGui::SliderScalar(label.data(), igdt, &value, &min, &max); break; case field_repr::drag: ret = ImGui::DragScalar(label.data(), igdt, &value, 1, &min, &max); break; case field_repr::cbx: { @@ -117,15 +117,15 @@ void do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r preview = str.data(); break; } - for (auto b = begin_combo(label.data(), preview); - const auto& [str, x] : list) - { - const bool is_selected = x == (std::size_t)old_value; - if (ImGui::Selectable(str.data(), is_selected)) - value = T(x); - if (is_selected) - ImGui::SetItemDefaultFocus(); - } + if (auto b = begin_combo(label.data(), preview)) + for (const auto& [str, x] : list) + { + const bool is_selected = x == (std::size_t)old_value; + if (ImGui::Selectable(str.data(), is_selected)) + value = T(x); + if (is_selected) + ImGui::SetItemDefaultFocus(); + } break; } } @@ -144,7 +144,7 @@ void do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r fm_warn_once("invalid repr enum value '%zu'", (std::size_t)repr); break; case field_repr::input: - ret = ImGui::InputScalarN(label.data(), igdt, &value, T::Size, &step_); + ret = ImGui::InputScalarN(label.data(), igdt, &value, T::Size, step_); break; case field_repr::drag: fm_warn_once("can't use imgui input drag mode for vector type"); |