Add prompt warning user that no game installed
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
package org.jackhuang.hmcl.ui;
|
package org.jackhuang.hmcl.ui;
|
||||||
|
|
||||||
import com.jfoenix.concurrency.JFXUtilities;
|
import com.jfoenix.concurrency.JFXUtilities;
|
||||||
|
import javafx.application.Platform;
|
||||||
import javafx.beans.binding.When;
|
import javafx.beans.binding.When;
|
||||||
import javafx.scene.layout.Region;
|
import javafx.scene.layout.Region;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
@@ -92,7 +93,7 @@ public final class LeftPaneController extends AdvancedListBox {
|
|||||||
// ==== Accounts ====
|
// ==== Accounts ====
|
||||||
public void checkAccount() {
|
public void checkAccount() {
|
||||||
if (Accounts.getAccounts().isEmpty())
|
if (Accounts.getAccounts().isEmpty())
|
||||||
addNewAccount();
|
Platform.runLater(this::addNewAccount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addNewAccount() {
|
private void addNewAccount() {
|
||||||
|
|||||||
@@ -281,6 +281,8 @@ public class DecoratorController {
|
|||||||
dialogPane = new StackContainerPane();
|
dialogPane = new StackContainerPane();
|
||||||
|
|
||||||
dialog.setContent(dialogPane);
|
dialog.setContent(dialogPane);
|
||||||
|
if (decorator.getDrawerWrapper() == null)
|
||||||
|
throw new IllegalStateException("Decorator has not been initialized");
|
||||||
dialog.setDialogContainer(decorator.getDrawerWrapper());
|
dialog.setDialogContainer(decorator.getDrawerWrapper());
|
||||||
dialog.setOverlayClose(false);
|
dialog.setOverlayClose(false);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import org.jackhuang.hmcl.ui.construct.AdvancedListItem;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
import static org.jackhuang.hmcl.util.i18n.I18n.i18n;
|
||||||
|
|
||||||
public class GameAdvancedListItem extends AdvancedListItem {
|
public class GameAdvancedListItem extends AdvancedListItem {
|
||||||
private final WeakListenerHelper helper = new WeakListenerHelper();
|
private final WeakListenerHelper helper = new WeakListenerHelper();
|
||||||
|
|
||||||
@@ -68,7 +70,13 @@ public class GameAdvancedListItem extends AdvancedListItem {
|
|||||||
else
|
else
|
||||||
imageProperty().set(new Image("/assets/img/grass.png"));
|
imageProperty().set(new Image("/assets/img/grass.png"));
|
||||||
|
|
||||||
titleProperty().set(version);
|
if (version != null) {
|
||||||
|
titleProperty().set(version);
|
||||||
|
subtitleProperty().set(null);
|
||||||
|
} else {
|
||||||
|
titleProperty().set(i18n("version.empty"));
|
||||||
|
subtitleProperty().set(i18n("version.empty.add"));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,6 +128,8 @@ public class Versions {
|
|||||||
public static void launch(Profile profile, String id) {
|
public static void launch(Profile profile, String id) {
|
||||||
if (Accounts.getSelectedAccount() == null)
|
if (Accounts.getSelectedAccount() == null)
|
||||||
Controllers.getLeftPaneController().checkAccount();
|
Controllers.getLeftPaneController().checkAccount();
|
||||||
|
else if (id == null)
|
||||||
|
Controllers.dialog(i18n("version.empty.launch"));
|
||||||
else
|
else
|
||||||
LauncherHelper.INSTANCE.launch(profile, Accounts.getSelectedAccount(), id, null);
|
LauncherHelper.INSTANCE.launch(profile, Accounts.getSelectedAccount(), id, null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -331,6 +331,9 @@ update.tooltip=Update
|
|||||||
|
|
||||||
version=Games
|
version=Games
|
||||||
version.cannot_read=Unable to gather the game version. Cannot continue auto-installing.
|
version.cannot_read=Unable to gather the game version. Cannot continue auto-installing.
|
||||||
|
version.empty=No game
|
||||||
|
version.empty.add=Click btn right to install game
|
||||||
|
version.empty.launch=No game to launch, please install new game via game list page.
|
||||||
version.forbidden_name=Forbidden name, do not use this.
|
version.forbidden_name=Forbidden name, do not use this.
|
||||||
version.game.old=Old
|
version.game.old=Old
|
||||||
version.game.release=Release
|
version.game.release=Release
|
||||||
|
|||||||
@@ -331,6 +331,9 @@ update.tooltip=更新
|
|||||||
|
|
||||||
version=遊戲
|
version=遊戲
|
||||||
version.cannot_read=讀取遊戲版本失敗,無法進行自動安裝
|
version.cannot_read=讀取遊戲版本失敗,無法進行自動安裝
|
||||||
|
version.empty=無遊戲版本
|
||||||
|
version.empty.add=點擊右側按鈕安裝
|
||||||
|
version.empty.launch=沒有可啟動的遊戲,你可以點擊左側遊戲欄內的設置按鈕進入遊戲列表安裝遊戲
|
||||||
version.forbidden_name=此版本名稱不受支援,請換一個名字
|
version.forbidden_name=此版本名稱不受支援,請換一個名字
|
||||||
version.game.old=老舊版本
|
version.game.old=老舊版本
|
||||||
version.game.release=穩定版本
|
version.game.release=穩定版本
|
||||||
|
|||||||
@@ -331,6 +331,9 @@ update.tooltip=更新
|
|||||||
|
|
||||||
version=游戏
|
version=游戏
|
||||||
version.cannot_read=读取游戏版本失败,无法进行自动安装
|
version.cannot_read=读取游戏版本失败,无法进行自动安装
|
||||||
|
version.empty=没有游戏版本
|
||||||
|
version.empty.add=点击右侧按钮安装
|
||||||
|
version.empty.launch=没有可启动的游戏,你可以点击左侧游戏栏内的设置按钮进入游戏列表安装游戏
|
||||||
version.forbidden_name=此版本名称不受支持,请换一个名字
|
version.forbidden_name=此版本名称不受支持,请换一个名字
|
||||||
version.game.old=远古版
|
version.game.old=远古版
|
||||||
version.game.release=稳定版
|
version.game.release=稳定版
|
||||||
|
|||||||
Reference in New Issue
Block a user