|
@@ -12,6 +12,7 @@ import javafx.scene.control.ButtonType;
|
|
|
import javafx.scene.input.KeyCode;
|
|
import javafx.scene.input.KeyCode;
|
|
|
import javafx.scene.input.KeyCodeCombination;
|
|
import javafx.scene.input.KeyCodeCombination;
|
|
|
import javafx.scene.input.KeyCombination;
|
|
import javafx.scene.input.KeyCombination;
|
|
|
|
|
+import javafx.scene.web.WebView;
|
|
|
import javafx.stage.Stage;
|
|
import javafx.stage.Stage;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
@@ -67,6 +68,9 @@ public class Session extends Application {
|
|
|
KeyCombination restartKeyCombination = new KeyCodeCombination(KeyCode.R, KeyCombination.CONTROL_DOWN);
|
|
KeyCombination restartKeyCombination = new KeyCodeCombination(KeyCode.R, KeyCombination.CONTROL_DOWN);
|
|
|
scene.getAccelerators().put(restartKeyCombination, () -> handleRestartRequest(stage));
|
|
scene.getAccelerators().put(restartKeyCombination, () -> handleRestartRequest(stage));
|
|
|
|
|
|
|
|
|
|
+ KeyCombination helpKeyCombination = new KeyCodeCombination(KeyCode.F1);
|
|
|
|
|
+ scene.getAccelerators().put(helpKeyCombination, this::handleHelpRequest);
|
|
|
|
|
+
|
|
|
stage.show();
|
|
stage.show();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -102,4 +106,22 @@ public class Session extends Application {
|
|
|
Output.print(game.getPrologue());
|
|
Output.print(game.getPrologue());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private void handleHelpRequest() {
|
|
|
|
|
+ var helpStage = new Stage();
|
|
|
|
|
+ WebView webView = new WebView();
|
|
|
|
|
+
|
|
|
|
|
+ Scene helpScene = new Scene(webView);
|
|
|
|
|
+
|
|
|
|
|
+ helpStage.setScene(helpScene);
|
|
|
|
|
+ helpStage.setTitle("Schmorn Help");
|
|
|
|
|
+ helpStage.show();
|
|
|
|
|
+
|
|
|
|
|
+ var helpPath = Objects.requireNonNull(Session.class.getResource("help.html")).toExternalForm();
|
|
|
|
|
+
|
|
|
|
|
+ webView.getEngine().load(helpPath);
|
|
|
|
|
+
|
|
|
|
|
+ helpStage.setWidth(1280);
|
|
|
|
|
+ helpStage.setHeight(720);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|