From 2af38af129d2fab1fdc0b0ffc402b830c64b2be8 Mon Sep 17 00:00:00 2001 From: Frakist <90983918+Frakist@users.noreply.github.com> Date: Sun, 1 Oct 2023 15:15:34 +0300 Subject: [PATCH 1/2] missing event icon check --- source/funkin/editors/charter/CharterEvent.hx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/funkin/editors/charter/CharterEvent.hx b/source/funkin/editors/charter/CharterEvent.hx index 1e6cab0c..442021a3 100644 --- a/source/funkin/editors/charter/CharterEvent.hx +++ b/source/funkin/editors/charter/CharterEvent.hx @@ -47,11 +47,10 @@ class CharterEvent extends UISliceSprite implements ICharterSelectable { private static function generateDefaultIcon(name:String) { var isBase64:Bool = false; var path:String = Paths.image('editors/charter/event-icons/$name'); - if (!Assets.exists(path) && Assets.exists(Paths.pack('events/$name'))) { + if (!Assets.exists(path)) path = Paths.image('editors/charter/event-icons/Unknown'); + var packimg = Assets.getText(Paths.pack('events/$name')).split('________PACKSEP________')[3]; + if (isBase64 = (packimg != null)) path = Assets.getText(Paths.pack('events/$name')).split('________PACKSEP________')[3]; - isBase64 = true; - } - else if (!Assets.exists(path)) path = Paths.image('editors/charter/event-icons/Unknown'); var spr = new FlxSprite().loadGraphic(isBase64 ? openfl.display.BitmapData.fromBase64(path.trim(), 'UTF8') : path); return spr; From 14491a0b9c3b1c132c37d5ffd4b3f354e3829612 Mon Sep 17 00:00:00 2001 From: Frakist <90983918+Frakist@users.noreply.github.com> Date: Sun, 1 Oct 2023 15:37:13 +0300 Subject: [PATCH 2/2] fixed the dumbass conductor line in charter --- source/funkin/editors/charter/Charter.hx | 20 +++++++++---------- .../editors/charter/CharterBackdropGroup.hx | 5 +++-- source/funkin/editors/charter/CharterEvent.hx | 9 +++++---- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 0461c873..209947fc 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -853,6 +853,16 @@ class Charter extends UIState { public override function update(elapsed:Float) { updateNoteLogic(elapsed); + if (FlxG.sound.music.playing) { + gridBackdrops.conductorSprY = curStepFloat * 40; + } else { + gridBackdrops.conductorSprY = lerp(gridBackdrops.conductorSprY, curStepFloat * 40, 1/3); + } + charterCamera.scroll.set( + ((((40*4) * gridBackdrops.strumlinesAmount) - FlxG.width) / 2), + gridBackdrops.conductorSprY - (FlxG.height * 0.5) + ); + super.update(elapsed); scrollBar.size = (FlxG.height / 40 / charterCamera.zoom); @@ -895,16 +905,6 @@ class Charter extends UIState { + '\nBPM: ${Conductor.bpm}' + '\nTime Signature: ${Conductor.beatsPerMesure}/${Conductor.stepsPerBeat}'; - if (FlxG.sound.music.playing) { - gridBackdrops.conductorSprY = curStepFloat * 40; - } else { - gridBackdrops.conductorSprY = lerp(gridBackdrops.conductorSprY, curStepFloat * 40, 1/3); - } - charterCamera.scroll.set( - ((((40*4) * gridBackdrops.strumlinesAmount) - FlxG.width) / 2), - gridBackdrops.conductorSprY - (FlxG.height * 0.5) - ); - if (charterCamera.zoom != (charterCamera.zoom = lerp(charterCamera.zoom, __camZoom, 0.125))) updateDisplaySprites(); diff --git a/source/funkin/editors/charter/CharterBackdropGroup.hx b/source/funkin/editors/charter/CharterBackdropGroup.hx index 3934f73c..62324276 100644 --- a/source/funkin/editors/charter/CharterBackdropGroup.hx +++ b/source/funkin/editors/charter/CharterBackdropGroup.hx @@ -48,6 +48,8 @@ class CharterBackdropGroup extends FlxTypedGroup { for (grid in members) grid.active = grid.visible = false; + super.update(elapsed); + for (i => strumLine in strumLineGroup.members) { if (strumLine == null) continue; @@ -73,8 +75,7 @@ class CharterBackdropGroup extends FlxTypedGroup { grid.active = grid.visible = true; grid.updateSprites(); } - - super.update(elapsed); + } public var draggingObj:CharterBackdrop = null; diff --git a/source/funkin/editors/charter/CharterEvent.hx b/source/funkin/editors/charter/CharterEvent.hx index 442021a3..ff62f465 100644 --- a/source/funkin/editors/charter/CharterEvent.hx +++ b/source/funkin/editors/charter/CharterEvent.hx @@ -48,10 +48,11 @@ class CharterEvent extends UISliceSprite implements ICharterSelectable { var isBase64:Bool = false; var path:String = Paths.image('editors/charter/event-icons/$name'); if (!Assets.exists(path)) path = Paths.image('editors/charter/event-icons/Unknown'); - var packimg = Assets.getText(Paths.pack('events/$name')).split('________PACKSEP________')[3]; - if (isBase64 = (packimg != null)) - path = Assets.getText(Paths.pack('events/$name')).split('________PACKSEP________')[3]; - + if (Assets.exists(Paths.pack('events/$name'))) { + var packimg = Assets.getText(Paths.pack('events/$name')).split('________PACKSEP________')[3]; + if (isBase64 = (packimg != null)) + path = Assets.getText(Paths.pack('events/$name')).split('________PACKSEP________')[3]; + } var spr = new FlxSprite().loadGraphic(isBase64 ? openfl.display.BitmapData.fromBase64(path.trim(), 'UTF8') : path); return spr; }