Add test game button in versions page
This commit is contained in:
@@ -28,7 +28,9 @@ import javafx.scene.control.Tab;
|
|||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
import org.jackhuang.hmcl.download.game.GameAssetIndexDownloadTask;
|
import org.jackhuang.hmcl.download.game.GameAssetIndexDownloadTask;
|
||||||
import org.jackhuang.hmcl.setting.Profile;
|
import org.jackhuang.hmcl.setting.Profile;
|
||||||
|
import org.jackhuang.hmcl.setting.Theme;
|
||||||
import org.jackhuang.hmcl.ui.FXUtils;
|
import org.jackhuang.hmcl.ui.FXUtils;
|
||||||
|
import org.jackhuang.hmcl.ui.SVG;
|
||||||
import org.jackhuang.hmcl.ui.construct.IconedMenuItem;
|
import org.jackhuang.hmcl.ui.construct.IconedMenuItem;
|
||||||
import org.jackhuang.hmcl.ui.construct.Navigator;
|
import org.jackhuang.hmcl.ui.construct.Navigator;
|
||||||
import org.jackhuang.hmcl.ui.construct.PageCloseEvent;
|
import org.jackhuang.hmcl.ui.construct.PageCloseEvent;
|
||||||
@@ -62,6 +64,8 @@ public final class VersionPage extends StackPane implements DecoratorPage {
|
|||||||
@FXML
|
@FXML
|
||||||
private JFXButton btnExport;
|
private JFXButton btnExport;
|
||||||
@FXML
|
@FXML
|
||||||
|
private JFXButton btnTestGame;
|
||||||
|
@FXML
|
||||||
private StackPane rootPane;
|
private StackPane rootPane;
|
||||||
@FXML
|
@FXML
|
||||||
private StackPane contentPane;
|
private StackPane contentPane;
|
||||||
@@ -102,6 +106,9 @@ public final class VersionPage extends StackPane implements DecoratorPage {
|
|||||||
FXUtils.installTooltip(btnManagementMenu, i18n("settings.game.management"));
|
FXUtils.installTooltip(btnManagementMenu, i18n("settings.game.management"));
|
||||||
FXUtils.installTooltip(btnExport, i18n("modpack.export"));
|
FXUtils.installTooltip(btnExport, i18n("modpack.export"));
|
||||||
|
|
||||||
|
btnTestGame.setGraphic(SVG.launch(Theme.whiteFillBinding(), 20, 20));
|
||||||
|
FXUtils.installTooltip(btnTestGame, i18n("version.launch.test"));
|
||||||
|
|
||||||
setEventHandler(Navigator.NavigationEvent.NAVIGATED, this::onNavigated);
|
setEventHandler(Navigator.NavigationEvent.NAVIGATED, this::onNavigated);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,6 +141,11 @@ public final class VersionPage extends StackPane implements DecoratorPage {
|
|||||||
load(this.version, this.profile);
|
load(this.version, this.profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private void onTestGame() {
|
||||||
|
Versions.testGame(profile, version);
|
||||||
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private void onBrowseMenu() {
|
private void onBrowseMenu() {
|
||||||
browsePopup.show(btnBrowseMenu, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 0, btnBrowseMenu.getHeight());
|
browsePopup.show(btnBrowseMenu, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 0, btnBrowseMenu.getHeight());
|
||||||
|
|||||||
@@ -30,6 +30,8 @@
|
|||||||
</JFXTabPane>
|
</JFXTabPane>
|
||||||
|
|
||||||
<HBox alignment="TOP_RIGHT" style="-fx-padding: 4;" spacing="3" pickOnBounds="false">
|
<HBox alignment="TOP_RIGHT" style="-fx-padding: 4;" spacing="3" pickOnBounds="false">
|
||||||
|
<JFXButton fx:id="btnTestGame" maxHeight="40.0" minHeight="40.0" onMouseClicked="#onTestGame"
|
||||||
|
styleClass="toggle-icon3" />
|
||||||
<JFXButton fx:id="btnBrowseMenu" maxHeight="40.0" minHeight="40.0" onMouseClicked="#onBrowseMenu"
|
<JFXButton fx:id="btnBrowseMenu" maxHeight="40.0" minHeight="40.0" onMouseClicked="#onBrowseMenu"
|
||||||
styleClass="toggle-icon3">
|
styleClass="toggle-icon3">
|
||||||
<graphic>
|
<graphic>
|
||||||
|
|||||||
Reference in New Issue
Block a user