diff options
| author | Salanto <62221668+Salanto@users.noreply.github.com> | 2023-01-29 22:11:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-29 22:11:04 +0100 |
| commit | 50beb7de444e8cd544702e00da945853b9929bed (patch) | |
| tree | 7eacf19f5860d3d26c918ec7a6956d9c515f2dce /src/courtroom.cpp | |
| parent | 74b02513e36063dabcd8c3b38d18285176406913 (diff) | |
Fix incorrect judge-button display behaviour(#884)
Co-authored-by: stonedDiscord <Tukz@gmx.de>
Diffstat (limited to 'src/courtroom.cpp')
| -rw-r--r-- | src/courtroom.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index acbcd1de..a08b5e13 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1420,17 +1420,13 @@ void Courtroom::set_background(QString p_background, bool display) void Courtroom::set_side(QString p_side) { - QString f_side; - if (p_side == ao_app->get_char_side(current_char)) - p_side = ""; - current_side = p_side; - if (current_side == "") { - f_side = ao_app->get_char_side(current_char); - ui_pos_remove->hide(); + if (p_side.isEmpty() || p_side == ao_app->get_char_side(current_char)) { + ui_pos_remove->hide(); + current_side = ao_app->get_char_side(current_char); } else { - f_side = current_side; - ui_pos_remove->show(); + ui_pos_remove->show(); + current_side = p_side; } set_judge_buttons(); @@ -1440,7 +1436,7 @@ void Courtroom::set_side(QString p_side) ui_pos_dropdown->blockSignals(true); for (int i = 0; i < ui_pos_dropdown->count(); ++i) { QString pos = ui_pos_dropdown->itemText(i); - if (pos == f_side) { + if (pos == current_side) { // Set the index on dropdown ui element to let you know what pos you're on // right now @@ -1453,7 +1449,7 @@ void Courtroom::set_side(QString p_side) } } // We will only get there if we failed the last step - ui_pos_dropdown->setEditText(f_side); + ui_pos_dropdown->setEditText(current_side); // Unblock the signals so the element can be used for setting pos again ui_pos_dropdown->blockSignals(false); } @@ -1479,7 +1475,6 @@ void Courtroom::set_pos_dropdown(QStringList pos_dropdowns) // Unblock the signals so the element can be used for setting pos again ui_pos_dropdown->blockSignals(false); - set_side(current_side); } void Courtroom::update_character(int p_cid, QString char_name, bool reset_emote) @@ -1506,6 +1501,7 @@ void Courtroom::update_character(int p_cid, QString char_name, bool reset_emote) } current_char = f_char; + current_side = ao_app->get_char_side(current_char); set_side(current_side); set_text_color_dropdown(); |
