diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 62be715c..35823b2d 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -778,22 +778,24 @@ class Charter extends UIState { } addEventSpr.selectable = !selectionBox.visible; + var inBoundsY:Bool = (mousePos.y > 0 && mousePos.y < (__endStep)*40); + // Event Spr - if (mousePos.x < 0 && mousePos.x > -addEventSpr.bWidth && gridActionType == NONE) { + if (mousePos.x < 0 && mousePos.x > -addEventSpr.bWidth && gridActionType == NONE && inBoundsY) { addEventSpr.incorporeal = false; addEventSpr.sprAlpha = lerp(addEventSpr.sprAlpha, 0.75, 0.25); var event = getHoveredEvent(mousePos.y); if (event != null) addEventSpr.updateEdit(event); - else addEventSpr.updatePos(mousePos.y); + else addEventSpr.updatePos(FlxG.keys.pressed.SHIFT ? ((mousePos.y+20) / 40) : quantStep(mousePos.y/40)); } else addEventSpr.sprAlpha = lerp(addEventSpr.sprAlpha, 0, 0.25); // Note Hoverer - if (mousePos.x > 0 && mousePos.x < gridBackdrops.strumlinesAmount * 160 && (mousePos.y > 0 && mousePos.y < (__endStep)*40) && gridActionType == NONE) { + if (mousePos.x > 0 && mousePos.x < gridBackdrops.strumlinesAmount * 160 && gridActionType == NONE && inBoundsY) { noteHoverer.alpha = lerp(noteHoverer.alpha, 0.35, 0.25); if (noteHoverer.id != Math.floor(mousePos.x / 40) % 4) { @:privateAccess noteHoverer.__doAnim = false; // Un comment to restore this noteHoverer.updatePos( - FlxMath.bound(FlxG.keys.pressed.SHIFT ? ((mousePos.y-20) / 40) : quantStep(mousePos.y/40), 0, __endStep-1), + FlxMath.bound(FlxG.keys.pressed.SHIFT ? ((mousePos.y) / 40) : quantStep((mousePos.y+20)/40), 0, __endStep-1), Math.floor(mousePos.x / 40) % 4, 0, null, null ); } else { diff --git a/source/funkin/editors/charter/CharterEventAdd.hx b/source/funkin/editors/charter/CharterEventAdd.hx index 254f822c..038725d3 100644 --- a/source/funkin/editors/charter/CharterEventAdd.hx +++ b/source/funkin/editors/charter/CharterEventAdd.hx @@ -34,9 +34,9 @@ class CharterEventAdd extends UISliceSprite { text.alpha = sprAlpha; } - public function updatePos(y:Float) { + public function updatePos(step:Float) { curCharterEvent = null; - step = FlxG.keys.pressed.SHIFT ? (y / 40) : Math.floor((y + 20) / 40); + this.step = step; this.y = (step * 40) - (bHeight / 2); text.text = "Add event"; framesOffset = 0;