Refactor, GUI::storage (map for direct access to panels)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <vector>
|
||||
#include <glm/glm.hpp>
|
||||
#include <functional>
|
||||
#include <unordered_map>
|
||||
|
||||
class Batch2D;
|
||||
class Assets;
|
||||
@@ -50,6 +51,8 @@ namespace gui {
|
||||
std::shared_ptr<UINode> hover = nullptr;
|
||||
std::shared_ptr<UINode> pressed = nullptr;
|
||||
std::shared_ptr<UINode> focus = nullptr;
|
||||
std::unordered_map<std::string, std::shared_ptr<UINode>> storage;
|
||||
|
||||
Camera* uicamera;
|
||||
public:
|
||||
GUI();
|
||||
@@ -62,6 +65,9 @@ namespace gui {
|
||||
void draw(Batch2D* batch, Assets* assets);
|
||||
void add(std::shared_ptr<UINode> panel);
|
||||
void remove(std::shared_ptr<UINode> panel);
|
||||
void store(std::string name, std::shared_ptr<UINode> node);
|
||||
std::shared_ptr<UINode> get(std::string name);
|
||||
void remove(std::string name);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user