aboutsummaryrefslogtreecommitdiff
path: root/src/text_file_functions.cpp
diff options
context:
space:
mode:
authorTrickyLeifa <date.epoch@gmail.com>2024-05-15 00:23:46 +0200
committerTrickyLeifa <date.epoch@gmail.com>2024-05-15 00:23:46 +0200
commita0cee58c048772b2dcfe3992f60728d5a6f7d786 (patch)
treefe98e757a87672af293800f62aa41eb8d52dcc72 /src/text_file_functions.cpp
parentc9f52b7223685d2e7fca925594171f94dd8c6e3b (diff)
parentc9eabf35dafa22f7ad7f012c23f63f1605a47668 (diff)
Merge branch 'master' into kaleidoscope
Diffstat (limited to 'src/text_file_functions.cpp')
-rw-r--r--src/text_file_functions.cpp53
1 files changed, 37 insertions, 16 deletions
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index d8d0c61c..0390225f 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -442,11 +442,23 @@ QStringList AOApplication::read_ini_tags(VPath p_path, QString target_tag)
return r_values;
}
-QString AOApplication::get_showname(QString p_char)
+QString AOApplication::get_showname(QString p_char, int p_emote)
{
QString f_result = read_char_ini(p_char, "showname", "Options");
QString f_needed = read_char_ini(p_char, "needs_showname", "Options");
+ if (p_emote != -1) {
+ int override_idx =
+ read_char_ini(p_char, QString::number(p_emote + 1), "OptionsN").toInt();
+ if (override_idx > 0) {
+ QString override_key = "Options" + QString::number(override_idx);
+ QString temp_f_result = read_char_ini(p_char, "showname", override_key);
+ if (!temp_f_result.isEmpty()) {
+ f_result = temp_f_result;
+ }
+ }
+ }
+
if (f_needed.startsWith("false"))
{
return "";
@@ -469,30 +481,39 @@ QString AOApplication::get_char_side(QString p_char)
return f_result;
}
-QString AOApplication::get_blips(QString p_char)
+QString AOApplication::get_blipname(QString p_char, int p_emote)
{
QString f_result = read_char_ini(p_char, "blips", "Options");
- if (f_result == "")
- {
- f_result = read_char_ini(p_char, "gender", "Options"); // not very PC, FanatSors
- if (f_result == "")
- {
- f_result = "male";
+ if (p_emote != -1) {
+ int override_idx =
+ read_char_ini(p_char, QString::number(p_emote + 1), "OptionsN").toInt();
+ if (override_idx > 0) {
+ QString override_key = "Options" + QString::number(override_idx);
+ QString temp_f_result = read_char_ini(p_char, "blips", override_key);
+ if (!temp_f_result.isEmpty()) {
+ f_result = temp_f_result;
+ }
}
}
- if (!file_exists(get_sfx_suffix(get_sounds_path(f_result))))
- {
- if (file_exists(get_sfx_suffix(get_sounds_path("../blips/" + f_result))))
- {
- return "../blips/" + f_result; // Return the cool kids variant
- }
-
- return "sfx-blip" + f_result; // Return legacy variant
+ if (f_result == "") {
+ f_result =
+ read_char_ini(p_char, "gender", "Options"); // not very PC, FanatSors
+ if (f_result == "") f_result = "male";
}
return f_result;
}
+QString AOApplication::get_blips(QString p_blipname)
+{
+ if (!file_exists(get_sfx_suffix(get_sounds_path(p_blipname)))) {
+ if (file_exists(get_sfx_suffix(get_sounds_path("../blips/" + p_blipname))))
+ return "../blips/" + p_blipname; // Return the cool kids variant
+
+ return "sfx-blip" + p_blipname; // Return legacy variant
+ }
+ return p_blipname;
+}
QString AOApplication::get_emote_property(QString p_char, QString p_emote, QString p_property)
{