aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2021-01-09 12:35:09 -0600
committerGitHub <noreply@github.com>2021-01-09 12:35:09 -0600
commit41c134b1be39de2d888e0064fa6fbe8fae8915b6 (patch)
tree0567ad13682c9f2426bdc34c8286ff1a8969011b
parent3993ba47e5f801d603b5da973d5e5e57eba14b0b (diff)
parent5b34df1c5a6da97ad426a6cfb4a7c43c03fb0aad (diff)
Merge pull request #387 from AttorneyOnline/feature/immediate
Rename noninterrupting bonanza to consistent and short "immediate" instead
-rw-r--r--include/courtroom.h4
-rw-r--r--include/datatypes.h2
-rw-r--r--src/courtroom.cpp42
3 files changed, 28 insertions, 20 deletions
diff --git a/include/courtroom.h b/include/courtroom.h
index d9c843aa..5fdbbac3 100644
--- a/include/courtroom.h
+++ b/include/courtroom.h
@@ -236,7 +236,7 @@ public:
// the second is the char id of who played it
void handle_song(QStringList *p_contents);
- void play_preanim(bool noninterrupting);
+ void play_preanim(bool immediate);
// plays the witness testimony or cross examination animation based on
// argument
@@ -610,7 +610,7 @@ private:
QCheckBox *ui_guard;
QCheckBox *ui_casing;
- QCheckBox *ui_pre_non_interrupt;
+ QCheckBox *ui_immediate;
QCheckBox *ui_showname_enable;
AOButton *ui_custom_objection;
diff --git a/include/datatypes.h b/include/datatypes.h
index 21ade040..ebf2e380 100644
--- a/include/datatypes.h
+++ b/include/datatypes.h
@@ -91,7 +91,7 @@ enum CHAT_MESSAGE {
SELF_OFFSET,
OTHER_OFFSET,
OTHER_FLIP,
- NONINTERRUPTING_PRE,
+ IMMEDIATE,
LOOPING_SFX,
SCREENSHAKE,
FRAME_SCREENSHAKE,
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 80c53c3b..ad401bb6 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -210,9 +210,9 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
ui_showname_enable->setChecked(ao_app->get_showname_enabled_by_default());
ui_showname_enable->setText(tr("Shownames"));
- ui_pre_non_interrupt = new QCheckBox(this);
- ui_pre_non_interrupt->setText(tr("No Interrupt"));
- ui_pre_non_interrupt->hide();
+ ui_immediate = new QCheckBox(this);
+ ui_immediate->setText(tr("No Interrupt"));
+ ui_immediate->hide();
ui_custom_objection = new AOButton(this, ao_app);
ui_custom_objection->setContextMenuPolicy(Qt::CustomContextMenu);
@@ -477,14 +477,14 @@ void Courtroom::set_widgets()
// if needed.
if (ao_app->cccc_ic_support_enabled) {
ui_pair_button->show();
- ui_pre_non_interrupt->show();
+ ui_immediate->show();
ui_showname_enable->show();
ui_ic_chat_name->show();
ui_ic_chat_name->setEnabled(true);
}
else {
ui_pair_button->hide();
- ui_pre_non_interrupt->hide();
+ ui_immediate->hide();
ui_showname_enable->hide();
ui_ic_chat_name->hide();
ui_ic_chat_name->setEnabled(false);
@@ -839,8 +839,16 @@ void Courtroom::set_widgets()
ui_pre->setToolTip(
tr("Play a single-shot animation as defined by the emote when checked."));
- set_size_and_pos(ui_pre_non_interrupt, "pre_no_interrupt");
- ui_pre_non_interrupt->setToolTip(
+ pos_size_type design_ini_result =
+ ao_app->get_element_dimensions("immediate", "courtroom_design.ini");
+
+ // If we don't have new-style naming, fall back to the old method
+ if (design_ini_result.width < 0 || design_ini_result.height < 0)
+ set_size_and_pos(ui_immediate, "pre_no_interrupt");
+ else // Adopt the based new method instead
+ set_size_and_pos(ui_immediate, "immediate");
+
+ ui_immediate->setToolTip(
tr("If preanim is checked, display the input text immediately as the "
"animation plays concurrently."));
@@ -1597,7 +1605,7 @@ void Courtroom::on_chat_return_pressed()
// showname#
// other_charid#
// self_offset#
- // noninterrupting_preanim#%
+ // immediate_preanim#%
QStringList packet_contents;
@@ -1648,7 +1656,7 @@ void Courtroom::on_chat_return_pressed()
else
f_emote_mod = 2;
}
- else if (ui_pre->isChecked() && !ui_pre_non_interrupt->isChecked()) {
+ else if (ui_pre->isChecked() && !ui_immediate->isChecked()) {
if (f_emote_mod == 0)
f_emote_mod = 1;
else if (f_emote_mod == 5 && ao_app->prezoom_enabled)
@@ -1744,7 +1752,7 @@ void Courtroom::on_chat_return_pressed()
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()) {
+ if (ui_immediate->isChecked() && ui_pre->isChecked()) {
packet_contents.append("1");
}
else {
@@ -2236,7 +2244,7 @@ void Courtroom::handle_chatmessage_2()
break;
case 0:
case 5:
- if (m_chatmessage[NONINTERRUPTING_PRE].toInt() == 0)
+ if (m_chatmessage[IMMEDIATE].toInt() == 0)
handle_chatmessage_3();
else
play_preanim(true);
@@ -2820,7 +2828,7 @@ void Courtroom::append_ic_text(QString p_text, QString p_name, QString p_action,
}
}
-void Courtroom::play_preanim(bool noninterrupting)
+void Courtroom::play_preanim(bool immediate)
{
QString f_char = m_chatmessage[CHAR_NAME];
QString f_preanim = m_chatmessage[PRE_EMOTE];
@@ -2842,7 +2850,7 @@ void Courtroom::play_preanim(bool noninterrupting)
QString anim_to_find =
ao_app->get_image_suffix(ao_app->get_character_path(f_char, f_preanim));
if (!file_exists(anim_to_find)) {
- if (noninterrupting)
+ if (immediate)
anim_state = 4;
else
anim_state = 1;
@@ -2853,7 +2861,7 @@ void Courtroom::play_preanim(bool noninterrupting)
ui_vp_player_char->play_pre(f_char, f_preanim, preanim_duration);
- if (noninterrupting)
+ if (immediate)
anim_state = 4;
else
anim_state = 1;
@@ -2861,7 +2869,7 @@ void Courtroom::play_preanim(bool noninterrupting)
if (text_delay >= 0)
text_delay_timer->start(text_delay);
- if (noninterrupting)
+ if (immediate)
handle_chatmessage_3();
}
@@ -3613,13 +3621,13 @@ void Courtroom::on_ooc_return_pressed()
return;
}
else if (ooc_message.startsWith("/non_int_pre")) {
- if (ui_pre_non_interrupt->isChecked())
+ if (ui_immediate->isChecked())
append_server_chatmessage(
"CLIENT", tr("Your pre-animations interrupt again."), "1");
else
append_server_chatmessage(
"CLIENT", tr("Your pre-animations will not interrupt text."), "1");
- ui_pre_non_interrupt->setChecked(!ui_pre_non_interrupt->isChecked());
+ ui_immediate->setChecked(!ui_immediate->isChecked());
ui_ooc_chat_message->clear();
return;
}