]> git.sesse.net Git - pkanalytics/commitdiff
Hook up our_defense.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 May 2023 17:33:43 +0000 (19:33 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 May 2023 17:33:43 +0000 (19:33 +0200)
events.cpp
main.cpp

index 3258c7739d1bce9d548ab33806b4045ac4f065a6..ded1b6f8124281c3a6297c7fc000cfa4563788d3 100644 (file)
@@ -258,6 +258,10 @@ EventsModel::Status EventsModel::get_status_at(uint64_t t)
                        s.offense = true;
                        last_gained_possession = e.t;
                }
+               if (e.type == "defense") {
+                       s.offense = true;
+                       num_touches = 0;
+               }
                if (e.type == "drop" || e.type == "throwaway") {
                        s.offense = false;
                        num_touches = 0;
index 18eb6177be122d579b196cbf1a8b70149670d9c9..d9c6e88b9a5aa518fdce4c770580e2969361f912 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -103,6 +103,7 @@ MainWindow::MainWindow(EventsModel *events, PlayersModel *players) : events(even
        connect(ui->their_throwaway, &QPushButton::clicked, [this]() { insert_noplayer_event("their_throwaway"); });
        connect(ui->their_goal, &QPushButton::clicked, [this]() { insert_noplayer_event("their_goal"); });
        connect(ui->their_pull, &QPushButton::clicked, [this]() { insert_noplayer_event("their_pull"); });
+       connect(ui->our_defense, &QPushButton::clicked, [this]() { set_current_event_type("defense"); });  // TODO: player-connected
 
        // Misc. events
        connect(ui->substitution, &QPushButton::clicked, [this]() { make_substitution(); });