aboutsummaryrefslogtreecommitdiff
path: root/src/courtroom.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-12 15:40:19 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-12 15:40:19 +0300
commit3b415f5a7005fd0b42ba7ccbb9a8836746a72d41 (patch)
tree2b2547988abf6db0fd314ea2cd2f4fb56008b577 /src/courtroom.cpp
parent7e2ec58c7eb62077733f354764d0b729fe0e0a93 (diff)
Expand get_image_suffix to fall back on .png last
Reorganize the file_exists checks to be an array iterator instead for much less code duplication and easier ordering of priority Reorganize desk and set_image loading on AOScene class, resolve issues with last_image setting to prevent animations from being restarted when characters talk on the same pos in succession Apply get_image_suffix for seancestand and jurystand searches TODO: At the moment, if you feed a .png shout, it will send the "Done" signal on the first frame (frame 0), not showing you the .png image at all. The shout code should be reorganized to allow static images to be displayed for exactly 720ms - the standard AA objection length. Usage of the timer similarly to the realizationflash.png might be possible.
Diffstat (limited to 'src/courtroom.cpp')
-rw-r--r--src/courtroom.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index cc69a1e..cc4410d 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -908,10 +908,8 @@ void Courtroom::enter_courtroom(int p_cid)
}
if (ao_app->custom_objection_enabled &&
- (file_exists(ao_app->get_character_path(current_char, "custom.gif")) ||
- file_exists(ao_app->get_character_path(current_char, "custom.apng")) ||
- file_exists(ao_app->get_character_path(current_char, "custom.webp"))) &&
- file_exists(ao_app->get_character_path(current_char, "custom.wav")))
+ (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.wav"))))
ui_custom_objection->show();
else
ui_custom_objection->hide();
@@ -2378,6 +2376,7 @@ void Courtroom::set_scene()
QString f_desk_mod = m_chatmessage[DESK_MOD];
QString f_side = m_chatmessage[SIDE];
+ //This thing desperately needs to be made into an array iteration.
if (f_side == "def")
{
f_background = "defenseempty";
@@ -2409,18 +2408,12 @@ void Courtroom::set_scene()
f_background = "prohelperstand";
f_desk_image = "prohelperdesk";
}
- else if (f_side == "jur" && (file_exists(ao_app->get_background_path("jurystand.png")) ||
- file_exists(ao_app->get_background_path("jurystand.gif")) ||
- file_exists(ao_app->get_background_path("jurystand.apng")) ||
- file_exists(ao_app->get_background_path("jurystand.webp"))))
+ else if (f_side == "jur" && (file_exists(ao_app->get_image_suffix(ao_app->get_background_path("jurystand")))))
{
f_background = "jurystand";
f_desk_image = "jurydesk";
}
- else if (f_side == "sea" && (file_exists(ao_app->get_background_path("seancestand.png")) ||
- file_exists(ao_app->get_background_path("seancestand.gif")) ||
- file_exists(ao_app->get_background_path("seancestand.apng")) ||
- file_exists(ao_app->get_background_path("seancestand.webp"))))
+ else if (f_side == "sea" && (file_exists(ao_app->get_image_suffix(ao_app->get_background_path("seancestand")))))
{
f_background = "seancestand";
f_desk_image = "seancedesk";
@@ -2436,7 +2429,6 @@ void Courtroom::set_scene()
ui_vp_background->set_image(f_background);
ui_vp_desk->set_image(f_desk_image);
ui_vp_legacy_desk->set_legacy_desk(f_desk_image);
-
if (f_desk_mod == "0" || (f_desk_mod != "1" &&
(f_side == "jud" ||
f_side == "hld" ||