Skip to content

Commit

Permalink
Merge pull request #16 from schlunzis/2-main-menu-redesign
Browse files Browse the repository at this point in the history
2 main menu redesign
  • Loading branch information
Til7701 authored Oct 27, 2023
2 parents 2fc7b3e + 66aec43 commit 3abbb15
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package de.schlunzis.client.controller;

import com.google.common.eventbus.EventBus;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.ListView;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

Expand All @@ -11,6 +13,9 @@ public class MainMenuController {

private final EventBus eventBus;

@FXML
private ListView lobbiesListView; // TODO implement

public MainMenuController(EventBus eventBus) {
this.eventBus = eventBus;
eventBus.register(this);
Expand All @@ -22,4 +27,19 @@ private void logout() {
// TODO implement, see issue
}

@FXML
private void settings(ActionEvent actionEvent) {
// TODO implement
}

@FXML
private void joinLobby(ActionEvent actionEvent) {
// TODO implement
}

@FXML
private void createLobby(ActionEvent actionEvent) {
// TODO implement
}

}
12 changes: 10 additions & 2 deletions client/src/main/resources/fxml/main.fxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import java.net.URL?>
<GridPane xmlns:fx="http://javafx.com/fxml" xmlns="http://javafx.com/javafx/17.0.2-ea"
Expand All @@ -22,7 +22,15 @@
<fx:include source="chat.fxml" GridPane.columnIndex="0" GridPane.rowIndex="1"/>
<VBox GridPane.columnIndex="0" GridPane.rowIndex="0">
<Button mnemonicParsing="false" onAction="#logout" text="Logout"/>
<Button mnemonicParsing="false" text="CreateLobby"/>
<Button mnemonicParsing="false" onAction="#settings" text="Settings"/>
</VBox>

<VBox GridPane.columnIndex="1" GridPane.rowIndex="0">
<ListView fx:id="lobbiesListView"/>
<HBox>
<Button mnemonicParsing="false" onAction="#joinLobby" text="Join Lobby"/>
<Button mnemonicParsing="false" onAction="#createLobby" text="CreateLobby"/>
</HBox>
</VBox>

</GridPane>

0 comments on commit 3abbb15

Please sign in to comment.