aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/gregtech/api/enums/SoundResource.java4
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java23
-rw-r--r--src/main/resources/assets/gregtech/sounds.json20
-rw-r--r--src/main/resources/assets/gregtech/sounds/buttonDown.oggbin0 -> 7353 bytes
-rw-r--r--src/main/resources/assets/gregtech/sounds/buttonUp.oggbin0 -> 9732 bytes
5 files changed, 37 insertions, 10 deletions
diff --git a/src/main/java/gregtech/api/enums/SoundResource.java b/src/main/java/gregtech/api/enums/SoundResource.java
index fe15c21deb..45cb6e3bc8 100644
--- a/src/main/java/gregtech/api/enums/SoundResource.java
+++ b/src/main/java/gregtech/api/enums/SoundResource.java
@@ -1,5 +1,6 @@
package gregtech.api.enums;
+import static gregtech.api.enums.GT_Values.MOD_ID;
import static gregtech.api.enums.GT_Values.MOD_ID_IC2;
import java.util.EnumSet;
@@ -55,6 +56,9 @@ public enum SoundResource {
IC2_MACHINES_KA_CHING(211, MOD_ID_IC2, "machines.KaChing"),
IC2_MACHINES_MAGNETIZER_LOOP(212, MOD_ID_IC2, "machines.MagnetizerLoop"),
+ GUI_BUTTON_DOWN(-1, MOD_ID, "gui.buttonDown"),
+ GUI_BUTTON_UP(-1, MOD_ID, "gui.buttonUp"),
+
/*
* Other Minecraft Sounds that were missing
*/
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
index 7bbfd46b35..92d90c63a9 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
@@ -1625,16 +1625,19 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity
} else {
getBaseMetaTileEntity().enableWorking();
}
- }).setPlayClickSound(true).setBackground(() -> {
- List<UITexture> ret = new ArrayList<>();
- ret.add(GT_UITextures.BUTTON_STANDARD);
- if (getBaseMetaTileEntity().isAllowedToWork()) {
- ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON);
- } else {
- ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF);
- }
- return ret.toArray(new IDrawable[0]);
- }).setPos(174, 148).setSize(16, 16);
+ }).setPlayClickSoundResource(
+ () -> getBaseMetaTileEntity().isAllowedToWork() ? SoundResource.GUI_BUTTON_UP.resourceLocation
+ : SoundResource.GUI_BUTTON_DOWN.resourceLocation)
+ .setBackground(() -> {
+ List<UITexture> ret = new ArrayList<>();
+ ret.add(GT_UITextures.BUTTON_STANDARD);
+ if (getBaseMetaTileEntity().isAllowedToWork()) {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_ON);
+ } else {
+ ret.add(GT_UITextures.OVERLAY_BUTTON_POWER_SWITCH_OFF);
+ }
+ return ret.toArray(new IDrawable[0]);
+ }).setPos(174, 148).setSize(16, 16);
button.addTooltip(StatCollector.translateToLocal("GT5U.gui.button.power_switch"))
.setTooltipShowUpDelay(TOOLTIP_DELAY);
return (ButtonWidget) button;
diff --git a/src/main/resources/assets/gregtech/sounds.json b/src/main/resources/assets/gregtech/sounds.json
new file mode 100644
index 0000000000..dcf17b55bb
--- /dev/null
+++ b/src/main/resources/assets/gregtech/sounds.json
@@ -0,0 +1,20 @@
+{
+ "gui.buttonDown": {
+ "category": "block",
+ "sounds": [
+ {
+ "name": "buttonDown",
+ "stream": false
+ }
+ ]
+ },
+ "gui.buttonUp": {
+ "category": "block",
+ "sounds": [
+ {
+ "name": "buttonUp",
+ "stream": false
+ }
+ ]
+ }
+}
diff --git a/src/main/resources/assets/gregtech/sounds/buttonDown.ogg b/src/main/resources/assets/gregtech/sounds/buttonDown.ogg
new file mode 100644
index 0000000000..d7dec32263
--- /dev/null
+++ b/src/main/resources/assets/gregtech/sounds/buttonDown.ogg
Binary files differ
diff --git a/src/main/resources/assets/gregtech/sounds/buttonUp.ogg b/src/main/resources/assets/gregtech/sounds/buttonUp.ogg
new file mode 100644
index 0000000000..9d498d6b74
--- /dev/null
+++ b/src/main/resources/assets/gregtech/sounds/buttonUp.ogg
Binary files differ