yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_workbench_inspector_helpers.cc
Go to the documentation of this file.
2
3#include <algorithm>
4
6
8
9bool HasEditableRoomObjectSize(std::span<const zelda3::RoomObject> objects,
10 std::span<const size_t> selected_indices) {
11 return std::any_of(
12 selected_indices.begin(), selected_indices.end(), [&](size_t index) {
13 return index < objects.size() &&
14 zelda3::IsRoomObjectSizeEditable(objects[index].id_);
15 });
16}
17
18void DrawInspectorSectionHeader(const char* label) {
19 ImGui::SeparatorText(label);
20}
21
22bool BeginInspectorSection(const char* label, bool default_open) {
23 gui::StyleVarGuard frame_padding_guard(
24 ImGuiStyleVar_FramePadding,
25 ImVec2(ImGui::GetStyle().FramePadding.x,
26 std::max(5.0f, ImGui::GetStyle().FramePadding.y + 1.0f)));
27 return ImGui::CollapsingHeader(
28 label, default_open ? ImGuiTreeNodeFlags_DefaultOpen : 0);
29}
30
31bool DrawActionButton(const char* label, const ImVec2& size) {
32 gui::StyleVarGuard align_guard(ImGuiStyleVar_ButtonTextAlign,
33 ImVec2(0.08f, 0.5f));
34 return ImGui::Button(label, size);
35}
36
37} // namespace yaze::editor::workbench
RAII guard for ImGui style vars.
Definition style_guard.h:68
bool BeginInspectorSection(const char *label, bool default_open)
bool DrawActionButton(const char *label, const ImVec2 &size)
bool HasEditableRoomObjectSize(std::span< const zelda3::RoomObject > objects, std::span< const size_t > selected_indices)