FL toggle for Y offset (#360)

Use "y_offset" to enable the Y offset protocol extension.
This commit is contained in:
scatterflower 2021-01-03 19:23:01 -06:00 committed by GitHub
parent 9cd533cf40
commit 29f8733dba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -76,6 +76,7 @@ public:
bool looping_sfx_support_enabled = false;
bool additive_enabled = false;
bool effects_enabled = false;
bool y_offset_enabled = false;
///////////////loading info///////////////////

View File

@ -1708,7 +1708,10 @@ void Courtroom::on_chat_return_pressed()
packet_contents.append("-1");
}
// Send the offset as it's gonna be used regardless
packet_contents.append(QString::number(char_offset) + "&" + QString::number(char_vert_offset));
if(ao_app->y_offset_enabled)
packet_contents.append(QString::number(char_offset) + "&" + QString::number(char_vert_offset));
else
packet_contents.append(QString::number(char_offset));
// Finally, we send over if we want our pres to not interrupt.
if (ui_pre_non_interrupt->isChecked() && ui_pre->isChecked()) {
@ -4450,7 +4453,8 @@ void Courtroom::on_pair_clicked()
if (ui_pair_list->isHidden()) {
ui_pair_list->show();
ui_pair_offset_spinbox->show();
ui_pair_vert_offset_spinbox->show();
if(ao_app->y_offset_enabled)
ui_pair_vert_offset_spinbox->show();
ui_pair_order_dropdown->show();
ui_mute_list->hide();
ui_mute->set_image("mute");

View File

@ -133,6 +133,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
looping_sfx_support_enabled = false;
additive_enabled = false;
effects_enabled = false;
y_offset_enabled = false;
QString f_hdid;
f_hdid = get_hdid();
@ -205,6 +206,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
additive_enabled = true;
if (f_packet.contains("effects", Qt::CaseInsensitive))
effects_enabled = true;
if (f_packet.contains("y_offset", Qt::CaseInsensitive))
y_offset_enabled = true;
}
else if (header == "PN") {
if (f_contents.size() < 2)