right click cause why not

This commit is contained in:
lunarcleint
2023-07-15 18:23:40 -07:00
parent d3f808c9e6
commit 6fb837e679
2 changed files with 19 additions and 3 deletions
@@ -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;
@@ -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);
}
}