aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-10-23 05:08:20 +0300
committerCrystalwarrior <varsash@gmail.com>2019-10-23 05:08:20 +0300
commitbef368e98651fa01e743728a2a88783fdfab74ac (patch)
tree678dcf6bc0149770da5d467b3d1f1d52d1512b83
parent3595fd11e60fd07a2a6802150f4dff60cf6669fc (diff)
Allow gender (blip sounds) that don't use sfx-blip naming convention
Fix "prezoom" packet being ignored Allow char.ini's to indicate a zoom w/ preanimation by using emote_mod=4 ((ALL OF THESE ARE UNTESTED - TESTING NEEDED!))
-rw-r--r--include/aocharmovie.h2
-rw-r--r--src/courtroom.cpp8
-rw-r--r--src/emotes.cpp2
-rw-r--r--src/packet_distribution.cpp2
-rw-r--r--src/text_file_functions.cpp6
5 files changed, 12 insertions, 8 deletions
diff --git a/include/aocharmovie.h b/include/aocharmovie.h
index 8aed1eb8..15fa7cf4 100644
--- a/include/aocharmovie.h
+++ b/include/aocharmovie.h
@@ -67,7 +67,7 @@ private:
QElapsedTimer actual_time;
- //it will forever be a mystery who thought this time_mod system would ever be a good idea with precision-based emotes
+ //Usually used to turn seconds into milliseconds such as for [Time] tag in char.ini
const int time_mod = 60;
// These are the X and Y values before they are fixed based on the sprite's width.
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 7cb5cf39..fec354a0 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -1391,7 +1391,7 @@ void Courtroom::on_chat_return_pressed()
{
if (ui_pre->isChecked())
{
- if (f_emote_mod == 5)
+ if (f_emote_mod == 4 || f_emote_mod == 5)
f_emote_mod = 6;
else
f_emote_mod = 2;
@@ -1957,7 +1957,7 @@ void Courtroom::play_char_sfx(QString sfx_name)
{
sfx_player->play(ao_app->get_sfx_suffix(sfx_name));
if(ao_app->get_looping_sfx())
- sfx_player->set_looping(ao_app->get_sfx_looping(current_char, sfx_name)!="0");
+ sfx_player->set_looping(ao_app->get_sfx_looping(current_char, QString::number(current_emote))!="0");
}
void Courtroom::handle_chatmessage_3()
@@ -2396,7 +2396,7 @@ void Courtroom::play_preanim(bool noninterrupting)
//all time values in char.inis are multiplied by a constant(time_mod) to get the actual time
int ao2_duration = ao_app->get_ao2_preanim_duration(f_char, f_preanim);
int text_delay = ao_app->get_text_delay(f_char, f_preanim) * time_mod;
- int sfx_delay = m_chatmessage[SFX_DELAY].toInt() * 60;
+ int sfx_delay = m_chatmessage[SFX_DELAY].toInt() * time_mod;
int preanim_duration;
@@ -2493,7 +2493,7 @@ void Courtroom::start_chat_ticking()
QString f_gender = ao_app->get_gender(m_chatmessage[CHAR_NAME]);
- blip_player->set_blips(ao_app->get_sfx_suffix("sfx-blip" + f_gender));
+ blip_player->set_blips(ao_app->get_sfx_suffix(f_gender));
//means text is currently ticking
text_state = 1;
diff --git a/src/emotes.cpp b/src/emotes.cpp
index 58e85948..de53169e 100644
--- a/src/emotes.cpp
+++ b/src/emotes.cpp
@@ -159,7 +159,7 @@ void Courtroom::select_emote(int p_id)
{
ui_pre->setChecked(!ui_pre->isChecked());
}
- else if (emote_mod == 1)
+ else if (emote_mod == 1 || emote_mod == 4)
ui_pre->setChecked(true);
else
ui_pre->setChecked(false);
diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp
index 20a07a62..8c74b768 100644
--- a/src/packet_distribution.cpp
+++ b/src/packet_distribution.cpp
@@ -192,6 +192,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
{
if (f_packet.contains("yellowtext",Qt::CaseInsensitive))
yellow_text_enabled = true;
+ if (f_packet.contains("prezoom",Qt::CaseInsensitive))
+ prezoom_enabled = true;
if (f_packet.contains("flipping",Qt::CaseInsensitive))
flipping_enabled = true;
if (f_packet.contains("customobjections",Qt::CaseInsensitive))
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index 204de69f..f38bbb5e 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -628,8 +628,10 @@ QString AOApplication::get_gender(QString p_char)
QString f_result = read_char_ini(p_char, "gender", "Options");
if (f_result == "")
- return "male";
- else return f_result;
+ return "sfx-blipmale";
+ if (!file_exists(get_sfx(f_result)))
+ f_result = "sfx-blip" + f_result;
+ return f_result;
}
QString AOApplication::get_chat(QString p_char)