mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 05:21:49 +00:00
Refactor, GUI::storage (map for direct access to panels)
This commit is contained in:
parent
4e1f19c911
commit
6392f63604
10 changed files with 75 additions and 54 deletions
|
|
@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue