@@ -1420,17 +1420,13 @@ void Courtroom::set_background(QString p_background, bool display)
14201420
14211421void Courtroom::set_side (QString p_side)
14221422{
1423- QString f_side;
1424- if (p_side == ao_app->get_char_side (current_char))
1425- p_side = " " ;
1426- current_side = p_side;
1427- if (current_side == " " ) {
1428- f_side = ao_app->get_char_side (current_char);
1429- ui_pos_remove->hide ();
1423+ if (p_side.isEmpty () || p_side == ao_app->get_char_side (current_char)) {
1424+ ui_pos_remove->hide ();
1425+ current_side = ao_app->get_char_side (current_char);
14301426 }
14311427 else {
1432- f_side = current_side ;
1433- ui_pos_remove-> show () ;
1428+ ui_pos_remove-> show () ;
1429+ current_side = p_side ;
14341430 }
14351431
14361432 set_judge_buttons ();
@@ -1440,7 +1436,7 @@ void Courtroom::set_side(QString p_side)
14401436 ui_pos_dropdown->blockSignals (true );
14411437 for (int i = 0 ; i < ui_pos_dropdown->count (); ++i) {
14421438 QString pos = ui_pos_dropdown->itemText (i);
1443- if (pos == f_side ) {
1439+ if (pos == current_side ) {
14441440
14451441 // Set the index on dropdown ui element to let you know what pos you're on
14461442 // right now
@@ -1453,7 +1449,7 @@ void Courtroom::set_side(QString p_side)
14531449 }
14541450 }
14551451 // We will only get there if we failed the last step
1456- ui_pos_dropdown->setEditText (f_side );
1452+ ui_pos_dropdown->setEditText (current_side );
14571453 // Unblock the signals so the element can be used for setting pos again
14581454 ui_pos_dropdown->blockSignals (false );
14591455}
@@ -1479,7 +1475,6 @@ void Courtroom::set_pos_dropdown(QStringList pos_dropdowns)
14791475
14801476 // Unblock the signals so the element can be used for setting pos again
14811477 ui_pos_dropdown->blockSignals (false );
1482- set_side (current_side);
14831478}
14841479
14851480void 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)
15061501 }
15071502
15081503 current_char = f_char;
1504+ current_side = ao_app->get_char_side (current_char);
15091505 set_side (current_side);
15101506
15111507 set_text_color_dropdown ();
0 commit comments