UIWindow collapsing fix

Co-Authored-By: Ne_Eo <NeeEoo@users.noreply.github.com>
This commit is contained in:
Dirk-Dinkum
2024-04-13 21:55:44 +02:00
co-authored by Ne_Eo
parent 69046ab5aa
commit 5f50b80df7
8 changed files with 42 additions and 27 deletions
+17 -8
View File
@@ -18,19 +18,28 @@ class UIWindow extends UISliceSprite {
public override function update(elapsed:Float) {
super.update(elapsed);
if(collapsable && FlxG.mouse.justPressed) {
// TOOLBAR
cursor = ARROW;
if(collapsable) {
__rect.x = x; __rect.y = y;
__rect.width = bWidth; __rect.height = 23;
__rect.width = bWidth; __rect.height = topHeight;
if(UIState.state.isOverlapping(this, __rect)) {
content.exists = !content.exists;
drawMiddle = !drawMiddle;
drawBottom = !drawBottom;
cursor = BUTTON;
if(FlxG.mouse.justPressed) {
content.exists = !content.exists;
drawMiddle = !drawMiddle;
drawBottom = !drawBottom;
}
}
}
__rect.x = x; __rect.y = y+23;
__rect.width = bWidth; __rect.height = bHeight-23;
__rect.x = x;
__rect.width = bWidth;
if(content.exists) {
__rect.y = y+topHeight;
__rect.height = bHeight-topHeight;
}
hovered = UIState.state.isOverlapping(this, __rect);
}
}