Make shout, verdict and wtce default duration values into constants

This commit is contained in:
Crystalwarrior 2019-09-13 11:41:59 +03:00
parent 8027bbffad
commit bb8edab579
2 changed files with 17 additions and 8 deletions

View File

@ -311,6 +311,15 @@ private:
//every time point in char.inis times this equals the final time //every time point in char.inis times this equals the final time
const int time_mod = 40; const int time_mod = 40;
//the amount of time non-animated objection/hold it/takethat images stay onscreen for in ms
const int shout_stay_time = 724;
//the amount of time non-animated guilty/not guilty images stay onscreen for in ms
const int verdict_stay_time = 3000;
//the amount of time non-animated witness testimony/cross-examination images stay onscreen for in ms
const int wtce_stay_time = 1500;
static const int chatmessage_size = 23; static const int chatmessage_size = 23;
QString m_chatmessage[chatmessage_size]; QString m_chatmessage[chatmessage_size];
bool chatmessage_is_empty = false; bool chatmessage_is_empty = false;

View File

@ -1330,22 +1330,22 @@ 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, 724); ui_vp_objection->play("holdit", f_char, f_custom_theme, shout_stay_time);
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, 724); ui_vp_objection->play("objection", f_char, f_custom_theme, shout_stay_time);
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()) 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. 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, 724); ui_vp_objection->play("takethat", f_char, f_custom_theme, shout_stay_time);
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, 724); ui_vp_objection->play("custom", f_char, f_custom_theme, shout_stay_time);
objection_player->play("custom.wav", f_char, f_custom_theme); objection_player->play("custom.wav", f_char, f_custom_theme);
break; break;
default: default:
@ -2524,14 +2524,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", "", "", 1500); ui_vp_wtce->play("witnesstestimony", "", "", wtce_stay_time);
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", "", "", 1500); ui_vp_wtce->play("crossexamination", "", "", wtce_stay_time);
ui_vp_testimony->stop(); ui_vp_testimony->stop();
} }
else if (p_wtce == "judgeruling") else if (p_wtce == "judgeruling")
@ -2539,12 +2539,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", "", "", 3000); ui_vp_wtce->play("notguilty", "", "", verdict_stay_time);
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", "", "", 3000); ui_vp_wtce->play("guilty", "", "", verdict_stay_time);
ui_vp_testimony->stop(); ui_vp_testimony->stop();
} }
} }