diff --git a/source/funkin/editors/charter/CharterNote.hx b/source/funkin/editors/charter/CharterNote.hx index bb7b5a61..ef005f4b 100644 --- a/source/funkin/editors/charter/CharterNote.hx +++ b/source/funkin/editors/charter/CharterNote.hx @@ -49,10 +49,7 @@ class CharterNote extends UISprite implements ICharterSelectable { } public override function updateButtonHandler() { - __rect.x = x; - __rect.y = y; - __rect.width = 40; - __rect.height = 40; + __rect.set(x, y, 40, 40); UIState.state.updateRectButtonHandler(this, __rect, onHovered); } diff --git a/source/funkin/editors/ui/UICheckbox.hx b/source/funkin/editors/ui/UICheckbox.hx index 864040ba..e8d84f8f 100644 --- a/source/funkin/editors/ui/UICheckbox.hx +++ b/source/funkin/editors/ui/UICheckbox.hx @@ -67,10 +67,7 @@ class UICheckbox extends UISprite { } public override function updateButton() { - __rect.x = x; - __rect.y = y; - __rect.width = field.width + 30; - __rect.height = field.height > height ? field.height : height; + __rect.set(x, y, field.width + 30, field.height > height ? field.height : height); UIState.state.updateRectButtonHandler(this, __rect, onHovered); } } \ No newline at end of file diff --git a/source/funkin/editors/ui/UIRadioButton.hx b/source/funkin/editors/ui/UIRadioButton.hx index ebff277a..9c009ece 100644 --- a/source/funkin/editors/ui/UIRadioButton.hx +++ b/source/funkin/editors/ui/UIRadioButton.hx @@ -92,10 +92,7 @@ class UIRadioButton extends UISprite { } public override function updateButton() { - __rect.x = x; - __rect.y = y; - __rect.width = field.width + 30; - __rect.height = field.height > height ? field.height : height; + __rect.set(x, y, field.width + 30, field.height > height ? field.height : height); UIState.state.updateRectButtonHandler(this, __rect, onHovered); } diff --git a/source/funkin/editors/ui/UISliceSprite.hx b/source/funkin/editors/ui/UISliceSprite.hx index 2ad5af43..50329708 100644 --- a/source/funkin/editors/ui/UISliceSprite.hx +++ b/source/funkin/editors/ui/UISliceSprite.hx @@ -19,10 +19,7 @@ class UISliceSprite extends UISprite { public override function updateButton() { if (incorporeal) return; - __rect.x = x; - __rect.y = y; - __rect.width = bWidth; - __rect.height = bHeight; + __rect.set(x, y, bWidth, bHeight); UIState.state.updateRectButtonHandler(this, __rect, onHovered); } diff --git a/source/funkin/editors/ui/UISprite.hx b/source/funkin/editors/ui/UISprite.hx index c8e38333..5e0e5ee7 100644 --- a/source/funkin/editors/ui/UISprite.hx +++ b/source/funkin/editors/ui/UISprite.hx @@ -118,9 +118,6 @@ class UISprite extends FlxSprite { } public function updateSpriteRect() { - __rect.x = x; - __rect.y = y; - __rect.width = width; - __rect.height = height; + __rect.set(x, y, width, height); } } \ No newline at end of file diff --git a/source/funkin/editors/ui/UITopMenu.hx b/source/funkin/editors/ui/UITopMenu.hx index 12e1b15e..7e4120a2 100644 --- a/source/funkin/editors/ui/UITopMenu.hx +++ b/source/funkin/editors/ui/UITopMenu.hx @@ -66,10 +66,7 @@ class UITopMenuButton extends UISliceSprite { var opened = curMenu != null ? curMenu.contextMenuOpened() : false; if(opened && FlxG.mouse.justPressed) { - __rect.x = x; - __rect.y = y; - __rect.width = bWidth; - __rect.height = bHeight; + __rect.set(x, y, bWidth, bHeight); if(UIState.state.isOverlapping(this, __rect)) { curMenu.close(); justClosed = 2; diff --git a/source/funkin/editors/ui/UIWindow.hx b/source/funkin/editors/ui/UIWindow.hx index 29abb538..a5e61db9 100644 --- a/source/funkin/editors/ui/UIWindow.hx +++ b/source/funkin/editors/ui/UIWindow.hx @@ -21,8 +21,7 @@ class UIWindow extends UISliceSprite { cursor = ARROW; if(collapsable) { - __rect.x = x; __rect.y = y; - __rect.width = bWidth; __rect.height = topHeight; + __rect.set(x, y, bWidth, topHeight); if(UIState.state.isOverlapping(this, __rect)) { cursor = CLICK; @@ -44,6 +43,6 @@ class UIWindow extends UISliceSprite { __rect.y = y+topHeight; __rect.height = bHeight-topHeight; } - hovered = UIState.state.isOverlapping(this, __rect); + hovered = content.exists && UIState.state.isOverlapping(this, __rect); } } \ No newline at end of file diff --git a/source/funkin/editors/ui/old/OldUISliceSpriteTri.hx b/source/funkin/editors/ui/old/OldUISliceSpriteTri.hx index 3a909f62..e560dee5 100644 --- a/source/funkin/editors/ui/old/OldUISliceSpriteTri.hx +++ b/source/funkin/editors/ui/old/OldUISliceSpriteTri.hx @@ -24,10 +24,7 @@ class OldUISliceSpriteTri extends UISprite { public override function updateButton() { if (incorporeal) return; - __rect.x = x; - __rect.y = y; - __rect.width = bWidth; - __rect.height = bHeight; + __rect.set(x, y, bWidth, bHeight); UIState.state.updateRectButtonHandler(this, __rect, onHovered); }