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.Checkbox;
import com.simsilica.lemur.Label;
import com.simsilica.lemur.Slider;
import com.simsilica.lemur.style.ElementId;
import pp.dialog.Dialog;
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 saveButton = new Button(lookup("menu.map.save"));
/**
* 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 Checkbox(lookup("menu.sound-enabled"),
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)
.addClickCommands(s -> ifTopDialog(this::loadDialog));
addChild(saveButton)
@@ -53,6 +58,7 @@ public Menu(BattleshipApp app) {
.addClickCommands(s -> ifTopDialog(this::close));
addChild(new Button(lookup("menu.quit")))
.addClickCommands(s -> ifTopDialog(app::closeApp));
update();
}

View File

@@ -22,5 +22,10 @@ public enum Sound {
/**
* 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
port.must.be.integer=Port must be an integer number
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
port.must.be.integer=Der Port muss eine ganze Zahl sein
map.doesnt.fit=Diese Karte passt nicht zu diesem Spiel
background.music.checkbox= Musik an/aus
background.music.volume= Musiklautst<EFBFBD>rke