diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-09-18 15:46:43 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-09-18 15:46:43 +0300 |
| commit | 04daff7446061bb87bdf85ed080079041a75f142 (patch) | |
| tree | 09983110f28c3414a854bf5a523f1221e55ce8ec | |
| parent | f8d3d5d8fdeda3d01595e02b7c616606be32f6aa (diff) | |
When the realization button is pressed, update the Effects thing too.
| -rw-r--r-- | include/courtroom.h | 1 | ||||
| -rw-r--r-- | src/courtroom.cpp | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/courtroom.h b/include/courtroom.h index 6ba3d651..a980aba8 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -627,6 +627,7 @@ private slots: void set_effects_dropdown(); void on_effects_dropdown_changed(int p_index); + bool effects_dropdown_find_and_set(QString effect); QString get_char_sfx(); int get_char_sfx_delay(); diff --git a/src/courtroom.cpp b/src/courtroom.cpp index bcf3a42a..423c5602 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -3564,6 +3564,20 @@ void Courtroom::on_effects_dropdown_changed(int p_index) ui_ic_chat_message->setFocus(); } +bool Courtroom::effects_dropdown_find_and_set(QString effect) +{ + for (int i = 0; i < ui_effects_dropdown->count(); ++i) + { + QString entry = ui_effects_dropdown->itemText(i); + if (entry == effect) + { + ui_effects_dropdown->setCurrentIndex(i); + return true; + } + } + return false; +} + QString Courtroom::get_char_sfx() { QString sfx = ui_sfx_dropdown->itemText(ui_sfx_dropdown->currentIndex()); @@ -3775,11 +3789,14 @@ void Courtroom::on_realization_clicked() if (realization_state == 0) { realization_state = 1; + effects_dropdown_find_and_set("realization"); ui_realization->set_image("realization_pressed"); } else { realization_state = 0; + ui_effects_dropdown->setCurrentIndex(0); + on_effects_dropdown_changed(ui_effects_dropdown->currentIndex()); ui_realization->set_image("realization"); } |
