From e1d22daec0135051ae047febed657dad21278315 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Thu, 22 Dec 2022 03:05:06 +0100 Subject: [PATCH] 11 changed files --- assets/images/desktop/ui.xml | 4 ++-- assets/images/desktop/ui/checkbox.png | Bin 0 -> 1387 bytes buildnumber.txt | 2 +- .../funkin/desktop/editors/CharacterEditor.hx | 17 +++++++-------- .../funkin/desktop/editors/EditorPlayState.hx | 2 ++ source/funkin/desktop/editors/MessageBox.hx | 3 +-- source/funkin/desktop/sprites/WindowText.hx | 20 ++++++++++++------ source/funkin/desktop/theme/Theme.hx | 6 +++--- source/funkin/desktop/windows/Window.hx | 13 +++++++++--- .../desktop/windows/WindowDragHitbox.hx | 5 ++++- source/funkin/game/Character.hx | 4 ++-- 11 files changed, 47 insertions(+), 29 deletions(-) create mode 100644 assets/images/desktop/ui/checkbox.png 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 0000000000000000000000000000000000000000..44c22b6f3755f8e0c2f22a985dd2f40c1f42afbf GIT binary patch literal 1387 zcmV-x1(f=UP)pK9Z5t%RCwCenSE#*br{E=q?flQeOp~8Wlk!tic}N|V`{0emN^Nv z$%YJEt(N-FYL$ZEKp43RBK8j{S}TY}t(`DrOSGhpVhTc-V^B~iB2_ljQM9w`OWu=9 zVxH%E;c_IG+%@*NAN+dU%jfqz-`{bi|@1PXh2^zuymLvze;NWFkl$02@oCQjkn0sXCob zY7mQ-JPE)Xfj|IkHXB&2Rs$yR3jnBm&#p+tAU`K>@K;!oPdIF`tC{%=MD|7au<&E8wNGzZAqL0UH||u(Gm3 z4G1-O^HqhSQ4oyu>biW*b;aqJ#fuUD_mE}MC=wVp_QogDJ(7&&pyIsJGlgE4I zIzW|xYFWs8@hF|Yaej?>v2E~LB^Fd=p=u4{xl3I|gJSZPP6Db1aW$t==`@J8*$po( zMW@kfFGNBT=vOto;)P82TM1on=5)WE*1Z5cUS7=L8NEh&m3Z8Foml8q;j7C%ZrG{0 zKXB?8ZvicN5^&}FG~E3CH?Uc2s9G&XFq@1y&rt{E{FsGgDg*IE24e9v)dwCt3@3Z} zL8v890=x?xtghaIdItjzJCj==7_gcP8;B<}xdn%VaD;>HFbA!zZQwr6(0wg=65zX< zg7u9*VPB&e>KrC&1bf27@C~H6EU88~6i&h2%_KB89Rk-0ejZoCFI+kR4?T6WB>$uT zpseqoaNaJ6PXfO2Cn1tth30)0Xs9z$PhbKJ!+VtD_*aL@w?esKcN1VYw?ekK+v0p>;EWQ%8wp63|(%1E1)G$0~X zmGk}7)D$cIVau~u-v?YS7bQ0_F~OGNhlht{1x!y*v(ldyJ$vzeptrX-pV;K&BwLCf z92}GtFf%j5N`Kt-{NLXPy1TpcNzKmAvU2>uz<{g(DPL6q=wF}D$BKDz@_4UY2dENI zEenl~j#BXX`FR$3v2E~LB^Fd=p=u4{v9YnD!7=$tCjnK1xSG?bbQ(n4?1qb 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'));