Merge branch 'aomovies'

# Conflicts:
#	include/aomovie.h
#	src/aomovie.cpp
#	src/courtroom.cpp
This commit is contained in:
Crystalwarrior 2019-09-13 12:00:27 +03:00
commit ab072132c3
4 changed files with 39 additions and 36 deletions

View File

@ -16,7 +16,7 @@ public:
void set_play_once(bool p_play_once); void set_play_once(bool p_play_once);
void start_timer(int delay); void start_timer(int delay);
void play(QString p_gif, QString p_char = "", QString p_custom_theme = "", int duration = 0); void play(QString p_gif, QString p_char = "", QString p_custom_theme = "", int default_duration = 0);
void combo_resize(int w, int h); void combo_resize(int w, int h);
void stop(); void stop();

View File

@ -61,11 +61,11 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix)
void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
{ {
QString gif_path = ao_app->get_character_path(p_char, p_emote); QString emote_path = ao_app->get_character_path(p_char, p_emote);
m_movie->stop(); m_movie->stop();
this->clear(); this->clear();
m_movie->setFileName(gif_path); m_movie->setFileName(emote_path);
m_movie->jumpToFrame(0); m_movie->jumpToFrame(0);
int full_duration = duration * time_mod; int full_duration = duration * time_mod;
@ -116,11 +116,11 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
void AOCharMovie::play_talking(QString p_char, QString p_emote) void AOCharMovie::play_talking(QString p_char, QString p_emote)
{ {
QString gif_path = ao_app->get_character_path(p_char, "(b)" + p_emote); QString emote_path = ao_app->get_character_path(p_char, "(b)" + p_emote);
m_movie->stop(); m_movie->stop();
this->clear(); this->clear();
m_movie->setFileName(gif_path); m_movie->setFileName(emote_path);
play_once = false; play_once = false;
m_movie->setSpeed(100); m_movie->setSpeed(100);
@ -129,11 +129,11 @@ void AOCharMovie::play_talking(QString p_char, QString p_emote)
void AOCharMovie::play_idle(QString p_char, QString p_emote) void AOCharMovie::play_idle(QString p_char, QString p_emote)
{ {
QString gif_path = ao_app->get_character_path(p_char, "(a)" + p_emote); QString emote_path = ao_app->get_character_path(p_char, "(a)" + p_emote);
m_movie->stop(); m_movie->stop();
this->clear(); this->clear();
m_movie->setFileName(gif_path); m_movie->setFileName(emote_path);
play_once = false; play_once = false;
m_movie->setSpeed(100); m_movie->setSpeed(100);

View File

@ -29,7 +29,7 @@ void AOMovie::start_timer(int delay)
timer->start(delay); timer->start(delay);
} }
void AOMovie::play(QString p_gif, QString p_char, QString p_custom_theme, int duration) void AOMovie::play(QString p_image, QString p_char, QString p_custom_theme, int duration)
{ {
m_movie->stop(); m_movie->stop();
@ -37,19 +37,19 @@ void AOMovie::play(QString p_gif, QString p_char, QString p_custom_theme, int du
QList<QString> pathlist; QList<QString> pathlist;
pathlist = { pathlist = {
ao_app->get_image_suffix(ao_app->get_base_path() + "misc/" + p_custom_theme + "/" + p_gif + "_bubble"), //Misc path ao_app->get_image_suffix(ao_app->get_base_path() + "misc/" + p_custom_theme + "/" + p_image + "_bubble"), //Misc path
ao_app->get_image_suffix(ao_app->get_custom_theme_path(p_custom_theme, p_gif)), //Custom theme path ao_app->get_image_suffix(ao_app->get_custom_theme_path(p_custom_theme, p_image)), //Custom theme path
ao_app->get_image_suffix(ao_app->get_theme_path(p_gif)), //Theme path ao_app->get_image_suffix(ao_app->get_theme_path(p_image)), //Theme path
ao_app->get_image_suffix(ao_app->get_default_theme_path(p_gif)), //Default theme path ao_app->get_image_suffix(ao_app->get_default_theme_path(p_image)), //Default theme path
ao_app->get_image_suffix(ao_app->get_theme_path("placeholder")), //Placeholder path ao_app->get_image_suffix(ao_app->get_theme_path("placeholder")), //Placeholder path
ao_app->get_image_suffix( ao_app->get_default_theme_path("placeholder")), //Default placeholder path ao_app->get_image_suffix( ao_app->get_default_theme_path("placeholder")), //Default placeholder path
}; };
//Add this at the beginning of the list - order matters. //Add this at the beginning of the list - order matters.
if (p_gif == "custom") if (p_image == "custom")
pathlist.prepend(ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_gif))); pathlist.prepend(ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_image)));
else else
pathlist.prepend(ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_gif + "_bubble"))); pathlist.prepend(ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_image + "_bubble")));
for (QString path : pathlist) for (QString path : pathlist)
{ {

View File

@ -890,8 +890,9 @@ void Courtroom::enter_courtroom(int p_cid)
} }
if (ao_app->custom_objection_enabled && if (ao_app->custom_objection_enabled &&
(file_exists(ao_app->get_image_suffix(ao_app->get_character_path(current_char, "custom"))) && (file_exists(ao_app->get_character_path(current_char, "custom.gif")) ||
file_exists(ao_app->get_character_path(current_char, "custom.wav")))) file_exists(ao_app->get_character_path(current_char, "custom.apng"))) &&
file_exists(ao_app->get_character_path(current_char, "custom.wav")))
ui_custom_objection->show(); ui_custom_objection->show();
else else
ui_custom_objection->hide(); ui_custom_objection->hide();
@ -981,9 +982,9 @@ void Courtroom::list_areas()
for (int n_area = 0 ; n_area < area_list.size() ; ++n_area) for (int n_area = 0 ; n_area < area_list.size() ; ++n_area)
{ {
QString i_area = ""; QString i_area = "";
// i_area.append("["); i_area.append("[");
// i_area.append(QString::number(n_area)); i_area.append(QString::number(n_area));
// i_area.append("] "); i_area.append("] ");
i_area.append(area_list.at(n_area)); i_area.append(area_list.at(n_area));
@ -1288,6 +1289,7 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
text_state = 0; text_state = 0;
anim_state = 0; anim_state = 0;
ui_vp_objection->stop(); ui_vp_objection->stop();
ui_vp_player_char->stop();
chat_tick_timer->stop(); chat_tick_timer->stop();
ui_vp_evidence_display->reset(); ui_vp_evidence_display->reset();
@ -1330,22 +1332,20 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
switch (objection_mod) switch (objection_mod)
{ {
case 1: case 1:
ui_vp_objection->play("holdit", f_char, f_custom_theme, shout_stay_time); ui_vp_objection->play("holdit", f_char, f_custom_theme, 724);
objection_player->play("holdit.wav", f_char, f_custom_theme); objection_player->play("holdit.wav", f_char, f_custom_theme);
break; break;
case 2: case 2:
ui_vp_objection->play("objection", f_char, f_custom_theme, shout_stay_time); ui_vp_objection->play("objection", f_char, f_custom_theme, 724);
objection_player->play("objection.wav", f_char, f_custom_theme); objection_player->play("objection.wav", f_char, f_custom_theme);
if (ao_app->objection_stop_music())
music_player->play(""); //I'd prefer if this sent a networked message instead so everyone would have their music cut when you object.
break; break;
case 3: case 3:
ui_vp_objection->play("takethat", f_char, f_custom_theme, shout_stay_time); ui_vp_objection->play("takethat", f_char, f_custom_theme, 724);
objection_player->play("takethat.wav", f_char, f_custom_theme); objection_player->play("takethat.wav", f_char, f_custom_theme);
break; break;
//case 4 is AO2 only //case 4 is AO2 only
case 4: case 4:
ui_vp_objection->play("custom", f_char, f_custom_theme, shout_stay_time); ui_vp_objection->play("custom", f_char, f_custom_theme, 724);
objection_player->play("custom.wav", f_char, f_custom_theme); objection_player->play("custom.wav", f_char, f_custom_theme);
break; break;
default: default:
@ -2275,11 +2275,13 @@ void Courtroom::chat_tick()
if (f_character != ' ' || blank_blip) if (f_character != ' ' || blank_blip)
{ {
if (blip_pos % blip_rate == 0 && !formatting_char) if (blip_pos % blip_rate == 0 && !formatting_char)
{ {
blip_pos = 0; blip_pos = 0;
blip_player->blip_tick(); blip_player->blip_tick();
} }
++blip_pos; ++blip_pos;
} }
@ -2287,15 +2289,14 @@ void Courtroom::chat_tick()
// Restart the timer, but according to the newly set speeds, if there were any. // Restart the timer, but according to the newly set speeds, if there were any.
// Keep the speed at bay. // Keep the speed at bay.
int max_speed = sizeof(message_display_speed) / sizeof(message_display_speed[0]); //7 entries by default
if (current_display_speed < 0) if (current_display_speed < 0)
{ {
current_display_speed = 0; current_display_speed = 0;
} }
if (current_display_speed >= max_speed) if (current_display_speed > 6)
{ {
current_display_speed = max_speed-1; current_display_speed = 6;
} }
// If we had a formatting char, we shouldn't wait so long again, as it won't appear! // If we had a formatting char, we shouldn't wait so long again, as it won't appear!
@ -2329,7 +2330,6 @@ void Courtroom::set_scene()
QString f_desk_mod = m_chatmessage[DESK_MOD]; QString f_desk_mod = m_chatmessage[DESK_MOD];
QString f_side = m_chatmessage[SIDE]; QString f_side = m_chatmessage[SIDE];
//This thing desperately needs to be made into an array iteration.
if (f_side == "def") if (f_side == "def")
{ {
f_background = "defenseempty"; f_background = "defenseempty";
@ -2361,12 +2361,14 @@ void Courtroom::set_scene()
f_background = "prohelperstand"; f_background = "prohelperstand";
f_desk_image = "prohelperdesk"; f_desk_image = "prohelperdesk";
} }
else if (f_side == "jur" && (file_exists(ao_app->get_image_suffix(ao_app->get_background_path("jurystand"))))) else if (f_side == "jur" && (file_exists(ao_app->get_background_path("jurystand.png")) ||
file_exists(ao_app->get_background_path("jurystand.gif"))))
{ {
f_background = "jurystand"; f_background = "jurystand";
f_desk_image = "jurydesk"; f_desk_image = "jurydesk";
} }
else if (f_side == "sea" && (file_exists(ao_app->get_image_suffix(ao_app->get_background_path("seancestand"))))) else if (f_side == "sea" && (file_exists(ao_app->get_background_path("seancestand.png")) ||
file_exists(ao_app->get_background_path("seancestand.gif"))))
{ {
f_background = "seancestand"; f_background = "seancestand";
f_desk_image = "seancedesk"; f_desk_image = "seancedesk";
@ -2382,6 +2384,7 @@ void Courtroom::set_scene()
ui_vp_background->set_image(f_background); ui_vp_background->set_image(f_background);
ui_vp_desk->set_image(f_desk_image); ui_vp_desk->set_image(f_desk_image);
ui_vp_legacy_desk->set_legacy_desk(f_desk_image); ui_vp_legacy_desk->set_legacy_desk(f_desk_image);
if (f_desk_mod == "0" || (f_desk_mod != "1" && if (f_desk_mod == "0" || (f_desk_mod != "1" &&
(f_side == "jud" || (f_side == "jud" ||
f_side == "hld" || f_side == "hld" ||
@ -2524,14 +2527,14 @@ void Courtroom::handle_wtce(QString p_wtce, int variant)
if (p_wtce == "testimony1") if (p_wtce == "testimony1")
{ {
sfx_player->play(ao_app->get_sfx("witness_testimony")); sfx_player->play(ao_app->get_sfx("witness_testimony"));
ui_vp_wtce->play("witnesstestimony", "", "", wtce_stay_time); ui_vp_wtce->play("witnesstestimony", "", "", 1500);
ui_vp_testimony->play("testimony"); ui_vp_testimony->play("testimony");
} }
//cross examination //cross examination
else if (p_wtce == "testimony2") else if (p_wtce == "testimony2")
{ {
sfx_player->play(ao_app->get_sfx("cross_examination")); sfx_player->play(ao_app->get_sfx("cross_examination"));
ui_vp_wtce->play("crossexamination", "", "", wtce_stay_time); ui_vp_wtce->play("crossexamination", "", "", 1500);
ui_vp_testimony->stop(); ui_vp_testimony->stop();
} }
else if (p_wtce == "judgeruling") else if (p_wtce == "judgeruling")
@ -2539,12 +2542,12 @@ void Courtroom::handle_wtce(QString p_wtce, int variant)
if (variant == 0) if (variant == 0)
{ {
sfx_player->play(ao_app->get_sfx("not_guilty")); sfx_player->play(ao_app->get_sfx("not_guilty"));
ui_vp_wtce->play("notguilty", "", "", verdict_stay_time); ui_vp_wtce->play("notguilty", "", "", 3000);
ui_vp_testimony->stop(); ui_vp_testimony->stop();
} }
else if (variant == 1) { else if (variant == 1) {
sfx_player->play(ao_app->get_sfx("guilty")); sfx_player->play(ao_app->get_sfx("guilty"));
ui_vp_wtce->play("guilty", "", "", verdict_stay_time); ui_vp_wtce->play("guilty", "", "", 3000);
ui_vp_testimony->stop(); ui_vp_testimony->stop();
} }
} }