Skip to content
Snippets Groups Projects
Verified Commit aa7de10f authored by Théo Pirkl's avatar Théo Pirkl :nail_care:
Browse files

Adds "refresh screen"

parent c9ac99e5
Branches
No related tags found
1 merge request!21*poof* final version
......@@ -51,6 +51,9 @@ public final class AppConfig {
public static final String WEATHER_ICON_STORMY = "/img/stormy.png";
public static final String WEATHER_ICON_SUNNY = "/img/sunny.png";
public static final String JOURNEY_ICON_COMMON_ITINERARY = "/img/friends.png";
public static final String EASTER_EGG_23DBM = "/img/javafx_res1";
public static final String EASTER_EGG_CAFE = "/img/javafx_rres2.png";
public static final String EASTER_EGG_EFFET_DE_BORD = "/img/javafx_res3";
/**
* Style
......
......@@ -393,6 +393,31 @@ public class MainWindowController implements Initializable {
}
}
/**
* "refreshes the screen" (right)
* @param message The message to check
* @return True if show, false if not
* Test d'obfuscation de code lol
*/
private boolean refreshScreen(String message) {
if (message.toLowerCase().contains("23 dbm") || message.contains("23dbm")){
Color c = Color.color(1, 0.0, 0.0, 0.5);
drawMessage("Maliki : halte ! Pas plus de 23 dbm !", AppConfig.EASTER_EGG_23DBM, c);
return true;
}
if (message.toLowerCase().contains("yaka")){
Color c = Color.color(0.96,0.317,0.592,0.5);
drawMessage("Orestis : Pause café !", AppConfig.EASTER_EGG_CAFE, c);
return true;
}
if (message.toLowerCase().contains("effet de bord")){
Color c = Color.color(1, 0.5, 0.1, 1);
drawMessage("Cavat : L'effet de bord.", AppConfig.EASTER_EGG_EFFET_DE_BORD, c);
return true;
}
return false;
}
/**
* Initializes the event handler for every textbox/combofield that has a "press enter" behaviour.
* @param app The app context
......@@ -416,7 +441,9 @@ public class MainWindowController implements Initializable {
sendMessageButton.setOnAction(event -> {
if (app.getUser().isPresent() && !messageTextBox.getText().isEmpty()){
if ( messageTextBox.getText().charAt(0) != '/') {
app.getMessageManager().sendChatMessage(new ChatMessage(app.getUser().get(), messageTextBox.getText()));
if(!refreshScreen(messageTextBox.getText())){
app.getMessageManager().sendChatMessage(new ChatMessage(app.getUser().get(), messageTextBox.getText()));
}
} else {
parseChatCommand(messageTextBox.getText().substring(1));
}
......
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment