Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Add Volume Keys to Controls. #518

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions source/funkin/options/Options.hx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class Options
public static var P1_PAUSE:Array<FlxKey> = [ENTER];
public static var P1_RESET:Array<FlxKey> = [R];
public static var P1_SWITCHMOD:Array<FlxKey> = [TAB];
public static var P1_VOLUME_UP:Array<FlxKey> = [PLUS];
public static var P1_VOLUME_DOWN:Array<FlxKey> = [MINUS];
public static var P1_VOLUME_MUTE:Array<FlxKey> = [ZERO];

/**
* PLAYER 2 CONTROLS (ALT)
Expand All @@ -101,6 +104,9 @@ class Options
public static var P2_PAUSE:Array<FlxKey> = [ESCAPE];
public static var P2_RESET:Array<FlxKey> = [];
public static var P2_SWITCHMOD:Array<FlxKey> = [];
public static var P2_VOLUME_UP:Array<FlxKey> = [NUMPADPLUS];
public static var P2_VOLUME_DOWN:Array<FlxKey> = [NUMPADMINUS];
public static var P2_VOLUME_MUTE:Array<FlxKey> = [NUMPADZERO];

/**
* SOLO GETTERS
Expand All @@ -118,6 +124,9 @@ class Options
public static var SOLO_PAUSE(get, null):Array<FlxKey>;
public static var SOLO_RESET(get, null):Array<FlxKey>;
public static var SOLO_SWITCHMOD(get, null):Array<FlxKey>;
public static var SOLO_VOLUME_UP(get, null):Array<FlxKey>;
public static var SOLO_VOLUME_DOWN(get, null):Array<FlxKey>;
public static var SOLO_VOLUME_MUTE(get, null):Array<FlxKey>;

public static function load() {
if (__save == null) __save = new FlxSave();
Expand Down Expand Up @@ -146,6 +155,10 @@ class Options
PlayerSettings.solo.setKeyboardScheme(Solo);
PlayerSettings.player1.setKeyboardScheme(Duo(true));
PlayerSettings.player2.setKeyboardScheme(Duo(false));

FlxG.sound.volumeUpKeys = SOLO_VOLUME_UP;
FlxG.sound.volumeDownKeys = SOLO_VOLUME_DOWN;
FlxG.sound.muteKeys = SOLO_VOLUME_MUTE;
}

public static function save() {
Expand Down
21 changes: 21 additions & 0 deletions source/funkin/options/keybinds/KeybindsOptions.hx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,23 @@ class KeybindsOptions extends MusicBeatSubstate {
},
]
},
{
name: 'Volume',
settings: [
{
name: 'Up',
control: 'VOLUME_UP'
},
{
name: 'Down',
control: 'VOLUME_DOWN'
},
{
name: 'Mute',
control: 'VOLUME_MUTE'
},
]
},
{
name: 'Engine',
settings: [
Expand Down Expand Up @@ -162,6 +179,10 @@ class KeybindsOptions extends MusicBeatSubstate {
}
add(alphabets);
add(camFollow);

FlxG.sound.volumeUpKeys = [];
FlxG.sound.volumeDownKeys = [];
FlxG.sound.muteKeys = [];
}

public override function destroy() {
Expand Down