From 144a5bb64b5dab98d9fa631d8bf627c650d242b1 Mon Sep 17 00:00:00 2001 From: Cerapter Date: Mon, 17 Dec 2018 10:46:09 +0100 Subject: [PATCH 1/2] Fixed the theme issues (casing button, emote page switcher buttons). --- base/themes/default/courtroom_design.ini | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/base/themes/default/courtroom_design.ini b/base/themes/default/courtroom_design.ini index bc07b3f..587d7ee 100644 --- a/base/themes/default/courtroom_design.ini +++ b/base/themes/default/courtroom_design.ini @@ -72,12 +72,12 @@ blip_slider = 326, 648, 140, 16 ; page. Having either number lower than 49 crashes the client when you try to ; pick a character. If you want X columns and Y rows, you would change it to ; 49X, 49Y (ie. 490, 147 if you want 10 columns and 3 rows) -emotes = 10, 342, 490, 98 +emotes = 5, 342, 490, 98 emote_button_spacing = 9, 9 ; Page togglers for emotes -emote_left = 373, 475, 17, 17 -emote_right = 392, 475, 17, 17 +emote_left = 5, 438, 17, 17 +emote_right = 470, 438, 17, 17 ; Emote dropdown/emote names - Change '125' to make it longer/shorter and ; display the full emote name or truncate it based on length @@ -234,3 +234,10 @@ area_rp_color = 200, 52, 252 area_gaming_color = 55, 255, 255 area_locked_color = 165, 43, 43 +; These two are casing-related inputs. +; "casing" is a tickbox that toggles whether you should receive case alerts or +; not (you can set your preferences, and its default value, in the Settings!) +; "casing_button" is an interface to help you announce a case (you have to be +; a CM first to be able to announce cases). +casing = 200, 560, 80, 21 +casing_button = 173, 637, 60, 23 \ No newline at end of file From 73b6e72ab90934eea7118793a1b71b9b53d508c8 Mon Sep 17 00:00:00 2001 From: Cerapter Date: Mon, 17 Dec 2018 11:08:20 +0100 Subject: [PATCH 2/2] Fix judge buttons not appearing & crash if MS goes down during play. The former was caused by the position dropdown simply not having code to make the judge buttons appear. Alongside that, the issue(?) where `/pos judddd` (or variations) would not put the user in the judge position, but gave them the buttons anyway. The latter was caused by a simple mistake. We deleted the Lobby (and the Courtroom) frequently, however, we never did set its (their) pointer(s) back to null -- so they pointer to trash data, and the `if (w_lobby != nullptr)` part never failed. This is also now fixed, and deletion of the Lobby or the Courtroom also brings about the nulling of their pointers. --- aoapplication.cpp | 4 +++- courtroom.cpp | 49 +++++++++++++++++++++++++++++++---------------- courtroom.h | 3 +++ 3 files changed, 38 insertions(+), 18 deletions(-) diff --git a/aoapplication.cpp b/aoapplication.cpp index cb98aef..d7c3e66 100644 --- a/aoapplication.cpp +++ b/aoapplication.cpp @@ -57,6 +57,7 @@ void AOApplication::destruct_lobby() } delete w_lobby; + w_lobby = nullptr; lobby_constructed = false; } @@ -86,6 +87,7 @@ void AOApplication::destruct_courtroom() } delete w_courtroom; + w_courtroom = nullptr; courtroom_constructed = false; } @@ -157,7 +159,7 @@ void AOApplication::ms_connect_finished(bool connected, bool will_retry) { if (will_retry) { - if (w_lobby != nullptr) + if (lobby_constructed) w_lobby->append_error("Error connecting to master server. Will try again in " + QString::number(net_manager->ms_reconnect_delay_ms / 1000.f) + " seconds."); } diff --git a/courtroom.cpp b/courtroom.cpp index c187e9c..2769f77 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -2585,6 +2585,32 @@ void Courtroom::set_hp_bar(int p_bar, int p_state) } } +void Courtroom::toggle_judge_buttons(bool is_on) +{ + if (is_on) + { + ui_witness_testimony->show(); + ui_cross_examination->show(); + ui_guilty->show(); + ui_not_guilty->show(); + ui_defense_minus->show(); + ui_defense_plus->show(); + ui_prosecution_minus->show(); + ui_prosecution_plus->show(); + } + else + { + ui_witness_testimony->hide(); + ui_cross_examination->hide(); + ui_guilty->hide(); + ui_not_guilty->hide(); + ui_defense_minus->hide(); + ui_defense_plus->hide(); + ui_prosecution_minus->hide(); + ui_prosecution_plus->hide(); + } +} + void Courtroom::mod_called(QString p_ip) { ui_server_chatlog->append(p_ip); @@ -2621,27 +2647,13 @@ void Courtroom::on_ooc_return_pressed() if (ooc_message.startsWith("/pos")) { - if (ooc_message.startsWith("/pos jud")) + if (ooc_message == "/pos jud") { - ui_witness_testimony->show(); - ui_cross_examination->show(); - ui_guilty->show(); - ui_not_guilty->show(); - ui_defense_minus->show(); - ui_defense_plus->show(); - ui_prosecution_minus->show(); - ui_prosecution_plus->show(); + toggle_judge_buttons(true); } else { - ui_witness_testimony->hide(); - ui_cross_examination->hide(); - ui_guilty->hide(); - ui_not_guilty->hide(); - ui_defense_minus->hide(); - ui_defense_plus->hide(); - ui_prosecution_minus->hide(); - ui_prosecution_plus->hide(); + toggle_judge_buttons(false); } } else if (ooc_message.startsWith("/login")) @@ -2891,6 +2903,8 @@ void Courtroom::on_pos_dropdown_changed(int p_index) if (p_index < 0 || p_index > 5) return; + toggle_judge_buttons(false); + QString f_pos; switch (p_index) @@ -2906,6 +2920,7 @@ void Courtroom::on_pos_dropdown_changed(int p_index) break; case 3: f_pos = "jud"; + toggle_judge_buttons(true); break; case 4: f_pos = "hld"; diff --git a/courtroom.h b/courtroom.h index 874b682..ec9f9ef 100644 --- a/courtroom.h +++ b/courtroom.h @@ -204,6 +204,9 @@ public: //state is an number between 0 and 10 inclusive void set_hp_bar(int p_bar, int p_state); + //Toggles the judge buttons, whether they should appear or not. + void toggle_judge_buttons(bool is_on); + void announce_case(QString title, bool def, bool pro, bool jud, bool jur, bool steno); void check_connection_received();