filling up a gap

This commit is contained in:
sirjonasxx 2018-11-06 22:20:18 +01:00
parent cf9d977d08
commit 982b3c3fe6
4 changed files with 93 additions and 78 deletions

View File

@ -11,7 +11,7 @@
<?import javafx.scene.layout.RowConstraints?> <?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<GridPane prefHeight="324.0" prefWidth="588.0" style="-fx-background-color: #FFFFFF;" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="extensions.blockreplacepackets.BlockAndReplacePackets"> <GridPane prefHeight="324.0" prefWidth="588.0" style="-fx-background-color: #FFFFFF;" xmlns="http://javafx.com/javafx/8.0.131" xmlns:fx="http://javafx.com/fxml/1" fx:controller="extensions.blockreplacepackets.BlockAndReplacePackets">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>

View File

@ -505,4 +505,7 @@ public class HConnection {
return clientHostAndPort; return clientHostAndPort;
} }
public String getHotelVersion() {
return hotelVersion;
}
} }

View File

@ -21,6 +21,7 @@ public class Connection extends SubForm {
public TextField outHost; public TextField outHost;
public TextField outPort; public TextField outPort;
public CheckBox cbx_autodetect; public CheckBox cbx_autodetect;
public TextField txtfield_hotelversion;
private boolean isBusy = false; private boolean isBusy = false;
@ -75,6 +76,7 @@ public class Connection extends SubForm {
public void onParentSet(){ public void onParentSet(){
getHConnection().addStateChangeListener((oldState, newState) -> Platform.runLater(() -> { getHConnection().addStateChangeListener((oldState, newState) -> Platform.runLater(() -> {
txtfield_hotelversion.setText(getHConnection().getHotelVersion());
if (newState == HConnection.State.NOT_CONNECTED) { if (newState == HConnection.State.NOT_CONNECTED) {
updateInputUI(); updateInputUI();
lblState.setText("Not connected"); lblState.setText("Not connected");

View File

@ -11,193 +11,203 @@
<?import javafx.scene.layout.RowConstraints?> <?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<GridPane alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="262.0" <GridPane alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="262.0" prefWidth="565.0" xmlns="http://javafx.com/javafx/8.0.131" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gearth.ui.connection.Connection">
prefWidth="565.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="gearth.ui.connection.Connection">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints maxHeight="172.0" minHeight="10.0" prefHeight="140.0" vgrow="SOMETIMES"/> <RowConstraints maxHeight="172.0" minHeight="10.0" prefHeight="140.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="127.0" minHeight="10.0" prefHeight="122.0" vgrow="SOMETIMES"/> <RowConstraints maxHeight="127.0" minHeight="10.0" prefHeight="122.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<GridPane alignment="CENTER" GridPane.hgrow="SOMETIMES" GridPane.vgrow="SOMETIMES"> <GridPane alignment="CENTER" GridPane.hgrow="SOMETIMES" GridPane.vgrow="SOMETIMES">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="483.0" minWidth="10.0" prefWidth="317.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="483.0" minWidth="10.0" prefWidth="317.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="350.0" minWidth="10.0" prefWidth="248.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="350.0" minWidth="10.0" prefWidth="248.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<GridPane GridPane.columnIndex="1"> <GridPane GridPane.columnIndex="1">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints maxHeight="32.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints maxHeight="32.0" minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="40.0" minHeight="10.0" prefHeight="37.0" vgrow="SOMETIMES"/> <RowConstraints maxHeight="40.0" minHeight="10.0" prefHeight="37.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="45.0" minHeight="10.0" prefHeight="32.0" vgrow="SOMETIMES"/> <RowConstraints maxHeight="45.0" minHeight="10.0" prefHeight="32.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="45.0" minHeight="10.0" prefHeight="21.0" vgrow="SOMETIMES"/> <RowConstraints maxHeight="45.0" minHeight="10.0" prefHeight="21.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<opaqueInsets> <opaqueInsets>
<Insets/> <Insets />
</opaqueInsets> </opaqueInsets>
<GridPane.margin> <GridPane.margin>
<Insets top="20.0"/> <Insets top="20.0" />
</GridPane.margin> </GridPane.margin>
<GridPane> <GridPane>
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="120.0" minWidth="10.0" prefWidth="68.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="120.0" minWidth="10.0" prefWidth="68.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="188.0" minWidth="10.0" <ColumnConstraints hgrow="SOMETIMES" maxWidth="188.0" minWidth="10.0" prefWidth="184.0" />
prefWidth="184.0"/>
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<Label text="Port:" GridPane.halignment="CENTER" GridPane.valignment="CENTER"/> <Label text="Port:" GridPane.halignment="CENTER" GridPane.valignment="CENTER" />
<ComboBox fx:id="inpPort" disable="true" editable="true" prefWidth="183.0" <ComboBox fx:id="inpPort" disable="true" editable="true" prefWidth="183.0" GridPane.columnIndex="1">
GridPane.columnIndex="1">
<GridPane.margin> <GridPane.margin>
<Insets right="15.0"/> <Insets right="15.0" />
</GridPane.margin> </GridPane.margin>
</ComboBox> </ComboBox>
</GridPane> </GridPane>
<GridPane layoutX="10.0" layoutY="10.0" GridPane.rowIndex="1"> <GridPane layoutX="10.0" layoutY="10.0" GridPane.rowIndex="1">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="120.0" minWidth="10.0" prefWidth="68.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="120.0" minWidth="10.0" prefWidth="68.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="188.0" minWidth="10.0" <ColumnConstraints hgrow="SOMETIMES" maxWidth="188.0" minWidth="10.0" prefWidth="184.0" />
prefWidth="184.0"/>
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<Label text="Host:" GridPane.halignment="CENTER" GridPane.valignment="CENTER"/> <Label text="Host:" GridPane.halignment="CENTER" GridPane.valignment="CENTER" />
<ComboBox fx:id="inpHost" disable="true" editable="true" GridPane.columnIndex="1"> <ComboBox fx:id="inpHost" disable="true" editable="true" GridPane.columnIndex="1">
<GridPane.margin> <GridPane.margin>
<Insets right="15.0"/> <Insets right="15.0" />
</GridPane.margin> </GridPane.margin>
</ComboBox> </ComboBox>
</GridPane> </GridPane>
<GridPane GridPane.rowIndex="2"> <GridPane GridPane.rowIndex="2">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="185.0" minWidth="10.0" <ColumnConstraints hgrow="SOMETIMES" maxWidth="185.0" minWidth="10.0" prefWidth="158.0" />
prefWidth="158.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="117.0" minWidth="10.0" prefWidth="90.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="117.0" minWidth="10.0" prefWidth="90.0"/>
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints/> <RowConstraints />
<RowConstraints/> <RowConstraints />
<RowConstraints/> <RowConstraints />
</rowConstraints> </rowConstraints>
<CheckBox fx:id="cbx_autodetect" mnemonicParsing="false" selected="true" <CheckBox fx:id="cbx_autodetect" mnemonicParsing="false" selected="true" text="Auto-detect" textFill="#000000a9" GridPane.columnIndex="1" GridPane.rowIndex="3">
text="Auto-detect" textFill="#000000a9" GridPane.columnIndex="1"
GridPane.rowIndex="3">
<GridPane.margin> <GridPane.margin>
<Insets left="-5.0"/> <Insets left="-5.0" />
</GridPane.margin> </GridPane.margin>
<font> <font>
<Font size="12.0"/> <Font size="12.0" />
</font> </font>
</CheckBox> </CheckBox>
<Button fx:id="btnConnect" alignment="CENTER" maxWidth="1.7976931348623157E308" <Button fx:id="btnConnect" alignment="CENTER" maxWidth="1.7976931348623157E308" onAction="#btnConnect_clicked" text="Connect" GridPane.halignment="CENTER" GridPane.rowIndex="3" GridPane.valignment="CENTER">
onAction="#btnConnect_clicked" text="Connect" GridPane.halignment="CENTER"
GridPane.rowIndex="3" GridPane.valignment="CENTER">
<GridPane.margin> <GridPane.margin>
<Insets left="15.0" right="15.0"/> <Insets left="15.0" right="15.0" />
</GridPane.margin> </GridPane.margin>
</Button> </Button>
</GridPane> </GridPane>
</GridPane> </GridPane>
<GridPane style="-fx-border-color: #888888; -fx-border-radius: 5px;"> <GridPane style="-fx-border-color: #888888; -fx-border-radius: 5px;">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<GridPane.margin> <GridPane.margin>
<Insets bottom="14.0" left="20.0" right="15.0" top="17.0"/> <Insets bottom="14.0" left="20.0" right="15.0" top="17.0" />
</GridPane.margin> </GridPane.margin>
<children>
<GridPane>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="83.0" minHeight="10.0" prefHeight="26.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="86.0" minHeight="10.0" prefHeight="33.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label text="Hotel version:" textFill="#000000cc" />
<TextField fx:id="txtfield_hotelversion" editable="false" GridPane.rowIndex="1">
<opaqueInsets>
<Insets />
</opaqueInsets>
<GridPane.margin>
<Insets right="16.0" />
</GridPane.margin>
</TextField>
</children>
<GridPane.margin>
<Insets bottom="26.0" left="12.0" right="10.0" top="22.0" />
</GridPane.margin>
</GridPane>
</children>
</GridPane> </GridPane>
</GridPane> </GridPane>
<GridPane alignment="CENTER" GridPane.rowIndex="1"> <GridPane alignment="CENTER" GridPane.rowIndex="1">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="340.0" minWidth="10.0" prefWidth="208.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="340.0" minWidth="10.0" prefWidth="208.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="380.0" minWidth="10.0" prefWidth="357.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="380.0" minWidth="10.0" prefWidth="357.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<GridPane.margin> <GridPane.margin>
<Insets/> <Insets />
</GridPane.margin> </GridPane.margin>
<GridPane> <GridPane>
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/> <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints maxHeight="62.0" minHeight="10.0" prefHeight="53.0" vgrow="SOMETIMES"/> <RowConstraints maxHeight="62.0" minHeight="10.0" prefHeight="53.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="107.0" minHeight="10.0" prefHeight="85.0" vgrow="SOMETIMES"/> <RowConstraints maxHeight="107.0" minHeight="10.0" prefHeight="85.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<GridPane.margin> <GridPane.margin>
<Insets bottom="14.0" left="20.0" right="20.0"/> <Insets bottom="14.0" left="20.0" right="20.0" />
</GridPane.margin> </GridPane.margin>
<Label text="Connection state:" textFill="#000000ba" GridPane.valignment="BOTTOM"> <Label text="Connection state:" textFill="#000000ba" GridPane.valignment="BOTTOM">
<GridPane.margin> <GridPane.margin>
<Insets bottom="5.0" left="2.0"/> <Insets bottom="5.0" left="2.0" />
</GridPane.margin> </GridPane.margin>
<font> <font>
<Font size="12.0"/> <Font size="12.0" />
</font> </font>
</Label> </Label>
<Label fx:id="lblState" alignment="CENTER" maxHeight="1.7976931348623157E308" <Label fx:id="lblState" alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" style="-fx-border-color: #888888; -fx-border-radius: 5px;" text="Not connected" textAlignment="CENTER" textFill="#000000d1" GridPane.halignment="CENTER" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.valignment="CENTER" GridPane.vgrow="ALWAYS">
maxWidth="1.7976931348623157E308"
style="-fx-border-color: #888888; -fx-border-radius: 5px;" text="Not connected"
textAlignment="CENTER" textFill="#000000d1" GridPane.halignment="CENTER"
GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.valignment="CENTER"
GridPane.vgrow="ALWAYS">
<GridPane.margin> <GridPane.margin>
<Insets/> <Insets />
</GridPane.margin> </GridPane.margin>
</Label> </Label>
</GridPane> </GridPane>
<GridPane style="-fx-border-color: #888888; -fx-border-radius: 5px; " GridPane.columnIndex="1"> <GridPane style="-fx-border-color: #888888; -fx-border-radius: 5px; " GridPane.columnIndex="1">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="140.0" minWidth="10.0" prefWidth="103.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="140.0" minWidth="10.0" prefWidth="103.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="191.0" minWidth="10.0" prefWidth="190.0"/> <ColumnConstraints hgrow="SOMETIMES" maxWidth="191.0" minWidth="10.0" prefWidth="190.0" />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/> <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints> </rowConstraints>
<GridPane.margin> <GridPane.margin>
<Insets bottom="12.0" left="20.0" right="10.0" top="12.0"/> <Insets bottom="12.0" left="20.0" right="10.0" top="12.0" />
</GridPane.margin> </GridPane.margin>
<padding> <padding>
<Insets bottom="7.0" top="7.0"/> <Insets bottom="7.0" top="7.0" />
</padding> </padding>
<Label text="Game host:" textFill="#000000cc"> <Label text="Game host:" textFill="#000000cc">
<GridPane.margin> <GridPane.margin>
<Insets left="10.0"/> <Insets left="10.0" />
</GridPane.margin> </GridPane.margin>
</Label> </Label>
<Label text="Port:" textFill="#000000cc" GridPane.rowIndex="1"> <Label text="Port:" textFill="#000000cc" GridPane.rowIndex="1">
<GridPane.margin> <GridPane.margin>
<Insets left="10.0"/> <Insets left="10.0" />
</GridPane.margin> </GridPane.margin>
</Label> </Label>
<TextField fx:id="outHost" editable="false" GridPane.columnIndex="1"> <TextField fx:id="outHost" editable="false" GridPane.columnIndex="1">
<opaqueInsets> <opaqueInsets>
<Insets/> <Insets />
</opaqueInsets> </opaqueInsets>
<GridPane.margin> <GridPane.margin>
<Insets left="5.0" right="10.0"/> <Insets left="5.0" right="10.0" />
</GridPane.margin> </GridPane.margin>
</TextField> </TextField>
<TextField fx:id="outPort" editable="false" GridPane.columnIndex="1" GridPane.rowIndex="1"> <TextField fx:id="outPort" editable="false" GridPane.columnIndex="1" GridPane.rowIndex="1">
<GridPane.margin> <GridPane.margin>
<Insets left="5.0" right="10.0"/> <Insets left="5.0" right="10.0" />
</GridPane.margin> </GridPane.margin>
</TextField> </TextField>
</GridPane> </GridPane>