Create real careers from the native wizard and preserve manager presentation (by Codex)

This commit is contained in:
Codex committed 2026-10-29 01:11:41 +01:00
1 parent 738ecc7a09
commit ce1535fe2d
38 files changed
+466 -75

No files matched your search

+15 -9
View File
@@ -86,6 +86,11 @@ void App::opening_restore_startup() {
}
}
bool App::opening_change(const std::string &kind) {
if(engine_mode_) {
if(!engine_opening_active())return false;
auto next=engine_opening_state_.at("opening_flow");const auto error=advance_opening_presentation(next,kind);if(!error.empty())return false;
engine_opening_state_["opening_flow"]=std::move(next);opening_due_=0;refresh();return true;
}
if (!source_)
return false;
const auto before = snap();
@@ -116,7 +121,7 @@ bool App::opening_change(const std::string &kind) {
return true;
}
bool App::opening_action(const std::string &action, Rml::Element *) {
if (scene_ != "opening" || !menu_.empty() || !popup_.empty())
if ((!engine_mode_&&scene_ != "opening") || (engine_mode_&&!engine_opening_active()) || !menu_.empty() || !popup_.empty())
return false;
if (action == "close")
return true;
@@ -125,14 +130,14 @@ bool App::opening_action(const std::string &action, Rml::Element *) {
kind = "next";
else if (action == "opening-play")
kind = opening_io_blocked_ &&
snap().state.at("opening_flow").at("playing").get<bool>()
(engine_mode_?engine_opening_state_:snap().state).at("opening_flow").at("playing").get<bool>()
? "reveal"
: "toggle";
else if (action == "opening-all")
kind = "skip";
else if (action == "opening-finish") {
const auto phase =
snap().state.at("opening_flow").at("phase").get<std::string>();
(engine_mode_?engine_opening_state_:snap().state).at("opening_flow").at("phase").get<std::string>();
if (phase == "done") {
scene_ = "desktop";
opening_due_ = 0;
@@ -145,7 +150,7 @@ bool App::opening_action(const std::string &action, Rml::Element *) {
if (!opening_change(kind))
return true;
const auto phase =
snap().state.at("opening_flow").at("phase").get<std::string>();
(engine_mode_?engine_opening_state_:snap().state).at("opening_flow").at("phase").get<std::string>();
if (phase == "done") {
scene_ = "desktop";
focus_after_render_.clear();
@@ -169,10 +174,10 @@ bool App::opening_event(Rml::Event &event) {
return false;
}
void App::opening_tick() {
if (scene_ != "opening" || !source_ || !menu_.empty() || !popup_.empty() ||
if ((!engine_mode_&&(scene_ != "opening" || !source_)) || (engine_mode_&&!engine_opening_active()) || !menu_.empty() || !popup_.empty() ||
opening_io_blocked_)
return;
const auto flow = snap().state.at("opening_flow");
const auto flow = (engine_mode_?engine_opening_state_:snap().state).at("opening_flow");
if (flow.at("phase") != "draw" || !flow.at("playing").get<bool>()) {
opening_due_ = 0;
return;
@@ -187,13 +192,14 @@ void App::opening_tick() {
if (now < opening_due_)
return;
if (opening_change("reveal")) {
if (snap().state.at("opening_flow").at("phase") == "overview")
if ((engine_mode_?engine_opening_state_:snap().state).at("opening_flow").at("phase") == "overview")
focus_after_render_ = "opening-finish";
opening_due_ = SDL_GetTicks64() + 900;
}
}
void App::handle_event(SDL_Event &event) {
if (event.type == SDL_QUIT) {
if(engine_creation_busy_){message("Die Partie wird noch vorbereitet. Bitte kurz warten.");return;}
if (engine_mode_) { engine_quit(); return; }
if (front_busy_) {
front_feedback_ = "Bitte den laufenden Import abwarten.";
@@ -209,8 +215,8 @@ void App::handle_event(SDL_Event &event) {
if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) {
desktop_cancel_drag();
if (scene_ == "opening" && source_ && !opening_io_blocked_ &&
snap().state.at("opening_flow").at("phase") == "draw" &&
snap().state.at("opening_flow").at("playing").get<bool>())
(engine_mode_?engine_opening_state_:snap().state).at("opening_flow").at("phase") == "draw" &&
(engine_mode_?engine_opening_state_:snap().state).at("opening_flow").at("playing").get<bool>())
opening_change("pause");
}
resize();