aboutsummaryrefslogtreecommitdiffstats
path: root/ui-client/src/main/resources
diff options
context:
space:
mode:
authorKostya <mail@sartin.in>2026-10-13 16:08:27 +0300
committerKostya <mail@sartin.in>2026-10-13 16:08:55 +0300
commit4edb27d378e8b79931ef6a6abebfda66f894d538 (patch)
treec3f534fdba50ede8559de95909628fdb257b9d2b /ui-client/src/main/resources
parentc0e134981cb494f12c72fbbd3e5c4de513327520 (diff)
downloadguess-market-4edb27d378e8b79931ef6a6abebfda66f894d538.tar.gz
guess-market-4edb27d378e8b79931ef6a6abebfda66f894d538.tar.xz
guess-market-4edb27d378e8b79931ef6a6abebfda66f894d538.zip
ui-client: add login window
Ask for the server address and a user name before opening the market, and show the server's reason when it refuses (name taken, unreachable). The request runs off the JavaFX thread so a dead server cannot freeze the window. --server= and --user= now only prefill the form.
Diffstat (limited to 'ui-client/src/main/resources')
-rw-r--r--ui-client/src/main/resources/market/guess/ui/client/login.fxml39
1 files changed, 39 insertions, 0 deletions
diff --git a/ui-client/src/main/resources/market/guess/ui/client/login.fxml b/ui-client/src/main/resources/market/guess/ui/client/login.fxml
new file mode 100644
index 0000000..db4cd1d
--- /dev/null
+++ b/ui-client/src/main/resources/market/guess/ui/client/login.fxml
@@ -0,0 +1,39 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3<?import javafx.geometry.Insets?>
4<?import javafx.scene.control.Button?>
5<?import javafx.scene.control.Label?>
6<?import javafx.scene.control.TextField?>
7<?import javafx.scene.layout.StackPane?>
8<?import javafx.scene.layout.VBox?>
9
10<StackPane styleClass="gm-root, gm-chrome" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="market.guess.ui.client.LoginController">
11 <padding>
12 <Insets bottom="24.0" left="24.0" right="24.0" top="24.0" />
13 </padding>
14 <children>
15 <VBox maxHeight="-Infinity" maxWidth="-Infinity" prefWidth="380.0" spacing="8.0" styleClass="gm-card">
16 <padding>
17 <Insets bottom="20.0" left="22.0" right="22.0" top="20.0" />
18 </padding>
19 <children>
20 <Label styleClass="gm-text-xl, gm-font-bold, gm-text-ink" text="Guess Market" />
21 <Label styleClass="gm-text-base, gm-font-regular, gm-text-ink2" text="Sign in to a market server" />
22 <Label styleClass="gm-text-base, gm-font-medium, gm-text-ink2" text="Server">
23 <VBox.margin>
24 <Insets top="8.0" />
25 </VBox.margin>
26 </Label>
27 <TextField fx:id="serverField" onAction="#handleLogin" styleClass="gm-textfield, gm-textfield-mono" />
28 <Label styleClass="gm-text-base, gm-font-medium, gm-text-ink2" text="User name" />
29 <TextField fx:id="userField" onAction="#handleLogin" styleClass="gm-textfield" />
30 <Label fx:id="errorLabel" managed="false" styleClass="gm-text-base, gm-font-medium, gm-text-no" visible="false" wrapText="true" />
31 <Button fx:id="loginBtn" defaultButton="true" maxWidth="1.7976931348623157E308" onAction="#handleLogin" styleClass="gm-btn, gm-btn-primary" text="Log in">
32 <VBox.margin>
33 <Insets top="8.0" />
34 </VBox.margin>
35 </Button>
36 </children>
37 </VBox>
38 </children>
39</StackPane>