diff --git a/mods/test/data/charts/test-dia.txt b/mods/test/data/charts/test-dia.txt deleted file mode 100644 index 1c8711d..0000000 --- a/mods/test/data/charts/test-dia.txt +++ /dev/null @@ -1 +0,0 @@ -DaveDialogue \ No newline at end of file diff --git a/mods/test/data/charts/test-settings.json b/mods/test/data/charts/test-settings.json index 757812f..20cc920 100644 --- a/mods/test/data/charts/test-settings.json +++ b/mods/test/data/charts/test-settings.json @@ -2,6 +2,7 @@ "songCreators": "Kawai Sprite & MtH", "songHeadings": "funkinHeading", "creditsTxt": "The testiest song on the planet", + "dialogueMusic": "DaveDialogue", "hasNoGf": false, "intro": "", "windowName": "", diff --git a/mods/test/data/dialogue/test-endDialogue.txt b/mods/test/data/dialogue/test-endDialogue.txt new file mode 100644 index 0000000..ab64464 --- /dev/null +++ b/mods/test/data/dialogue/test-endDialogue.txt @@ -0,0 +1,3 @@ +:dave,festival-exhausted:Testing +:generic:Testing +:generic:1 2 3 \ No newline at end of file diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index b5eee34..7c62420 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -61,7 +61,7 @@ class DialogueBox extends FlxSpriteGroup var debug:Bool = false; var curshader:Dynamic; - var custom:Array; + var custom:String; public var rawJsonDial:String; public var jsonDial:DiaCharacter; @@ -78,8 +78,10 @@ class DialogueBox extends FlxSpriteGroup { super(); - if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-dia.txt')) { - custom = CoolUtil.coolTextFile(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-dia.txt'); + if (PlayState.settingsExist && PlayState.jsonSettings.dialogueMusic != null) { + custom = PlayState.jsonSettings.dialogueMusic; + } else { + custom = ''; } if (playMusic) @@ -120,19 +122,13 @@ class DialogueBox extends FlxSpriteGroup case 'rano': FlxG.sound.playMusic(Paths.music('stocknightambianceforranolol'), 0); default: - if (FileSystem.exists(TitleState.modFolder + '/data/charts/' + PlayState.SONG.song.toLowerCase() + '-dia.txt')) { - for (i in 0...custom.length) - { - var data:Array = custom[i].split(':'); - if (data[0] == null) { + if (PlayState.settingsExist) { + if (custom == '') { FlxG.sound.music.stop(); } else { - FlxG.sound.playMusic(Paths.music(data[0]), 0); + FlxG.sound.playMusic(Paths.music(custom), 0); } } - } else { - FlxG.sound.music.stop(); - } } FlxG.sound.music.fadeIn(1, 0, 0.8); } diff --git a/source/PlayState.hx b/source/PlayState.hx index 53d698a..c1ae63f 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -134,6 +134,7 @@ typedef Settings = { var songCreators:String; var songHeadings:String; var creditsTxt:String; + var dialogueMusic:String; var hasNoGf:Bool; var intro:String; var windowName:String;