mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-14 14:34:16 +01:00
Merge pull request #4018 from starlottemusic/patch-2
Scroll Tick sound in GUIs
This commit is contained in:
commit
3d8a147d79
@ -4,11 +4,14 @@ import java.util.function.Consumer;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import com.simibubi.create.AllKeys;
|
import com.simibubi.create.AllKeys;
|
||||||
|
import com.simibubi.create.AllSoundEvents;
|
||||||
import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour.StepContext;
|
import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour.StepContext;
|
||||||
import com.simibubi.create.foundation.utility.Components;
|
import com.simibubi.create.foundation.utility.Components;
|
||||||
import com.simibubi.create.foundation.utility.Lang;
|
import com.simibubi.create.foundation.utility.Lang;
|
||||||
|
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
|
|
||||||
@ -124,8 +127,10 @@ public class ScrollInput extends AbstractSimiWidget {
|
|||||||
|
|
||||||
clampState();
|
clampState();
|
||||||
|
|
||||||
if (priorState != state)
|
if (priorState != state) {
|
||||||
|
Minecraft.getInstance().getSoundManager().play(SimpleSoundInstance.forUI(AllSoundEvents.SCROLL_VALUE.getMainEvent(), 1.5f + 0.1f * (state-min)/(max-min)));
|
||||||
onChanged();
|
onChanged();
|
||||||
|
}
|
||||||
|
|
||||||
return priorState != state;
|
return priorState != state;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user