ok fixed i think

This commit is contained in:
lunarcleint
2023-07-31 04:18:03 -07:00
parent fc358f41db
commit 965ff2f26b
4 changed files with 24 additions and 22 deletions
@@ -265,7 +265,7 @@ 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 (!(characterPropertiresWindow.hovered || characterAnimsWindow.hovered)) {
if (!(characterPropertiresWindow.hovered || characterAnimsWindow.hovered) && !characterAnimsWindow.dragging) {
if (FlxG.mouse.wheel != 0) {
zoom += 0.25 * FlxG.mouse.wheel;
__camZoom = Math.pow(2, zoom);
@@ -275,22 +275,22 @@ class CharacterEditor extends UIState {
closeCurrentContextMenu();
openContextMenu(topMenu[2].childs);
}
}
if (FlxG.mouse.justPressed) {
FlxG.mouse.getScreenPosition(charCamera, camDrag);
camDrag *= camDragSpeed;
camDrag += charCamera.scroll;
}
if (FlxG.mouse.justPressed) {
FlxG.mouse.getScreenPosition(charCamera, camDrag);
camDrag *= camDragSpeed;
camDrag += charCamera.scroll;
}
if (FlxG.mouse.pressed) {
var pos = FlxG.mouse.getScreenPosition(charCamera);
pos *= camDragSpeed;
nextScroll.set((camDrag.x - pos.x), (camDrag.y - pos.y));
if (FlxG.mouse.pressed) {
var pos = FlxG.mouse.getScreenPosition(charCamera);
pos *= camDragSpeed;
nextScroll.set((camDrag.x - pos.x), (camDrag.y - pos.y));
currentCursor = HAND;
} else
currentCursor = HAND;
} else
currentCursor = ARROW;
} else if (!FlxG.mouse.pressed)
currentCursor = ARROW;
charCamera.scroll.set(
@@ -24,12 +24,4 @@ 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);
}
}
+2
View File
@@ -14,6 +14,7 @@ class UIButtonList extends UIWindow {
public var addIcon:FlxSprite;
public var buttonCameras:FlxCamera;
public var cameraSpacing = 36;
public var dragging:Bool = false;
var _buttonXOffset:Float = 16;
var _buttonYOffset:Float = 16;
@@ -106,5 +107,6 @@ class UIButtonList extends UIWindow {
buttonCameras.y = y + cameraSpacing - __lastDrawCameras[0].scroll.y;
buttonCameras.zoom = __lastDrawCameras[0].zoom;
}
dragging = _curMoving != null;
}
}
+8
View File
@@ -9,4 +9,12 @@ class UIWindow extends UISliceSprite {
members.push(titleSpr = new UIText(x + 25, y, bWidth - 50, title, 15, -1));
titleSpr.y = y + ((30 - titleSpr.height) / 2);
}
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);
}
}