Nr.10 edited 'Menu','Sound','battlship.properties' and 'battleship_de.properties'

edited the property files to ensure, that in the menu the background music on/off and the background volume slider are named in eng and german, edited the childnotes for
the menu, so the checkbox and slider are visible, edited the enum Suonds, for another entry 'BACKGROUNDMUSIC'
This commit is contained in:
Benjamin Feyer
2024-10-03 13:46:18 +02:00
parent b96a3dd270
commit 6355b98441
4 changed files with 17 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
import com.simsilica.lemur.Button; import com.simsilica.lemur.Button;
import com.simsilica.lemur.Checkbox; import com.simsilica.lemur.Checkbox;
import com.simsilica.lemur.Label; import com.simsilica.lemur.Label;
import com.simsilica.lemur.Slider;
import com.simsilica.lemur.style.ElementId; import com.simsilica.lemur.style.ElementId;
import pp.dialog.Dialog; import pp.dialog.Dialog;
import pp.dialog.StateCheckboxModel; import pp.dialog.StateCheckboxModel;
@@ -34,6 +35,7 @@ class Menu extends Dialog {
private final Button loadButton = new Button(lookup("menu.map.load")); private final Button loadButton = new Button(lookup("menu.map.load"));
private final Button saveButton = new Button(lookup("menu.map.save")); private final Button saveButton = new Button(lookup("menu.map.save"));
/** /**
* Constructs the Menu dialog for the Battleship application. * Constructs the Menu dialog for the Battleship application.
* *
@@ -45,6 +47,9 @@ public Menu(BattleshipApp app) {
addChild(new Label(lookup("battleship.name"), new ElementId("header"))); //NON-NLS addChild(new Label(lookup("battleship.name"), new ElementId("header"))); //NON-NLS
addChild(new Checkbox(lookup("menu.sound-enabled"), addChild(new Checkbox(lookup("menu.sound-enabled"),
new StateCheckboxModel(app, GameSound.class))); new StateCheckboxModel(app, GameSound.class)));
addChild(new Checkbox(lookup("background.music.checkbox")));
addChild(new Label(lookup("background.music.volume")));
addChild(new Slider(lookup("background.music.volume")));
addChild(loadButton) addChild(loadButton)
.addClickCommands(s -> ifTopDialog(this::loadDialog)); .addClickCommands(s -> ifTopDialog(this::loadDialog));
addChild(saveButton) addChild(saveButton)
@@ -53,6 +58,7 @@ public Menu(BattleshipApp app) {
.addClickCommands(s -> ifTopDialog(this::close)); .addClickCommands(s -> ifTopDialog(this::close));
addChild(new Button(lookup("menu.quit"))) addChild(new Button(lookup("menu.quit")))
.addClickCommands(s -> ifTopDialog(app::closeApp)); .addClickCommands(s -> ifTopDialog(app::closeApp));
update(); update();
} }

View File

@@ -22,5 +22,10 @@ public enum Sound {
/** /**
* Sound of a ship being destroyed. * Sound of a ship being destroyed.
*/ */
DESTROYED_SHIP DESTROYED_SHIP,
/**
*
*/
BACKGROUND_MUSIC //TODO
} }

View File

@@ -37,3 +37,5 @@ dialog.error=Error
dialog.question=Question dialog.question=Question
port.must.be.integer=Port must be an integer number port.must.be.integer=Port must be an integer number
map.doesnt.fit=The map doesn't fit to this game map.doesnt.fit=The map doesn't fit to this game
background.music.checkbox= Background music on/off
background.music.volume= Background volume

View File

@@ -37,3 +37,6 @@ dialog.error=Fehler
dialog.question=Frage dialog.question=Frage
port.must.be.integer=Der Port muss eine ganze Zahl sein port.must.be.integer=Der Port muss eine ganze Zahl sein
map.doesnt.fit=Diese Karte passt nicht zu diesem Spiel map.doesnt.fit=Diese Karte passt nicht zu diesem Spiel
background.music.checkbox= Musik an/aus
background.music.volume= Musiklautstärke