Bind native desk and training camps to Modern OBS careers (by Codex)

This commit is contained in:
Codex committed 2026-10-27 22:00:10 +01:00
1 parent 1fb6499b15
commit 85a1fe5a95
19 files changed
+733 -46

No files matched your search

+9 -2
View File
@@ -123,6 +123,7 @@ void App::drag_event(Rml::Event &event) {
}
void App::ProcessEvent(Rml::Event &event) try {
const auto type = event.GetType();
if (engine_mode_) { engine_event(event); return; }
// Native widgets can emit intermediate selected values while their options
// are being constructed. Opening a squad menu must stay read-only.
if (setting_menu_markup_ && (menu_ == "lineup" || menu_ == "transfer" || menu_ == "news" || menu_ == "settings" || menu_=="widgets" || menu_=="save" || menu_=="load" || menu_=="view-save" || menu_=="view-load") &&
@@ -898,7 +899,11 @@ void App::script() {
try {
const auto command = Json::parse(line);
const auto type = command.value("type", std::string());
if(type=="window-resize-probe"){
if (type == "engine-wait") {
const auto until = SDL_GetTicks64() + command.value("timeout_ms", uint64_t(300000));
while (engine_busy_ && SDL_GetTicks64() < until) { pump_events(); frame(); SDL_Delay(10); }
if (engine_busy_) throw editor::Error("Engine-Vorgang hat das QA-Zeitlimit überschritten.");
} else if(type=="window-resize-probe"){
// QA-only synthetic event: no OS window or mouse coordinate is changed.
int w,h,pw,ph;SDL_GetWindowSize(video_.window,&w,&h);video_.drawable_size(pw,ph);
const auto before=context_->GetDimensions();SDL_Event probe{};probe.type=SDL_WINDOWEVENT;probe.window.windowID=SDL_GetWindowID(video_.window);probe.window.event=SDL_WINDOWEVENT_SIZE_CHANGED;probe.window.data1=std::max(1,w/2);probe.window.data2=std::max(1,h/2);handle_event(probe);
@@ -975,6 +980,7 @@ void App::script() {
} else if (type == "screenshot")
screenshot(editor::path(command.at("path").get<std::string>()));
else if (type == "checkpoint") {
if (engine_mode_) throw editor::Error("Der UI-Demo-Checkpoint speichert keine Enginekarriere. Bitte die OBS-Speicheraktion verwenden.");
init_desktop();
source_->save(editor::path(command.at("path").get<std::string>()),
desktop_);
@@ -984,6 +990,7 @@ void App::script() {
Json{{"scene", scene_},
{"menu", menu_},
{"live_view", live_snapshot()},
{"engine_view", engine_snapshot()},
{"report_picker", report_picker_},
{"planning_dialog", planning_dialog_},
{"bank_view", bank_view_}, {"bank_property", bank_property_}, {"bank_stock", bank_stock_},
@@ -1004,7 +1011,7 @@ void App::script() {
{"amount_editor", amount_ ? Json{{"title", amount_->request.title}, {"raw", amount_->raw}, {"review", amount_->review}, {"error", amount_error()}} : Json()},
{"display_metrics",[&](){int w,h,pw,ph;SDL_GetWindowSize(video_.window,&w,&h);video_.drawable_size(pw,ph);const auto d=context_->GetDimensions();return Json{{"logical",{w,h}},{"drawable",{pw,ph}},{"context",{d.x,d.y}}};}()},
{"source_revision", source_ ? Json(snap().revision) : Json()},
{"game_dirty", source_ && source_->dirty()},
{"game_dirty", engine_mode_ ? engine_dirty_ : source_ && source_->dirty()},
{"desktop_dirty", desktop_ != saved_desktop_},
{"almanac_view", {{"year", almanac_year_}, {"date", almanac_day_}, {"id", almanac_match_}, {"tab", almanac_tab_}}},
{"report_detail", {{"kind", report_detail_kind_},