fixed some objection when communicating with legacy AO

This commit is contained in:
David Skoland 2017-02-10 14:38:19 +01:00
parent afb22c8564
commit 8428939fd3
3 changed files with 16 additions and 21 deletions

View File

@ -47,6 +47,9 @@ public:
bool ao2_features = false; bool ao2_features = false;
bool yellow_text_enabled = false; bool yellow_text_enabled = false;
bool prezoom_enabled = false;
bool flipping_enabled = false;
bool custom_objection_enabled = false;
///////////////loading info/////////////////// ///////////////loading info///////////////////

View File

@ -753,21 +753,20 @@ void Courtroom::on_chat_return_pressed()
int f_emote_mod = ao_app->get_emote_mod(current_char, current_emote); int f_emote_mod = ao_app->get_emote_mod(current_char, current_emote);
if (ui_pre->isChecked()) //needed or else legacy won't understand what we're saying
if (objection_state > 0)
f_emote_mod = 2;
else if (ui_pre->isChecked())
{ {
if (f_emote_mod == 0) if (f_emote_mod == 0)
f_emote_mod = 1; f_emote_mod = 1;
else if (f_emote_mod == 2) else if (f_emote_mod == 5 && ao_app->prezoom_enabled)
f_emote_mod = 3;
else if (f_emote_mod == 5)
f_emote_mod = 4; f_emote_mod = 4;
} }
else else
{ {
if (f_emote_mod == 1) if (f_emote_mod == 1)
f_emote_mod = 0; f_emote_mod = 0;
else if (f_emote_mod == 3)
f_emote_mod = 2;
else if (f_emote_mod == 4) else if (f_emote_mod == 4)
f_emote_mod = 5; f_emote_mod = 5;
} }
@ -779,7 +778,7 @@ void Courtroom::on_chat_return_pressed()
QString f_obj_state; QString f_obj_state;
if ((objection_state > 3 && !ao_app->ao2_features) || if ((objection_state == 4 && !ao_app->custom_objection_enabled) ||
(objection_state < 0)) (objection_state < 0))
f_obj_state = "0"; f_obj_state = "0";
else else
@ -854,6 +853,8 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
previous_ic_message = f_message; previous_ic_message = f_message;
qDebug() << "objection_mod of received message: " << m_chatmessage[OBJECTION_MOD];
int objection_mod = m_chatmessage[OBJECTION_MOD].toInt(); int objection_mod = m_chatmessage[OBJECTION_MOD].toInt();
//if an objection is used //if an objection is used
@ -878,16 +879,13 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
qDebug() << "W: Logic error in objection switch statement!"; qDebug() << "W: Logic error in objection switch statement!";
} }
//means we are in a state of objecting
//anim_state = 0;
int emote_mod = m_chatmessage[EMOTE_MOD].toInt(); int emote_mod = m_chatmessage[EMOTE_MOD].toInt();
switch (emote_mod) switch (emote_mod)
{ {
//we change the chatmessage from no preanim to preanim, see documentation //we change the chatmessage from no preanim to preanim, see documentation
case 0: case 2: case 0: case 2:
m_chatmessage[EMOTE_MOD] = QString::number(++emote_mod); m_chatmessage[EMOTE_MOD] = "1";
break; break;
case 5: case 5:
m_chatmessage[EMOTE_MOD] = QString::number(--emote_mod); m_chatmessage[EMOTE_MOD] = QString::number(--emote_mod);
@ -1142,15 +1140,9 @@ void Courtroom::set_scene()
ui_vp_background->set_image(f_image); ui_vp_background->set_image(f_image);
//now for the hard part: desks //no-desk-emotes have been temporarily reverted
int emote_mod = m_chatmessage[EMOTE_MOD].toInt(); //we're done if one of the non-desk positions is the current one(jud, hlp and hld)
if (f_side == "jud" ||
//desks show on emote modifier 0, 1 and 4, we're done with this function if theyre not any of those
//we're also done if one of the non-desk positions is the current one(jud, hlp and hld)
if (emote_mod == 2 ||
emote_mod == 3 ||
emote_mod == 5 ||
f_side == "jud" ||
f_side == "hlp" || f_side == "hlp" ||
f_side == "hld") f_side == "hld")
{ {

View File

@ -136,7 +136,7 @@ private:
int current_char_page = 0; int current_char_page = 0;
//character id, which index of the char_list the player is //character id, which index of the char_list the player is
int m_cid = 0; int m_cid = -1;
//cid and this may differ in cases of ini-editing //cid and this may differ in cases of ini-editing
QString current_char = ""; QString current_char = "";