1
0
forked from Clones/Controlify

ui sounds

This commit is contained in:
isXander
2023-04-16 17:44:39 +01:00
parent 6eaf16d8c3
commit 800f219fa6
12 changed files with 62 additions and 6 deletions

View File

@ -6,6 +6,7 @@ import dev.isxander.controlify.controller.Controller;
import dev.isxander.controlify.api.event.ControlifyEvents;
import dev.isxander.controlify.mixins.feature.screenop.vanilla.ScreenAccessor;
import dev.isxander.controlify.mixins.feature.screenop.vanilla.TabNavigationBarAccessor;
import dev.isxander.controlify.sound.ControlifySounds;
import dev.isxander.controlify.utils.NavigationHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ComponentPath;
@ -101,6 +102,9 @@ public class ScreenProcessor<T extends Screen> {
navigationHelper.onNavigate();
if (Controlify.instance().config().globalSettings().uiSounds)
minecraft.getSoundManager().play(SimpleSoundInstance.forUI(ControlifySounds.SCREEN_FOCUS_CHANGE, 1.0F));
var newFocusTree = getFocusTree();
while (!newFocusTree.isEmpty() && !focuses.contains(newFocusTree.peek())) {
ComponentProcessorProvider.provide(newFocusTree.poll()).onFocusGained(this, controller);