From 6fb837e6798bf64f884caae8fd61fabcbab719e4 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Sat, 15 Jul 2023 18:23:40 -0700 Subject: [PATCH] right click cause why not --- source/funkin/editors/character/CharacterEditor.hx | 14 +++++++++++--- .../editors/character/CharacterPropertiesWindow.hx | 8 ++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/source/funkin/editors/character/CharacterEditor.hx b/source/funkin/editors/character/CharacterEditor.hx index 31b9d7d4..00350f2e 100644 --- a/source/funkin/editors/character/CharacterEditor.hx +++ b/source/funkin/editors/character/CharacterEditor.hx @@ -249,11 +249,19 @@ class CharacterEditor extends UIState { if (character != null) characterPropertiresWindow.characterInfo.text = '(${character.getNameList().length}) Animations\nFlipped: ${character.flipX}\nSprite: ${character.sprite}\nAnim: ${character.getAnimName()}\nOffset: (${character.frameOffset.x}, ${character.frameOffset.y})'; - if (FlxG.mouse.wheel != 0 && !(characterPropertiresWindow.hovered || characterAnimsWindow.hovered)) { - zoom += 0.25 * FlxG.mouse.wheel; - __camZoom = Math.pow(2, zoom); + if (!(characterPropertiresWindow.hovered || characterAnimsWindow.hovered)) { + if (FlxG.mouse.wheel != 0) { + zoom += 0.25 * FlxG.mouse.wheel; + __camZoom = Math.pow(2, zoom); + } + + if (FlxG.mouse.justReleasedRight) { + closeCurrentContextMenu(); + openContextMenu(topMenu[2].childs); + } } + if (FlxG.mouse.justPressedMiddle) { FlxG.mouse.getScreenPosition(charCamera, camDrag); camDrag *= camDragSpeed; diff --git a/source/funkin/editors/character/CharacterPropertiesWindow.hx b/source/funkin/editors/character/CharacterPropertiesWindow.hx index f13478c7..06795eb1 100644 --- a/source/funkin/editors/character/CharacterPropertiesWindow.hx +++ b/source/funkin/editors/character/CharacterPropertiesWindow.hx @@ -24,4 +24,12 @@ class CharacterPropertiesWindow extends UIWindow { characterInfo.alignment = LEFT; members.push(characterInfo); } + + public override function update(elapsed:Float) { + super.update(elapsed); + + __rect.x = x; __rect.y = y+23; + __rect.width = bWidth; __rect.height = bHeight-23; + hovered = UIState.state.isOverlapping(this, __rect); + } } \ No newline at end of file