diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 5d9d3c4d..e5aa923b 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -340,6 +340,7 @@ class Charter extends UIState { add(charterBG); gridBackdrop = new CharterBackdrop(); + gridBackdrop.notesGroup = this.notesGroup; eventsBackdrop = new EventBackdrop(); eventsBackdrop.x = -eventsBackdrop.width; @@ -430,11 +431,9 @@ class Charter extends UIState { vocals = FlxG.sound.load(Paths.voices(__song, __diff)); vocals.group = FlxG.sound.defaultMusicGroup; - trace("generating notes..."); for(strL in PlayState.SONG.strumLines) createStrumline(strumLines.members.length, strL, false); - trace("generating events..."); var __last:CharterEvent = null; var __lastTime:Float = Math.NaN; for(e in PlayState.SONG.events) { diff --git a/source/funkin/editors/charter/CharterBackdrop.hx b/source/funkin/editors/charter/CharterBackdrop.hx index d365cdcc..8c66ce43 100644 --- a/source/funkin/editors/charter/CharterBackdrop.hx +++ b/source/funkin/editors/charter/CharterBackdrop.hx @@ -16,6 +16,8 @@ class CharterBackdrop extends FlxBackdrop { public var beatSeparator:FlxBackdrop; public var sectionSeparator:FlxBackdrop; + public var notesGroup:CharterNoteGroup; + public function new() { super(null, Y, 0, 0); @@ -102,6 +104,12 @@ class CharterBackdrop extends FlxBackdrop { topLimit.x = this.x; topLimit.cameras = this.cameras; + // Draw notes + notesGroup.forEach((n) -> { + if(n.exists && n.visible && (Math.floor(n.id/4) == _)) + n.draw(); + }); + topLimit.scale.set(4 * 40, Math.ceil(FlxG.height / cameras[0].zoom)); topLimit.updateHitbox(); topLimit.y = -topLimit.height; diff --git a/source/funkin/editors/charter/CharterNote.hx b/source/funkin/editors/charter/CharterNote.hx index 1fa9d296..b05ad1db 100644 --- a/source/funkin/editors/charter/CharterNote.hx +++ b/source/funkin/editors/charter/CharterNote.hx @@ -53,17 +53,20 @@ class CharterNote extends UISprite implements ICharterSelectable { public var step:Float; - public var realId:Int; - @:isVar public var id(get, set):Int; public var susLength:Float; public var type:Int; + + public var realId:Int; + @:isVar public var id(get, set):Int; function set_id(d:Int) { strumLine = Charter.instance.strumLines.members[Math.floor(d / 4)]; - id = d % 4; realId = d; - return id; + return id = d % 4; } - function get_id() return id + 4 * Charter.instance.strumLines.members.indexOf(strumLine); + + function get_id():Int + return id + 4 * Charter.instance.strumLines.members.indexOf(strumLine); + public function updatePos(step:Float, id:Int, susLength:Float = 0, type:Int = 0) { this.step = step; this.id = id; diff --git a/source/funkin/editors/charter/CharterNoteGroup.hx b/source/funkin/editors/charter/CharterNoteGroup.hx index 8478daa9..60dd393f 100644 --- a/source/funkin/editors/charter/CharterNoteGroup.hx +++ b/source/funkin/editors/charter/CharterNoteGroup.hx @@ -7,6 +7,7 @@ class CharterNoteGroup extends FlxTypedGroup { var i:Int = 0; var max:Float = 0; var __currentlyLooping:Bool = false; + var __autoDraw:Bool = false; public override function forEach(noteFunc:CharterNote->Void, recursive:Bool = false) { __loopSprite = null; @@ -54,10 +55,13 @@ class CharterNoteGroup extends FlxTypedGroup { @:privateAccess var oldDefaultCameras = FlxCamera._defaultCameras; @:privateAccess if (cameras != null) FlxCamera._defaultCameras = cameras; - forEach((n) -> { - if(n.exists && n.visible) - n.draw(); - }); + if (__autoDraw) { + forEach((n) -> { + if(n.exists && n.visible) + n.draw(); + }); + } + @:privateAccess FlxCamera._defaultCameras = oldDefaultCameras; }