aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/courtroom.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index f39ec820..7a65391a 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -4468,7 +4468,7 @@ void Courtroom::set_iniswap_dropdown()
}
QStringList iniswaps =
ao_app->get_list_file(ao_app->get_character_path(char_list.at(m_cid).name, "iniswaps.ini")) +
- ao_app->get_list_file(ao_app->get_base_path() + "iniswaps.ini");
+ ao_app->get_list_file(VPath("iniswaps.ini"));
if (ao_app->get_char_name(char_list.at(m_cid).name) != char_list.at(m_cid).name)
iniswaps.append(ao_app->get_char_name(char_list.at(m_cid).name));
@@ -4510,9 +4510,11 @@ void Courtroom::on_iniswap_dropdown_changed(int p_index)
if (!swaplist.contains(entry) && entry != char_list.at(m_cid).name && !defswaplist.contains(entry))
swaplist.append(entry);
}
- ao_app->write_to_file(
- swaplist.join("\n"),
- ao_app->get_base_path() + "iniswaps.ini");
+ QString p_path = ao_app->get_real_path(VPath("iniswaps.ini"));
+ if (!file_exists(p_path)) {
+ p_path = ao_app->get_base_path() + "iniswaps.ini";
+ }
+ ao_app->write_to_file(swaplist.join("\n"), p_path);
ui_iniswap_dropdown->blockSignals(true);
ui_iniswap_dropdown->setCurrentIndex(p_index);
ui_iniswap_dropdown->blockSignals(false);
@@ -4586,8 +4588,7 @@ void Courtroom::set_sfx_dropdown()
}
// Append default sound list after the character sound list.
- sound_list += ao_app->get_list_file(
- ao_app->get_base_path() + "soundlist.ini");
+ sound_list += ao_app->get_list_file(VPath("soundlist.ini"));
QStringList display_sounds;
for (const QString &sound : qAsConst(sound_list)) {
@@ -4635,7 +4636,7 @@ void Courtroom::on_sfx_context_menu_requested(const QPoint &pos)
menu->addAction(QString("Edit " + current_char + "/soundlist.ini"), this,
&Courtroom::on_sfx_edit_requested);
else
- menu->addAction(QString("Edit global soundlist.ini"), this,
+ menu->addAction(QString("Edit base soundlist.ini"), this,
&Courtroom::on_sfx_edit_requested);
if (!custom_sfx.isEmpty())
menu->addAction(QString("Clear Edit Text"), this, &Courtroom::on_sfx_remove_clicked);
@@ -4655,6 +4656,10 @@ void Courtroom::on_sfx_edit_requested()
}
if (!file_exists(p_path)) {
+ p_path = ao_app->get_real_path(VPath("soundlist.ini"));
+ }
+
+ if (!file_exists(p_path)) {
p_path = ao_app->get_base_path() + "soundlist.ini";
}
QDesktopServices::openUrl(QUrl::fromLocalFile(p_path));