sound changes, press sounds, remove pitch

This commit is contained in:
Sen 2025-03-18 12:03:56 +01:00
parent c5219ce100
commit c602585e6a
76 changed files with 231 additions and 251 deletions

View file

@ -40,5 +40,6 @@ public class ActButton extends Element {
public void mouse(Button btn, int x, int y, boolean ctrl, boolean shift) {
this.func.use(this, (ctrl || (btn == Button.MOUSE_MIDDLE)) ? Mode.TERTIARY : ((shift || (btn == Button.MOUSE_RIGHT)) ? Mode.SECONDARY : Mode.PRIMARY));
this.formatText();
this.playSound();
}
}

View file

@ -3,9 +3,12 @@ package game.gui.element;
import org.lwjgl.opengl.GL11;
import game.Game;
import game.audio.PositionedSound;
import game.audio.Volume;
import game.gui.Font;
import game.gui.Gui;
import game.gui.element.Dropdown.Handle;
import game.init.SoundEvent;
import game.renderer.Drawing;
import game.renderer.Drawing.Vec2i;
import game.util.Formatter;
@ -276,4 +279,8 @@ public abstract class Element {
public void drawPress() {
Drawing.drawRectColor(this.pos_x, this.pos_y, this.size_x, this.size_y, this.gm.style.press);
}
public void playSound() {
this.gm.getSoundManager().playSound(new PositionedSound(SoundEvent.CLICK, Volume.GUI));
}
}