Skip to content

Commit

Permalink
New field "TAKEOVER" in main page of the launcher. New icon for the
Browse files Browse the repository at this point in the history
launcher.
  • Loading branch information
cesar-rgon committed Oct 20, 2019
1 parent a51c134 commit e21d8b6
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/main/java/start/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void start(Stage primaryStage) throws Exception {
FXMLLoader mainContent = new FXMLLoader(getClass().getResource("/views/mainContent.fxml"));
mainContent.setRoot(template.getNamespace().get("content"));
mainContent.load();
primaryStage.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("images/kf2ico.png")));
primaryStage.getIcons().add(new Image(getClass().getClassLoader().getResourceAsStream("images/logo.png")));
String applicationTitle = propertyService.getPropertyValue("properties/config.properties", "prop.config.applicationTitle");
primaryStage.setTitle(applicationTitle);
primaryStage.setScene(scene);
Expand Down
23 changes: 15 additions & 8 deletions src/main/java/stories/maincontent/MainContentController.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public class MainContentController implements Initializable {
@FXML private Label serverNameLabel;
@FXML private Label serverPasswordLabel;
@FXML private Label webPageLabel;
@FXML private Label webPasswordLabel;
@FXML private Label portsLabel;
@FXML private Label clanLabel;
@FXML private Label webLinkLabel;
Expand All @@ -89,7 +88,9 @@ public class MainContentController implements Initializable {
@FXML private ImageView serverNameImg;
@FXML private ImageView serverPasswordImg;
@FXML private ImageView webPageImg;
@FXML private ImageView webPasswordImg;
@FXML private ImageView takeoverImg;
@FXML private Label takeoverLabel;
@FXML private CheckBox takeover;
@FXML private ImageView portsImg;
@FXML private ImageView clanImg;
@FXML private ImageView webLinkImg;
Expand Down Expand Up @@ -453,6 +454,14 @@ private void loadTooltip(String languageCode, String propKey, ImageView img, Lab
}
}

private void loadTooltip(String languageCode, String propKey, ImageView img, Label label, CheckBox checkBox, TextField textField) throws Exception {
Tooltip tooltip = new Tooltip(propertyService.getPropertyValue("properties/languages/" + languageCode + ".properties",propKey));
Tooltip.install(img, tooltip);
label.setTooltip(tooltip);
checkBox.setTooltip(tooltip);
textField.setTooltip(tooltip);
}

private void loadTooltip(String languageCode, String propKey, ImageView img, Label label, CheckBox checkBox) throws Exception {
Tooltip tooltip = new Tooltip(propertyService.getPropertyValue("properties/languages/" + languageCode + ".properties",propKey));
Tooltip.install(img, tooltip);
Expand Down Expand Up @@ -504,13 +513,11 @@ private void loadLanguageTexts(String languageCode) throws Exception {

String webPageLabelText = propertyService.getPropertyValue("properties/languages/" + languageCode + ".properties","prop.label.webPage");
webPageLabel.setText(webPageLabelText);
String webPageText = propertyService.getPropertyValue("properties/languages/" + languageCode + ".properties","prop.label.webAdmin");
webPage.setText(webPageText);
loadTooltip(languageCode, "prop.tooltip.webPage", webPageImg, webPageLabel, webPage);
loadTooltip(languageCode, "prop.tooltip.webPage", webPageImg, webPageLabel, webPage, webPassword);

String webPasswordLabelText = propertyService.getPropertyValue("properties/languages/" + languageCode + ".properties","prop.label.webPassword");
webPasswordLabel.setText(webPasswordLabelText);
loadTooltip(languageCode, "prop.tooltip.webPassword", webPasswordImg, webPasswordLabel, webPassword);
String takeoverLabelText = propertyService.getPropertyValue("properties/languages/" + languageCode + ".properties","prop.label.takeover");
takeoverLabel.setText(takeoverLabelText);
loadTooltip(languageCode, "prop.tooltip.takeover", takeoverImg, takeoverLabel, takeover);

String portsLabelText = propertyService.getPropertyValue("properties/languages/" + languageCode + ".properties","prop.label.ports");
portsLabel.setText(portsLabelText);
Expand Down
Binary file removed src/main/resources/images/kf2ico.png
Binary file not shown.
Binary file added src/main/resources/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions src/main/resources/properties/languages/en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ prop.label.length=LENGTH
prop.label.maxPlayers=MAX.PLAYERS
prop.label.serverName=SERVER NAME
prop.label.serverPassword=SERVER PASSWORD
prop.label.webPage=WEB PAGE
prop.label.webPassword=WEB PASSWORD
prop.label.webPage=WEB ( Enable / Password )
prop.label.takeover=TAKEOVER
prop.label.ports=WEB/GAME/QUERY PORT
prop.label.clan=YOUR CLAN
prop.label.webLink=YOUR WEB LINK
Expand All @@ -39,7 +39,6 @@ prop.label.customParameters=CUSTOM PARAMETERS
prop.label.console=CONSOLE
prop.label.runServer=RUN SERVER
prop.label.joinServer=JOIN SERVER
prop.label.webAdmin=Enable WebAdmin
prop.label.webAdminMessage=Web page must be enabled and server must be started in order to access WebAdmin page
prop.label.installationFolder=INSTALLATION FOLDER
prop.label.validateFiles=VALIDATE FILES
Expand Down Expand Up @@ -237,8 +236,7 @@ prop.tooltip.length=This field indicates the selected length to be applied. It i
prop.tooltip.maxPlayers=This field indicates the selected max.players to be applied. It is mandatory
prop.tooltip.serverName=This field indicates the server name. It must contains be an alphanumeric phrase. It is mandatory
prop.tooltip.serverPassword=This field indicates a server password. Users must validate the password when login to the server. It is optional
prop.tooltip.webPage=This field indicates if WebAdmin page is enabled or not. WebAdmin is used to manage the server while it is still running
prop.tooltip.webPassword=This field indicates a web password. The launcher uses this password to automatically login to WebAdmin page. It is optional
prop.tooltip.webPage=These fields indicate if WebAdmin page is enabled or not and the password to login. WebAdmin is used to manage the server while it is still running
prop.tooltip.ports=These fields indicate ports used by the server. They have to be opened in router and firewall in order the server is public on internet
prop.tooltip.clan=This field indicates your Clan's alias. If defined, it will be visible in the welcome screen of the server game. It is optional
prop.tooltip.weblink=This field indicates your web link site. If defined, it will be visible in the welcome screen of the server game. It is optional
Expand Down Expand Up @@ -285,4 +283,5 @@ prop.tooltip.lengthDescription=This field indicates the length descriptions avai
prop.tooltip.addMaxPlayers=This button allows to add a new max.players to the launcher
prop.tooltip.removeMaxPlayers=This button allows to remove the selected max.players from the launcher
prop.tooltip.maxPlayersCode=This field indicates the max.players codes available in the launcher. The codes must be exactly as defined in the server's documentation. It is mandatory
prop.tooltip.maxPlayersDescription=This field indicates the max.players descriptions available in the launcher. It is mandatory
prop.tooltip.maxPlayersDescription=This field indicates the max.players descriptions available in the launcher. It is mandatory
prop.tooltip.takeover=This field indicates if the server can be taken over by other ones
11 changes: 5 additions & 6 deletions src/main/resources/properties/languages/es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ prop.label.length=LONGITUD
prop.label.maxPlayers=MAX.JUGADORES
prop.label.serverName=NOMBRE SERVIDOR
prop.label.serverPassword=CONTRASE\u00d1A SERVIDOR
prop.label.webPage=PAGINA WEB
prop.label.webPassword=CONTRASE\u00d1A WEB
prop.label.webPage=WEB ( Activo / Contrase\u00f1a )
prop.label.takeover=TOMA DE CONTROL
prop.label.ports=PUERTO WEB/GAME/QUERY
prop.label.clan=TU CLAN
prop.label.webLink=TU ENLACE WEB
Expand All @@ -39,7 +39,6 @@ prop.label.customParameters=PARAMETROS OPCIONALES
prop.label.console=CONSOLA
prop.label.runServer=EJECUTAR SERVIDOR
prop.label.joinServer=UNIRSE A SERVIDOR
prop.label.webAdmin=Habilitar WebAdmin
prop.label.webAdminMessage=La p\u00e1gina web debe estar habilitada y el servidor iniciado para acceder a la p\u00e1gina de WebAdmin
prop.label.installationFolder=CARPETA DE INSTALACION
prop.label.validateFiles=VALIDAR FICHEROS
Expand Down Expand Up @@ -237,8 +236,7 @@ prop.tooltip.length=Este campo indica la longitud seleccionada a ser aplicada. N
prop.tooltip.maxPlayers=Este campo indica el m\u00e1x.jugadores seleccionado a ser aplicado. Es obligatorio
prop.tooltip.serverName=Este campo indica el nombre de servidor. Debe contener una frase alfanum\u00e9rica. Es obligatorio
prop.tooltip.serverPassword=Este campo indica una contrase\u00f1a de servidor. Los usuarios deben validar la contrase\u00f1a cuando se autentican al servidor. Es opcional
prop.tooltip.webPage=Este campo indica si la p\u00e1gina de WebAdmin est\u00e1 activa o no. WebAdmin es usado para gestionar el servidor mientras se est\u00e1 ejecutando
prop.tooltip.webPassword=Este campo indica una contrase\u00f1a web. El lanzador usa esta contrase\u00f1a para autenticar autom\u00e1ticamente a la p\u00e1gina de WebAdmin. Es opcional
prop.tooltip.webPage=Estos campos indican si la p\u00e1gina de WebAdmin est\u00e1 activa o no y la contrase\u00f1a para validarse. WebAdmin es usado para gestionar el servidor mientras se est\u00e1 ejecutando
prop.tooltip.ports=Estos campos indican los puertos usados por el servidor. Tienen que estar abiertos en el router y firewall para que el servidor sea p\u00fablico en internet
prop.tooltip.clan=Este campo indica el alias de tu Clan. Si es definido, ser\u00e1 visible en la pantalla de bienvenida del juego. Es optional
prop.tooltip.weblink=Este campo indica el enlace a tu web. Si es definida, ser\u00e1 visible en la pantalla de bienvenida del juego. Es opcional
Expand Down Expand Up @@ -285,4 +283,5 @@ prop.tooltip.lengthDescription=Este campo indica las descripciones de longitudes
prop.tooltip.addMaxPlayers=Este bot\u00f3n permite a\u00f1adir una nuevo m\u00e1x.jugadores al lanzador
prop.tooltip.removeMaxPlayers=Este bot\u00f3n permite eliminar el m\u00e1x.jugadores seleccionado del lanzador
prop.tooltip.maxPlayersCode=Este campo indica los c\u00f3digos de m\u00e1x.jugadores disponibles en el lanzador. Los c\u00f3digos deben ser exactamente como son definidos en la documentaci\u00f3n del servidor. Es obligatorio
prop.tooltip.maxPlayersDescription=Este campo indica las descripciones de m\u00e1x.jugadores disponibles en el lanzador. Es obligatorio
prop.tooltip.maxPlayersDescription=Este campo indica las descripciones de m\u00e1x.jugadores disponibles en el lanzador. Es obligatorio
prop.tooltip.takeover=Esta campo indica si el servidor puede ser controlado por otros
11 changes: 5 additions & 6 deletions src/main/resources/properties/languages/fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ prop.label.length=LONGUEURS DE VAGUES
prop.label.maxPlayers=JOUEURS MAX
prop.label.serverName=NOM DE SERVER
prop.label.serverPassword=MOT DE PASSE SERVER
prop.label.webPage=PAGE WEB
prop.label.webPassword=MOT DE PASSE WEB
prop.label.webPage=WEB ( Activer / Mot de passe )
prop.label.takeover=Prendre le contr\u00f4le
prop.label.ports=WEB/JEU/REQU\u00caTE PORT
prop.label.clan=TON CLAN
prop.label.webLink=TON LIEN WEB
Expand All @@ -39,7 +39,6 @@ prop.label.customParameters=PARAMETRES PERSONNALIS\u00c9S
prop.label.console=CONSOLE
prop.label.runServer=LANCER LE SERVER
prop.label.joinServer=JOINDRE LE SERVER
prop.label.webAdmin=Activer WebAdmin
prop.label.webAdminMessage=La page web doit \u00eatre activ\u00e9 et le serveur lanc\u00e9 pour pouvoir acc\u00e9der \u00e0 la page WebAdmin
prop.label.installationFolder=DOSSIER D'INSTALLATION
prop.label.validateFiles=FICHIERS VALID\u00c9S
Expand Down Expand Up @@ -237,8 +236,7 @@ prop.tooltip.length=Ce champ indique la longueur s\u00e9lectionn\u00e9e \u00e0 a
prop.tooltip.maxPlayers=Ce champ indique le nombre maximum de joueurs s\u00e9lectionn\u00e9s \u00e0 appliquer. C'est indispensable
prop.tooltip.serverName=Ce champ indique le nom du serveur. Il doit contenir une formule alphanum\u00e9rique. C'est indispensable
prop.tooltip.serverPassword=Ce champ indique un mot de passe de serveur. Les utilisateurs doivent valider le mot de passe lorsqu'ils se connectent au serveur. C'est facultatif
prop.tooltip.webPage=Ce champ indique si la page WebAdmin est activ\u00e9e ou non. WebAdmin est utilis\u00e9 pour g\u00e9rer le serveur alors qu'il est encore en cours d'ex\u00e9cution.
prop.tooltip.webPassword=Ce champ indique un mot de passe Web. Le launcher utilise ce mot de passe pour se connecter automatiquement \u00e0 la page WebAdmin. C'est facultatif
prop.tooltip.webPage=Ces champs indiquent si la page WebAdmin est activ\u00e9e ou non et le mot de passe pour se connecter. WebAdmin est utilis\u00e9 pour g\u00e9rer le serveur alors qu'il est encore en cours d'ex\u00e9cution.
prop.tooltip.ports=Ces champs indiquent les ports utilis\u00e9s par le serveur. Ils doivent \u00eatre ouverts dans le routeur et le pare-feu afin que le serveur soit public sur internet.
prop.tooltip.clan=Ce champ indique l'alias de votre Clan. S'il est d\u00e9fini, il sera visible dans l'\u00e9cran d'accueil du jeu serveur. C'est facultatif
prop.tooltip.weblink=Ce champ indique votre site web. S'il est d\u00e9fini, il sera visible dans l'\u00e9cran d'accueil du jeu serveur. C'est facultatif
Expand Down Expand Up @@ -285,4 +283,5 @@ prop.tooltip.lengthDescription=Ce champ indique les descriptions des longueurs d
prop.tooltip.addMaxPlayers=Ce bouton permet d'ajouter un nouveau maximum de joueurs au launcher.
prop.tooltip.removeMaxPlayers=Ce bouton permet de supprimer les joueurs maximum s\u00e9lectionn\u00e9s du launcher.
prop.tooltip.maxPlayersCode=Ce champ indique les codes joueurs maximum disponibles dans le launcher. Les codes doivent \u00eatre exactement comme d\u00e9finis dans la documentation du serveur. C'est obligatoire
prop.tooltip.maxPlayersDescription=Ce champ indique les descriptions des joueurs maximum disponibles dans le launcher. C'est obligatoire
prop.tooltip.maxPlayersDescription=Ce champ indique les descriptions des joueurs maximum disponibles dans le launcher. C'est obligatoire
prop.tooltip.takeover=Ce champ indique si le serveur peut \u00eatre repris par d'autres
11 changes: 6 additions & 5 deletions src/main/resources/views/mainContent.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<Image url="@../images/label.png" />
</image>
</ImageView>
<ImageView fx:id="webPasswordImg" fitHeight="30.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true" GridPane.halignment="RIGHT" GridPane.rowIndex="11">
<ImageView fx:id="takeoverImg" fitHeight="30.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true" GridPane.halignment="RIGHT" GridPane.rowIndex="11">
<image>
<Image url="@../images/label.png" />
</image>
Expand Down Expand Up @@ -190,12 +190,12 @@
<Insets right="10.0" />
</GridPane.margin>
</Label>
<Label fx:id="webPageLabel" text="WEB PAGE" textFill="WHITE" GridPane.halignment="RIGHT" GridPane.rowIndex="10">
<Label fx:id="webPageLabel" text="WEB ( Enable / Password )" textFill="WHITE" GridPane.halignment="RIGHT" GridPane.rowIndex="10">
<GridPane.margin>
<Insets right="10.0" />
</GridPane.margin>
</Label>
<Label fx:id="webPasswordLabel" text="WEB PASSWORD" textFill="WHITE" GridPane.halignment="RIGHT" GridPane.rowIndex="11">
<Label fx:id="takeoverLabel" text="TAKEOVER" textFill="WHITE" GridPane.halignment="RIGHT" GridPane.rowIndex="11">
<GridPane.margin>
<Insets right="10.0" />
</GridPane.margin>
Expand Down Expand Up @@ -227,8 +227,9 @@
</Label>
<TextField fx:id="serverName" maxWidth="350.0" GridPane.columnIndex="1" GridPane.rowIndex="8" />
<PasswordField fx:id="serverPassword" maxWidth="350.0" GridPane.columnIndex="1" GridPane.rowIndex="9" />
<CheckBox fx:id="webPage" lineSpacing="0.9" mnemonicParsing="false" onAction="#webPageOnAction" opacity="0.75" text="Enable WebAdmin" textFill="WHITE" GridPane.columnIndex="1" GridPane.rowIndex="10" />
<PasswordField fx:id="webPassword" maxWidth="350.0" GridPane.columnIndex="1" GridPane.rowIndex="11" />
<CheckBox fx:id="webPage" lineSpacing="0.9" mnemonicParsing="false" onAction="#webPageOnAction" opacity="0.75" textFill="WHITE" GridPane.columnIndex="1" GridPane.rowIndex="10" />
<CheckBox fx:id="takeover" mnemonicParsing="false" opacity="0.75" text="Enable takeover" GridPane.columnIndex="1" GridPane.rowIndex="11" />
<PasswordField fx:id="webPassword" maxWidth="320.0" GridPane.columnIndex="1" GridPane.halignment="RIGHT" GridPane.rowIndex="10" />
<TextField fx:id="webPort" maxWidth="65.0" GridPane.columnIndex="1" GridPane.halignment="LEFT" GridPane.rowIndex="12">
<GridPane.margin>
<Insets />
Expand Down

0 comments on commit e21d8b6

Please sign in to comment.