Port career setup, manager hub and context-aware native UI (by Codex)
This commit is contained in:
1 parent
d88bf2872a
commit
d085697bb9
37 files changed
+1447
-421
No files matched your search
@@ -27,6 +27,7 @@ bool App::opening_pending() const {
|
||||
if (!source_)
|
||||
return false;
|
||||
const auto state = snap().state;
|
||||
if(state.value("career",Json::object()).value("ended",false))return false;
|
||||
const auto &flow = state.at("opening_flow");
|
||||
return flow.at("created").get<bool>() && flow.at("phase") != "done";
|
||||
}
|
||||
@@ -70,6 +71,7 @@ void App::opening_restore_startup() {
|
||||
auto checkpoint = data.at("state");
|
||||
checkpoint["desktop"] = data.at("desktop");
|
||||
const auto layout = demo->load_data(std::move(checkpoint), false);
|
||||
if(demo->snapshot().state.value("career",Json::object()).value("ended",false))return;
|
||||
const auto flow = demo->snapshot().state.at("opening_flow");
|
||||
if (!flow.at("created").get<bool>() || flow.at("phase") == "done")
|
||||
return;
|
||||
@@ -211,6 +213,11 @@ void App::handle_event(SDL_Event &event) {
|
||||
opening_change("pause");
|
||||
}
|
||||
resize();
|
||||
if(event.window.event==SDL_WINDOWEVENT_SIZE_CHANGED || event.window.event==SDL_WINDOWEVENT_RESIZED || event.window.event==SDL_WINDOWEVENT_DISPLAY_CHANGED){
|
||||
// resize() already uses the drawable size. The SDL2 Rml backend would
|
||||
// replace it with logical event dimensions on SIZE_CHANGED.
|
||||
dirty_=true;return;
|
||||
}
|
||||
}
|
||||
int w, h, pw, ph;
|
||||
SDL_GetWindowSize(video_.window, &w, &h);
|
||||
|
||||
Reference in new issue
Block a user