diff --git a/assets/images/desktop/ui.xml b/assets/images/desktop/ui.xml index 2f705826..26c8d287 100644 --- a/assets/images/desktop/ui.xml +++ b/assets/images/desktop/ui.xml @@ -1,7 +1,7 @@ - - + + diff --git a/assets/images/desktop/ui/checkbox.png b/assets/images/desktop/ui/checkbox.png new file mode 100644 index 00000000..44c22b6f Binary files /dev/null and b/assets/images/desktop/ui/checkbox.png differ diff --git a/buildnumber.txt b/buildnumber.txt index 68661b7e..f01f3762 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1668 \ No newline at end of file +1675 \ No newline at end of file diff --git a/source/funkin/desktop/editors/CharacterEditor.hx b/source/funkin/desktop/editors/CharacterEditor.hx index e7aab23a..364fe08b 100644 --- a/source/funkin/desktop/editors/CharacterEditor.hx +++ b/source/funkin/desktop/editors/CharacterEditor.hx @@ -29,19 +29,18 @@ class CharacterEditor extends WindowContent { // stage var bg = new FlxSprite(-600, -200).loadAnimatedGraphic(Paths.image('stages/default/stageback')); bg.scrollFactor.set(0.9, 0.9); + var stageFront = new FlxSprite(-600, 600).loadAnimatedGraphic(Paths.image('stages/default/stagefront')); stageFront.scrollFactor.set(0.9, 0.9); - var stageCurtains = new FlxSprite(-500, -300).loadAnimatedGraphic(Paths.image('stages/default/stagecurtains')); - stageCurtains.scrollFactor.set(1.3, 1.3); - char = new Character(100, 100, curCharacter, false); - for(e in [bg, stageFront, stageCurtains]) { + char = new Character(100, 100, curCharacter, false, false); + + for(e in [bg, stageFront]) { e.antialiasing = true; } add(bg); add(stageFront); add(char); - add(stageCurtains); // character setup & following camFollow = new FlxObject(0, 0, 2, 2); @@ -55,10 +54,10 @@ class CharacterEditor extends WindowContent { public override function update(elapsed:Float) { super.update(elapsed); if (parent.focused) { - if (FlxG.keys.pressed.RIGHT) camFollow.x += elapsed * 200; - if (FlxG.keys.pressed.LEFT) camFollow.x -= elapsed * 200; - if (FlxG.keys.pressed.DOWN) camFollow.y += elapsed * 200; - if (FlxG.keys.pressed.UP) camFollow.y -= elapsed * 200; + if (FlxG.keys.pressed.RIGHT) camFollow.x += elapsed * 500; + if (FlxG.keys.pressed.LEFT) camFollow.x -= elapsed * 500; + if (FlxG.keys.pressed.DOWN) camFollow.y += elapsed * 500; + if (FlxG.keys.pressed.UP) camFollow.y -= elapsed * 500; } } } \ No newline at end of file diff --git a/source/funkin/desktop/editors/EditorPlayState.hx b/source/funkin/desktop/editors/EditorPlayState.hx index 162d2b22..9a0fb4ab 100644 --- a/source/funkin/desktop/editors/EditorPlayState.hx +++ b/source/funkin/desktop/editors/EditorPlayState.hx @@ -74,6 +74,8 @@ class EditorPlayState extends WindowContent { public override function update(elapsed:Float) { beforeStateShit(); super.update(elapsed); + @:privateAccess + FlxG.cameras.update(elapsed); state.tryUpdate(elapsed); afterStateShit(); } diff --git a/source/funkin/desktop/editors/MessageBox.hx b/source/funkin/desktop/editors/MessageBox.hx index f9840990..b3da4605 100644 --- a/source/funkin/desktop/editors/MessageBox.hx +++ b/source/funkin/desktop/editors/MessageBox.hx @@ -31,8 +31,7 @@ class MessageBox extends WindowContent { setSize(Std.int(Math.max(text.width + 20, 240)), Std.int(text.height + 20)); - if (__buttons == null) __buttons = ["OK"]; - else if (__buttons.length <= 0) __buttons.push("OK"); + if (__buttons == null || __buttons.length <= 0) __buttons = ["OK"]; var firstButt:Button = null; for(k=>b in __buttons) { diff --git a/source/funkin/desktop/sprites/WindowText.hx b/source/funkin/desktop/sprites/WindowText.hx index da01b572..7bf0fe51 100644 --- a/source/funkin/desktop/sprites/WindowText.hx +++ b/source/funkin/desktop/sprites/WindowText.hx @@ -9,16 +9,24 @@ class WindowText extends FlxText { super(x, y, w, t); color = 0xFF000000; scrollFactor.set(); + size = 12; applyFontSettings(DesktopMain.theme.window); - // setFormat(Paths.font(.font)) } public function applyFontSettings(data:ThemeData) { - var fontPath = Paths.font(data.font); - if (data.font.startsWith("file://")) { - fontPath = data.font.substr(7); - while(fontPath.charAt(0) == "/") fontPath = fontPath.substr(1); + if (data.font != null) { + var fontPath:String; + if (data.font.startsWith("file://")) { + fontPath = data.font.substr(7); + while(fontPath.charAt(0) == "/") fontPath = fontPath.substr(1); + } else { + fontPath = Paths.font(data.font); + } + font = fontPath; } - setFormat(fontPath, Std.int(data.fontSize), data.textColor); + if (data.fontSize != null) + size = Std.int(data.fontSize); + if (data.textColor != null) + color = data.textColor; } } \ No newline at end of file diff --git a/source/funkin/desktop/theme/Theme.hx b/source/funkin/desktop/theme/Theme.hx index fb10beed..20012316 100644 --- a/source/funkin/desktop/theme/Theme.hx +++ b/source/funkin/desktop/theme/Theme.hx @@ -89,10 +89,10 @@ class Theme { class ThemeData implements IFlxDestroyable { public var sprite:String = ""; - public var font:String = ""; - public var fontSize:Float = 12; + public var font:String = null; + public var fontSize:Null = null; - public var textColor:FlxColor = FlxColor.BLACK; + public var textColor:Null = null; public var color:FlxColor = FlxColor.WHITE; public var left:Float = 4; diff --git a/source/funkin/desktop/windows/Window.hx b/source/funkin/desktop/windows/Window.hx index a139fc42..86947d3d 100644 --- a/source/funkin/desktop/windows/Window.hx +++ b/source/funkin/desktop/windows/Window.hx @@ -40,7 +40,7 @@ class Window extends FlxTypedGroup { public var content:WindowContent; - public var caption:FlxUIText; + public var caption:WindowText; public var icon:FlxSprite; public var dragHitbox:WindowDragHitbox; @@ -91,20 +91,27 @@ class Window extends FlxTypedGroup { add(windowFrame); add(windowInactiveFrame); - caption = new FlxUIText(24, 4, 0, content.title); + caption = new WindowText(24, 4, 0, content.title); + caption.applyFontSettings(DesktopMain.theme.captionActive); + caption.borderSize = 1.25; + caption.borderStyle = OUTLINE; + caption.borderColor = 0x63000000; + captionButtons = new FlxTypedSpriteGroup(); for(i in 0...4) { var btn = new WindowCaptionButton(this, i); btn.x = (i+1) * -(DesktopMain.theme.captionButtons.size.x + DesktopMain.theme.captionButtons.margin.x); captionButtons.add(btn); } + + caption.y = (DesktopMain.theme.captionActive.top - caption.height) / 2; add(caption); dragHitbox = new WindowDragHitbox(DesktopMain.theme.captionActive.left, DesktopMain.theme.captionActive.left, DesktopMain.theme.captionActive.left, DesktopMain.theme.captionActive.top); dragHitbox.parent = this; add(dragHitbox); - icon = new FlxSprite(4, 4); + icon = new FlxSprite(4, (DesktopMain.theme.captionActive.top - 16) / 2); add(icon); loadIcon(content.icon); diff --git a/source/funkin/desktop/windows/WindowDragHitbox.hx b/source/funkin/desktop/windows/WindowDragHitbox.hx index bd095f4c..24344b75 100644 --- a/source/funkin/desktop/windows/WindowDragHitbox.hx +++ b/source/funkin/desktop/windows/WindowDragHitbox.hx @@ -32,7 +32,10 @@ class WindowDragHitbox extends FlxObject { public override function update(elapsed:Float) { super.update(elapsed); - if (!parent.moveable) return; + if (!parent.moveable || parent.maximized) { + dragging = false; + return; + } if (dragging) { var screenPos = FlxG.mouse.getScreenPosition(FlxG.camera); screenPos.x = FlxMath.bound(screenPos.x, 0, FlxG.camera.width); diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index a04e7a03..b5ebc703 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -74,7 +74,7 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom if (!event.cancelled) playAnim(event.animName, event.force, SING, event.reversed, event.frame); } - public function new(x:Float, y:Float, ?character:String = "bf", ?isPlayer:Bool = false) + public function new(x:Float, y:Float, ?character:String = "bf", isPlayer:Bool = false, switchAnims:Bool = true) { super(x, y); @@ -172,7 +172,7 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom // [ true ][ false ][ true ] // [ false ][ true ][ true ] // [ true ][ true ][ false ] - if (isPlayer != playerOffsets) + if (isPlayer != playerOffsets && switchAnims) { // character is flipped CoolUtil.switchAnimFrames(animation.getByName('singRIGHT'), animation.getByName('singLEFT'));