Skip to content

Commit

Permalink
Add error messages to map and mod reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Oct 10, 2021
1 parent 1c798f0 commit 9787723
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Expand Up @@ -108,6 +108,7 @@ public void setMapPath(Path mapPath) {
.thenAccept(this::setMapInfo)
.exceptionally(throwable -> {
log.warn("Map could not be read", throwable);
notificationService.addImmediateErrorNotification(throwable, "mapVault.upload.readError");
return null;
});
}
Expand Down
Expand Up @@ -92,6 +92,7 @@ public void setModPath(Path modPath) {
.thenAccept(this::setModVersionInfo)
.exceptionally(throwable -> {
log.warn("ModVersion could not be read", throwable);
notificationService.addImmediateErrorNotification(throwable, "modVault.upload.readError");
return null;
});
}
Expand All @@ -110,7 +111,7 @@ private void setModVersionInfo(ModVersionBean modVersion) {
modNameLabel.textProperty().bind(modVersion.getMod().displayNameProperty());
descriptionLabel.textProperty().bind(modVersion.descriptionProperty());
versionLabel.textProperty().bind(modVersion.versionProperty().asString());
uidLabel.textProperty().bind(modVersion.idProperty().asString());
uidLabel.textProperty().bind(modVersion.uidProperty());
thumbnailImageView.imageProperty().bind(
Bindings.createObjectBinding(() -> modService.loadThumbnail(modVersion), modVersion.idProperty(), modVersion.imagePathProperty())
);
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/i18n/messages.properties
Expand Up @@ -282,18 +282,21 @@ modVault.upload.uploading = Uploading mod…
modVault.upload.complete = Upload complete
modVault.upload.failed = Mod upload failed. Server gave the following errors\:\n\n{0}
modVault.upload.retry = Retry
modVault.upload.readError = An error occurred while reading the mod
modVault.upload.reading = Reading mod…
modVault.upload.compressing = Compressing mod…
mapVault.upload.title = Upload map
mapVault.upload.hint = Values were read from *_scenario.lua
mapVault.upload.mapVersion = Version
mapVault.upload.readError = An error occurred while reading the map
mapVault.upload.reading = Reading map…
mapVault.upload = Upload map…
mapVault.upload.uploadNow = Upload now
mapVault.upload.uploading = Uploading map…
mapVault.upload.compressing = Compressing map…
mapVault.upload.complete = Upload complete
mapVault.upload.complete.hint = WARNING\: Since the server may have renamed your files, it's strongly recommended that you remove your map from the map folder and instead install it using the map vault.
mapVault.upload.failed = Map could not be uploaded. Server gave the following errors\:\n\n{0}
mapVault.upload.failed = Map upload failed. Server gave the following errors\:\n\n{0}
mapVault.upload.mapSize = Size
mapVault.upload.players = Players
mapVault.upload.chooseDirectory = Choose map directory
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/theme/vault/mod/mod_upload.fxml
Expand Up @@ -82,7 +82,7 @@
</VBox>
<VBox fx:id="parseProgressPane" alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" VBox.vgrow="ALWAYS">
<children>
<Label contentDisplay="TOP" styleClass="h2" text="%mapVault.upload.reading">
<Label contentDisplay="TOP" styleClass="h2" text="%modVault.upload.reading">
<graphic>
<ProgressIndicator prefHeight="100.0" prefWidth="100.0"/>
</graphic>
Expand Down

0 comments on commit 9787723

Please sign in to comment.