package game.gui.options; import game.audio.Volume; import game.gui.element.ActButton; import game.gui.element.ActButton.Mode; public class GuiSound extends GuiOptions { protected GuiSound() { } public void init(int width, int height) { this.addSelector("snd_enabled", 30, 380, 440, 24); this.addSelector("snd_buffer_size", 30, 420, 440, 24); this.addSelector("snd_frame_size", 490, 420, 440, 24); this.add(new ActButton(30, 480, 900, 24, new ActButton.Callback() { public void use(ActButton elem, Mode action) { GuiSound.this.gm.restartSound(false); } }, "Übernehmen und Audio-Thread neu starten")); int x = 30; int y = 220; for(Volume volume : Volume.values()) { this.addSelector(volume.getCVarName(), x, y, 440, 24); x = (x == 30) ? 490 : 30; if(x == 30) y += 40; } super.init(width, height); } public String getTitle() { return "Audio und Ton"; } }