gui cleanup
This commit is contained in:
@@ -173,27 +173,47 @@ absl::Status MasterEditor::Update() {
|
|||||||
auto current_tab_bar = ImGui::GetCurrentContext()->CurrentTabBar;
|
auto current_tab_bar = ImGui::GetCurrentContext()->CurrentTabBar;
|
||||||
|
|
||||||
if (overworld_editor_.jump_to_tab() == -1) {
|
if (overworld_editor_.jump_to_tab() == -1) {
|
||||||
gui::RenderTabItem("Overworld", [&]() {
|
if (ImGui::BeginTabItem("Overworld")) {
|
||||||
current_editor_ = &overworld_editor_;
|
current_editor_ = &overworld_editor_;
|
||||||
status_ = overworld_editor_.Update();
|
status_ = overworld_editor_.Update();
|
||||||
});
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gui::RenderTabItem("Dungeon", [&]() {
|
if (ImGui::BeginTabItem("Dungeon")) {
|
||||||
current_editor_ = &dungeon_editor_;
|
current_editor_ = &dungeon_editor_;
|
||||||
status_ = dungeon_editor_.Update();
|
status_ = dungeon_editor_.Update();
|
||||||
if (overworld_editor_.jump_to_tab() != -1) {
|
if (overworld_editor_.jump_to_tab() != -1) {
|
||||||
dungeon_editor_.add_room(overworld_editor_.jump_to_tab());
|
dungeon_editor_.add_room(overworld_editor_.jump_to_tab());
|
||||||
overworld_editor_.jump_to_tab_ = -1;
|
overworld_editor_.jump_to_tab_ = -1;
|
||||||
}
|
}
|
||||||
});
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
gui::RenderTabItem("Graphics",
|
if (ImGui::BeginTabItem("Graphics")) {
|
||||||
[&]() { status_ = graphics_editor_.Update(); });
|
status_ = graphics_editor_.Update();
|
||||||
gui::RenderTabItem("Sprites", [&]() { status_ = sprite_editor_.Update(); });
|
ImGui::EndTabItem();
|
||||||
gui::RenderTabItem("Palettes", [&]() { status_ = palette_editor_.Update(); });
|
}
|
||||||
gui::RenderTabItem("Screens", [&]() { screen_editor_.Update(); });
|
|
||||||
gui::RenderTabItem("Music", [&]() { music_editor_.Update(); });
|
if (ImGui::BeginTabItem("Sprites")) {
|
||||||
|
status_ = sprite_editor_.Update();
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginTabItem("Palettes")) {
|
||||||
|
status_ = palette_editor_.Update();
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginTabItem("Screens")) {
|
||||||
|
screen_editor_.Update();
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginTabItem("Music")) {
|
||||||
|
music_editor_.Update();
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
END_TAB_BAR()
|
END_TAB_BAR()
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|||||||
@@ -293,13 +293,7 @@ void ScreenEditor::DrawDungeonMapsTabs() {
|
|||||||
std::string label =
|
std::string label =
|
||||||
dungeon_map_labels_[selected_dungeon][floor_number][j];
|
dungeon_map_labels_[selected_dungeon][floor_number][j];
|
||||||
screen_canvas_.DrawText(label, (posX * 2), (posY * 2));
|
screen_canvas_.DrawText(label, (posX * 2), (posY * 2));
|
||||||
// GFX.drawText(
|
|
||||||
// e.Graphics, 16 + ((i % 5) * 32), 20 + ((i / 5) * 32),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (dungmapSelectedTile == i)
|
|
||||||
// Constants.AzurePen2,
|
|
||||||
// 10 + ((i % 5) * 32), 12 + ((i / 5) * 32), 32, 32));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
screen_canvas_.DrawGrid(64.f, 5);
|
screen_canvas_.DrawGrid(64.f, 5);
|
||||||
@@ -369,6 +363,9 @@ void ScreenEditor::DrawDungeonMapsEditor() {
|
|||||||
rom()->resource_label()->SelectableLabelWithNameEdit(
|
rom()->resource_label()->SelectableLabelWithNameEdit(
|
||||||
selected_dungeon == i, "Dungeon Names", absl::StrFormat("%d", i),
|
selected_dungeon == i, "Dungeon Names", absl::StrFormat("%d", i),
|
||||||
dungeon_names[i]);
|
dungeon_names[i]);
|
||||||
|
if (ImGui::IsItemClicked()) {
|
||||||
|
selected_dungeon = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map column
|
// Map column
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ using ItemLabelFlags = enum ItemLabelFlag {
|
|||||||
|
|
||||||
IMGUI_API void ItemLabel(absl::string_view title, ItemLabelFlags flags);
|
IMGUI_API void ItemLabel(absl::string_view title, ItemLabelFlags flags);
|
||||||
|
|
||||||
IMGUI_API ImGuiID GetID(const std::string &id);
|
IMGUI_API ImGuiID GetID(const std::string& id);
|
||||||
|
|
||||||
} // namespace gui
|
} // namespace gui
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
|||||||
Reference in New Issue
Block a user