Skip to content

Commit 15496de

Browse files
committed
Fix Voices Muted Option in Charter
1 parent 7fc0476 commit 15496de

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

source/funkin/editors/charter/Charter.hx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class Charter extends UIState {
8080
public var metronome:FlxSound;
8181

8282
public var vocals:FlxSound;
83+
public var voicesMuted:Bool = false;
8384

8485
public var quant:Int = 16;
8586
public var quants:Array<Int> = [4, 8, 12, 16, 20, 24, 32, 48, 64, 192]; // different quants
@@ -1812,9 +1813,9 @@ class Charter extends UIState {
18121813
t.icon = 1 - Std.int(Math.ceil(FlxG.sound.music.volume));
18131814
}
18141815
function _song_mutevoices(t) {
1815-
vocals.volume = vocals.volume > 0 ? 0 : 1;
1816-
for (strumLine in strumLines.members) strumLine.vocals.volume = strumLine.vocals.volume > 0 ? 0 : 1;
1817-
t.icon = 1 - Std.int(Math.ceil(vocals.volume));
1816+
vocals.volume = (voicesMuted = !voicesMuted) ? 0 : 1;
1817+
for (strumLine in strumLines.members) strumLine.updateVoicesVolume();
1818+
t.icon = voicesMuted ? 1 : 0;
18181819
}
18191820
function _playback_back(_) {
18201821
if (FlxG.sound.music.playing) return;

source/funkin/editors/charter/CharterStrumline.hx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class CharterStrumline extends UISprite {
2222
public var curMenu:UIContextMenu = null;
2323

2424
public var vocals:FlxSound;
25+
public var voicesMuted:Bool = false;
2526

2627
public var keyCount:Int = 4;
2728
public var startingID(get, null):Int;
@@ -147,6 +148,10 @@ class CharterStrumline extends UISprite {
147148
}
148149
vocals.group = FlxG.sound.defaultMusicGroup;
149150
}
151+
152+
public function updateVoicesVolume() {
153+
vocals.volume = (voicesMuted || (Charter.instance?.voicesMuted ?? false)) ? 0 : 1;
154+
}
150155
}
151156

152157
class CharterStrumlineOptions extends UITopMenuButton {
@@ -176,9 +181,10 @@ class CharterStrumlineOptions extends UITopMenuButton {
176181
{
177182
label: TU.translate("charter.strumLine.muteVocals"),
178183
onSelect: function(_) {
179-
strLine.vocals.volume = strLine.vocals.volume > 0 ? 0 : 1;
184+
strLine.voicesMuted = !strLine.voicesMuted;
185+
strLine.updateVoicesVolume();
180186
},
181-
icon: strLine.vocals.volume > 0 ? 0 : 1
187+
icon: strLine.voicesMuted ? 1 : 0
182188
},
183189
null,
184190
{

0 commit comments

Comments
 (0)