Allow character select list to refresh even if client is already loaded in (#655)
* Allow "SC" packet to be used to refresh the character list even if the client is loaded in Fix tree list of characters not being cleared properly between "SC" packets Fix client theme breaking when joining a server with empty character select list * Do my review suggestions on CW's behalf Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
This commit is contained in:
parent
5657ac74ae
commit
fa6eef8eba
@ -73,6 +73,7 @@ public:
|
|||||||
void append_evidence(evi_type p_evi) { evidence_list.append(p_evi); }
|
void append_evidence(evi_type p_evi) { evidence_list.append(p_evi); }
|
||||||
void append_music(QString f_music) { music_list.append(f_music); }
|
void append_music(QString f_music) { music_list.append(f_music); }
|
||||||
void append_area(QString f_area) { area_list.append(f_area); }
|
void append_area(QString f_area) { area_list.append(f_area); }
|
||||||
|
void clear_chars() { char_list.clear(); }
|
||||||
void clear_music() { music_list.clear(); }
|
void clear_music() { music_list.clear(); }
|
||||||
void clear_areas() { area_list.clear(); }
|
void clear_areas() { area_list.clear(); }
|
||||||
|
|
||||||
|
@ -243,6 +243,7 @@ void Courtroom::character_loading_finished()
|
|||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
ui_char_button_list.clear();
|
ui_char_button_list.clear();
|
||||||
|
ui_char_list->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// First, we'll make all the character buttons in the very beginning.
|
// First, we'll make all the character buttons in the very beginning.
|
||||||
@ -305,7 +306,6 @@ void Courtroom::character_loading_finished()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui_char_list->expandAll();
|
ui_char_list->expandAll();
|
||||||
filter_character_list();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Courtroom::filter_character_list()
|
void Courtroom::filter_character_list()
|
||||||
|
@ -1310,13 +1310,13 @@ void Courtroom::done_received()
|
|||||||
|
|
||||||
if (char_list.size() > 0)
|
if (char_list.size() > 0)
|
||||||
{
|
{
|
||||||
set_char_select_page();
|
|
||||||
set_char_select();
|
set_char_select();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
update_character(m_cid);
|
update_character(m_cid);
|
||||||
enter_courtroom();
|
enter_courtroom();
|
||||||
|
set_courtroom_size();
|
||||||
}
|
}
|
||||||
|
|
||||||
set_mute_list();
|
set_mute_list();
|
||||||
|
@ -240,9 +240,9 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (header == "SC") {
|
else if (header == "SC") {
|
||||||
if (!courtroom_constructed || courtroom_loaded)
|
if (!courtroom_constructed)
|
||||||
goto end;
|
goto end;
|
||||||
|
w_courtroom->clear_chars();
|
||||||
for (int n_element = 0; n_element < f_contents.size(); ++n_element) {
|
for (int n_element = 0; n_element < f_contents.size(); ++n_element) {
|
||||||
QStringList sub_elements = f_contents.at(n_element).split("&");
|
QStringList sub_elements = f_contents.at(n_element).split("&");
|
||||||
|
|
||||||
@ -256,14 +256,14 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
|
|||||||
// temporary. the CharsCheck packet sets this properly
|
// temporary. the CharsCheck packet sets this properly
|
||||||
f_char.taken = false;
|
f_char.taken = false;
|
||||||
|
|
||||||
++loaded_chars;
|
w_courtroom->append_char(f_char);
|
||||||
|
|
||||||
|
if (!courtroom_loaded) {
|
||||||
|
++loaded_chars;
|
||||||
w_lobby->set_loading_text(tr("Loading chars:\n%1/%2")
|
w_lobby->set_loading_text(tr("Loading chars:\n%1/%2")
|
||||||
.arg(QString::number(loaded_chars))
|
.arg(QString::number(loaded_chars))
|
||||||
.arg(QString::number(char_list_size)));
|
.arg(QString::number(char_list_size)));
|
||||||
|
|
||||||
w_courtroom->append_char(f_char);
|
|
||||||
|
|
||||||
int total_loading_size =
|
int total_loading_size =
|
||||||
char_list_size * 2 + evidence_list_size + music_list_size;
|
char_list_size * 2 + evidence_list_size + music_list_size;
|
||||||
int loading_value = int(
|
int loading_value = int(
|
||||||
@ -272,8 +272,12 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
|
|||||||
100);
|
100);
|
||||||
w_lobby->set_loading_value(loading_value);
|
w_lobby->set_loading_value(loading_value);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!courtroom_loaded)
|
||||||
send_server_packet(new AOPacket("RM#%"));
|
send_server_packet(new AOPacket("RM#%"));
|
||||||
|
else
|
||||||
|
w_courtroom->character_loading_finished();
|
||||||
append_to_demofile(f_packet_encoded);
|
append_to_demofile(f_packet_encoded);
|
||||||
}
|
}
|
||||||
else if (header == "SM") {
|
else if (header == "SM") {
|
||||||
|
Loading…
Reference in New Issue
Block a user