});
connect(ui->drop, &QPushButton::clicked, [this]() { set_current_event_type("drop"); });
connect(ui->goal, &QPushButton::clicked, [this]() { set_current_event_type("goal"); });
+ connect(ui->stallout, &QPushButton::clicked, [this]() { set_current_event_type("stallout"); });
connect(ui->soft_plus, &QPushButton::clicked, [this, events]() {
EventsModel::Status s = events->get_status_at(ui->video->get_position());
if (s.attack_state == EventsModel::Status::OFFENSE) {
});
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) {
+ if (s.pull_state == EventsModel::Status::SHOULD_PULL ||
+ events->get_status_at(ui->video->get_position() - 1).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");
QItemSelectionModel *select = ui->event_view->selectionModel();
if (select->hasSelection()) {
int row = select->selectedRows().front().row(); // Should only be one, due to our selection behavior.
- string expected_type = offense ? "formation_offense" : "formation_defense";
+ EventType expected_type = offense ? EventType::FORMATION_OFFENSE : EventType::FORMATION_DEFENSE;
if (events->get_event_type(row) == expected_type) {
events->set_event_formation(row, formation_id);
update_ui_from_time(ui->video->get_position());
ui->throwaway->setEnabled(false);
ui->drop->setEnabled(false);
ui->goal->setEnabled(false);
+ ui->stallout->setEnabled(false);
ui->soft_plus->setEnabled(false);
ui->soft_minus->setEnabled(false);
ui->pull_or_was_d->setEnabled(false);
ui->throwaway->setText("Throwaway (&t)");
ui->throwaway->setShortcut(QCoreApplication::translate("MainWindow", "T", nullptr));
- if (s.pull_state == EventsModel::Status::SHOULD_PULL) {
+ if (s.pull_state == EventsModel::Status::SHOULD_PULL ||
+ (has_selection_with_player && events->get_status_at(ui->video->get_position() - 1).pull_state == EventsModel::Status::SHOULD_PULL)) { // Can change this event to pull.
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->throwaway->setEnabled(false);
ui->drop->setEnabled(false);
ui->goal->setEnabled(false);
+ ui->stallout->setEnabled(false);
ui->soft_plus->setEnabled(false);
ui->soft_minus->setEnabled(false);
ui->interception->setEnabled(false);
ui->catch_->setEnabled(false);
ui->drop->setEnabled(false);
ui->goal->setEnabled(false);
+ ui->stallout->setEnabled(false);
ui->soft_plus->setEnabled(false);
ui->soft_minus->setEnabled(false);
ui->interception->setEnabled(false);
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->stallout->setEnabled(s.attack_state == EventsModel::Status::OFFENSE && has_selection_with_player);
ui->soft_plus->setEnabled(s.attack_state != EventsModel::Status::NOT_STARTED && has_selection_with_player);
ui->soft_minus->setEnabled(s.attack_state != EventsModel::Status::NOT_STARTED && has_selection_with_player);
ui->pull_or_was_d->setEnabled(s.attack_state == EventsModel::Status::OFFENSE && has_selection_with_player); // Was d-ed.