settings menu update + UINode 'enabled' property

This commit is contained in:
MihailRis
2024-04-30 16:41:44 +03:00
parent 9b843817f8
commit 2380375f3c
15 changed files with 130 additions and 84 deletions
+13 -1
View File
@@ -20,6 +20,18 @@ void UINode::setVisible(bool flag) {
visible = flag;
}
void UINode::setEnabled(bool flag) {
enabled = flag;
if (!flag) {
defocus();
hover = false;
}
}
bool UINode::isEnabled() const {
return enabled;
}
Align UINode::getAlign() const {
return align;
}
@@ -82,7 +94,7 @@ bool UINode::isInside(glm::vec2 point) {
}
std::shared_ptr<UINode> UINode::getAt(glm::vec2 point, std::shared_ptr<UINode> self) {
if (!interactive) {
if (!interactive || !enabled) {
return nullptr;
}
return isInside(point) ? self : nullptr;