From b4782ad5f4727bf77d99beae5ad6a548dc95250a Mon Sep 17 00:00:00 2001 From: Frakist <90983918+Frakist@users.noreply.github.com> Date: Sun, 24 Sep 2023 10:36:24 +0300 Subject: [PATCH 1/2] made some editor vars static --- source/funkin/editors/character/CharacterEditor.hx | 4 ++-- source/funkin/editors/charter/Charter.hx | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/source/funkin/editors/character/CharacterEditor.hx b/source/funkin/editors/character/CharacterEditor.hx index cf0434d4..287b4a44 100644 --- a/source/funkin/editors/character/CharacterEditor.hx +++ b/source/funkin/editors/character/CharacterEditor.hx @@ -11,7 +11,7 @@ import flixel.input.keyboard.FlxKey; import funkin.game.Character; class CharacterEditor extends UIState { - var __character:String; + static var __character:String; public var character:Character; public var ghosts:CharacterGhostsHandler; @@ -45,7 +45,7 @@ class CharacterEditor extends UIState { public function new(character:String) { super(); - __character = character; + if (character != null) __character = character; } public override function create() { diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 280795bb..34ba79b0 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -20,9 +20,9 @@ import funkin.editors.ui.UIState; import openfl.net.FileReference; class Charter extends UIState { - var __song:String; - var __diff:String; - var __reload:Bool; + static var __song:String; + static var __diff:String; + static var __reload:Bool; var chart(get, null):ChartData; private function get_chart() @@ -85,9 +85,11 @@ class Charter extends UIState { public function new(song:String, diff:String, reload:Bool = true) { super(); - __song = song; - __diff = diff; - __reload = reload; + if (song != null) { + __song = song; + __diff = diff; + __reload = reload; + } } public override function create() { From b245b8476ac38c8926367f4c9e3e21ebf7e2c8fe Mon Sep 17 00:00:00 2001 From: NeeEoo Date: Sun, 24 Sep 2023 12:32:28 +0200 Subject: [PATCH 2/2] Small Fixes --- source/funkin/editors/charter/Charter.hx | 2 +- source/funkin/game/NoteGroup.hx | 11 ++++++++--- source/funkin/game/PlayState.hx | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 34ba79b0..85ef6a6c 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -231,7 +231,7 @@ class Charter extends UIState { onSelect: _note_selectall }, { - label: "Select maeasure", + label: "Select measure", keybind: [CONTROL, SHIFT, A], onSelect: _note_selectmeasure }, diff --git a/source/funkin/game/NoteGroup.hx b/source/funkin/game/NoteGroup.hx index dc066ea4..ca617eec 100644 --- a/source/funkin/game/NoteGroup.hx +++ b/source/funkin/game/NoteGroup.hx @@ -8,6 +8,11 @@ class NoteGroup extends FlxTypedGroup { var i:Int = 0; var __currentlyLooping:Bool = false; + /** + * How many ms it should show a note before it should be hit + **/ + public var limit:Float = 1500; + /** * Preallocates the members array with nulls, but if theres anything in the array already it clears it **/ @@ -36,7 +41,7 @@ class NoteGroup extends FlxTypedGroup { if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.active) { continue; } - if (__loopSprite.strumTime - Conductor.songPosition > 1500) + if (__loopSprite.strumTime - Conductor.songPosition > limit) break; __loopSprite.update(elapsed); } @@ -55,7 +60,7 @@ class NoteGroup extends FlxTypedGroup { __loopSprite = members[i--]; if (__loopSprite == null || !__loopSprite.exists || !__loopSprite.visible) continue; - if (__loopSprite.strumTime - Conductor.songPosition > 1500) break; + if (__loopSprite.strumTime - Conductor.songPosition > limit) break; __loopSprite.draw(); } __currentlyLooping = oldCur; @@ -74,7 +79,7 @@ class NoteGroup extends FlxTypedGroup { __loopSprite = members[i--]; if (__loopSprite == null || !__loopSprite.exists) continue; - if (__loopSprite.strumTime - Conductor.songPosition > 1500) break; + if (__loopSprite.strumTime - Conductor.songPosition > limit) break; noteFunc(__loopSprite); } __currentlyLooping = oldCur; diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 2629e7ca..fbf8dba8 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -565,8 +565,8 @@ class PlayState extends MusicBeatState for(folder in scriptsFolders) { for(file in Paths.getFolderContent(folder, true, fromMods ? MODS : BOTH)) { if (folder == 'data/charts/') - Logs.trace('data/charts/ is deprecrated and will be removed in the future. Please move script $file.hx to songs/', WARNING, DARKYELLOW); - + Logs.trace('data/charts/ is deprecrated and will be removed in the future. Please move script $file to songs/', WARNING, DARKYELLOW); + addScript(file); } }