Add Tilesheet class, update ScreenEditor for DungeonMaps

This commit is contained in:
scawful
2024-01-22 03:30:55 -05:00
parent 7d28d35e5d
commit 6f80f328a8
12 changed files with 751 additions and 84 deletions

View File

@@ -2,6 +2,7 @@
#include <imgui/imgui.h>
#include <imgui/imgui_internal.h>
#include <imgui/misc/cpp/imgui_stdlib.h>
#include "absl/strings/string_view.h"
@@ -176,6 +177,18 @@ void ItemLabel(absl::string_view title, ItemLabelFlags flags) {
ImGui::SetCursorScreenPos(lineStart);
}
bool ListBox(const char* label, int* current_item,
const std::vector<std::string>& items, int height_in_items) {
std::vector<const char*> items_ptr;
items_ptr.reserve(items.size());
for (const auto& item : items) {
items_ptr.push_back(item.c_str());
}
int items_count = static_cast<int>(items.size());
return ImGui::ListBox(label, current_item, items_ptr.data(), items_count,
height_in_items);
}
} // namespace gui
} // namespace app
} // namespace yaze