aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstonedDiscord <stoned@derpymail.org>2017-07-06 14:23:25 +0200
committerstonedDiscord <stoned@derpymail.org>2017-07-06 14:23:31 +0200
commit4780ea57157e10dfaf90e14ae56c31e3cb390790 (patch)
tree14c023b8cc1b82a89d6cf2fb5031eac3af0074c8
parentb961ff3075f8ceeeff5fbcbd2afbb29f94867bca (diff)
not really animated backgrounds
-rw-r--r--aoscene.cpp8
-rw-r--r--courtroom.cpp32
2 files changed, 22 insertions, 18 deletions
diff --git a/aoscene.cpp b/aoscene.cpp
index 2e266109..61cd342d 100644
--- a/aoscene.cpp
+++ b/aoscene.cpp
@@ -14,16 +14,20 @@ AOScene::AOScene(QWidget *parent, AOApplication *p_ao_app) : QLabel(parent)
void AOScene::set_image(QString p_image)
{
- QString background_path = ao_app->get_background_path() + p_image;
+ QString background_path = ao_app->get_background_path() + p_image + ".png";
+ QString animated_background_path = ao_app->get_background_path() + p_image + ".gif";
QString default_path = ao_app->get_default_background_path() + p_image;
QPixmap background(background_path);
+ QPixmap animated_background(animated_background_path);
QPixmap default_bg(default_path);
int w = this->width();
int h = this->height();
- if (file_exists(background_path))
+ if (file_exists(animated_background_path))
+ this->setPixmap(animated_background.scaled(w, h));
+ else if (file_exists(background_path))
this->setPixmap(background.scaled(w, h));
else
this->setPixmap(default_bg.scaled(w, h));
diff --git a/courtroom.cpp b/courtroom.cpp
index 244a9c06..38da0683 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -1348,48 +1348,48 @@ void Courtroom::set_scene()
show_testimony();
//witness is default if pos is invalid
- QString f_background = "witnessempty.png";
- QString f_desk_image = "stand.png";
+ QString f_background = "witnessempty";
+ QString f_desk_image = "stand";
QString f_desk_mod = m_chatmessage[DESK_MOD];
QString f_side = m_chatmessage[SIDE];
if (f_side == "def")
{
- f_background = "defenseempty.png";
+ f_background = "defenseempty";
if (is_ao2_bg)
- f_desk_image = "defensedesk.png";
+ f_desk_image = "defensedesk";
else
- f_desk_image = "bancodefensa.png";
+ f_desk_image = "bancodefensa";
}
else if (f_side == "pro")
{
- f_background = "prosecutorempty.png";
+ f_background = "prosecutorempty";
if (is_ao2_bg)
- f_desk_image = "prosecutiondesk.png";
+ f_desk_image = "prosecutiondesk";
else
- f_desk_image = "bancoacusacion.png";
+ f_desk_image = "bancoacusacion";
}
else if (f_side == "jud")
{
- f_background = "judgestand.png";
- f_desk_image = "judgedesk.png";
+ f_background = "judgestand";
+ f_desk_image = "judgedesk";
}
else if (f_side == "hld")
{
- f_background = "helperstand.png";
- f_desk_image = "helperdesk.png";
+ f_background = "helperstand";
+ f_desk_image = "helperdesk";
}
else if (f_side == "hlp")
{
- f_background = "prohelperstand.png";
- f_desk_image = "prohelperdesk.png";
+ f_background = "prohelperstand";
+ f_desk_image = "prohelperdesk";
}
else
{
if (is_ao2_bg)
- f_desk_image = "stand.png";
+ f_desk_image = "stand";
else
- f_desk_image = "estrado.png";
+ f_desk_image = "estrado";
}
ui_vp_background->set_image(f_background);