aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2021-02-16 11:20:54 +0300
committerCrystalwarrior <varsash@gmail.com>2021-02-16 11:20:54 +0300
commit63128fea1362b0fe2388ff0b85b9f1120806b332 (patch)
tree4ce37a4d76f4e9e285ab529f17309cde88f0a55c /src
parent5063880530c98d17e6d15a888f7c4a8462351e52 (diff)
Stop supporting the DRO way (we will make a .bat file or utility that does it for you automatically instead!)
Add an option to enable/disable stickers Make stickers actually respect the custom chatbox setting properly
Diffstat (limited to 'src')
-rw-r--r--src/aolayer.cpp7
-rw-r--r--src/aooptionsdialog.cpp14
-rw-r--r--src/courtroom.cpp3
-rw-r--r--src/text_file_functions.cpp6
4 files changed, 25 insertions, 5 deletions
diff --git a/src/aolayer.cpp b/src/aolayer.cpp
index 8d2c7960..e2a1f075 100644
--- a/src/aolayer.cpp
+++ b/src/aolayer.cpp
@@ -240,12 +240,11 @@ void InterfaceLayer::load_image(QString p_filename, QString p_miscname)
void StickerLayer::load_image(QString p_charname)
{
- QString p_miscname = ao_app->get_chat(p_charname);
+ QString p_miscname;
+ if (ao_app->is_customchat_enabled())
+ p_miscname = ao_app->get_chat(p_charname);
transform_mode = ao_app->get_misc_scaling(p_miscname);
QString final_image = ao_app->get_image("sticker/" + p_charname, ao_app->current_theme, ao_app->get_subtheme(), ao_app->default_theme, p_miscname);
- if (!file_exists((final_image)))
- final_image = ao_app->get_image_suffix(
- ao_app->get_character_path(p_charname, "showname")), // Scuffed DRO way
start_playback(final_image);
}
diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp
index dfd8555d..5817d96e 100644
--- a/src/aooptionsdialog.cpp
+++ b/src/aooptionsdialog.cpp
@@ -486,6 +486,19 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_customchat_cb);
row += 1;
+ ui_sticker_lbl = new QLabel(ui_form_layout_widget);
+ ui_sticker_lbl->setText(tr("Stickers:"));
+ ui_sticker_lbl->setToolTip(
+ tr("Turn this on to allow characters to define their own "
+ "stickers (unique images that show up over the chatbox - like avatars or shownames)."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_sticker_lbl);
+
+ ui_sticker_cb = new QCheckBox(ui_form_layout_widget);
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_sticker_cb);
+
+ row += 1;
ui_continuous_lbl = new QLabel(ui_form_layout_widget);
ui_continuous_lbl->setText(tr("Continuous Playback:"));
ui_continuous_lbl->setToolTip(
@@ -909,6 +922,7 @@ void AOOptionsDialog::update_values() {
ui_stickyeffects_cb->setChecked(ao_app->is_stickyeffects_enabled());
ui_stickypres_cb->setChecked(ao_app->is_stickypres_enabled());
ui_customchat_cb->setChecked(ao_app->is_customchat_enabled());
+ ui_sticker_cb->setChecked(ao_app->is_sticker_enabled());
ui_continuous_cb->setChecked(ao_app->is_continuous_enabled());
ui_category_stop_cb->setChecked(ao_app->is_category_stop_enabled());
ui_blank_blips_cb->setChecked(ao_app->get_blank_blip());
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 3d67defe..183bcbaf 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -3209,7 +3209,8 @@ void Courtroom::start_chat_ticking()
ui_vp_chatbox->show();
ui_vp_message->show();
- ui_vp_sticker->load_image(m_chatmessage[CHAR_NAME]);
+ if (ao_app->is_sticker_enabled())
+ ui_vp_sticker->load_image(m_chatmessage[CHAR_NAME]);
if (m_chatmessage[ADDITIVE] != "1") {
ui_vp_message->clear();
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index 45df30dc..4718f745 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -981,6 +981,12 @@ bool AOApplication::is_customchat_enabled()
return result.startsWith("true");
}
+bool AOApplication::is_sticker_enabled()
+{
+ QString result = configini->value("sticker", "true").value<QString>();
+ return result.startsWith("true");
+}
+
bool AOApplication::is_continuous_enabled()
{
QString result = configini->value("continuous_playback", "true").value<QString>();