position_changed(pos);
});
-
// It's not really clear whether PgUp should be forwards or backwards,
// but mpv does at least up = forwards, so that's probably standard.
QShortcut *pgdown = new QShortcut(QKeySequence(Qt::Key_PageDown), this);
connect(ui->minus2s, &QPushButton::clicked, [this]() { ui->video->seek(-2000); });
connect(ui->plus2s, &QPushButton::clicked, [this]() { ui->video->seek(2000); });
+ connect(ui->video, &VideoWidget::mouse_back_clicked, [this]() { ui->video->seek(-2000); });
+ connect(ui->video, &VideoWidget::mouse_forward_clicked, [this]() { ui->video->seek(2000); });
connect(ui->minus1f, &QPushButton::clicked, [this]() { ui->video->seek_frames(-1); });
connect(ui->plus1f, &QPushButton::clicked, [this]() { ui->video->seek_frames(1); });
connect(ui->goal, &QPushButton::clicked, [this]() { set_current_event_type("goal"); });
connect(ui->offensive_soft_plus, &QPushButton::clicked, [this]() { set_current_event_type("offensive_soft_plus"); });
connect(ui->offensive_soft_minus, &QPushButton::clicked, [this]() { set_current_event_type("offensive_soft_minus"); });
- connect(ui->pull, &QPushButton::clicked, [this, events]() {
+ connect(ui->pull_or_was_d, &QPushButton::clicked, [this, events]() {
EventsModel::Status s = events->get_status_at(ui->video->get_position());
if (s.pull_state == EventsModel::Status::SHOULD_PULL) {
set_current_event_type("pull");
} else if (s.pull_state == EventsModel::Status::PULL_IN_AIR) {
insert_noplayer_event("pull_landed");
+ } else if (s.pull_state == EventsModel::Status::NOT_PULLING) {
+ set_current_event_type("was_d");
}
});
new_team.insert(players->get_player_id(row.row()));
}
events->set_team_at(ui->video->get_position(), new_team);
+ update_player_buttons(ui->video->get_position());
}
void MainWindow::update_ui_from_time(uint64_t t)
ui->goal->setEnabled(false);
ui->offensive_soft_plus->setEnabled(false);
ui->offensive_soft_minus->setEnabled(false);
- ui->pull->setEnabled(false);
+ ui->pull_or_was_d->setEnabled(false);
ui->interception->setEnabled(false);
ui->their_throwaway->setEnabled(false);
ui->our_defense->setEnabled(false);
}
// Defaults for pull-related buttons.
- ui->pull->setText("Pull (&p)");
+ ui->pull_or_was_d->setText("Pull (&p)");
ui->their_pull->setText("Their pull (&p)");
- ui->pull->setShortcut(QCoreApplication::translate("MainWindow", "P", nullptr));
+ ui->pull_or_was_d->setShortcut(QCoreApplication::translate("MainWindow", "P", nullptr));
ui->their_pull->setShortcut(QCoreApplication::translate("MainWindow", "P", nullptr));
ui->throwaway->setText("Throwaway (&t)");
ui->throwaway->setShortcut(QCoreApplication::translate("MainWindow", "T", nullptr));
if (s.pull_state == EventsModel::Status::SHOULD_PULL) {
- ui->pull->setEnabled(s.attack_state == EventsModel::Status::DEFENSE && has_selection_with_player);
+ ui->pull_or_was_d->setEnabled(s.attack_state == EventsModel::Status::DEFENSE && has_selection_with_player);
ui->their_pull->setEnabled(s.attack_state == EventsModel::Status::OFFENSE);
ui->catch_->setEnabled(false);
}
if (s.pull_state == EventsModel::Status::PULL_IN_AIR) {
if (s.attack_state == EventsModel::Status::DEFENSE) {
- ui->pull->setText("Pull landed (&p)");
- ui->pull->setShortcut(QCoreApplication::translate("MainWindow", "P", nullptr));
- ui->pull->setEnabled(true);
+ ui->pull_or_was_d->setText("Pull landed (&p)");
+ ui->pull_or_was_d->setShortcut(QCoreApplication::translate("MainWindow", "P", nullptr));
+ ui->pull_or_was_d->setEnabled(true);
ui->throwaway->setText("Pull OOB (&t)");
ui->throwaway->setShortcut(QCoreApplication::translate("MainWindow", "T", nullptr));
ui->throwaway->setEnabled(true);
} else {
- ui->pull->setEnabled(false);
+ ui->pull_or_was_d->setEnabled(false);
ui->throwaway->setEnabled(false);
}
ui->their_pull->setEnabled(false); // We don't track their pull landings; only by means of catch etc.
return;
}
+ // Not pulling, so reuse the pull button for got d-ed.
+ ui->pull_or_was_d->setText("Was d-ed (&z)");
+ ui->pull_or_was_d->setShortcut(QCoreApplication::translate("MainWindow", "Z", nullptr));
+ ui->pull_or_was_d->setEnabled(true);
+
ui->catch_->setEnabled(s.attack_state == EventsModel::Status::OFFENSE && has_selection_with_player);
ui->throwaway->setEnabled(s.attack_state == EventsModel::Status::OFFENSE && has_selection_with_player);
ui->drop->setEnabled(s.attack_state == EventsModel::Status::OFFENSE && has_selection_with_player);
ui->goal->setEnabled(s.attack_state == EventsModel::Status::OFFENSE && has_selection_with_player);
ui->offensive_soft_plus->setEnabled(s.attack_state == EventsModel::Status::OFFENSE && has_selection_with_player);
ui->offensive_soft_minus->setEnabled(s.attack_state == EventsModel::Status::OFFENSE && has_selection_with_player);
- ui->pull->setEnabled(false);
+ ui->pull_or_was_d->setEnabled(s.attack_state == EventsModel::Status::OFFENSE && has_selection_with_player); // Was d-ed.
ui->interception->setEnabled(s.attack_state == EventsModel::Status::DEFENSE && has_selection_with_player);
ui->their_throwaway->setEnabled(s.attack_state == EventsModel::Status::DEFENSE);