feat(ui): show world download button in worldlistpage.

This commit is contained in:
huanghongxun 2021-10-12 14:03:27 +08:00
parent 9b0c0d1870
commit 04a68d0b95
5 changed files with 14 additions and 1 deletions

View File

@ -230,6 +230,10 @@ public class DownloadPage extends DecoratorAnimatedPage implements DecoratorPage
tab.select(modTab);
}
public void showWorldDownloads() {
tab.select(worldTab);
}
private class DownloadNavigator implements Navigation {
private final Map<String, Object> settings = new HashMap<>();

View File

@ -114,6 +114,11 @@ public class WorldListPage extends ListPageBase<WorldListItem> implements Versio
installWorld(res.get(0));
}
public void download() {
Controllers.getDownloadPage().showWorldDownloads();
Controllers.navigate(Controllers.getDownloadPage());
}
private void installWorld(File zipFile) {
// Only accept one world file because user is required to confirm the new world name
// Or too many input dialogs are popped.
@ -165,7 +170,8 @@ public class WorldListPage extends ListPageBase<WorldListItem> implements Versio
return Arrays.asList(chkShowAll,
createToolbarButton2(i18n("button.refresh"), SVG::refresh, skinnable::refresh),
createToolbarButton2(i18n("world.add"), SVG::plus, skinnable::add));
createToolbarButton2(i18n("world.add"), SVG::plus, skinnable::add),
createToolbarButton2(i18n("world.download"), SVG::plus, skinnable::download));
}
}
}

View File

@ -706,6 +706,7 @@ world.add=Add world(.zip)
world.datapack=Manage data packs
world.datapack.1_13=Only Minecraft 1.13 and later versions support data packs.
world.description=%s. Last played time: %s. Game version: %s.
world.download=Downloads
world.export=Export this world
world.export.title=Choose a location to store your world
world.export.location=Export to

View File

@ -705,6 +705,7 @@ world.add=加入世界
world.datapack=管理資料包
world.datapack.1_13=僅 Minecraft 1.13 及之後的版本支援資料包
world.description=%s. 上一次遊戲時間: %s. 遊戲版本: %s
world.download=存檔下載
world.export=匯出此世界
world.export.title=選擇該世界的儲存位置
world.export.location=儲存到

View File

@ -706,6 +706,7 @@ world.add=添加世界
world.datapack=管理数据包
world.datapack.1_13=仅 Minecraft 1.13 及之后的版本支持数据包
world.description=%s. 上一次游戏时间: %s. 游戏版本: %s
world.download=存档下载
world.export=导出此世界
world.export.title=选择该世界的存储位置
world.export.location=保存到