diff --git a/art/flashFiles/Editor_Icons.fla b/art/flashFiles/Editor_Icons.fla index 6ad80d3d..d9be2190 100644 Binary files a/art/flashFiles/Editor_Icons.fla and b/art/flashFiles/Editor_Icons.fla differ diff --git a/assets/images/editors/icons.png b/assets/images/editors/icons.png deleted file mode 100644 index cccc10f9..00000000 Binary files a/assets/images/editors/icons.png and /dev/null differ diff --git a/assets/images/editors/icons/alphabet.png b/assets/images/editors/icons/alphabet.png new file mode 100644 index 00000000..5496fcd1 Binary files /dev/null and b/assets/images/editors/icons/alphabet.png differ diff --git a/assets/images/editors/icons/character.png b/assets/images/editors/icons/character.png new file mode 100644 index 00000000..b58fbe98 Binary files /dev/null and b/assets/images/editors/icons/character.png differ diff --git a/assets/images/editors/icons/chart.png b/assets/images/editors/icons/chart.png new file mode 100644 index 00000000..88f01e64 Binary files /dev/null and b/assets/images/editors/icons/chart.png differ diff --git a/assets/images/editors/icons/debugOptions.png b/assets/images/editors/icons/debugOptions.png new file mode 100644 index 00000000..9910412f Binary files /dev/null and b/assets/images/editors/icons/debugOptions.png differ diff --git a/assets/images/editors/icons/dialogue.png b/assets/images/editors/icons/dialogue.png new file mode 100644 index 00000000..c6b6ce1f Binary files /dev/null and b/assets/images/editors/icons/dialogue.png differ diff --git a/assets/images/editors/icons/noteskin.png b/assets/images/editors/icons/noteskin.png new file mode 100644 index 00000000..c508eb79 Binary files /dev/null and b/assets/images/editors/icons/noteskin.png differ diff --git a/assets/images/editors/icons/stage.png b/assets/images/editors/icons/stage.png new file mode 100644 index 00000000..3735a3f5 Binary files /dev/null and b/assets/images/editors/icons/stage.png differ diff --git a/assets/images/editors/icons/uiDebug.png b/assets/images/editors/icons/uiDebug.png new file mode 100644 index 00000000..527b3328 Binary files /dev/null and b/assets/images/editors/icons/uiDebug.png differ diff --git a/assets/images/editors/icons/wiki.png b/assets/images/editors/icons/wiki.png new file mode 100644 index 00000000..47be596f Binary files /dev/null and b/assets/images/editors/icons/wiki.png differ diff --git a/project.xml b/project.xml index fa9f7f48..5b737d6f 100644 --- a/project.xml +++ b/project.xml @@ -64,6 +64,7 @@ + @@ -150,7 +151,7 @@ - + diff --git a/source/funkin/backend/chart/EventsData.hx b/source/funkin/backend/chart/EventsData.hx index 09050b91..e19523ed 100644 --- a/source/funkin/backend/chart/EventsData.hx +++ b/source/funkin/backend/chart/EventsData.hx @@ -31,7 +31,7 @@ final class EventsData { {name: "Time (Steps)", type: TFloat(0.25, 9999, 0.25, 2), defValue: 4}, {name: "Camera", type: TDropDown(['camGame', 'camHUD']), defValue: "camHUD"} ], - "BPM Change" => [{name: "Target BPM", type: TFloat(1), defValue: 100}], + "BPM Change" => [{name: "Target BPM", type: TFloat(1.00, null, 0.001, 3), defValue: 100}], "Scroll Speed Change" => [ {name: "Tween Speed?", type: TBool, defValue: true}, {name: "New Speed", type: TFloat(0.01, 99, 0.01, 2), defValue: 1.}, diff --git a/source/funkin/backend/scripting/HScript.hx b/source/funkin/backend/scripting/HScript.hx index f937d3dc..1727750d 100644 --- a/source/funkin/backend/scripting/HScript.hx +++ b/source/funkin/backend/scripting/HScript.hx @@ -101,11 +101,15 @@ class HScript extends Script { private function _errorHandler(error:Error) { var fileName = error.origin; + var oldfn = '$fileName:${error.line}: '; if(remappedNames.exists(fileName)) fileName = remappedNames.get(fileName); var fn = '$fileName:${error.line}: '; var err = error.toString(); - if (err.startsWith(fn)) err = err.substr(fn.length); + while(err.startsWith(oldfn) || err.startsWith(fn)) { + if (err.startsWith(oldfn)) err = err.substr(oldfn.length); + if (err.startsWith(fn)) err = err.substr(fn.length); + } Logs.traceColored([ Logs.logText(fn, GREEN), diff --git a/source/funkin/editors/EditorPicker.hx b/source/funkin/editors/EditorPicker.hx index f34a7219..2d601407 100644 --- a/source/funkin/editors/EditorPicker.hx +++ b/source/funkin/editors/EditorPicker.hx @@ -9,29 +9,29 @@ class EditorPicker extends MusicBeatSubstate { public var options:Array = [ { name: "Chart Editor", - iconID: 0, + id: "chart", state: funkin.editors.charter.CharterSelection }, { name: "Character Editor", - iconID: 1, + id: "character", state: funkin.editors.character.CharacterSelection }, { name: "Stage Editor", - iconID: 2, + id: "stage", state: funkin.editors.stage.StageSelection }, #if debug { name: "UI Debug State", - iconID: 3, + id: "uiDebug", state: UIDebugState }, #end { name: "Wiki", - iconID: 5, + id: "wiki", state: null, onClick: function() { CoolUtil.openURL("https://codename-engine.com/"); @@ -39,7 +39,7 @@ class EditorPicker extends MusicBeatSubstate { }, { name: "Debug Options", - iconID: 4, + id: "debugOptions", state: DebugOptions } ]; @@ -74,7 +74,7 @@ class EditorPicker extends MusicBeatSubstate { optionHeight = FlxG.height / options.length; for(k=>o in options) { - var spr = new EditorPickerOption(o.name, o.iconID, optionHeight); + var spr = new EditorPickerOption(o.name, o.id, optionHeight); spr.y = k * optionHeight; add(spr); sprites.push(spr); @@ -155,7 +155,7 @@ class EditorPicker extends MusicBeatSubstate { typedef Editor = { var name:String; - var iconID:Int; + var id:String; var state:Class; var ?onClick:Void->Void; } @@ -171,19 +171,14 @@ class EditorPickerOption extends FlxTypedSpriteGroup { public var selectionLerp:Float = 0; public var iconRotationCycle:Float = 0; - public function new(name:String, iconID:Int, height:Float) { + public function new(name:String, iconID:String, height:Float) { super(); FlxG.mouse.visible = true; iconSpr = new FlxSprite(); - iconSpr.loadGraphic(Paths.image('editors/icons'), true, 128, 128); - iconSpr.animation.add("icon", [iconID], 24, true); - iconSpr.animation.play("icon"); + iconSpr.loadGraphic(Paths.image('editors/icons/$iconID')); iconSpr.antialiasing = true; - if (height < 150) { - iconSpr.scale.set(height / 150, height / 150); - iconSpr.updateHitbox(); - } + iconSpr.setUnstretchedGraphicSize(110, 110, false); iconSpr.x = 25 + ((height - iconSpr.width) / 2); iconSpr.y = (height - iconSpr.height) / 2; diff --git a/source/funkin/game/StrumLine.hx b/source/funkin/game/StrumLine.hx index 7dacf494..484a6075 100644 --- a/source/funkin/game/StrumLine.hx +++ b/source/funkin/game/StrumLine.hx @@ -340,6 +340,7 @@ class StrumLine extends FlxTypedGroup { super.destroy(); if(startingPos != null) startingPos.put(); + notes = FlxDestroyUtil.destroy(notes); } /** diff --git a/source/funkin/game/cutscenes/Cutscene.hx b/source/funkin/game/cutscenes/Cutscene.hx index 41f7e233..21ee5690 100644 --- a/source/funkin/game/cutscenes/Cutscene.hx +++ b/source/funkin/game/cutscenes/Cutscene.hx @@ -16,8 +16,8 @@ class Cutscene extends MusicBeatSubstate { public var skippable(default, set):Bool; public function set_skippable(val:Bool):Bool { - if(!val) pauseItems.remove('Skip Cutscene'); - else if(!pauseItems.contains('Skip Cutscene')) pauseItems.insert(1, 'Skip Cutscene'); + if (!val) pauseItems.remove('Skip Cutscene'); + else if (!pauseItems.contains('Skip Cutscene')) pauseItems.insert(1, 'Skip Cutscene'); return skippable = val; } diff --git a/source/funkin/game/cutscenes/DialogueCutscene.hx b/source/funkin/game/cutscenes/DialogueCutscene.hx index 5f3aed63..0d9a95fd 100644 --- a/source/funkin/game/cutscenes/DialogueCutscene.hx +++ b/source/funkin/game/cutscenes/DialogueCutscene.hx @@ -30,14 +30,14 @@ class DialogueCutscene extends ScriptedCutscene { public static var cutscene:DialogueCutscene; public var dialogueScript(get, set):Script; - public function set_curLine(val:DialogueLine) { + public inline function set_curLine(val:DialogueLine) { lastLine = curLine; return curLine = val; } // Backwards compat funcs - Nex - public function set_dialogueScript(val:Script) return script = val; - public function get_dialogueScript() return script; + public inline function set_dialogueScript(val:Script) return script = val; + public inline function get_dialogueScript() return script; public function new(dialoguePath:String, callback:Void->Void) { super(this.dialoguePath = dialoguePath, callback); diff --git a/source/funkin/game/cutscenes/VideoCutscene.hx b/source/funkin/game/cutscenes/VideoCutscene.hx index 9216c340..9e5a50bd 100644 --- a/source/funkin/game/cutscenes/VideoCutscene.hx +++ b/source/funkin/game/cutscenes/VideoCutscene.hx @@ -62,6 +62,14 @@ class VideoCutscene extends Cutscene { video.antialiasing = true; video.autoPause = false; // Imma handle it better inside this class, mainly because of the pause menu - Nex video.bitmap.onEndReached.add(close); + video.bitmap.onFormatSetup.add(function() if (video.bitmap != null && video.bitmap.bitmapData != null) { + final width = video.bitmap.bitmapData.width; + final height = video.bitmap.bitmapData.height; + final scale:Float = Math.min(FlxG.width / width, FlxG.height / height); + video.setGraphicSize(Std.int(width * scale), Std.int(height * scale)); + video.updateHitbox(); + video.screenCenter(); + }); //cover = new FlxSprite(0, FlxG.height * 0.85).makeSolid(FlxG.width + 50, FlxG.height + 50, 0xFF000000); //cover.scrollFactor.set(0, 0); @@ -100,7 +108,7 @@ class VideoCutscene extends Cutscene { File.saveBytes(localPath, Assets.getBytes(path)); } - if(video.load(localPath)) new FlxTimer().start(0.001, function(_) {mutex.acquire(); onReady(); mutex.release();}); + if (video.load(localPath)) new FlxTimer().start(0.001, function(_) { mutex.acquire(); onReady(); mutex.release(); }); else { mutex.acquire(); close(); mutex.release(); } }); @@ -236,6 +244,7 @@ class VideoCutscene extends Cutscene { public override function destroy() { FlxG.cameras.remove(cutsceneCamera, true); + video.destroy(); super.destroy(); } #end diff --git a/source/funkin/menus/credits/CreditsMain.hx b/source/funkin/menus/credits/CreditsMain.hx index 0ed3bacf..d19df882 100644 --- a/source/funkin/menus/credits/CreditsMain.hx +++ b/source/funkin/menus/credits/CreditsMain.hx @@ -12,7 +12,7 @@ class CreditsMain extends TreeMenu { var items:Array = []; public override function create() { - bg = new FlxSprite(-80).loadGraphic(Paths.image('menus/menuBGBlue')); + bg = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBGBlue')); // bg.scrollFactor.set(); bg.scale.set(1.15, 1.15); bg.updateHitbox(); diff --git a/source/funkin/options/OptionsMenu.hx b/source/funkin/options/OptionsMenu.hx index facfcafc..2b8c0168 100644 --- a/source/funkin/options/OptionsMenu.hx +++ b/source/funkin/options/OptionsMenu.hx @@ -32,6 +32,8 @@ class OptionsMenu extends TreeMenu { } ]; + var bg:FlxSprite; + public override function create() { super.create(); @@ -39,7 +41,7 @@ class OptionsMenu extends TreeMenu { DiscordUtil.call("onMenuLoaded", ["Options Menu"]); - var bg:FlxSprite = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBGBlue')); + bg = new FlxSprite(-80).loadAnimatedGraphic(Paths.image('menus/menuBGBlue')); // bg.scrollFactor.set(); bg.scale.set(1.15, 1.15); bg.updateHitbox();