Skip to content

Commit 1995c7f

Browse files
[ENHANCEMENT] Add Volume Keys to Controls (#518)
* add ze volume keys B) * e * better --------- Co-authored-by: ⍚~Nex <[email protected]>
1 parent b41602f commit 1995c7f

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

source/funkin/options/Options.hx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Options
7171
/**
7272
* PLAYER 1 CONTROLS
7373
*/
74-
74+
7575
// Notes
7676
public static var P1_NOTE_LEFT:Array<FlxKey> = [A];
7777
public static var P1_NOTE_DOWN:Array<FlxKey> = [S];
@@ -90,7 +90,10 @@ class Options
9090
// Misc
9191
public static var P1_RESET:Array<FlxKey> = [R];
9292
public static var P1_SWITCHMOD:Array<FlxKey> = [TAB];
93-
93+
public static var P1_VOLUME_UP:Array<FlxKey> = [];
94+
public static var P1_VOLUME_DOWN:Array<FlxKey> = [];
95+
public static var P1_VOLUME_MUTE:Array<FlxKey> = [];
96+
9497
// Debugs
9598
public static var P1_DEBUG_RELOAD:Array<FlxKey> = [F5];
9699

@@ -116,14 +119,17 @@ class Options
116119
// Misc
117120
public static var P2_RESET:Array<FlxKey> = [];
118121
public static var P2_SWITCHMOD:Array<FlxKey> = [];
119-
122+
public static var P2_VOLUME_UP:Array<FlxKey> = [NUMPADPLUS];
123+
public static var P2_VOLUME_DOWN:Array<FlxKey> = [NUMPADMINUS];
124+
public static var P2_VOLUME_MUTE:Array<FlxKey> = [NUMPADZERO];
125+
120126
// Debugs
121127
public static var P2_DEBUG_RELOAD:Array<FlxKey> = [];
122128

123129
/**
124130
* SOLO GETTERS
125131
*/
126-
132+
127133
// Notes
128134
public static var SOLO_NOTE_LEFT(get, null):Array<FlxKey>;
129135
public static var SOLO_NOTE_DOWN(get, null):Array<FlxKey>;
@@ -142,6 +148,9 @@ class Options
142148
// Misc
143149
public static var SOLO_RESET(get, null):Array<FlxKey>;
144150
public static var SOLO_SWITCHMOD(get, null):Array<FlxKey>;
151+
public static var SOLO_VOLUME_UP(get, null):Array<FlxKey>;
152+
public static var SOLO_VOLUME_DOWN(get, null):Array<FlxKey>;
153+
public static var SOLO_VOLUME_MUTE(get, null):Array<FlxKey>;
145154

146155
// Debugs
147156
public static var SOLO_DEBUG_RELOAD(get, null):Array<FlxKey>;
@@ -173,6 +182,10 @@ class Options
173182
PlayerSettings.solo.setKeyboardScheme(Solo);
174183
PlayerSettings.player1.setKeyboardScheme(Duo(true));
175184
PlayerSettings.player2.setKeyboardScheme(Duo(false));
185+
186+
FlxG.sound.volumeUpKeys = SOLO_VOLUME_UP;
187+
FlxG.sound.volumeDownKeys = SOLO_VOLUME_DOWN;
188+
FlxG.sound.muteKeys = SOLO_VOLUME_MUTE;
176189
}
177190

178191
public static function save() {

source/funkin/options/keybinds/KeybindsOptions.hx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,23 @@ class KeybindsOptions extends MusicBeatSubstate {
6666
},
6767
]
6868
},
69+
{
70+
name: 'Volume',
71+
settings: [
72+
{
73+
name: 'Up',
74+
control: 'VOLUME_UP'
75+
},
76+
{
77+
name: 'Down',
78+
control: 'VOLUME_DOWN'
79+
},
80+
{
81+
name: 'Mute',
82+
control: 'VOLUME_MUTE'
83+
},
84+
]
85+
},
6986
{
7087
name: 'Engine',
7188
settings: [
@@ -171,6 +188,10 @@ class KeybindsOptions extends MusicBeatSubstate {
171188
}
172189
add(alphabets);
173190
add(camFollow);
191+
192+
FlxG.sound.volumeUpKeys = [];
193+
FlxG.sound.volumeDownKeys = [];
194+
FlxG.sound.muteKeys = [];
174195
}
175196

176197
public override function destroy() {

0 commit comments

Comments
 (0)