added custom sfx support and incremented to 2.3.4
This commit is contained in:
		
							parent
							
								
									b15214b739
								
							
						
					
					
						commit
						2510a89c54
					
				@ -13,7 +13,7 @@ RC_ICONS = logo.ico
 | 
				
			|||||||
TARGET = Attorney_Online_remake
 | 
					TARGET = Attorney_Online_remake
 | 
				
			||||||
TEMPLATE = app
 | 
					TEMPLATE = app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VERSION = 2.3.3.0
 | 
					VERSION = 2.3.4.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SOURCES += main.cpp\
 | 
					SOURCES += main.cpp\
 | 
				
			||||||
        lobby.cpp \
 | 
					        lobby.cpp \
 | 
				
			||||||
 | 
				
			|||||||
@ -114,6 +114,7 @@ public:
 | 
				
			|||||||
  pos_size_type get_element_dimensions(QString p_identifier, QString p_file);
 | 
					  pos_size_type get_element_dimensions(QString p_identifier, QString p_file);
 | 
				
			||||||
  int get_font_size(QString p_identifier, QString p_file);
 | 
					  int get_font_size(QString p_identifier, QString p_file);
 | 
				
			||||||
  QColor get_color(QString p_identifier, QString p_file);
 | 
					  QColor get_color(QString p_identifier, QString p_file);
 | 
				
			||||||
 | 
					  QString get_sfx(QString p_identifier, QString p_file);
 | 
				
			||||||
  QString read_char_ini(QString p_char, QString p_search_line, QString target_tag, QString terminator_tag);
 | 
					  QString read_char_ini(QString p_char, QString p_search_line, QString target_tag, QString terminator_tag);
 | 
				
			||||||
  QString get_char_side(QString p_char);
 | 
					  QString get_char_side(QString p_char);
 | 
				
			||||||
  QString get_showname(QString p_char);
 | 
					  QString get_showname(QString p_char);
 | 
				
			||||||
@ -136,7 +137,7 @@ public:
 | 
				
			|||||||
private:
 | 
					private:
 | 
				
			||||||
  const int RELEASE = 2;
 | 
					  const int RELEASE = 2;
 | 
				
			||||||
  const int MAJOR_VERSION = 3;
 | 
					  const int MAJOR_VERSION = 3;
 | 
				
			||||||
  const int MINOR_VERSION = 3;
 | 
					  const int MINOR_VERSION = 4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QString user_theme = "default";
 | 
					  QString user_theme = "default";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -349,14 +349,10 @@ void Courtroom::set_widgets()
 | 
				
			|||||||
  ui_vp_objection->combo_resize(ui_viewport->width(), ui_viewport->height());
 | 
					  ui_vp_objection->combo_resize(ui_viewport->width(), ui_viewport->height());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  set_size_and_pos(ui_ic_chatlog, "ic_chatlog");
 | 
					  set_size_and_pos(ui_ic_chatlog, "ic_chatlog");
 | 
				
			||||||
  ui_ic_chatlog->setStyleSheet("QPlainTextEdit{ background-color: rgba(0, 0, 0, 0);"
 | 
					 | 
				
			||||||
                               "color: white; }");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  set_size_and_pos(ui_ms_chatlog, "ms_chatlog");
 | 
					  set_size_and_pos(ui_ms_chatlog, "ms_chatlog");
 | 
				
			||||||
  ui_ms_chatlog->setStyleSheet("QTextBrowser{ background-color: rgba(0, 0, 0, 0); }");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  set_size_and_pos(ui_server_chatlog, "server_chatlog");
 | 
					  set_size_and_pos(ui_server_chatlog, "server_chatlog");
 | 
				
			||||||
  ui_server_chatlog->setStyleSheet("QTextBrowser{ background-color: rgba(0, 0, 0, 0); }");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  set_size_and_pos(ui_mute_list, "mute_list");
 | 
					  set_size_and_pos(ui_mute_list, "mute_list");
 | 
				
			||||||
  ui_mute_list->hide();
 | 
					  ui_mute_list->hide();
 | 
				
			||||||
@ -365,7 +361,6 @@ void Courtroom::set_widgets()
 | 
				
			|||||||
  //ui_area_list->setStyleSheet("background-color: rgba(0, 0, 0, 0);");
 | 
					  //ui_area_list->setStyleSheet("background-color: rgba(0, 0, 0, 0);");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  set_size_and_pos(ui_music_list, "music_list");
 | 
					  set_size_and_pos(ui_music_list, "music_list");
 | 
				
			||||||
  ui_music_list->setStyleSheet("QListWidget{background-color: rgba(0, 0, 0, 0);}");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (is_ao2_bg)
 | 
					  if (is_ao2_bg)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
@ -521,23 +516,11 @@ void Courtroom::set_widgets()
 | 
				
			|||||||
void Courtroom::set_fonts()
 | 
					void Courtroom::set_fonts()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  set_font(ui_vp_showname, "showname");
 | 
					  set_font(ui_vp_showname, "showname");
 | 
				
			||||||
 | 
					 | 
				
			||||||
  /*
 | 
					 | 
				
			||||||
  int id = QFontDatabase::addApplicationFont(":/resource/fonts/Ace-Attorney.ttf");
 | 
					 | 
				
			||||||
  QString family = QFontDatabase::applicationFontFamilies(id).at(0);
 | 
					 | 
				
			||||||
  QFont monospace(family);
 | 
					 | 
				
			||||||
  monospace.setPointSize(ao_app->get_font_size("message", design_file));
 | 
					 | 
				
			||||||
  ui_vp_message->setFont(monospace);
 | 
					 | 
				
			||||||
  */
 | 
					 | 
				
			||||||
  set_font(ui_vp_message, "message");
 | 
					  set_font(ui_vp_message, "message");
 | 
				
			||||||
  set_font(ui_ic_chatlog, "ic_chatlog");
 | 
					  set_font(ui_ic_chatlog, "ic_chatlog");
 | 
				
			||||||
  set_font(ui_ms_chatlog, "ms_chatlog");
 | 
					  set_font(ui_ms_chatlog, "ms_chatlog");
 | 
				
			||||||
  set_font(ui_server_chatlog, "server_chatlog");
 | 
					  set_font(ui_server_chatlog, "server_chatlog");
 | 
				
			||||||
  set_font(ui_music_list, "music_list");
 | 
					  set_font(ui_music_list, "music_list");
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Courtroom::set_font(QWidget *widget, QString p_identifier)
 | 
					void Courtroom::set_font(QWidget *widget, QString p_identifier)
 | 
				
			||||||
@ -548,7 +531,7 @@ void Courtroom::set_font(QWidget *widget, QString p_identifier)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  widget->setFont(QFont("Sans", f_weight));
 | 
					  widget->setFont(QFont("Sans", f_weight));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QColor f_color = ao_app->get_color(p_identifier + "_color", design_file);\
 | 
					  QColor f_color = ao_app->get_color(p_identifier + "_color", design_file);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QString style_sheet_string = class_name + " { background-color: rgba(0, 0, 0, 0);\n" +
 | 
					  QString style_sheet_string = class_name + " { background-color: rgba(0, 0, 0, 0);\n" +
 | 
				
			||||||
                                            "color: rgba(" +
 | 
					                                            "color: rgba(" +
 | 
				
			||||||
@ -558,14 +541,7 @@ void Courtroom::set_font(QWidget *widget, QString p_identifier)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  qDebug() << "style_sheet_string: " << style_sheet_string;
 | 
					  qDebug() << "style_sheet_string: " << style_sheet_string;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //widget->setStyleSheet(style_sheet_string);
 | 
					  widget->setStyleSheet(style_sheet_string);
 | 
				
			||||||
 | 
					 | 
				
			||||||
  ui_ic_chatlog->setStyleSheet("QPlainTextEdit { background-color: rgba(0, 0, 0, 0);"
 | 
					 | 
				
			||||||
                               "color: rgba(" +
 | 
					 | 
				
			||||||
                                QString::number(f_color.red()) + ", " +
 | 
					 | 
				
			||||||
                                QString::number(f_color.green()) + ", " +
 | 
					 | 
				
			||||||
                                QString::number(f_color.blue()) + ", 255); }");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Courtroom::set_window_title(QString p_title)
 | 
					void Courtroom::set_window_title(QString p_title)
 | 
				
			||||||
@ -1095,7 +1071,7 @@ void Courtroom::handle_chatmessage_3()
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    realization_timer->start(60);
 | 
					    realization_timer->start(60);
 | 
				
			||||||
    ui_vp_realization->show();
 | 
					    ui_vp_realization->show();
 | 
				
			||||||
    sfx_player->play("sfx-realization.wav");
 | 
					    sfx_player->play(ao_app->get_sfx("realization", "courtroom_sounds.ini"));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -1492,10 +1468,12 @@ void Courtroom::handle_song(QStringList *p_contents)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void Courtroom::handle_wtce(QString p_wtce)
 | 
					void Courtroom::handle_wtce(QString p_wtce)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					  QString sfx_file = "courtroom_sounds.ini";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //witness testimony
 | 
					  //witness testimony
 | 
				
			||||||
  if (p_wtce == "testimony1")
 | 
					  if (p_wtce == "testimony1")
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    sfx_player->play("sfx-testimony2.wav");
 | 
					    sfx_player->play(ao_app->get_sfx("witness_testimony", sfx_file));
 | 
				
			||||||
    ui_vp_wtce->play("witnesstestimony");
 | 
					    ui_vp_wtce->play("witnesstestimony");
 | 
				
			||||||
    testimony_in_progress = true;
 | 
					    testimony_in_progress = true;
 | 
				
			||||||
    show_testimony();
 | 
					    show_testimony();
 | 
				
			||||||
@ -1503,7 +1481,7 @@ void Courtroom::handle_wtce(QString p_wtce)
 | 
				
			|||||||
  //cross examination
 | 
					  //cross examination
 | 
				
			||||||
  else if (p_wtce == "testimony2")
 | 
					  else if (p_wtce == "testimony2")
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    sfx_player->play("sfx-testimony.wav");
 | 
					    sfx_player->play(ao_app->get_sfx("cross_examination", sfx_file));
 | 
				
			||||||
    ui_vp_wtce->play("crossexamination");
 | 
					    ui_vp_wtce->play("crossexamination");
 | 
				
			||||||
    testimony_in_progress = false;
 | 
					    testimony_in_progress = false;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
@ -295,6 +295,27 @@ QColor AOApplication::get_color(QString p_identifier, QString p_file)
 | 
				
			|||||||
  return return_color;
 | 
					  return return_color;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					QString AOApplication::get_sfx(QString p_identifier, QString p_file)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  QString design_ini_path = get_theme_path() + p_file;
 | 
				
			||||||
 | 
					  QString default_path = get_default_theme_path() + p_file;
 | 
				
			||||||
 | 
					  QString f_result = read_design_ini(p_identifier, design_ini_path);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  QString return_sfx = "";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (f_result == "")
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    f_result = read_design_ini(p_identifier, default_path);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (f_result == "")
 | 
				
			||||||
 | 
					      return return_sfx;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return_sfx = f_result;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return return_sfx;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//returns whatever is to the right of "search_line =" within target_tag and terminator_tag, trimmed
 | 
					//returns whatever is to the right of "search_line =" within target_tag and terminator_tag, trimmed
 | 
				
			||||||
//returns the empty string if the search line couldnt be found
 | 
					//returns the empty string if the search line couldnt be found
 | 
				
			||||||
QString AOApplication::read_char_ini(QString p_char, QString p_search_line, QString target_tag, QString terminator_tag)
 | 
					QString AOApplication::read_char_ini(QString p_char, QString p_search_line, QString target_tag, QString terminator_tag)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user