Skip to content

Commit f867732

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents b113317 + 0500680 commit f867732

File tree

11 files changed

+30
-5
lines changed

11 files changed

+30
-5
lines changed

assets/languages/en/Editors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
<str id="color">Color</str>
114114
<str id="difficulties">Difficulties</str>
115115
<str id="customValues">Custom Values (Advanced)</str>
116+
<str id="needsVoices">Needs Voices</str>
116117

117118
<str id="opponentMode">Opponent Mode</str>
118119
<str id="coopAllowed">Co-op Mode</str>

assets/languages/es/Editors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
<str id="modesAllowed">Modos Permitidos</str>
106106
<str id="difficulties">Difficultades</str>
107107
<str id="customValues">Valores Especiales (Avanzado)</str>
108+
<str id="needsVoices">Necesita Voces</str>
108109

109110
<str id="opponentMode">Modo Oponente</str>
110111
<str id="coopAllowed">Modo Co-op</str>

assets/languages/it/Editors.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@
108108
<str id="color">Colore</str>
109109
<str id="difficulties">Difficoltà</str>
110110
<str id="customValues">Valori Personalizzati (Avanzato)</str>
111+
<str id="needsVoices">Bisogno Voci</str>
111112

112-
<str id="opponentMode">Modalità Avvers.</str>
113+
<str id="opponentMode">Modalità Avvers</str>
113114
<str id="coopAllowed">Modalità Co-op</str>
114115
</group>
115116

assets/languages/pl/Editors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
<str id="color">Kolor</str>
112112
<str id="difficulties">Trudności</str>
113113
<str id="customValues">Własna Waluta (Zaawansowane)</str>
114+
<str id="needsVoices">Potrzebne Wokale</str>
114115

115116
<str id="opponentMode">Tryb Przeciwnika</str>
116117
<str id="coopAllowed">Tryb Ko-operacyjny</str>

source/funkin/backend/chart/Chart.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ class Chart {
121121
data.setFieldDefault("coopAllowed", Flags.DEFAULT_COOP_ALLOWED);
122122
data.setFieldDefault("opponentModeAllowed", Flags.DEFAULT_OPPONENT_MODE_ALLOWED);
123123
data.setFieldDefault("instSuffix", "");
124+
data.setFieldDefault("vocalsSuffix", "");
125+
data.setFieldDefault("needsVoices", true);
124126

125127
if (data.difficulties.length <= 0) {
126128
data.difficulties = [for(f in Paths.getFolderContent('songs/${songName}/charts/', false, fromMods ? MODS : SOURCE)) if (Path.extension(f.toUpperCase()) == "JSON") Path.withoutExtension(f)];

source/funkin/backend/chart/ChartData.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ typedef ChartMetaData = {
3030
public var ?customValues:Dynamic;
3131
public var ?metas:Map<String, ChartMetaData>;
3232
public var ?instSuffix:String;
33+
public var ?vocalsSuffix:String;
34+
public var ?needsVoices:Bool;
3335
}
3436

3537
typedef ChartStrumLine = {

source/funkin/backend/chart/FNFLegacyParser.hx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class FNFLegacyParser {
4040
}
4141

4242
result.meta.bpm = data.bpm;
43+
result.meta.needsVoices = data.needsVoices.getDefault(true);
4344

4445
var camFocusedBF:Bool = false;
4546
var altAnims:Bool = false;
@@ -156,7 +157,7 @@ class FNFLegacyParser {
156157
notes: null,
157158
bpm: chart.meta.bpm,
158159
speed: chart.scrollSpeed,
159-
needsVoices: true,
160+
needsVoices: chart.meta.needsVoices,
160161

161162
player1: null,
162163
player2: null,

source/funkin/backend/chart/VSliceParser.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class VSliceParser {
6767

6868
var timeChanges = metadata.timeChanges;
6969
result.meta.bpm = timeChanges[0].bpm;
70+
result.meta.needsVoices = false;
7071

7172
for (note in data)
7273
{

source/funkin/editors/charter/Charter.hx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,12 @@ class Charter extends UIState {
602602
noteTypes = PlayState.SONG.noteTypes;
603603

604604
FlxG.sound.setMusic(FlxG.sound.load(Paths.inst(__song, __diff, PlayState.SONG.meta.instSuffix)));
605-
vocals = Assets.exists(Paths.voices(__song, __diff)) ? FlxG.sound.load(Paths.voices(__song, __diff)) : new FlxSound();
605+
if (Assets.exists(Paths.voices(__song, __diff, PlayState.SONG.meta.vocalsSuffix)))
606+
vocals = FlxG.sound.load(Paths.voices(__song, __diff, PlayState.SONG.meta.vocalsSuffix));
607+
else
608+
vocals = new FlxSound();
609+
610+
vocals.muted = !PlayState.SONG.meta.needsVoices;
606611
vocals.group = FlxG.sound.defaultMusicGroup;
607612

608613
gridBackdrops.createGrids(PlayState.SONG.strumLines.length);

source/funkin/editors/charter/CharterMetaDataScreen.hx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class CharterMetaDataScreen extends UISubstateWindow {
2323
public var iconSprite:HealthIcon;
2424
public var opponentModeCheckbox:UICheckbox;
2525
public var coopAllowedCheckbox:UICheckbox;
26+
public var needsVoicesCheckbox:UICheckbox;
2627
public var colorWheel:UIColorwheel;
2728
public var difficultiesTextBox:UITextBox;
2829

@@ -68,6 +69,9 @@ class CharterMetaDataScreen extends UISubstateWindow {
6869
denominatorStepper = new UINumericStepper(beatsPerMeasureStepper.x + 30 + 24, beatsPerMeasureStepper.y, Math.floor(16 / metadata.stepsPerBeat), 1, 0, 1, null, 54);
6970
add(denominatorStepper);
7071

72+
needsVoicesCheckbox = new UICheckbox(beatsPerMeasureStepper.x + 100, beatsPerMeasureStepper.y + 6, translate("needsVoices"), metadata.needsVoices);
73+
add(needsVoicesCheckbox);
74+
7175
add(title = new UIText(songNameTextBox.x, songNameTextBox.y + 10 + 46, 0, translate("menusData"), 28));
7276

7377
displayNameTextBox = new UITextBox(title.x, title.y + title.height + 36, metadata.displayName);
@@ -149,6 +153,7 @@ class CharterMetaDataScreen extends UISubstateWindow {
149153
PlayState.SONG.meta = {
150154
name: songNameTextBox.label.text,
151155
bpm: bpmStepper.value,
156+
needsVoices: needsVoicesCheckbox.checked,
152157
beatsPerMeasure: Std.int(beatsPerMeasureStepper.value),
153158
stepsPerBeat: Std.int(16 / denominatorStepper.value),
154159
displayName: displayNameTextBox.label.text,
@@ -161,5 +166,6 @@ class CharterMetaDataScreen extends UISubstateWindow {
161166
};
162167

163168
Charter.instance.updateBPMEvents();
169+
Charter.instance.vocals.muted = !needsVoicesCheckbox.checked;
164170
}
165171
}

0 commit comments

Comments
 (0)