mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 19:05:02 -04:00
translate connection dialogs, progress bar design
This commit is contained in:
parent
4f4c72884b
commit
875c892f8d
@ -18,6 +18,7 @@ import de.bixilon.minosoft.assets.util.FileAssetsUtil
|
|||||||
import de.bixilon.minosoft.assets.util.FileAssetsUtil.toAssetName
|
import de.bixilon.minosoft.assets.util.FileAssetsUtil.toAssetName
|
||||||
import de.bixilon.minosoft.assets.util.FileUtil
|
import de.bixilon.minosoft.assets.util.FileUtil
|
||||||
import de.bixilon.minosoft.assets.util.FileUtil.readJsonObject
|
import de.bixilon.minosoft.assets.util.FileUtil.readJsonObject
|
||||||
|
import de.bixilon.minosoft.config.StaticConfiguration
|
||||||
import de.bixilon.minosoft.config.profile.profiles.resources.ResourcesProfile
|
import de.bixilon.minosoft.config.profile.profiles.resources.ResourcesProfile
|
||||||
import de.bixilon.minosoft.data.registries.ResourceLocation
|
import de.bixilon.minosoft.data.registries.ResourceLocation
|
||||||
import de.bixilon.minosoft.protocol.protocol.ProtocolDefinition
|
import de.bixilon.minosoft.protocol.protocol.ProtocolDefinition
|
||||||
@ -121,6 +122,9 @@ class IndexAssetsManager(
|
|||||||
this.assets[name] = AssetsProperty(type, hash, size)
|
this.assets[name] = AssetsProperty(type, hash, size)
|
||||||
tasks.dec()
|
tasks.dec()
|
||||||
assetsLatch.dec()
|
assetsLatch.dec()
|
||||||
|
if (StaticConfiguration.DEBUG_SLOW_LOADING) {
|
||||||
|
Thread.sleep(30L)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assetsLatch.await()
|
assetsLatch.await()
|
||||||
|
@ -36,13 +36,14 @@ class ConnectingDialog(
|
|||||||
|
|
||||||
fun show() {
|
fun show() {
|
||||||
JavaFXUtil.runLater {
|
JavaFXUtil.runLater {
|
||||||
JavaFXUtil.openModal("TODO", LAYOUT, this)
|
JavaFXUtil.openModal(TITLE, LAYOUT, this)
|
||||||
update(connection.state)
|
update(connection.state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
headerFX.text = HEADER
|
||||||
connection.registerEvent(JavaFXEventInvoker.of<PlayConnectionStateChangeEvent> { update(it.state) }) // ToDo: This creates a memory leak...
|
connection.registerEvent(JavaFXEventInvoker.of<PlayConnectionStateChangeEvent> { update(it.state) }) // ToDo: This creates a memory leak...
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,6 +69,9 @@ class ConnectingDialog(
|
|||||||
companion object {
|
companion object {
|
||||||
private val LAYOUT = "minosoft:eros/dialog/connection/connecting.fxml".toResourceLocation()
|
private val LAYOUT = "minosoft:eros/dialog/connection/connecting.fxml".toResourceLocation()
|
||||||
|
|
||||||
|
private val TITLE = "minosoft:connection.dialog.connecting.title".toResourceLocation()
|
||||||
|
private val HEADER = "minosoft:connection.dialog.connecting.header".toResourceLocation()
|
||||||
|
|
||||||
private const val PROGRESS_STEPS = 7
|
private const val PROGRESS_STEPS = 7
|
||||||
private val PlayConnectionStates.step: Int
|
private val PlayConnectionStates.step: Int
|
||||||
get() = when (this) {
|
get() = when (this) {
|
||||||
|
@ -34,7 +34,7 @@ class VerifyAssetsDialog(
|
|||||||
|
|
||||||
fun show() {
|
fun show() {
|
||||||
JavaFXUtil.runLater {
|
JavaFXUtil.runLater {
|
||||||
JavaFXUtil.openModal("TODO", LAYOUT, this)
|
JavaFXUtil.openModal(TITLE, LAYOUT, this)
|
||||||
update()
|
update()
|
||||||
stage.show()
|
stage.show()
|
||||||
}
|
}
|
||||||
@ -42,6 +42,8 @@ class VerifyAssetsDialog(
|
|||||||
|
|
||||||
|
|
||||||
override fun init() {
|
override fun init() {
|
||||||
|
headerFX.text = HEADER
|
||||||
|
cancelButtonFX.isDisable = true
|
||||||
latch += {
|
latch += {
|
||||||
JavaFXUtil.runLater {
|
JavaFXUtil.runLater {
|
||||||
update()
|
update()
|
||||||
@ -57,7 +59,7 @@ class VerifyAssetsDialog(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
countTextFX.text = "${total - count}/${total}"
|
countTextFX.text = "${total - count}/${total}"
|
||||||
mibTextFX.text = "?/? Mib"
|
mibTextFX.text = "No clue how much MiB :)"
|
||||||
val progress = if (total <= 0) {
|
val progress = if (total <= 0) {
|
||||||
0.0
|
0.0
|
||||||
} else {
|
} else {
|
||||||
@ -73,5 +75,8 @@ class VerifyAssetsDialog(
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val LAYOUT = "minosoft:eros/dialog/connection/verify_assets.fxml".toResourceLocation()
|
private val LAYOUT = "minosoft:eros/dialog/connection/verify_assets.fxml".toResourceLocation()
|
||||||
|
|
||||||
|
private val TITLE = "minosoft:connection.dialog.verify_assets.title".toResourceLocation()
|
||||||
|
private val HEADER = "minosoft:connection.dialog.verify_assets.header".toResourceLocation()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,9 @@
|
|||||||
</VBox.margin>
|
</VBox.margin>
|
||||||
<TextFlow fx:id="headerFX">
|
<TextFlow fx:id="headerFX">
|
||||||
<Text text="Connecting to the server..."/>
|
<Text text="Connecting to the server..."/>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="10.0"/>
|
||||||
|
</GridPane.margin>
|
||||||
</TextFlow>
|
</TextFlow>
|
||||||
<GridPane GridPane.rowIndex="1">
|
<GridPane GridPane.rowIndex="1">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
|
||||||
<?import javafx.geometry.Insets?>
|
<?import javafx.geometry.Insets?>
|
||||||
<?import javafx.scene.control.Button?>
|
<?import javafx.scene.control.Button?>
|
||||||
<?import javafx.scene.control.ProgressBar?>
|
<?import javafx.scene.control.ProgressBar?>
|
||||||
@ -23,6 +22,9 @@
|
|||||||
</VBox.margin>
|
</VBox.margin>
|
||||||
<TextFlow fx:id="headerFX">
|
<TextFlow fx:id="headerFX">
|
||||||
<Text text="Minosoft is downloading assets..."/>
|
<Text text="Minosoft is downloading assets..."/>
|
||||||
|
<GridPane.margin>
|
||||||
|
<Insets bottom="10.0"/>
|
||||||
|
</GridPane.margin>
|
||||||
</TextFlow>
|
</TextFlow>
|
||||||
<GridPane GridPane.rowIndex="1">
|
<GridPane GridPane.rowIndex="1">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
|
@ -324,3 +324,21 @@
|
|||||||
.table-row-cell:empty:selected {
|
.table-row-cell:empty:selected {
|
||||||
-fx-background-color: -secondary-color;
|
-fx-background-color: -secondary-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Progress bar */
|
||||||
|
.progress-bar {
|
||||||
|
-fx-background-color: -secondary-color;
|
||||||
|
-fx-border-color: -primary-color;
|
||||||
|
-fx-background-radius: 2px;
|
||||||
|
-fx-border-radius: 2px;
|
||||||
|
-fx-border-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-bar .bar {
|
||||||
|
-fx-background-color: -primary-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-bar > .track {
|
||||||
|
-fx-background-color: -secondary-color;
|
||||||
|
}
|
||||||
|
@ -22,9 +22,12 @@ minosoft:server_info.ping=Latency
|
|||||||
minosoft:server_info.delete.dialog.description=Do you really want to delete the server %1$s (%2$s)?
|
minosoft:server_info.delete.dialog.description=Do you really want to delete the server %1$s (%2$s)?
|
||||||
|
|
||||||
|
|
||||||
minosoft:connection.verify_assets.header=Verifying and downloading missing assets. This might take a while...
|
minosoft:connection.dialog.verify_assets.title=Verifying assets... - Minosoft
|
||||||
|
minosoft:connection.dialog.verify_assets.header=Verifying and downloading missing assets. This might take a while...
|
||||||
|
|
||||||
|
minosoft:connection.dialog.connecting.title=Connecting... - Minosoft
|
||||||
minosoft:connection.dialog.connecting.header=Connecting...
|
minosoft:connection.dialog.connecting.header=Connecting...
|
||||||
|
|
||||||
minosoft:connection.play.state.waiting=Waiting for connection...
|
minosoft:connection.play.state.waiting=Waiting for connection...
|
||||||
minosoft:connection.play.state.loading_assets=Loading assets...
|
minosoft:connection.play.state.loading_assets=Loading assets...
|
||||||
minosoft:connection.play.state.loading=Loading...
|
minosoft:connection.play.state.loading=Loading...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user