adjusted preanims and added emotions/ao2 feature
This commit is contained in:
		
							parent
							
								
									ca6b1030be
								
							
						
					
					
						commit
						c5c7997f41
					
				@ -111,7 +111,7 @@ void AOCharMovie::frame_change(int n_frame)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if (m_movie->frameCount() - 1 == n_frame && play_once)
 | 
					  if (m_movie->frameCount() - 1 == n_frame && play_once)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    delay(m_movie->nextFrameDelay());
 | 
					    preanim_timer->start(m_movie->nextFrameDelay());
 | 
				
			||||||
    done();
 | 
					    done();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -14,6 +14,7 @@ AOEmoteButton::AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x
 | 
				
			|||||||
  connect(this, SIGNAL(clicked()), this, SLOT(on_clicked()));
 | 
					  connect(this, SIGNAL(clicked()), this, SLOT(on_clicked()));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
void AOEmoteButton::set_on(QString p_char, int p_emote)
 | 
					void AOEmoteButton::set_on(QString p_char, int p_emote)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  //+1 because programmatical emotes start on 0, while filesystem ones start on 1
 | 
					  //+1 because programmatical emotes start on 0, while filesystem ones start on 1
 | 
				
			||||||
@ -31,17 +32,24 @@ void AOEmoteButton::set_on(QString p_char, int p_emote)
 | 
				
			|||||||
    this->setStyleSheet("border-image:url(\"\")");
 | 
					    this->setStyleSheet("border-image:url(\"\")");
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AOEmoteButton::set_off(QString p_char, int p_emote)
 | 
					void AOEmoteButton::set_image(QString p_char, int p_emote, QString suffix)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  QString emotion_number = QString::number(p_emote + 1);
 | 
					  QString emotion_number = QString::number(p_emote + 1);
 | 
				
			||||||
  QString image_path = ao_app->get_character_path(p_char) + "emotions/button" + emotion_number + "_off.png";
 | 
					  QString image_path = ao_app->get_character_path(p_char) + "emotions/button" + emotion_number + suffix;
 | 
				
			||||||
 | 
					  QString alt_path = ao_app->get_character_path(p_char) + "emotions/ao2/button" + emotion_number + suffix;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (file_exists(image_path))
 | 
					  if (file_exists(image_path))
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    this->setText("");
 | 
					    this->setText("");
 | 
				
			||||||
    this->setStyleSheet("border-image:url(\"" + image_path + "\")");
 | 
					    this->setStyleSheet("border-image:url(\"" + image_path + "\")");
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  else if (file_exists(alt_path))
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    this->setText("");
 | 
				
			||||||
 | 
					    this->setStyleSheet("border-image:url(\"" + alt_path + "\")");
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    this->setText(ao_app->get_emote_comment(p_char, p_emote));
 | 
					    this->setText(ao_app->get_emote_comment(p_char, p_emote));
 | 
				
			||||||
 | 
				
			|||||||
@ -12,8 +12,9 @@ class AOEmoteButton : public QPushButton
 | 
				
			|||||||
public:
 | 
					public:
 | 
				
			||||||
  AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y);
 | 
					  AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  void set_on(QString p_char, int p_emote);
 | 
					  //void set_on(QString p_char, int p_emote);
 | 
				
			||||||
  void set_off(QString p_char, int p_emote);
 | 
					  //void set_off(QString p_char, int p_emote);
 | 
				
			||||||
 | 
					  void set_image(QString p_char, int p_emote, QString suffix);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  void set_id(int p_id) {m_id = p_id;}
 | 
					  void set_id(int p_id) {m_id = p_id;}
 | 
				
			||||||
  int get_id() {return m_id;}
 | 
					  int get_id() {return m_id;}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										12
									
								
								emotes.cpp
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								emotes.cpp
									
									
									
									
									
								
							@ -91,9 +91,9 @@ void Courtroom::set_emote_page()
 | 
				
			|||||||
    AOEmoteButton *f_emote = ui_emote_list.at(n_emote);
 | 
					    AOEmoteButton *f_emote = ui_emote_list.at(n_emote);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (n_real_emote == current_emote)
 | 
					    if (n_real_emote == current_emote)
 | 
				
			||||||
      f_emote->set_on(current_char, n_real_emote);
 | 
					      f_emote->set_image(current_char, n_real_emote, "_on.png");
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      f_emote->set_off(current_char, n_real_emote);
 | 
					      f_emote->set_image(current_char, n_real_emote, "_off.png");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    f_emote->show();
 | 
					    f_emote->show();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -106,17 +106,15 @@ void Courtroom::on_emote_clicked(int p_id)
 | 
				
			|||||||
  int max = (max_emotes_on_page - 1) + current_emote_page * max_emotes_on_page;
 | 
					  int max = (max_emotes_on_page - 1) + current_emote_page * max_emotes_on_page;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (current_emote >= min && current_emote <= max)
 | 
					  if (current_emote >= min && current_emote <= max)
 | 
				
			||||||
    ui_emote_list.at(current_emote % max_emotes_on_page)->set_off(current_char, current_emote);
 | 
					    ui_emote_list.at(current_emote % max_emotes_on_page)->set_image(current_char, current_emote, "_off.png");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  current_emote = p_id + max_emotes_on_page * current_emote_page;
 | 
					  current_emote = p_id + max_emotes_on_page * current_emote_page;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ui_emote_list.at(current_emote % max_emotes_on_page)->set_on(current_char, current_emote);
 | 
					  ui_emote_list.at(current_emote % max_emotes_on_page)->set_image(current_char, current_emote, "_on.png");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  int emote_mod = ao_app->get_emote_mod(current_char, current_emote);
 | 
					  int emote_mod = ao_app->get_emote_mod(current_char, current_emote);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (emote_mod == 1 ||
 | 
					  if (emote_mod == 1)
 | 
				
			||||||
      emote_mod == 3 ||
 | 
					 | 
				
			||||||
      emote_mod == 4)
 | 
					 | 
				
			||||||
    ui_pre->setChecked(true);
 | 
					    ui_pre->setChecked(true);
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
    ui_pre->setChecked(false);
 | 
					    ui_pre->setChecked(false);
 | 
				
			||||||
 | 
				
			|||||||
@ -286,7 +286,7 @@ QString AOApplication::get_pre_emote(QString p_char, int p_emote)
 | 
				
			|||||||
  if (result_contents.size() < 4)
 | 
					  if (result_contents.size() < 4)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    qDebug() << "W: misformatted char.ini: " << p_char << ", " << p_emote;
 | 
					    qDebug() << "W: misformatted char.ini: " << p_char << ", " << p_emote;
 | 
				
			||||||
    return "normal";
 | 
					    return "";
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else return result_contents.at(1);
 | 
					  else return result_contents.at(1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user