From 510c0f4b17f24eb534d22654a41e9157c89a8211 Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Sun, 21 Mar 2021 05:12:44 +0300 Subject: Add timer packets to demo playback (#494) When the demo skips by some number of seconds, the timer will also skip forward by that duration. Co-authored-by: in1tiate <32779090+in1tiate@users.noreply.github.com> Co-authored-by: oldmud0 --- src/aoapplication.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/aoapplication.cpp') diff --git a/src/aoapplication.cpp b/src/aoapplication.cpp index 00845385..00175e56 100644 --- a/src/aoapplication.cpp +++ b/src/aoapplication.cpp @@ -48,7 +48,7 @@ void AOApplication::construct_lobby() if (demo_server) demo_server->deleteLater(); - demo_server = new DemoServer(); + demo_server = new DemoServer(this); w_lobby->show(); } @@ -79,6 +79,14 @@ void AOApplication::construct_courtroom() int x = (geometry.width() - w_courtroom->width()) / 2; int y = (geometry.height() - w_courtroom->height()) / 2; w_courtroom->move(x, y); + + if (demo_server != nullptr) { + QObject::connect(demo_server, &DemoServer::skip_timers, + w_courtroom, &Courtroom::skip_clocks); + } + else { + qDebug() << "W: demo server did not exist during courtroom construction"; + } } void AOApplication::destruct_courtroom() -- cgit