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,10 +7,10 @@
using namespace gui;
InputBindBox::InputBindBox(Binding& binding, glm::vec4 padding)
: Panel(glm::vec2(100,32), padding, 0),
InputBindBox::InputBindBox(GUI& gui, Binding& binding, glm::vec4 padding)
: Panel(gui, glm::vec2(100,32), padding, 0),
binding(binding),
label(std::make_shared<Label>(L"")) {
label(std::make_shared<Label>(gui, L"")) {
add(label);
setScrollable(false);
hoverColor = glm::vec4(0.05f, 0.1f, 0.2f, 0.75f);
@@ -25,7 +25,7 @@ void InputBindBox::drawBackground(const DrawContext& pctx, const Assets&) {
label->setText(util::str2wstr_utf8(binding.text()));
}
void InputBindBox::clicked(GUI*, mousecode button) {
void InputBindBox::clicked(mousecode button) {
if (isFocused()) {
binding.reset(button);
defocus();