Skip to content

Commit

Permalink
More generic names
Browse files Browse the repository at this point in the history
  • Loading branch information
Gwendal LE DOUSSAL committed Apr 26, 2020
1 parent a7422fa commit e931517
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/main/me/gledoussal/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

public class Main extends Application {

public static final String APPLICATION_TITLE = "Esperia Launcher";
public static final String WEBSITE_URL = "https://www.esperia-rp.net/";
private static final GameVersion VERSION = new GameVersion("1.12.2", GameType.V1_8_HIGHER);

Expand Down Expand Up @@ -81,7 +82,7 @@ public void start(Stage primaryStage) throws Exception{
});

primaryStage.initStyle(StageStyle.TRANSPARENT);
primaryStage.setTitle("Launcher Esperia");
primaryStage.setTitle(Main.APPLICATION_TITLE);
primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/images/icon.png")));
primaryStage.setResizable(false);
primaryStage.setScene(new Scene(root, 1200, 737));
Expand Down
5 changes: 5 additions & 0 deletions src/main/me/gledoussal/controllers/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.StackPane;
import lombok.Getter;
Expand All @@ -15,6 +16,9 @@

public class MainController {

@FXML
private Label titleLabel;

@Getter @Setter @FXML private StackPane stackPane;

@FXML
Expand All @@ -37,6 +41,7 @@ public class MainController {

@FXML
private void initialize() {
titleLabel.setText(Main.APPLICATION_TITLE);
FXMLLoader loginFXMLLoader = new FXMLLoader(getClass().getResource("/views/login.fxml"));
try {
AppProperties.loadProperties();
Expand Down
6 changes: 3 additions & 3 deletions src/main/me/gledoussal/controllers/PlayController.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import me.gledoussal.AppProperties;
import me.gledoussal.Main;
import me.gledoussal.nologin.util.Utilities;
import me.gledoussal.status.Esperia;
import me.gledoussal.status.Server;
import me.gledoussal.status.Mojang;

import java.awt.*;
Expand Down Expand Up @@ -57,7 +57,7 @@ public class PlayController {
public void initialize() {

new Thread(() -> {
Esperia server = new Esperia();
Server server = new Server();
if (server.isOnline()) {
Platform.runLater(() -> {
playersCountLabel.setText(server.getPlayerCount() + "/200");
Expand Down Expand Up @@ -97,7 +97,7 @@ private void onExternalLinkClicked(MouseEvent event) {
URI uri = null;
switch (id) {
case "w":
uri = new URI("https://esperia-rp.net");
uri = new URI(Main.WEBSITE_URL);
break;
case "ds":
uri = new URI("https://discord.gg/GGxR2gK");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
import java.net.URL;
import java.net.URLConnection;

public class Esperia {
public class Server {
private static JsonObject serversState;

private int playerCount;
private boolean online;

public Esperia() {
public Server() {
initServersState();
playerCount = serversState.getAsJsonArray("players").size();
online = serversState.get("online").getAsBoolean();
Expand Down
File renamed without changes
Binary file removed src/resources/images/esperia_short_logo.png
Binary file not shown.
Binary file removed src/resources/images/fort_lointain.png
Binary file not shown.
File renamed without changes
2 changes: 1 addition & 1 deletion src/resources/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#stackPane {
-fx-background-image: url("./images/phare.png");
-fx-background-image: url("./images/background.png");
-fx-background-size: cover;
}

Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/login.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</fill>
</Rectangle>
<ImageView layoutX="352.0" layoutY="50.0" mouseTransparent="true" pickOnBounds="true" preserveRatio="true">
<Image url="@../images/esperia_logo.png" />
<Image url="@../images/logo.png" />
</ImageView>
<Label layoutX="473.0" layoutY="242.0" text="Connexion à mojang" textFill="WHITE">
<font>
Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/main.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<StackPane fx:id="stackPane" alignment="TOP_CENTER" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="me.gledoussal.controllers.MainController">
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="35" minWidth="1200">
<Pane minHeight="35.0" minWidth="1200.0" style="-fx-background-color: #00000050;">
<Label layoutX="15.0" layoutY="6.0" text="Launcher Esperia" textFill="WHITE" />
<Label fx:id="titleLabel" layoutX="15.0" layoutY="6.0" text="Launcher Esperia" textFill="WHITE" />
<ImageView layoutX="1162.0" layoutY="5.0" onMouseReleased="#onExitClicked" pickOnBounds="true" preserveRatio="true" styleClass="hand">
<Image url="@../images/close.png" />
</ImageView>
Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/play.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<Pane prefHeight="737" prefWidth="1200" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="me.gledoussal.controllers.PlayController">
<ImageView fitHeight="64.0" layoutX="100.0" layoutY="99.0" mouseTransparent="true" pickOnBounds="true" preserveRatio="true">
<Image url="@../images/esperia_logo.png" />
<Image url="@../images/logo.png" />
</ImageView>
<ImageView fx:id="playerImage" fitHeight="64.0" fitWidth="64.0" layoutX="1036.0" layoutY="100.0" onMouseReleased="#onPlayerImageClicked" pickOnBounds="true" preserveRatio="true" styleClass="hand, zoom">
</ImageView>
Expand Down
10 changes: 4 additions & 6 deletions src/resources/views/users.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.shape.*?>
<?import javafx.scene.text.*?>

<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.paint.LinearGradient?>
<?import javafx.scene.paint.Stop?>
<?import javafx.scene.paint.Color?>
<Pane prefHeight="737" prefWidth="1200" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="me.gledoussal.controllers.UsersController">
<ImageView fitHeight="64.0" layoutX="555.0" layoutY="99.0" mouseTransparent="true" pickOnBounds="true" preserveRatio="true">
<Image url="@../images/esperia_short_logo.png" />
<ImageView fitHeight="64.0" layoutX="502.0" layoutY="99.0" mouseTransparent="true" pickOnBounds="true" preserveRatio="true">
<Image url="@../images/logo.png" />
</ImageView>
<Label layoutX="527.0" layoutY="174.0" text="Qui est-ce ?" textFill="WHITE">
<font>
Expand Down

0 comments on commit e931517

Please sign in to comment.