Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -121,6 +121,8 @@ class Chart {
|
||||
data.setFieldDefault("coopAllowed", Flags.DEFAULT_COOP_ALLOWED);
|
||||
data.setFieldDefault("opponentModeAllowed", Flags.DEFAULT_OPPONENT_MODE_ALLOWED);
|
||||
data.setFieldDefault("instSuffix", "");
|
||||
data.setFieldDefault("vocalsSuffix", "");
|
||||
data.setFieldDefault("needsVoices", true);
|
||||
|
||||
if (data.difficulties.length <= 0) {
|
||||
data.difficulties = [for(f in Paths.getFolderContent('songs/${songName}/charts/', false, fromMods ? MODS : SOURCE)) if (Path.extension(f.toUpperCase()) == "JSON") Path.withoutExtension(f)];
|
||||
|
||||
@@ -30,6 +30,8 @@ typedef ChartMetaData = {
|
||||
public var ?customValues:Dynamic;
|
||||
public var ?metas:Map<String, ChartMetaData>;
|
||||
public var ?instSuffix:String;
|
||||
public var ?vocalsSuffix:String;
|
||||
public var ?needsVoices:Bool;
|
||||
}
|
||||
|
||||
typedef ChartStrumLine = {
|
||||
|
||||
@@ -40,6 +40,7 @@ class FNFLegacyParser {
|
||||
}
|
||||
|
||||
result.meta.bpm = data.bpm;
|
||||
result.meta.needsVoices = data.needsVoices.getDefault(true);
|
||||
|
||||
var camFocusedBF:Bool = false;
|
||||
var altAnims:Bool = false;
|
||||
@@ -156,7 +157,7 @@ class FNFLegacyParser {
|
||||
notes: null,
|
||||
bpm: chart.meta.bpm,
|
||||
speed: chart.scrollSpeed,
|
||||
needsVoices: true,
|
||||
needsVoices: chart.meta.needsVoices,
|
||||
|
||||
player1: null,
|
||||
player2: null,
|
||||
|
||||
@@ -67,6 +67,7 @@ class VSliceParser {
|
||||
|
||||
var timeChanges = metadata.timeChanges;
|
||||
result.meta.bpm = timeChanges[0].bpm;
|
||||
result.meta.needsVoices = false;
|
||||
|
||||
for (note in data)
|
||||
{
|
||||
|
||||
@@ -602,7 +602,12 @@ class Charter extends UIState {
|
||||
noteTypes = PlayState.SONG.noteTypes;
|
||||
|
||||
FlxG.sound.setMusic(FlxG.sound.load(Paths.inst(__song, __diff, PlayState.SONG.meta.instSuffix)));
|
||||
vocals = Assets.exists(Paths.voices(__song, __diff)) ? FlxG.sound.load(Paths.voices(__song, __diff)) : new FlxSound();
|
||||
if (Assets.exists(Paths.voices(__song, __diff, PlayState.SONG.meta.vocalsSuffix)))
|
||||
vocals = FlxG.sound.load(Paths.voices(__song, __diff, PlayState.SONG.meta.vocalsSuffix));
|
||||
else
|
||||
vocals = new FlxSound();
|
||||
|
||||
vocals.muted = !PlayState.SONG.meta.needsVoices;
|
||||
vocals.group = FlxG.sound.defaultMusicGroup;
|
||||
|
||||
gridBackdrops.createGrids(PlayState.SONG.strumLines.length);
|
||||
|
||||
@@ -23,6 +23,7 @@ class CharterMetaDataScreen extends UISubstateWindow {
|
||||
public var iconSprite:HealthIcon;
|
||||
public var opponentModeCheckbox:UICheckbox;
|
||||
public var coopAllowedCheckbox:UICheckbox;
|
||||
public var needsVoicesCheckbox:UICheckbox;
|
||||
public var colorWheel:UIColorwheel;
|
||||
public var difficultiesTextBox:UITextBox;
|
||||
|
||||
@@ -68,6 +69,9 @@ class CharterMetaDataScreen extends UISubstateWindow {
|
||||
denominatorStepper = new UINumericStepper(beatsPerMeasureStepper.x + 30 + 24, beatsPerMeasureStepper.y, Math.floor(16 / metadata.stepsPerBeat), 1, 0, 1, null, 54);
|
||||
add(denominatorStepper);
|
||||
|
||||
needsVoicesCheckbox = new UICheckbox(beatsPerMeasureStepper.x + 100, beatsPerMeasureStepper.y + 6, translate("needsVoices"), metadata.needsVoices);
|
||||
add(needsVoicesCheckbox);
|
||||
|
||||
add(title = new UIText(songNameTextBox.x, songNameTextBox.y + 10 + 46, 0, translate("menusData"), 28));
|
||||
|
||||
displayNameTextBox = new UITextBox(title.x, title.y + title.height + 36, metadata.displayName);
|
||||
@@ -149,6 +153,7 @@ class CharterMetaDataScreen extends UISubstateWindow {
|
||||
PlayState.SONG.meta = {
|
||||
name: songNameTextBox.label.text,
|
||||
bpm: bpmStepper.value,
|
||||
needsVoices: needsVoicesCheckbox.checked,
|
||||
beatsPerMeasure: Std.int(beatsPerMeasureStepper.value),
|
||||
stepsPerBeat: Std.int(16 / denominatorStepper.value),
|
||||
displayName: displayNameTextBox.label.text,
|
||||
@@ -161,5 +166,6 @@ class CharterMetaDataScreen extends UISubstateWindow {
|
||||
};
|
||||
|
||||
Charter.instance.updateBPMEvents();
|
||||
Charter.instance.vocals.muted = !needsVoicesCheckbox.checked;
|
||||
}
|
||||
}
|
||||
@@ -1115,8 +1115,12 @@ class PlayState extends MusicBeatState
|
||||
|
||||
FlxG.sound.setMusic(inst = FlxG.sound.load(Assets.getMusic(Paths.inst(SONG.meta.name, difficulty, SONG.meta.instSuffix))));
|
||||
|
||||
var vocalsPath = Paths.voices(SONG.meta.name, difficulty);
|
||||
vocals = Assets.exists(vocalsPath) ? FlxG.sound.load(Options.streamedVocals ? Assets.getMusic(vocalsPath) : vocalsPath) : new FlxSound();
|
||||
var vocalsPath = Paths.voices(SONG.meta.name, difficulty, SONG.meta.vocalsSuffix);
|
||||
if (SONG.meta.needsVoices && Assets.exists(vocalsPath))
|
||||
vocals = FlxG.sound.load(Options.streamedVocals ? Assets.getMusic(vocalsPath) : vocalsPath);
|
||||
else
|
||||
vocals = new FlxSound();
|
||||
|
||||
vocals.group = FlxG.sound.defaultMusicGroup;
|
||||
vocals.persist = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user