diff options
| author | Crystalwarrior <Varsash@Gmail.com> | 2020-07-31 00:25:19 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-30 16:25:19 -0500 |
| commit | 1802f6309f5804c221a41fc3a487d759369df0e3 (patch) | |
| tree | 76a14d47db57ab361df53a0df84c4d1e87f5f4a7 /src/charselect.cpp | |
| parent | 906a600a6433531010e6e6493ebaf786823edb8c (diff) | |
Make spectator function as a character with ID -1 (#211)
- Don't hide spectator button anymore.
- Make the spectator button properly send the char switch packet.
- Fix the spectator button not properly loading the courtroom and music list etc.
Diffstat (limited to 'src/charselect.cpp')
| -rw-r--r-- | src/charselect.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/charselect.cpp b/src/charselect.cpp index 77e2c95a..8e0aab5e 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -123,14 +123,17 @@ void Courtroom::set_char_select_page() void Courtroom::char_clicked(int n_char) { - QString char_ini_path = - ao_app->get_character_path(char_list.at(n_char).name, "char.ini"); + if (n_char != -1) + { + QString char_ini_path = + ao_app->get_character_path(char_list.at(n_char).name, "char.ini"); - qDebug() << "char_ini_path" << char_ini_path; + qDebug() << "char_ini_path" << char_ini_path; - if (!file_exists(char_ini_path)) { - call_notice("Could not find " + char_ini_path); - return; + if (!file_exists(char_ini_path)) { + call_notice("Could not find " + char_ini_path); + return; + } } if (n_char != m_cid) { @@ -144,6 +147,9 @@ void Courtroom::char_clicked(int n_char) update_character(n_char); enter_courtroom(); + + if (n_char != -1) + ui_ic_chat_name->setPlaceholderText(char_list.at(n_char).name); } void Courtroom::put_button_in_place(int starting, int chars_on_this_page) |
