From 1bc1ec6d4005ab46314c20c680aca4157d5c2244 Mon Sep 17 00:00:00 2001 From: OmniTroid Date: Sun, 26 Mar 2017 01:00:48 +0100 Subject: [PATCH] added get_emote_mod function --- aoapplication.h | 1 + text_file_functions.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/aoapplication.h b/aoapplication.h index 9fa9bb2..0dc15e9 100644 --- a/aoapplication.h +++ b/aoapplication.h @@ -127,6 +127,7 @@ public: QString get_sfx_name(QString p_char, int p_emote); int get_sfx_delay(QString p_char, int p_emote); int get_emote_mod(QString p_char, int p_emote); + int get_desk_mod(QString p_char, int p_emote); QString get_gender(QString p_char); private: diff --git a/text_file_functions.cpp b/text_file_functions.cpp index 82e76a8..5d809c3 100644 --- a/text_file_functions.cpp +++ b/text_file_functions.cpp @@ -452,6 +452,19 @@ int AOApplication::get_emote_mod(QString p_char, int p_emote) else return result_contents.at(3).toInt(); } +int AOApplication::get_desk_mod(QString p_char, int p_emote) +{ + QString f_result = read_char_ini(p_char, QString::number(p_emote + 1), "[Emotions]", "[SoundN]"); + + QStringList result_contents = f_result.split("#"); + + if (result_contents.size() < 5) + { + return -1; + } + else return result_contents.at(4).toInt(); +} + QString AOApplication::get_sfx_name(QString p_char, int p_emote) { QString f_result = read_char_ini(p_char, QString::number(p_emote + 1), "[SoundN]", "[SoundT]");