Skip to content

Commit 63128fe

Browse files
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
1 parent 5063880 commit 63128fe

6 files changed

Lines changed: 31 additions & 5 deletions

File tree

include/aoapplication.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ class AOApplication : public QApplication {
228228
// for settings.
229229
bool is_customchat_enabled();
230230

231+
// Returns the value of characer sticker (avatar) setting
232+
bool is_sticker_enabled();
233+
231234
// Returns the value of whether continuous playback should be used
232235
// from the config.ini.
233236
bool is_continuous_enabled();

include/aooptionsdialog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ class AOOptionsDialog : public QDialog {
108108
QLabel *ui_customchat_lbl;
109109
QCheckBox *ui_customchat_cb;
110110

111+
QLabel *ui_sticker_lbl;
112+
QCheckBox *ui_sticker_cb;
113+
111114
QLabel *ui_continuous_lbl;
112115
QCheckBox *ui_continuous_cb;
113116

src/aolayer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,11 @@ void InterfaceLayer::load_image(QString p_filename, QString p_miscname)
240240

241241
void StickerLayer::load_image(QString p_charname)
242242
{
243-
QString p_miscname = ao_app->get_chat(p_charname);
243+
QString p_miscname;
244+
if (ao_app->is_customchat_enabled())
245+
p_miscname = ao_app->get_chat(p_charname);
244246
transform_mode = ao_app->get_misc_scaling(p_miscname);
245247
QString final_image = ao_app->get_image("sticker/" + p_charname, ao_app->current_theme, ao_app->get_subtheme(), ao_app->default_theme, p_miscname);
246-
if (!file_exists((final_image)))
247-
final_image = ao_app->get_image_suffix(
248-
ao_app->get_character_path(p_charname, "showname")), // Scuffed DRO way
249248
start_playback(final_image);
250249
}
251250

src/aooptionsdialog.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,19 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
485485

486486
ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_customchat_cb);
487487

488+
row += 1;
489+
ui_sticker_lbl = new QLabel(ui_form_layout_widget);
490+
ui_sticker_lbl->setText(tr("Stickers:"));
491+
ui_sticker_lbl->setToolTip(
492+
tr("Turn this on to allow characters to define their own "
493+
"stickers (unique images that show up over the chatbox - like avatars or shownames)."));
494+
495+
ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_sticker_lbl);
496+
497+
ui_sticker_cb = new QCheckBox(ui_form_layout_widget);
498+
499+
ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_sticker_cb);
500+
488501
row += 1;
489502
ui_continuous_lbl = new QLabel(ui_form_layout_widget);
490503
ui_continuous_lbl->setText(tr("Continuous Playback:"));
@@ -909,6 +922,7 @@ void AOOptionsDialog::update_values() {
909922
ui_stickyeffects_cb->setChecked(ao_app->is_stickyeffects_enabled());
910923
ui_stickypres_cb->setChecked(ao_app->is_stickypres_enabled());
911924
ui_customchat_cb->setChecked(ao_app->is_customchat_enabled());
925+
ui_sticker_cb->setChecked(ao_app->is_sticker_enabled());
912926
ui_continuous_cb->setChecked(ao_app->is_continuous_enabled());
913927
ui_category_stop_cb->setChecked(ao_app->is_category_stop_enabled());
914928
ui_blank_blips_cb->setChecked(ao_app->get_blank_blip());

src/courtroom.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3209,7 +3209,8 @@ void Courtroom::start_chat_ticking()
32093209
ui_vp_chatbox->show();
32103210
ui_vp_message->show();
32113211

3212-
ui_vp_sticker->load_image(m_chatmessage[CHAR_NAME]);
3212+
if (ao_app->is_sticker_enabled())
3213+
ui_vp_sticker->load_image(m_chatmessage[CHAR_NAME]);
32133214

32143215
if (m_chatmessage[ADDITIVE] != "1") {
32153216
ui_vp_message->clear();

src/text_file_functions.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,12 @@ bool AOApplication::is_customchat_enabled()
981981
return result.startsWith("true");
982982
}
983983

984+
bool AOApplication::is_sticker_enabled()
985+
{
986+
QString result = configini->value("sticker", "true").value<QString>();
987+
return result.startsWith("true");
988+
}
989+
984990
bool AOApplication::is_continuous_enabled()
985991
{
986992
QString result = configini->value("continuous_playback", "true").value<QString>();

0 commit comments

Comments
 (0)