diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 2aea7273..e7532f31 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -725,7 +725,7 @@ class Charter extends UIState { /** * NOTE DRAG HANDLING */ - mousePos = FlxG.mouse.getWorldPosition(charterCamera); + FlxG.mouse.getWorldPosition(charterCamera, mousePos); if (!gridBackdropDummy.hoveredByChild && !FlxG.mouse.pressed) gridActionType = NONE; selectionBox.visible = false; @@ -918,7 +918,6 @@ class Charter extends UIState { var mousePos = FlxG.mouse.getScreenPosition(uiCamera); closeCurrentContextMenu(); openContextMenu(topMenu[1].childs, null, mousePos.x, mousePos.y); - mousePos.put(); } gridActionType = NONE; deletedNotes = []; } diff --git a/source/funkin/editors/charter/CharterDeleteAnim.hx b/source/funkin/editors/charter/CharterDeleteAnim.hx index df3f565b..88bde691 100644 --- a/source/funkin/editors/charter/CharterDeleteAnim.hx +++ b/source/funkin/editors/charter/CharterDeleteAnim.hx @@ -11,7 +11,7 @@ class CharterDeleteAnim extends CharterNote { super(); sustainSpr.color = 0xFF630000; color = 0xFF605A5A; - snappedToStrumline = selectable = autoAlpha = false; + snappedToStrumline = selectable = autoAlpha = false; @:privateAccess __animSpeed = 1.25; garbageIcon = new FlxSprite().loadGraphic(Paths.image("editors/deleter")); @@ -40,12 +40,12 @@ class CharterDeleteAnim extends CharterNote { FlxG.mouse.getWorldPosition(Charter.instance.uiCamera, __mousePos); if (FlxG.mouse.pressedRight && __deletionTimer <= 0) { garbageIcon.setPosition( - __mousePos.x + garbageIcon.width/2 + (.65*FlxG.random.float(-1, 1)) + 2, + __mousePos.x + garbageIcon.width/2 + (.65*FlxG.random.float(-1, 1)) + 2, __mousePos.y - garbageIcon.height + (.65*FlxG.random.float(-1, 1)) - 8 ); garbageCircle.setPosition( - __mousePos.x - garbageCircle.width/2, + __mousePos.x - garbageCircle.width/2, (__mousePos.y - garbageCircle.height/2) + 2 ); } @@ -56,7 +56,7 @@ class CharterDeleteAnim extends CharterNote { public override function draw() @:privateAccess { for (deleteData in deleteNotes) { - y = deleteData.note.y + (deleteData.time>deleteTime*.5 ? (deleteData.time/deleteTime)*FlxG.random.float(-1.1, 1.1) : 0); // lunar when no shake :(( + y = deleteData.note.y + (deleteData.time>deleteTime*.5 ? (deleteData.time/deleteTime)*FlxG.random.float(-1.1, 1.1) : 0); // lunar when no shake :(( x = deleteData.note.x + (deleteData.time>deleteTime*.5 ? (deleteData.time/deleteTime)*FlxG.random.float(-1.1, 1.1) : 0); // lunar when no shake :(( angle = deleteData.note.angle; alpha = 1; animation.curAnim.curFrame = 3; @@ -69,7 +69,7 @@ class CharterDeleteAnim extends CharterNote { typeText.exists = deleteData.note.type != 0; typeText.alpha = .4; typeText.follow(this, 20 - (typeText.frameWidth/2), 20 - (typeText.frameHeight/2)); - for (member in [this, sustainSpr, typeText]) + for (member in [this, sustainSpr, typeText]) member.alpha *= FlxEase.quadInOut(deleteData.time/deleteTime); super.draw(); diff --git a/source/funkin/editors/charter/CharterStrumLineGroup.hx b/source/funkin/editors/charter/CharterStrumLineGroup.hx index e10e45b3..ad1522a5 100644 --- a/source/funkin/editors/charter/CharterStrumLineGroup.hx +++ b/source/funkin/editors/charter/CharterStrumLineGroup.hx @@ -13,8 +13,10 @@ class CharterStrumLineGroup extends FlxTypedGroup { public function get_isDragging():Bool return draggingObj != null; + var __mousePos:FlxPoint = new FlxPoint(); + public override function update(elapsed:Float) { - var mousePos = FlxG.mouse.getWorldPosition(cameras[0], FlxPoint.get()); + FlxG.mouse.getWorldPosition(cameras[0], __mousePos); for (strumLine in members) { if (strumLine == null) continue; strumLine.draggable = draggable; @@ -22,14 +24,14 @@ class CharterStrumLineGroup extends FlxTypedGroup { draggingObj = strumLine; strumLine.dragging = true; - draggingOffset = mousePos.x - strumLine.button.x; + draggingOffset = __mousePos.x - strumLine.button.x; __pastStrumlines = members.copy(); break; } } if (isDragging) { - draggingObj.x = mousePos.x - draggingOffset; + draggingObj.x = __mousePos.x - draggingOffset; this.sort(function(o, a, b) return FlxSort.byValues(o, a.x, b.x), -1); } @@ -46,7 +48,6 @@ class CharterStrumLineGroup extends FlxTypedGroup { if ((FlxG.mouse.justReleased || !draggable) && isDragging) finishDrag(); - mousePos.put(); super.update(elapsed); } diff --git a/source/funkin/editors/stage/StageEditor.hx b/source/funkin/editors/stage/StageEditor.hx index 090be4e3..f715d8e0 100644 --- a/source/funkin/editors/stage/StageEditor.hx +++ b/source/funkin/editors/stage/StageEditor.hx @@ -454,7 +454,7 @@ class StageEditor extends UIState { currentCursor = ARROW; - mousePoint = FlxG.mouse.getWorldPosition(stageCamera, mousePoint); + FlxG.mouse.getWorldPosition(stageCamera, mousePoint); if ((!stageSpritesWindow.hovered && !stageSpritesWindow.dragging) && !topMenuSpr.hovered) { if (FlxG.mouse.wheel != 0) { zoom += 0.25 * FlxG.mouse.wheel; diff --git a/source/funkin/editors/ui/UIButtonList.hx b/source/funkin/editors/ui/UIButtonList.hx index ff5e1fc1..8384b89f 100644 --- a/source/funkin/editors/ui/UIButtonList.hx +++ b/source/funkin/editors/ui/UIButtonList.hx @@ -89,8 +89,10 @@ class UIButtonList extends UIWindow { curMovingInterval += FlxG.mouse.deltaY; if (Math.abs(curMovingInterval) > addButton.bHeight / 2) { curMovingInterval = 999; - curMoving.y = CoolUtil.fpsLerp(curMoving.y, FlxG.mouse.getWorldPosition(buttonCameras).y - (curMoving.bHeight / 2), 0.3); + var mousePos = FlxG.mouse.getWorldPosition(buttonCameras); + curMoving.y = CoolUtil.fpsLerp(curMoving.y, mousePos.y - (curMoving.bHeight / 2), 0.3); buttons.sort(function(o, a:T, b:T) return FlxSort.byValues(o, a.y + (a.bHeight / 2), b.y + (a.bHeight / 2)), -1); + mousePos.put(); } if (FlxG.mouse.justReleased) { curMoving = null;