Rename noninterrupting_preanim and all its associated bullshit with more cooler and nicer bro immediate
In themes, pre_no_interrupt old-style name is still supported if we cannot find "immediate" Resolves https://github.com/AttorneyOnline/AO2-Client/issues/64
This commit is contained in:
		
							parent
							
								
									883fa8547d
								
							
						
					
					
						commit
						5b34df1c5a
					
				@ -233,7 +233,7 @@ public:
 | 
				
			|||||||
  // the second is the char id of who played it
 | 
					  // the second is the char id of who played it
 | 
				
			||||||
  void handle_song(QStringList *p_contents);
 | 
					  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
 | 
					  // plays the witness testimony or cross examination animation based on
 | 
				
			||||||
  // argument
 | 
					  // argument
 | 
				
			||||||
@ -607,7 +607,7 @@ private:
 | 
				
			|||||||
  QCheckBox *ui_guard;
 | 
					  QCheckBox *ui_guard;
 | 
				
			||||||
  QCheckBox *ui_casing;
 | 
					  QCheckBox *ui_casing;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QCheckBox *ui_pre_non_interrupt;
 | 
					  QCheckBox *ui_immediate;
 | 
				
			||||||
  QCheckBox *ui_showname_enable;
 | 
					  QCheckBox *ui_showname_enable;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  AOButton *ui_custom_objection;
 | 
					  AOButton *ui_custom_objection;
 | 
				
			||||||
 | 
				
			|||||||
@ -91,7 +91,7 @@ enum CHAT_MESSAGE {
 | 
				
			|||||||
  SELF_OFFSET,
 | 
					  SELF_OFFSET,
 | 
				
			||||||
  OTHER_OFFSET,
 | 
					  OTHER_OFFSET,
 | 
				
			||||||
  OTHER_FLIP,
 | 
					  OTHER_FLIP,
 | 
				
			||||||
  NONINTERRUPTING_PRE,
 | 
					  IMMEDIATE,
 | 
				
			||||||
  LOOPING_SFX,
 | 
					  LOOPING_SFX,
 | 
				
			||||||
  SCREENSHAKE,
 | 
					  SCREENSHAKE,
 | 
				
			||||||
  FRAME_SCREENSHAKE,
 | 
					  FRAME_SCREENSHAKE,
 | 
				
			||||||
 | 
				
			|||||||
@ -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->setChecked(ao_app->get_showname_enabled_by_default());
 | 
				
			||||||
  ui_showname_enable->setText(tr("Shownames"));
 | 
					  ui_showname_enable->setText(tr("Shownames"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ui_pre_non_interrupt = new QCheckBox(this);
 | 
					  ui_immediate = new QCheckBox(this);
 | 
				
			||||||
  ui_pre_non_interrupt->setText(tr("No Interrupt"));
 | 
					  ui_immediate->setText(tr("No Interrupt"));
 | 
				
			||||||
  ui_pre_non_interrupt->hide();
 | 
					  ui_immediate->hide();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ui_custom_objection = new AOButton(this, ao_app);
 | 
					  ui_custom_objection = new AOButton(this, ao_app);
 | 
				
			||||||
  ui_custom_objection->setContextMenuPolicy(Qt::CustomContextMenu);
 | 
					  ui_custom_objection->setContextMenuPolicy(Qt::CustomContextMenu);
 | 
				
			||||||
@ -477,14 +477,14 @@ void Courtroom::set_widgets()
 | 
				
			|||||||
  // if needed.
 | 
					  // if needed.
 | 
				
			||||||
  if (ao_app->cccc_ic_support_enabled) {
 | 
					  if (ao_app->cccc_ic_support_enabled) {
 | 
				
			||||||
    ui_pair_button->show();
 | 
					    ui_pair_button->show();
 | 
				
			||||||
    ui_pre_non_interrupt->show();
 | 
					    ui_immediate->show();
 | 
				
			||||||
    ui_showname_enable->show();
 | 
					    ui_showname_enable->show();
 | 
				
			||||||
    ui_ic_chat_name->show();
 | 
					    ui_ic_chat_name->show();
 | 
				
			||||||
    ui_ic_chat_name->setEnabled(true);
 | 
					    ui_ic_chat_name->setEnabled(true);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else {
 | 
					  else {
 | 
				
			||||||
    ui_pair_button->hide();
 | 
					    ui_pair_button->hide();
 | 
				
			||||||
    ui_pre_non_interrupt->hide();
 | 
					    ui_immediate->hide();
 | 
				
			||||||
    ui_showname_enable->hide();
 | 
					    ui_showname_enable->hide();
 | 
				
			||||||
    ui_ic_chat_name->hide();
 | 
					    ui_ic_chat_name->hide();
 | 
				
			||||||
    ui_ic_chat_name->setEnabled(false);
 | 
					    ui_ic_chat_name->setEnabled(false);
 | 
				
			||||||
@ -839,8 +839,16 @@ void Courtroom::set_widgets()
 | 
				
			|||||||
  ui_pre->setToolTip(
 | 
					  ui_pre->setToolTip(
 | 
				
			||||||
      tr("Play a single-shot animation as defined by the emote when checked."));
 | 
					      tr("Play a single-shot animation as defined by the emote when checked."));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  set_size_and_pos(ui_pre_non_interrupt, "pre_no_interrupt");
 | 
					  pos_size_type design_ini_result =
 | 
				
			||||||
  ui_pre_non_interrupt->setToolTip(
 | 
					      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 "
 | 
					      tr("If preanim is checked, display the input text immediately as the "
 | 
				
			||||||
         "animation plays concurrently."));
 | 
					         "animation plays concurrently."));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1597,7 +1605,7 @@ void Courtroom::on_chat_return_pressed()
 | 
				
			|||||||
  // showname#
 | 
					  // showname#
 | 
				
			||||||
  // other_charid#
 | 
					  // other_charid#
 | 
				
			||||||
  // self_offset#
 | 
					  // self_offset#
 | 
				
			||||||
  // noninterrupting_preanim#%
 | 
					  // immediate_preanim#%
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QStringList packet_contents;
 | 
					  QStringList packet_contents;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1642,7 +1650,7 @@ void Courtroom::on_chat_return_pressed()
 | 
				
			|||||||
    else
 | 
					    else
 | 
				
			||||||
      f_emote_mod = 2;
 | 
					      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)
 | 
					    if (f_emote_mod == 0)
 | 
				
			||||||
      f_emote_mod = 1;
 | 
					      f_emote_mod = 1;
 | 
				
			||||||
    else if (f_emote_mod == 5 && ao_app->prezoom_enabled)
 | 
					    else if (f_emote_mod == 5 && ao_app->prezoom_enabled)
 | 
				
			||||||
@ -1738,7 +1746,7 @@ void Courtroom::on_chat_return_pressed()
 | 
				
			|||||||
        packet_contents.append(QString::number(char_offset));
 | 
					        packet_contents.append(QString::number(char_offset));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Finally, we send over if we want our pres to not interrupt.
 | 
					    // 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");
 | 
					      packet_contents.append("1");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
@ -2216,7 +2224,7 @@ void Courtroom::handle_chatmessage_2()
 | 
				
			|||||||
    break;
 | 
					    break;
 | 
				
			||||||
  case 0:
 | 
					  case 0:
 | 
				
			||||||
  case 5:
 | 
					  case 5:
 | 
				
			||||||
    if (m_chatmessage[NONINTERRUPTING_PRE].toInt() == 0)
 | 
					    if (m_chatmessage[IMMEDIATE].toInt() == 0)
 | 
				
			||||||
      handle_chatmessage_3();
 | 
					      handle_chatmessage_3();
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      play_preanim(true);
 | 
					      play_preanim(true);
 | 
				
			||||||
@ -2782,7 +2790,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_char = m_chatmessage[CHAR_NAME];
 | 
				
			||||||
  QString f_preanim = m_chatmessage[PRE_EMOTE];
 | 
					  QString f_preanim = m_chatmessage[PRE_EMOTE];
 | 
				
			||||||
@ -2804,7 +2812,7 @@ void Courtroom::play_preanim(bool noninterrupting)
 | 
				
			|||||||
  QString anim_to_find =
 | 
					  QString anim_to_find =
 | 
				
			||||||
      ao_app->get_image_suffix(ao_app->get_character_path(f_char, f_preanim));
 | 
					      ao_app->get_image_suffix(ao_app->get_character_path(f_char, f_preanim));
 | 
				
			||||||
  if (!file_exists(anim_to_find)) {
 | 
					  if (!file_exists(anim_to_find)) {
 | 
				
			||||||
    if (noninterrupting)
 | 
					    if (immediate)
 | 
				
			||||||
      anim_state = 4;
 | 
					      anim_state = 4;
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      anim_state = 1;
 | 
					      anim_state = 1;
 | 
				
			||||||
@ -2815,7 +2823,7 @@ void Courtroom::play_preanim(bool noninterrupting)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  ui_vp_player_char->play_pre(f_char, f_preanim, preanim_duration);
 | 
					  ui_vp_player_char->play_pre(f_char, f_preanim, preanim_duration);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (noninterrupting)
 | 
					  if (immediate)
 | 
				
			||||||
    anim_state = 4;
 | 
					    anim_state = 4;
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
    anim_state = 1;
 | 
					    anim_state = 1;
 | 
				
			||||||
@ -2823,7 +2831,7 @@ void Courtroom::play_preanim(bool noninterrupting)
 | 
				
			|||||||
  if (text_delay >= 0)
 | 
					  if (text_delay >= 0)
 | 
				
			||||||
    text_delay_timer->start(text_delay);
 | 
					    text_delay_timer->start(text_delay);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (noninterrupting)
 | 
					  if (immediate)
 | 
				
			||||||
    handle_chatmessage_3();
 | 
					    handle_chatmessage_3();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -3564,13 +3572,13 @@ void Courtroom::on_ooc_return_pressed()
 | 
				
			|||||||
    return;
 | 
					    return;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else if (ooc_message.startsWith("/non_int_pre")) {
 | 
					  else if (ooc_message.startsWith("/non_int_pre")) {
 | 
				
			||||||
    if (ui_pre_non_interrupt->isChecked())
 | 
					    if (ui_immediate->isChecked())
 | 
				
			||||||
      append_server_chatmessage(
 | 
					      append_server_chatmessage(
 | 
				
			||||||
          "CLIENT", tr("Your pre-animations interrupt again."), "1");
 | 
					          "CLIENT", tr("Your pre-animations interrupt again."), "1");
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      append_server_chatmessage(
 | 
					      append_server_chatmessage(
 | 
				
			||||||
          "CLIENT", tr("Your pre-animations will not interrupt text."), "1");
 | 
					          "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();
 | 
					    ui_ooc_chat_message->clear();
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user