Skip to content

Commit

Permalink
Remove unnecessary scrollMenu sounds + adjust volume
Browse files Browse the repository at this point in the history
  • Loading branch information
gamerbross authored and ninjamuffin99 committed Jun 10, 2024
1 parent 4691e3d commit 8f44d96
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions source/funkin/play/PauseSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,14 @@ class PauseSubState extends MusicBeatSubState
*/
function changeSelection(change:Int = 0):Void
{
FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4);

var prevEntry:Int = currentEntry;
currentEntry += change;

if (currentEntry < 0) currentEntry = currentMenuEntries.length - 1;
if (currentEntry >= currentMenuEntries.length) currentEntry = 0;

if (currentEntry != prevEntry) FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4);

for (entryIndex in 0...currentMenuEntries.length)
{
var isCurrent:Bool = entryIndex == currentEntry;
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/ui/MenuList.hx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class MenuTypedList<T:MenuListItem> extends FlxTypedGroup<T>

if (newIndex != selectedIndex)
{
FunkinSound.playOnce(Paths.sound('scrollMenu'));
FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4);
selectItem(newIndex);
}

Expand Down
4 changes: 2 additions & 2 deletions source/funkin/ui/freeplay/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1833,12 +1833,12 @@ class FreeplayState extends MusicBeatSubState

function changeSelection(change:Int = 0):Void
{
if (!prepForNewRank) FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4);

var prevSelected:Int = curSelected;

curSelected += change;

if (!prepForNewRank && curSelected != prevSelected) FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4);

if (curSelected < 0) curSelected = grpCapsules.countLiving() - 1;
if (curSelected >= grpCapsules.countLiving()) curSelected = 0;

Expand Down
3 changes: 2 additions & 1 deletion source/funkin/ui/story/StoryMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ class StoryMenuState extends MusicBeatState
function changeLevel(change:Int = 0):Void
{
var currentIndex:Int = levelList.indexOf(currentLevelId);
var prevIndex:Int = currentIndex;

currentIndex += change;

Expand Down Expand Up @@ -417,7 +418,7 @@ class StoryMenuState extends MusicBeatState
}
}

FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4);
if (currentIndex != prevIndex) FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4);

updateText();
updateBackground(previousLevelId);
Expand Down

0 comments on commit 8f44d96

Please sign in to comment.