Add RenderLayout function to handle dynamic rendering of Text and Button elements; introduce Layout struct for managing UI components in input module.

This commit is contained in:
scawful
2025-04-17 21:33:35 -04:00
parent c3d707901c
commit eeab477e72
2 changed files with 38 additions and 2 deletions

View File

@@ -3,15 +3,14 @@
#define IMGUI_DEFINE_MATH_OPERATORS
#include <cctype>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <optional>
#include <string>
#include <variant>
#include <vector>
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "app/gfx/snes_tile.h"
#include "imgui/imgui.h"
@@ -93,6 +92,21 @@ constexpr std::string kSeparator = "-";
IMGUI_API bool OpenUrl(const std::string &url);
struct Text {
std::string content;
};
struct Button {
std::string label;
std::function<void()> callback;
};
struct Layout {
std::vector<std::variant<Text, Button>> elements;
};
void RenderLayout(const Layout &layout);
} // namespace gui
} // namespace yaze