fixed some sfx issues

This commit is contained in:
OmniTroid 2017-02-15 23:15:06 +01:00
parent eb2c0b1b4a
commit 897e19546a
6 changed files with 22 additions and 24 deletions

View File

@ -13,7 +13,7 @@ RC_ICONS = logo.ico
TARGET = Attorney_Online_remake
TEMPLATE = app
VERSION = 2.1.7.0
VERSION = 2.1.8.0
SOURCES += main.cpp\
lobby.cpp \

View File

@ -120,7 +120,7 @@ public:
private:
const int RELEASE = 2;
const int MAJOR_VERSION = 1;
const int MINOR_VERSION = 7;
const int MINOR_VERSION = 8;
QString user_theme = "default";

View File

@ -1010,6 +1010,7 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
return;
text_state = 0;
qDebug() << "anim_state set to 0 in handle_chatmessage";
anim_state = 0;
chatmessage_is_empty = m_chatmessage[MESSAGE] == " " || m_chatmessage[MESSAGE] == "";
@ -1075,6 +1076,7 @@ void Courtroom::objection_done()
void Courtroom::handle_chatmessage_2()
{
qDebug() << "handle_chatmessage_2 called";
ui_vp_speedlines->stop();
ui_vp_player_char->stop();
@ -1102,14 +1104,13 @@ void Courtroom::handle_chatmessage_2()
switch (emote_mod)
{
case 1: case 2: case 3: case 4: case 6:
case 1: case 2: case 6:
play_preanim();
break;
default:
qDebug() << "W: invalid emote mod: " << QString::number(emote_mod);
//intentional fallthru
case 0: case 5:
start_chat_ticking();
handle_chatmessage_3();
}
}
@ -1205,6 +1206,13 @@ void Courtroom::play_preanim()
QString f_char = m_chatmessage[CHAR_NAME];
QString f_preanim = m_chatmessage[PRE_EMOTE];
//all time values in char.inis are multiplied by a constant(time_mod) to get the actual time
int preanim_duration = ao_app->get_ao2_preanim_duration(f_char, f_preanim) * time_mod;
int text_delay = ao_app->get_text_delay(f_char, f_preanim) * time_mod;
int sfx_delay = m_chatmessage[SFX_DELAY].toInt() * time_mod;
sfx_delay_timer->start(sfx_delay);
if (!file_exists(ao_app->get_character_path(f_char) + f_preanim.toLower() + ".gif"))
{
anim_state = 1;
@ -1213,20 +1221,16 @@ void Courtroom::play_preanim()
return;
}
//all time values in char.inis are multiplied by a constant(time_mod) to get the actual time
int preanim_duration = ao_app->get_ao2_preanim_duration(f_char, f_preanim) * time_mod;
int text_delay = ao_app->get_text_delay(f_char, f_preanim) * time_mod;
int sfx_delay = m_chatmessage[SFX_DELAY].toInt() * time_mod;
ui_vp_player_char->play_pre(f_char, f_preanim, preanim_duration);
anim_state = 1;
if (text_delay >= 0)
text_delay_timer->start(text_delay);
sfx_delay_timer->start(sfx_delay);
}
void Courtroom::preanim_done()
{
qDebug() << "preanim_done called";
handle_chatmessage_3();
}
@ -1273,11 +1277,8 @@ void Courtroom::chat_tick()
{
text_state = 2;
chat_tick_timer->stop();
if (anim_state == 2)
{
anim_state = 3;
ui_vp_player_char->play_idle(m_chatmessage[CHAR_NAME], m_chatmessage[EMOTE]);
}
anim_state = 3;
ui_vp_player_char->play_idle(m_chatmessage[CHAR_NAME], m_chatmessage[EMOTE]);
}
else
@ -1822,7 +1823,8 @@ void Courtroom::on_reload_theme_clicked()
set_background(current_background);
enter_courtroom(m_cid);
anim_state = 4;
text_state = 3;
}
void Courtroom::on_back_to_lobby_clicked()

View File

@ -25,7 +25,6 @@
#include <QVector>
#include <QCloseEvent>
#include <QSignalMapper>
#include <QSoundEffect>
#include <QMap>
class AOApplication;

View File

@ -1,17 +1,16 @@
#include "aoapplication.h"
#include "courtroom.h"
#ifndef OMNI_WIN_DEBUG
#define OMNI_WIN_DEBUG
#include <QDir>
#include <QDebug>
#endif
QString AOApplication::get_base_path()
{
#ifdef OMNI_DEBUG
return "/media/omnitroid/Data/winshare/AO/client/base/";
#elif defined(OMNI_WIN_DEBUG)
return "E:/AO/client/base/";
#else
return (QDir::currentPath() + "/base/");
#endif

View File

@ -130,8 +130,6 @@ pos_size_type AOApplication::get_pos_and_size(QString p_identifier, QString p_de
return return_value;
}
qDebug() << "W: Could not find proper " << p_identifier << " in " << p_design_path;
//caller should deal with the result properly(check width and height of output for negatives)
return_value.height = -1;
return_value.width = -1;