feat: key pressed event interception & 'owner' input.add_callback third argument

This commit is contained in:
MihailRis
2025-01-02 20:51:43 +03:00
parent 7fce735ca1
commit b9ff1db086
17 changed files with 192 additions and 63 deletions
+8 -4
View File
@@ -13,11 +13,15 @@ bool Menu::has(const std::string& name) {
pageSuppliers.find(name) != pageSuppliers.end();
}
void Menu::addPage(const std::string& name, const std::shared_ptr<UINode> &panel) {
pages[name] = Page{name, panel};
void Menu::addPage(const std::string& name, const std::shared_ptr<UINode>& panel) {
pages[name] = Page {name, panel};
}
void Menu::addSupplier(const std::string &name, const supplier<std::shared_ptr<UINode>> &pageSupplier) {
void Menu::removePage(const std::string& name) {
pages.erase(name);
}
void Menu::addSupplier(const std::string& name, const supplier<std::shared_ptr<UINode>>& pageSupplier) {
pageSuppliers[name] = pageSupplier;
}
@@ -89,6 +93,6 @@ void Menu::reset() {
clearHistory();
if (current.panel) {
Container::remove(current.panel);
current = Page{"", nullptr};
current = Page {"", nullptr};
}
}