This commit is contained in:
Sen 2025-03-18 13:07:23 +01:00
parent 47b9ecbb94
commit b3fff0134f
6 changed files with 10 additions and 3 deletions

View file

@ -375,7 +375,7 @@ public class Game implements IThreadListener {
public int port = Config.PORT; public int port = Config.PORT;
public int bind = -1; public int bind = -1;
@Variable(name = "snd_device_type", category = CVarCategory.SOUND, display = "Tonausgabe") @Variable(name = "snd_enabled", category = CVarCategory.SOUND, display = "Tonausgabe")
public boolean soundEnabled = true; public boolean soundEnabled = true;
@Variable(name = "snd_buffer_size", category = CVarCategory.SOUND, min = 0, max = 1048576, display = "Puffergröße") @Variable(name = "snd_buffer_size", category = CVarCategory.SOUND, min = 0, max = 1048576, display = "Puffergröße")
public int soundBufferSize = 2048; public int soundBufferSize = 2048;

View file

@ -20,7 +20,7 @@ public class GuiSound extends GuiOptions {
// gui_add_custom(win, 30, 240, 128, 128, gui_render_velocity); // gui_add_custom(win, 30, 240, 128, 128, gui_render_velocity);
this.addSelector("snd_device_type", 490, 260, 440, 24); this.addSelector("snd_enabled", 30, 380, 440, 24);
// this.addSelector("snd_sample_rate", 30, 380, 440, 24); // this.addSelector("snd_sample_rate", 30, 380, 440, 24);
// this.addSelector("snd_sample_format", 490, 380, 440, 24); // this.addSelector("snd_sample_format", 490, 380, 440, 24);
@ -35,7 +35,7 @@ public class GuiSound extends GuiOptions {
}, "Übernehmen und Audio-Thread neu starten")); }, "Übernehmen und Audio-Thread neu starten"));
int x = 30; int x = 30;
int y = 540; int y = 220;
for(Volume volume : Volume.values()) { for(Volume volume : Volume.values()) {
this.addSelector(volume.getCVarName(), x, y, 440, 24); this.addSelector(volume.getCVarName(), x, y, 440, 24);
x = (x == 30) ? 490 : 30; x = (x == 30) ? 490 : 30;

View file

@ -51,6 +51,7 @@ public class Dropdown<T> extends Element {
if(drop.value != prev) { if(drop.value != prev) {
drop.func.use(drop, drop.getValue()); drop.func.use(drop, drop.getValue());
drop.formatText(); drop.formatText();
this.playSound();
} }
this.visible = false; this.visible = false;
this.r_dirty = true; this.r_dirty = true;
@ -110,6 +111,7 @@ public class Dropdown<T> extends Element {
if((this.value = this.def) != prev) { if((this.value = this.def) != prev) {
this.func.use(this, this.getValue()); this.func.use(this, this.getValue());
this.formatText(); this.formatText();
this.playSound();
} }
} }
else if(this.gui != null) { else if(this.gui != null) {
@ -117,6 +119,7 @@ public class Dropdown<T> extends Element {
drop.visible = true; drop.visible = true;
drop.r_dirty = true; drop.r_dirty = true;
this.gui.selected = drop; this.gui.selected = drop;
this.playSound();
} }
} }

View file

@ -97,6 +97,7 @@ public class Slider extends Element {
if(this.value != prev) { if(this.value != prev) {
this.func.use(this, this.value); this.func.use(this, this.value);
this.formatText(); this.formatText();
this.playSound();
} }
} }
else { else {
@ -106,6 +107,7 @@ public class Slider extends Element {
if(this.value != prev) { if(this.value != prev) {
this.func.use(this, this.value); this.func.use(this, this.value);
this.formatText(); this.formatText();
this.playSound();
} }
} }
} }

View file

@ -49,6 +49,7 @@ public class Switch<T> extends Element {
if(this.value != prev) { if(this.value != prev) {
this.func.use(this, this.getValue()); this.func.use(this, this.getValue());
this.formatText(); this.formatText();
this.playSound();
} }
} }
} }

View file

@ -39,6 +39,7 @@ public class Toggle extends Element {
this.r_dirty = true; this.r_dirty = true;
this.func.use(this, this.value); this.func.use(this, this.value);
this.formatText(); this.formatText();
this.playSound();
} }
} }