void MainWindow::insert_event(int button_id)
{
uint64_t t = video->position();
- set<int> team = events->get_team_at(t);
+ vector<int> team = events->sort_team(events->get_team_at(t));
if (button_id > team.size()) {
return;
}
- int player_id = *next(team.begin(), button_id - 1);
+ int player_id = team[button_id - 1];
EventsModel::Status s = events->get_status_at(t);
void MainWindow::update_player_buttons(uint64_t t)
{
- // FIXME: sort by number, instead of by internal ID
QPushButton *buttons[] = {
ui->player_1,
ui->player_2,
};
const char shortcuts[] = "qweasdf";
int num_players = 0;
- for (int player_id : events->get_team_at(t)) {
+ for (int player_id : events->sort_team(events->get_team_at(t))) {
QPushButton *btn = buttons[num_players];
string label = players->get_player_name_by_id(player_id) + " (&" + shortcuts[num_players] + ")";
char shortcut[2] = "";