mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 02:15:34 -04:00
eros: warn user if not account is present/selected, #114
This commit is contained in:
parent
6849f38675
commit
da27f6de06
@ -18,8 +18,10 @@ import de.bixilon.kutil.shutdown.AbstractShutdownReason
|
||||
import de.bixilon.kutil.shutdown.ShutdownManager
|
||||
import de.bixilon.minosoft.config.profile.profiles.eros.ErosProfileManager
|
||||
import de.bixilon.minosoft.data.accounts.Account
|
||||
import de.bixilon.minosoft.data.registries.identified.Namespaces.minosoft
|
||||
import de.bixilon.minosoft.gui.eros.controller.EmbeddedJavaFXController
|
||||
import de.bixilon.minosoft.gui.eros.controller.JavaFXWindowController
|
||||
import de.bixilon.minosoft.gui.eros.dialog.SimpleErosWarningDialog
|
||||
import de.bixilon.minosoft.gui.eros.main.account.AccountController
|
||||
import de.bixilon.minosoft.gui.eros.util.JavaFXAccountUtil.avatar
|
||||
import de.bixilon.minosoft.gui.eros.util.JavaFXUtil
|
||||
@ -39,21 +41,41 @@ import org.kordamp.ikonli.javafx.FontIcon
|
||||
|
||||
|
||||
class MainErosController : JavaFXWindowController() {
|
||||
@FXML private lateinit var logoFX: ImageView
|
||||
@FXML private lateinit var versionTextFX: Label
|
||||
@FXML
|
||||
private lateinit var logoFX: ImageView
|
||||
|
||||
@FXML private lateinit var playIconFX: FontIcon
|
||||
@FXML private lateinit var profilesIconFX: FontIcon
|
||||
@FXML private lateinit var modsIconFX: FontIcon
|
||||
@FXML private lateinit var helpIconFX: FontIcon
|
||||
@FXML private lateinit var aboutIconFX: FontIcon
|
||||
@FXML private lateinit var exitIconFX: FontIcon
|
||||
@FXML
|
||||
private lateinit var versionTextFX: Label
|
||||
|
||||
@FXML private lateinit var contentFX: Pane
|
||||
@FXML
|
||||
private lateinit var playIconFX: FontIcon
|
||||
|
||||
@FXML private lateinit var accountFX: GridPane
|
||||
@FXML private lateinit var accountImageFX: PixelImageView
|
||||
@FXML private lateinit var accountNameFX: Label
|
||||
@FXML
|
||||
private lateinit var profilesIconFX: FontIcon
|
||||
|
||||
@FXML
|
||||
private lateinit var modsIconFX: FontIcon
|
||||
|
||||
@FXML
|
||||
private lateinit var helpIconFX: FontIcon
|
||||
|
||||
@FXML
|
||||
private lateinit var aboutIconFX: FontIcon
|
||||
|
||||
@FXML
|
||||
private lateinit var exitIconFX: FontIcon
|
||||
|
||||
@FXML
|
||||
private lateinit var contentFX: Pane
|
||||
|
||||
@FXML
|
||||
private lateinit var accountFX: GridPane
|
||||
|
||||
@FXML
|
||||
private lateinit var accountImageFX: PixelImageView
|
||||
|
||||
@FXML
|
||||
private lateinit var accountNameFX: Label
|
||||
|
||||
private lateinit var iconMap: Map<ErosMainActivities, FontIcon>
|
||||
|
||||
@ -158,7 +180,7 @@ class MainErosController : JavaFXWindowController() {
|
||||
val profile = ErosProfileManager.selected.general.accountProfile
|
||||
val account = account ?: profile.selected
|
||||
if (account == null) {
|
||||
activity = ErosMainActivities.ACCOUNT
|
||||
SimpleErosWarningDialog(title = NO_ACCOUNT_WARNING_TITLE, header = NO_ACCOUNT_WARNING_HEADER, description = NO_ACCOUNT_WARNING_DESCRIPTION, ignoreButtonText = NO_ACCOUNT_WARNING_BUTTON, onIgnore = { JavaFXUtil.runLater { activity = ErosMainActivities.ACCOUNT } }).show()
|
||||
return
|
||||
}
|
||||
|
||||
@ -173,5 +195,9 @@ class MainErosController : JavaFXWindowController() {
|
||||
|
||||
companion object {
|
||||
private val NO_ACCOUNT_SELECTED = "minosoft:main.account.no_account_selected".toResourceLocation()
|
||||
private val NO_ACCOUNT_WARNING_TITLE = minosoft("main.account.no_account.warning.title")
|
||||
private val NO_ACCOUNT_WARNING_HEADER = minosoft("main.account.no_account.warning.header")
|
||||
private val NO_ACCOUNT_WARNING_DESCRIPTION = minosoft("main.account.no_account.warning.description")
|
||||
private val NO_ACCOUNT_WARNING_BUTTON = minosoft("main.account.no_account.warning.button")
|
||||
}
|
||||
}
|
||||
|
@ -107,6 +107,11 @@ minosoft:main.account.checking_dialog.title=Checking account... - Minosoft
|
||||
minosoft:main.account.checking_dialog.header=Checking account... Please wait
|
||||
|
||||
|
||||
minosoft:main.account.no_account.warning.title=No account!
|
||||
minosoft:main.account.no_account.warning.header=You didn't add any account yet!
|
||||
minosoft:main.account.no_account.warning.description=In order to use minosoft, you'll first have to add an account!\nThis can either be an offline account (only playable on offline servers) or an microsoft account.
|
||||
minosoft:main.account.no_account.warning.button=Manage accounts
|
||||
|
||||
minosoft:main.account.card.connection_count=%0$s connections
|
||||
|
||||
minosoft:main.account.account_info.id=Id
|
||||
|
Loading…
x
Reference in New Issue
Block a user