Skip to content

Commit

Permalink
Merge branch 'FNF-CNE-Devs:main' into cne-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 authored Nov 24, 2024
2 parents 21bf2ec + f671055 commit b84daca
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 24 deletions.
12 changes: 4 additions & 8 deletions assets/data/scripts/week6-pause.hx
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,11 @@ function update(elapsed) {

if (!canDoShit) return;
var oldSec = curSelected;
if (controls.DOWN_P)
changeSelection(1, false);
if (controls.UP_P)
changeSelection(-1);

if (oldSec != curSelected) {
FlxG.sound.play(Paths.sound(isThorns ? 'pixel/type' : 'pixel/pixelText'));
}
changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0) - FlxG.mouse.wheel);

if (oldSec != curSelected)
FlxG.sound.play(Paths.sound(isThorns ? 'pixel/type' : 'pixel/pixelText'));

if (controls.ACCEPT) {
FlxG.sound.play(Paths.sound(isThorns ? 'pixel/ANGRY' : 'pixel/clickText'));
Expand All @@ -121,7 +117,7 @@ function update(elapsed) {
}
}

function changeSelection(change) {
function changeSelection(change) { // this overrides the function inside of the normal pause btw, so no event gets called - Nex
curSelected += change;

if (curSelected < 0)
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/menus/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class FreeplayState extends MusicBeatState
lerpScore = intendedScore;

if (canSelect) {
changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0));
changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0) - FlxG.mouse.wheel);
changeDiff((controls.LEFT_P ? -1 : 0) + (controls.RIGHT_P ? 1 : 0));
changeCoopMode(((#if TOUCH_CONTROLS virtualPad.buttonX.justPressed || #end FlxG.keys.justPressed.TAB) ? 1 : 0));
// putting it before so that its actually smooth
Expand Down
11 changes: 5 additions & 6 deletions source/funkin/menus/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ class MainMenuState extends MusicBeatState
*/
}

if (controls.UP_P)
changeItem(-1);
var upP = controls.UP_P;
var downP = controls.DOWN_P;
var scroll = FlxG.mouse.wheel;

if (controls.DOWN_P)
changeItem(1);
if (upP || downP || scroll != 0) // like this we wont break mods that expect a 0 change event when calling sometimes - Nex
changeItem((upP ? -1 : 0) + (downP ? 1 : 0) - scroll);

if (controls.BACK)
FlxG.switchState(new TitleState());
Expand All @@ -130,9 +131,7 @@ class MainMenuState extends MusicBeatState
#end

if (controls.ACCEPT)
{
selectItem();
}
}

super.update(elapsed);
Expand Down
4 changes: 2 additions & 2 deletions source/funkin/menus/ModSwitchMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ModSwitchMenu extends MusicBeatSubstate {
public override function update(elapsed:Float) {
super.update(elapsed);

changeSelection((controls.DOWN_P ? 1 : 0) + (controls.UP_P ? -1 : 0));
changeSelection((controls.DOWN_P ? 1 : 0) + (controls.UP_P ? -1 : 0) - FlxG.mouse.wheel);

if (controls.ACCEPT) {
ModsFolder.switchMod(mods[curSelected]);
Expand All @@ -67,4 +67,4 @@ class ModSwitchMenu extends MusicBeatSubstate {
alphabets.members[curSelected].alpha = 1;
}
}
#end
#end
11 changes: 5 additions & 6 deletions source/funkin/menus/PauseSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,12 @@ class PauseSubState extends MusicBeatSubstate

var upP = controls.UP_P;
var downP = controls.DOWN_P;
var accepted = controls.ACCEPT;
var scroll = FlxG.mouse.wheel;

if (upP)
changeSelection(-1);
if (downP)
changeSelection(1);
if (accepted)
if (upP || downP || scroll != 0) // like this we wont break mods that expect a 0 change event when calling sometimes - Nex
changeSelection((upP ? -1 : 0) + (downP ? 1 : 0) - scroll);

if (controls.ACCEPT)
selectOption();
}

Expand Down
2 changes: 1 addition & 1 deletion source/funkin/menus/StoryMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class StoryMenuState extends MusicBeatState {
}

changeDifficulty((controls.LEFT_P ? -1 : 0) + (controls.RIGHT_P ? 1 : 0));
changeWeek((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0));
changeWeek((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0) - FlxG.mouse.wheel);

if (controls.ACCEPT)
selectWeek();
Expand Down

0 comments on commit b84daca

Please sign in to comment.