mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-05 02:37:50 -04:00
Initial attempt at the popup menu
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include "popup.hpp"
|
||||
#include "window.hpp"
|
||||
|
||||
namespace dusk::ui {
|
||||
@@ -17,6 +18,7 @@ void load_font(const char* filename, bool fallback = false) {
|
||||
|
||||
bool sInitialized = false;
|
||||
std::vector<std::unique_ptr<Window> > sWindows;
|
||||
std::unique_ptr<Popup> sPopup;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -37,6 +39,7 @@ bool initialize() noexcept {
|
||||
}
|
||||
|
||||
void shutdown() noexcept {
|
||||
sPopup.reset();
|
||||
sWindows.clear();
|
||||
sInitialized = false;
|
||||
}
|
||||
@@ -55,10 +58,18 @@ void remove_window(Window& window) noexcept {
|
||||
// TODO
|
||||
}
|
||||
|
||||
Popup& add_popup(std::unique_ptr<Popup> popupMenu) noexcept {
|
||||
sPopup = std::move(popupMenu);
|
||||
return *sPopup;
|
||||
}
|
||||
|
||||
void update() noexcept {
|
||||
for (const auto& window : sWindows) {
|
||||
window->update();
|
||||
}
|
||||
if (sPopup != nullptr) {
|
||||
sPopup->update();
|
||||
}
|
||||
}
|
||||
|
||||
std::filesystem::path resource_path(const std::filesystem::path& filename) noexcept {
|
||||
|
||||
Reference in New Issue
Block a user