diff options
| author | TrickyLeifa <date.epoch@gmail.com> | 2024-05-17 16:39:30 +0200 |
|---|---|---|
| committer | TrickyLeifa <date.epoch@gmail.com> | 2024-05-17 19:04:57 +0200 |
| commit | 1ef96383c8f7ed136a0e028aef0835b4838b5e95 (patch) | |
| tree | e87a9df097a50b4d1f918f8a4f37d210562d10d6 /src/text_file_functions.cpp | |
| parent | 39e4354b1dae5d8487ea5b84be9f304b1950a61a (diff) | |
Lightly reworked `NetworkManager`, ...
* Lightly reworked `NetworkManager`
* Added new modules to handle various connection types.
* TCP
* WebSocket
* Added general string splitter alias based on Qt version.
* Replaced `lobby_constructed` and `courtroom_constructed`
* Refactored and partially reimplemented the following classes:
* `AOBlipPlayer`
* `AOEmotePreview`
* `AOMusicPlayer`
* `AOSfxPlayer`
* `AOTextArea`
Diffstat (limited to 'src/text_file_functions.cpp')
| -rw-r--r-- | src/text_file_functions.cpp | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 0390225f..e7c4511b 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -447,13 +447,15 @@ 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) { + 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()) { + if (!temp_f_result.isEmpty()) + { f_result = temp_f_result; } } @@ -485,30 +487,38 @@ QString AOApplication::get_blipname(QString p_char, int p_emote) { QString f_result = read_char_ini(p_char, "blips", "Options"); - if (p_emote != -1) { - int override_idx = - read_char_ini(p_char, QString::number(p_emote + 1), "OptionsN").toInt(); - if (override_idx > 0) { + 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()) { + if (!temp_f_result.isEmpty()) + { f_result = temp_f_result; } } } - if (f_result == "") { - f_result = - read_char_ini(p_char, "gender", "Options"); // not very PC, FanatSors - if (f_result == "") f_result = "male"; + 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(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 } |
