refactor: add GUI instance reference to UI nodes

This commit is contained in:
MihailRis
2025-04-02 14:55:53 +03:00
parent 74a94f869c
commit 4c48afbb90
70 changed files with 1133 additions and 832 deletions
+4 -4
View File
@@ -7,7 +7,7 @@
#include <vector>
namespace gui {
class Container : public UINode, public util::ObjectsKeeper {
class Container : public UINode, public ::util::ObjectsKeeper {
int prevScrollY = -1;
protected:
std::vector<std::shared_ptr<UINode>> nodes;
@@ -22,7 +22,7 @@ namespace gui {
return prevScrollY != -1;
}
public:
Container(glm::vec2 size);
Container(GUI& gui, glm::vec2 size);
virtual ~Container();
virtual void act(float delta) override;
@@ -44,8 +44,8 @@ namespace gui {
virtual void refresh() override;
void setScroll(int scroll);
virtual void mouseMove(GUI*, int x, int y) override;
virtual void mouseRelease(GUI*, int x, int y) override;
virtual void mouseMove(int x, int y) override;
virtual void mouseRelease(int x, int y) override;
const std::vector<std::shared_ptr<UINode>>& getNodes() const;
};