aboutsummaryrefslogtreecommitdiff
path: root/src/aooptionsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/aooptionsdialog.cpp')
-rw-r--r--src/aooptionsdialog.cpp499
1 files changed, 282 insertions, 217 deletions
diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp
index e2c6ac8c..6cedee8d 100644
--- a/src/aooptionsdialog.cpp
+++ b/src/aooptionsdialog.cpp
@@ -1,5 +1,6 @@
#include "aooptionsdialog.h"
#include "aoapplication.h"
+#include "bass.h"
AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
: QDialog(parent)
@@ -9,11 +10,11 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
// Setting up the basics.
// setAttribute(Qt::WA_DeleteOnClose);
setWindowTitle(tr("Settings"));
- resize(398, 360);
+ resize(398, 320);
ui_settings_buttons = new QDialogButtonBox(this);
- QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
sizePolicy1.setHeightForWidth(
@@ -39,16 +40,13 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_vertical_layout->addWidget(ui_settings_buttons);
// Let's add the tabs one by one.
-
- //
- // GAMEPLAY
- //
-
+ // First, we'll start with 'Gameplay'.
ui_gameplay_tab = new QWidget();
+ ui_gameplay_tab->setSizePolicy(sizePolicy1);
ui_settings_tabs->addTab(ui_gameplay_tab, tr("Gameplay"));
-
ui_form_layout_widget = new QWidget(ui_gameplay_tab);
- ui_form_layout_widget->setGeometry(QRect(10, 10, 361, 240));
+ ui_form_layout_widget->setGeometry(QRect(10, 10, 361, 361));
+ ui_form_layout_widget->setSizePolicy(sizePolicy1);
ui_gameplay_form = new QFormLayout(ui_form_layout_widget);
ui_gameplay_form->setLabelAlignment(Qt::AlignLeading | Qt::AlignLeft |
@@ -56,6 +54,9 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_gameplay_form->setFormAlignment(Qt::AlignLeading | Qt::AlignLeft |
Qt::AlignTop);
ui_gameplay_form->setContentsMargins(0, 0, 0, 0);
+ ui_gameplay_form->setSpacing(2);
+
+ int row = 0;
ui_theme_label = new QLabel(ui_form_layout_widget);
ui_theme_label->setText(tr("Theme:"));
@@ -64,8 +65,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
"the lobby's look as well, you'll need to reload the "
"lobby for the changes to take effect, such as by joining "
"a server and leaving it."));
- ui_gameplay_form->setWidget(0, QFormLayout::LabelRole, ui_theme_label);
-
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_theme_label);
ui_theme_combobox = new QComboBox(ui_form_layout_widget);
// Fill the combobox with the names of the themes.
@@ -79,64 +79,108 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_theme_combobox->setCurrentIndex(ui_theme_combobox->count() - 1);
}
- ui_gameplay_form->setWidget(0, QFormLayout::FieldRole, ui_theme_combobox);
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_theme_combobox);
+ row += 1;
ui_theme_log_divider = new QFrame(ui_form_layout_widget);
ui_theme_log_divider->setMidLineWidth(0);
ui_theme_log_divider->setFrameShape(QFrame::HLine);
ui_theme_log_divider->setFrameShadow(QFrame::Sunken);
- ui_gameplay_form->setWidget(1, QFormLayout::FieldRole, ui_theme_log_divider);
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole,
+ ui_theme_log_divider);
+
+ row += 1;
+ ui_downwards_lbl = new QLabel(ui_form_layout_widget);
+ ui_downwards_lbl->setText(tr("Log goes downwards:"));
+ ui_downwards_lbl->setToolTip(
+ tr("If ticked, new messages will appear at "
+ "the bottom (like the OOC chatlog). The traditional "
+ "(AO1) behaviour is equivalent to this being unticked."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_downwards_lbl);
+
+ ui_downwards_cb = new QCheckBox(ui_form_layout_widget);
+ ui_downwards_cb->setChecked(p_ao_app->get_log_goes_downwards());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_downwards_cb);
+
+ row += 1;
+ ui_length_lbl = new QLabel(ui_form_layout_widget);
+ ui_length_lbl->setText(tr("Log length:"));
+ ui_length_lbl->setToolTip(tr(
+ "The amount of messages the IC chatlog will keep before "
+ "deleting older messages. A value of 0 or below counts as 'infinite'."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_length_lbl);
+
+ ui_length_spinbox = new QSpinBox(ui_form_layout_widget);
+ ui_length_spinbox->setMaximum(10000);
+ ui_length_spinbox->setValue(p_ao_app->get_max_log_size());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_length_spinbox);
+
+ row += 1;
+ ui_log_names_divider = new QFrame(ui_form_layout_widget);
+ ui_log_names_divider->setFrameShape(QFrame::HLine);
+ ui_log_names_divider->setFrameShadow(QFrame::Sunken);
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole,
+ ui_log_names_divider);
+ row += 1;
ui_username_lbl = new QLabel(ui_form_layout_widget);
ui_username_lbl->setText(tr("Default username:"));
ui_username_lbl->setToolTip(
tr("Your OOC name will be automatically set to this value "
"when you join a server."));
- ui_gameplay_form->setWidget(2, QFormLayout::LabelRole, ui_username_lbl);
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_username_lbl);
ui_username_textbox = new QLineEdit(ui_form_layout_widget);
ui_username_textbox->setMaxLength(30);
ui_username_textbox->setText(p_ao_app->get_default_username());
- ui_gameplay_form->setWidget(2, QFormLayout::FieldRole, ui_username_textbox);
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_username_textbox);
+ row += 1;
ui_showname_lbl = new QLabel(ui_form_layout_widget);
ui_showname_lbl->setText(tr("Custom shownames:"));
ui_showname_lbl->setToolTip(
tr("Gives the default value for the in-game 'Custom shownames' "
- "checkbox, which in turn determines whether the client should "
+ "tickbox, which in turn determines whether the client should "
"display custom in-character names."));
- ui_gameplay_form->setWidget(3, QFormLayout::LabelRole, ui_showname_lbl);
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_showname_lbl);
ui_showname_cb = new QCheckBox(ui_form_layout_widget);
ui_showname_cb->setChecked(p_ao_app->get_showname_enabled_by_default());
- ui_gameplay_form->setWidget(3, QFormLayout::FieldRole, ui_showname_cb);
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_showname_cb);
+ row += 1;
ui_net_divider = new QFrame(ui_form_layout_widget);
ui_net_divider->setFrameShape(QFrame::HLine);
ui_net_divider->setFrameShadow(QFrame::Sunken);
- ui_gameplay_form->setWidget(4, QFormLayout::FieldRole, ui_net_divider);
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_net_divider);
+ row += 1;
ui_ms_lbl = new QLabel(ui_form_layout_widget);
ui_ms_lbl->setText(tr("Backup MS:"));
ui_ms_lbl->setToolTip(
tr("If the built-in server lookups fail, the game will try the "
"address given here and use it as a backup master server address."));
- ui_gameplay_form->setWidget(5, QFormLayout::LabelRole, ui_ms_lbl);
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_ms_lbl);
QSettings *configini = ao_app->configini;
ui_ms_textbox = new QLineEdit(ui_form_layout_widget);
ui_ms_textbox->setText(configini->value("master", "").value<QString>());
- ui_gameplay_form->setWidget(5, QFormLayout::FieldRole, ui_ms_textbox);
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_ms_textbox);
+ row += 1;
ui_discord_lbl = new QLabel(ui_form_layout_widget);
ui_discord_lbl->setText(tr("Discord:"));
ui_discord_lbl->setToolTip(
@@ -144,68 +188,152 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
"what character are you playing, and how long you have "
"been playing for."));
- ui_gameplay_form->setWidget(6, QFormLayout::LabelRole, ui_discord_lbl);
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_discord_lbl);
ui_discord_cb = new QCheckBox(ui_form_layout_widget);
ui_discord_cb->setChecked(ao_app->is_discord_enabled());
- ui_gameplay_form->setWidget(6, QFormLayout::FieldRole, ui_discord_cb);
-
- ui_epilepsy_lbl = new QLabel(ui_form_layout_widget);
- ui_epilepsy_lbl->setText(tr("Allow Shake/Flash:"));
- ui_epilepsy_lbl->setToolTip(
- tr("Allows screenshaking and flashing. Disable this if you have concerns "
- "or issues with photosensitivity and/or seizures."));
-
- ui_gameplay_form->setWidget(7, QFormLayout::LabelRole, ui_epilepsy_lbl);
-
- ui_epilepsy_cb = new QCheckBox(ui_form_layout_widget);
- ui_epilepsy_cb->setChecked(ao_app->is_shakeandflash_enabled());
-
- ui_gameplay_form->setWidget(7, QFormLayout::FieldRole, ui_epilepsy_cb);
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_discord_cb);
+ row += 1;
ui_language_label = new QLabel(ui_form_layout_widget);
ui_language_label->setText(tr("Language:"));
ui_language_label->setToolTip(
tr("Sets the language if you don't want to use your system language."));
- ui_gameplay_form->setWidget(8, QFormLayout::LabelRole, ui_language_label);
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_language_label);
ui_language_combobox = new QComboBox(ui_form_layout_widget);
ui_language_combobox->addItem(
configini->value("language", " ").value<QString>() +
- " - Keep current setting");
+ tr(" - Keep current setting"));
ui_language_combobox->addItem(" - Default");
ui_language_combobox->addItem("en - English");
ui_language_combobox->addItem("de - Deutsch");
ui_language_combobox->addItem("es - Español");
ui_language_combobox->addItem("pt - Português");
- ui_language_combobox->addItem("pl - Polski");
+ ui_language_combobox->addItem("pl - Polskie");
ui_language_combobox->addItem("jp - 日本語");
ui_language_combobox->addItem("ru - Русский");
- ui_gameplay_form->setWidget(8, QFormLayout::FieldRole, ui_language_combobox);
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole,
+ ui_language_combobox);
- ui_net_divider = new QFrame(ui_form_layout_widget);
- ui_net_divider->setFrameShape(QFrame::HLine);
- ui_net_divider->setFrameShadow(QFrame::Sunken);
- ui_gameplay_form->setWidget(9, QFormLayout::FieldRole, ui_net_divider);
-
- ui_slower_blips_lb = new QLabel(ui_form_layout_widget);
- ui_slower_blips_lb->setText(tr("Slower text speed:"));
- ui_slower_blips_lb->setToolTip(tr("Set the text speed to be the same as the AA games."));
- ui_slower_blips_cb = new QCheckBox(ui_form_layout_widget);
- ui_slower_blips_cb->setChecked(p_ao_app->get_slower_blips());
- ui_gameplay_form->setWidget(10, QFormLayout::FieldRole, ui_slower_blips_cb);
- ui_gameplay_form->setWidget(10, QFormLayout::LabelRole, ui_slower_blips_lb);
-
- ui_pun_delay = new QLabel(ui_form_layout_widget);
- ui_pun_delay->setText(tr("Blip delay on punctuations:"));
- ui_pun_delay->setToolTip(tr("Punctuation delay modifier."
- " Enable it for the blips to slow down on punctuations."));
- ui_pun_delay_cb = new QCheckBox(ui_form_layout_widget);
- ui_pun_delay_cb->setChecked(p_ao_app->get_pundelay());
- ui_gameplay_form->setWidget(11, QFormLayout::FieldRole, ui_pun_delay_cb);
- ui_gameplay_form->setWidget(11, QFormLayout::LabelRole, ui_pun_delay);
+ row += 1;
+ ui_shake_lbl = new QLabel(ui_form_layout_widget);
+ ui_shake_lbl->setText(tr("Allow Screenshake:"));
+ ui_shake_lbl->setToolTip(
+ tr("Allows screenshaking. Disable this if you have concerns or issues "
+ "with photosensitivity and/or seizures."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_shake_lbl);
+
+ ui_shake_cb = new QCheckBox(ui_form_layout_widget);
+ ui_shake_cb->setChecked(ao_app->is_shake_enabled());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_shake_cb);
+
+ row += 1;
+ ui_effects_lbl = new QLabel(ui_form_layout_widget);
+ ui_effects_lbl->setText(tr("Allow Effects:"));
+ ui_effects_lbl->setToolTip(
+ tr("Allows screen effects. Disable this if you have concerns or issues "
+ "with photosensitivity and/or seizures."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_effects_lbl);
+
+ ui_effects_cb = new QCheckBox(ui_form_layout_widget);
+ ui_effects_cb->setChecked(ao_app->is_effects_enabled());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_effects_cb);
+
+ row += 1;
+ ui_framenetwork_lbl = new QLabel(ui_form_layout_widget);
+ ui_framenetwork_lbl->setText(tr("Network Frame Effects:"));
+ ui_framenetwork_lbl->setToolTip(tr(
+ "Send screen-shaking, flashes and sounds as defined in the char.ini over "
+ "the network. Only works for servers that support this functionality."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_framenetwork_lbl);
+
+ ui_framenetwork_cb = new QCheckBox(ui_form_layout_widget);
+ ui_framenetwork_cb->setChecked(ao_app->is_frame_network_enabled());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_framenetwork_cb);
+
+ row += 1;
+ ui_colorlog_lbl = new QLabel(ui_form_layout_widget);
+ ui_colorlog_lbl->setText(tr("Colors in IC Log:"));
+ ui_colorlog_lbl->setToolTip(
+ tr("Use the markup colors in the server IC chatlog."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_colorlog_lbl);
+
+ ui_colorlog_cb = new QCheckBox(ui_form_layout_widget);
+ ui_colorlog_cb->setChecked(ao_app->is_colorlog_enabled());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_colorlog_cb);
+ row += 1;
+ ui_stickysounds_lbl = new QLabel(ui_form_layout_widget);
+ ui_stickysounds_lbl->setText(tr("Sticky Sounds:"));
+ ui_stickysounds_lbl->setToolTip(
+ tr("Turn this on to prevent the sound dropdown from clearing the sound "
+ "after playing it."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_stickysounds_lbl);
+
+ ui_stickysounds_cb = new QCheckBox(ui_form_layout_widget);
+ ui_stickysounds_cb->setChecked(ao_app->is_stickysounds_enabled());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_stickysounds_cb);
+
+ row += 1;
+ ui_stickyeffects_lbl = new QLabel(ui_form_layout_widget);
+ ui_stickyeffects_lbl->setText(tr("Sticky Effects:"));
+ ui_stickyeffects_lbl->setToolTip(
+ tr("Turn this on to prevent the effects dropdown from clearing the "
+ "effect after playing it."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole,
+ ui_stickyeffects_lbl);
+
+ ui_stickyeffects_cb = new QCheckBox(ui_form_layout_widget);
+ ui_stickyeffects_cb->setChecked(ao_app->is_stickyeffects_enabled());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_stickyeffects_cb);
+
+ row += 1;
+ ui_stickypres_lbl = new QLabel(ui_form_layout_widget);
+ ui_stickypres_lbl->setText(tr("Sticky Preanims:"));
+ ui_stickypres_lbl->setToolTip(
+ tr("Turn this on to prevent preanimation checkbox from clearing after "
+ "playing the emote."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_stickypres_lbl);
+
+ ui_stickypres_cb = new QCheckBox(ui_form_layout_widget);
+ ui_stickypres_cb->setChecked(ao_app->is_stickypres_enabled());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_stickypres_cb);
+
+ row += 1;
+ ui_customchat_lbl = new QLabel(ui_form_layout_widget);
+ ui_customchat_lbl->setText(tr("Custom Chatboxes:"));
+ ui_customchat_lbl->setToolTip(
+ tr("Turn this on to allow characters to define their own "
+ "custom chat box designs."));
+
+ ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_customchat_lbl);
+
+ ui_customchat_cb = new QCheckBox(ui_form_layout_widget);
+ ui_customchat_cb->setChecked(ao_app->is_customchat_enabled());
+
+ ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_customchat_cb);
+
+ QScrollArea *scroll = new QScrollArea;
+ scroll->setWidget(ui_form_layout_widget);
+ ui_gameplay_tab->setLayout(new QVBoxLayout);
+ ui_gameplay_tab->layout()->addWidget(scroll);
+ ui_gameplay_tab->show();
// Here we start the callwords tab.
ui_callwords_tab = new QWidget();
@@ -257,24 +385,25 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_audio_layout->setFormAlignment(Qt::AlignLeading | Qt::AlignLeft |
Qt::AlignTop);
ui_audio_layout->setContentsMargins(0, 0, 0, 0);
+ row = 0;
ui_audio_device_lbl = new QLabel(ui_audio_widget);
ui_audio_device_lbl->setText(tr("Audio device:"));
ui_audio_device_lbl->setToolTip(tr("Sets the audio device for all sounds."));
- ui_audio_layout->setWidget(0, QFormLayout::LabelRole, ui_audio_device_lbl);
+ ui_audio_layout->setWidget(row, QFormLayout::LabelRole, ui_audio_device_lbl);
ui_audio_device_combobox = new QComboBox(ui_audio_widget);
// Let's fill out the combobox with the available audio devices. Or don't if
// there is no audio
+ int a = 0;
if (needs_default_audiodev()) {
- ui_audio_device_combobox->addItem("default");
+ ui_audio_device_combobox->addItem("default"); //TODO translate this without breaking the default audio device
}
#ifdef BASSAUDIO
BASS_DEVICEINFO info;
- int a = 0;
for (a = 0; BASS_GetDeviceInfo(a, &info); a++) {
ui_audio_device_combobox->addItem(info.name);
if (p_ao_app->get_audio_output_device() == info.name)
@@ -290,120 +419,131 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_audio_device_combobox->count() - 1);
}
#endif
- ui_audio_layout->setWidget(0, QFormLayout::FieldRole,
+ ui_audio_layout->setWidget(row, QFormLayout::FieldRole,
ui_audio_device_combobox);
+ row += 1;
ui_audio_volume_divider = new QFrame(ui_audio_widget);
ui_audio_volume_divider->setFrameShape(QFrame::HLine);
ui_audio_volume_divider->setFrameShadow(QFrame::Sunken);
- ui_audio_layout->setWidget(1, QFormLayout::FieldRole,
+ ui_audio_layout->setWidget(row, QFormLayout::FieldRole,
ui_audio_volume_divider);
+ row += 1;
ui_music_volume_lbl = new QLabel(ui_audio_widget);
ui_music_volume_lbl->setText(tr("Music:"));
- ui_music_volume_lbl->setToolTip(tr("Sets the default volume for music."));
+ ui_music_volume_lbl->setToolTip(tr("Sets the music's default volume."));
- ui_audio_layout->setWidget(2, QFormLayout::LabelRole, ui_music_volume_lbl);
+ ui_audio_layout->setWidget(row, QFormLayout::LabelRole, ui_music_volume_lbl);
ui_music_volume_spinbox = new QSpinBox(ui_audio_widget);
ui_music_volume_spinbox->setValue(p_ao_app->get_default_music());
ui_music_volume_spinbox->setMaximum(100);
ui_music_volume_spinbox->setSuffix("%");
- ui_audio_layout->setWidget(2, QFormLayout::FieldRole,
+ ui_audio_layout->setWidget(row, QFormLayout::FieldRole,
ui_music_volume_spinbox);
+ row += 1;
ui_sfx_volume_lbl = new QLabel(ui_audio_widget);
ui_sfx_volume_lbl->setText(tr("SFX:"));
ui_sfx_volume_lbl->setToolTip(
- tr("Sets the default volume for SFX sounds, "
- "like interjections or other character sound effects."));
-
- ui_audio_layout->setWidget(3, QFormLayout::LabelRole, ui_sfx_volume_lbl);
+ tr("Sets the SFX's default volume. "
+ "Interjections and actual sound effects count as 'SFX'."));
+ ui_audio_layout->setWidget(row, QFormLayout::LabelRole, ui_sfx_volume_lbl);
ui_sfx_volume_spinbox = new QSpinBox(ui_audio_widget);
ui_sfx_volume_spinbox->setValue(p_ao_app->get_default_sfx());
ui_sfx_volume_spinbox->setMaximum(100);
ui_sfx_volume_spinbox->setSuffix("%");
- ui_audio_layout->setWidget(3, QFormLayout::FieldRole, ui_sfx_volume_spinbox);
+ ui_audio_layout->setWidget(row, QFormLayout::FieldRole,
+ ui_sfx_volume_spinbox);
+ row += 1;
ui_blips_volume_lbl = new QLabel(ui_audio_widget);
ui_blips_volume_lbl->setText(tr("Blips:"));
ui_blips_volume_lbl->setToolTip(
tr("Sets the volume of the blips, the talking sound effects."));
- ui_audio_layout->setWidget(4, QFormLayout::LabelRole, ui_blips_volume_lbl);
+ ui_audio_layout->setWidget(row, QFormLayout::LabelRole, ui_blips_volume_lbl);
ui_blips_volume_spinbox = new QSpinBox(ui_audio_widget);
ui_blips_volume_spinbox->setValue(p_ao_app->get_default_blip());
ui_blips_volume_spinbox->setMaximum(100);
ui_blips_volume_spinbox->setSuffix("%");
- ui_audio_layout->setWidget(4, QFormLayout::FieldRole,
+ ui_audio_layout->setWidget(row, QFormLayout::FieldRole,
ui_blips_volume_spinbox);
+ row += 1;
ui_volume_blip_divider = new QFrame(ui_audio_widget);
ui_volume_blip_divider->setFrameShape(QFrame::HLine);
ui_volume_blip_divider->setFrameShadow(QFrame::Sunken);
- ui_audio_layout->setWidget(5, QFormLayout::FieldRole, ui_volume_blip_divider);
+ ui_audio_layout->setWidget(row, QFormLayout::FieldRole,
+ ui_volume_blip_divider);
+ row += 1;
ui_bliprate_lbl = new QLabel(ui_audio_widget);
ui_bliprate_lbl->setText(tr("Blip rate:"));
ui_bliprate_lbl->setToolTip(
tr("Sets the delay between playing the blip sounds."));
- ui_audio_layout->setWidget(6, QFormLayout::LabelRole, ui_bliprate_lbl);
+ ui_audio_layout->setWidget(row, QFormLayout::LabelRole, ui_bliprate_lbl);
ui_bliprate_spinbox = new QSpinBox(ui_audio_widget);
ui_bliprate_spinbox->setValue(p_ao_app->read_blip_rate());
ui_bliprate_spinbox->setMinimum(1);
+ ui_bliprate_spinbox->setToolTip(
+ tr("Play a blip sound \"once per every X symbols\", where "
+ "X is the blip rate."));
- ui_audio_layout->setWidget(6, QFormLayout::FieldRole, ui_bliprate_spinbox);
+ ui_audio_layout->setWidget(row, QFormLayout::FieldRole, ui_bliprate_spinbox);
+ row += 1;
ui_blank_blips_lbl = new QLabel(ui_audio_widget);
ui_blank_blips_lbl->setText(tr("Blank blips:"));
ui_blank_blips_lbl->setToolTip(
tr("If true, the game will play a blip sound even "
"when a space is 'being said'."));
- ui_audio_layout->setWidget(7, QFormLayout::LabelRole, ui_blank_blips_lbl);
+ ui_audio_layout->setWidget(row, QFormLayout::LabelRole, ui_blank_blips_lbl);
ui_blank_blips_cb = new QCheckBox(ui_audio_widget);
ui_blank_blips_cb->setChecked(p_ao_app->get_blank_blip());
- ui_audio_layout->setWidget(7, QFormLayout::FieldRole, ui_blank_blips_cb);
+ ui_audio_layout->setWidget(row, QFormLayout::FieldRole, ui_blank_blips_cb);
+ row += 1;
ui_loopsfx_lbl = new QLabel(ui_audio_widget);
ui_loopsfx_lbl->setText(tr("Enable Looping SFX:"));
ui_loopsfx_lbl->setToolTip(tr("If true, the game will allow looping sound "
"effects to play on preanimations."));
- ui_audio_layout->setWidget(8, QFormLayout::LabelRole, ui_loopsfx_lbl);
+ ui_audio_layout->setWidget(row, QFormLayout::LabelRole, ui_loopsfx_lbl);
ui_loopsfx_cb = new QCheckBox(ui_audio_widget);
ui_loopsfx_cb->setChecked(p_ao_app->get_looping_sfx());
- ui_audio_layout->setWidget(8, QFormLayout::FieldRole, ui_loopsfx_cb);
+ ui_audio_layout->setWidget(row, QFormLayout::FieldRole, ui_loopsfx_cb);
+ row += 1;
ui_objectmusic_lbl = new QLabel(ui_audio_widget);
ui_objectmusic_lbl->setText(tr("Kill Music On Objection:"));
ui_objectmusic_lbl->setToolTip(
- tr("If true, the game will stop music when someone objects, like in the "
- "actual games."));
+ tr("If true, AO2 will stop the music for you when you or someone else "
+ "does 'Objection!'."));
- ui_audio_layout->setWidget(9, QFormLayout::LabelRole, ui_objectmusic_lbl);
+ ui_audio_layout->setWidget(row, QFormLayout::LabelRole, ui_objectmusic_lbl);
ui_objectmusic_cb = new QCheckBox(ui_audio_widget);
- ui_objectmusic_cb->setChecked(p_ao_app->get_objectmusic());
+ ui_objectmusic_cb->setChecked(p_ao_app->objection_stop_music());
- ui_audio_layout->setWidget(9, QFormLayout::FieldRole, ui_objectmusic_cb);
+ ui_audio_layout->setWidget(row, QFormLayout::FieldRole, ui_objectmusic_cb);
- //
- // CASING
- //
+ // The casing tab!
ui_casing_tab = new QWidget();
ui_settings_tabs->addTab(ui_casing_tab, tr("Casing"));
@@ -416,6 +556,7 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
ui_casing_layout->setFormAlignment(Qt::AlignLeading | Qt::AlignLeft |
Qt::AlignTop);
ui_casing_layout->setContentsMargins(0, 0, 0, 0);
+ row = 0;
// -- SERVER SUPPORTS CASING
@@ -427,222 +568,151 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
tr("This server does not support case alerts."));
ui_casing_supported_lbl->setToolTip(tr("Pretty self-explanatory."));
- ui_casing_layout->setWidget(0, QFormLayout::FieldRole,
+ ui_casing_layout->setWidget(row, QFormLayout::FieldRole,
ui_casing_supported_lbl);
// -- CASE ANNOUNCEMENTS
+ row += 1;
ui_casing_enabled_lbl = new QLabel(ui_casing_widget);
ui_casing_enabled_lbl->setText(tr("Casing:"));
ui_casing_enabled_lbl->setToolTip(
tr("If checked, you will get alerts about case "
"announcements."));
- ui_casing_layout->setWidget(1, QFormLayout::LabelRole, ui_casing_enabled_lbl);
+ ui_casing_layout->setWidget(row, QFormLayout::LabelRole,
+ ui_casing_enabled_lbl);
ui_casing_enabled_cb = new QCheckBox(ui_casing_widget);
ui_casing_enabled_cb->setChecked(ao_app->get_casing_enabled());
- ui_casing_layout->setWidget(1, QFormLayout::FieldRole, ui_casing_enabled_cb);
+ ui_casing_layout->setWidget(row, QFormLayout::FieldRole,
+ ui_casing_enabled_cb);
// -- DEFENSE ANNOUNCEMENTS
+ row += 1;
ui_casing_def_lbl = new QLabel(ui_casing_widget);
ui_casing_def_lbl->setText(tr("Defense:"));
ui_casing_def_lbl->setToolTip(tr("If checked, you will get alerts about case "
"announcements if a defense spot is open."));
- ui_casing_layout->setWidget(2, QFormLayout::LabelRole, ui_casing_def_lbl);
+ ui_casing_layout->setWidget(row, QFormLayout::LabelRole, ui_casing_def_lbl);
ui_casing_def_cb = new QCheckBox(ui_casing_widget);
ui_casing_def_cb->setChecked(ao_app->get_casing_defence_enabled());
- ui_casing_layout->setWidget(2, QFormLayout::FieldRole, ui_casing_def_cb);
+ ui_casing_layout->setWidget(row, QFormLayout::FieldRole, ui_casing_def_cb);
// -- PROSECUTOR ANNOUNCEMENTS
+ row += 1;
ui_casing_pro_lbl = new QLabel(ui_casing_widget);
ui_casing_pro_lbl->setText(tr("Prosecution:"));
ui_casing_pro_lbl->setToolTip(
tr("If checked, you will get alerts about case "
"announcements if a prosecutor spot is open."));
- ui_casing_layout->setWidget(3, QFormLayout::LabelRole, ui_casing_pro_lbl);
+ ui_casing_layout->setWidget(row, QFormLayout::LabelRole, ui_casing_pro_lbl);
ui_casing_pro_cb = new QCheckBox(ui_casing_widget);
ui_casing_pro_cb->setChecked(ao_app->get_casing_prosecution_enabled());
- ui_casing_layout->setWidget(3, QFormLayout::FieldRole, ui_casing_pro_cb);
+ ui_casing_layout->setWidget(row, QFormLayout::FieldRole, ui_casing_pro_cb);
// -- JUDGE ANNOUNCEMENTS
+ row += 1;
ui_casing_jud_lbl = new QLabel(ui_casing_widget);
ui_casing_jud_lbl->setText(tr("Judge:"));
ui_casing_jud_lbl->setToolTip(tr("If checked, you will get alerts about case "
"announcements if the judge spot is open."));
- ui_casing_layout->setWidget(4, QFormLayout::LabelRole, ui_casing_jud_lbl);
+ ui_casing_layout->setWidget(row, QFormLayout::LabelRole, ui_casing_jud_lbl);
ui_casing_jud_cb = new QCheckBox(ui_casing_widget);
ui_casing_jud_cb->setChecked(ao_app->get_casing_judge_enabled());
- ui_casing_layout->setWidget(4, QFormLayout::FieldRole, ui_casing_jud_cb);
+ ui_casing_layout->setWidget(row, QFormLayout::FieldRole, ui_casing_jud_cb);
// -- JUROR ANNOUNCEMENTS
+ row += 1;
ui_casing_jur_lbl = new QLabel(ui_casing_widget);
ui_casing_jur_lbl->setText(tr("Juror:"));
ui_casing_jur_lbl->setToolTip(tr("If checked, you will get alerts about case "
"announcements if a juror spot is open."));
- ui_casing_layout->setWidget(5, QFormLayout::LabelRole, ui_casing_jur_lbl);
+ ui_casing_layout->setWidget(row, QFormLayout::LabelRole, ui_casing_jur_lbl);
ui_casing_jur_cb = new QCheckBox(ui_casing_widget);
ui_casing_jur_cb->setChecked(ao_app->get_casing_juror_enabled());
- ui_casing_layout->setWidget(5, QFormLayout::FieldRole, ui_casing_jur_cb);
+ ui_casing_layout->setWidget(row, QFormLayout::FieldRole, ui_casing_jur_cb);
// -- STENO ANNOUNCEMENTS
+ row += 1;
ui_casing_steno_lbl = new QLabel(ui_casing_widget);
ui_casing_steno_lbl->setText(tr("Stenographer:"));
ui_casing_steno_lbl->setToolTip(
tr("If checked, you will get alerts about case "
"announcements if a stenographer spot is open."));
- ui_casing_layout->setWidget(6, QFormLayout::LabelRole, ui_casing_steno_lbl);
+ ui_casing_layout->setWidget(row, QFormLayout::LabelRole, ui_casing_steno_lbl);
ui_casing_steno_cb = new QCheckBox(ui_casing_widget);
ui_casing_steno_cb->setChecked(ao_app->get_casing_steno_enabled());
- ui_casing_layout->setWidget(6, QFormLayout::FieldRole, ui_casing_steno_cb);
+ ui_casing_layout->setWidget(row, QFormLayout::FieldRole, ui_casing_steno_cb);
// -- CM ANNOUNCEMENTS
+ row += 1;
ui_casing_cm_lbl = new QLabel(ui_casing_widget);
ui_casing_cm_lbl->setText(tr("CM:"));
ui_casing_cm_lbl->setToolTip(
tr("If checked, you will appear amongst the potential "
"CMs on the server."));
- ui_casing_layout->setWidget(7, QFormLayout::LabelRole, ui_casing_cm_lbl);
+ ui_casing_layout->setWidget(row, QFormLayout::LabelRole, ui_casing_cm_lbl);
ui_casing_cm_cb = new QCheckBox(ui_casing_widget);
ui_casing_cm_cb->setChecked(ao_app->get_casing_cm_enabled());
- ui_casing_layout->setWidget(7, QFormLayout::FieldRole, ui_casing_cm_cb);
-
- ui_casing_wit_lbl = new QLabel(ui_casing_widget);
- ui_casing_wit_lbl->setText(tr("Witness:"));
- ui_casing_wit_lbl->setToolTip(
- tr("If checked, you will appear amongst the potential "
- "witnesses on the server."));
-
- ui_casing_layout->setWidget(8, QFormLayout::LabelRole, ui_casing_wit_lbl);
-
- ui_casing_wit_cb = new QCheckBox(ui_casing_widget);
- ui_casing_wit_cb->setChecked(ao_app->get_casing_wit_enabled());
-
- ui_casing_layout->setWidget(8, QFormLayout::FieldRole, ui_casing_wit_cb);
+ ui_casing_layout->setWidget(row, QFormLayout::FieldRole, ui_casing_cm_cb);
// -- CM CASES ANNOUNCEMENTS
+ row += 1;
ui_casing_cm_cases_lbl = new QLabel(ui_casing_widget);
ui_casing_cm_cases_lbl->setText(tr("Hosting cases:"));
ui_casing_cm_cases_lbl->setToolTip(
tr("If you're a CM, enter what cases you are "
"willing to host."));
- ui_casing_layout->setWidget(9, QFormLayout::LabelRole,
+ ui_casing_layout->setWidget(row, QFormLayout::LabelRole,
ui_casing_cm_cases_lbl);
ui_casing_cm_cases_textbox = new QLineEdit(ui_casing_widget);
ui_casing_cm_cases_textbox->setText(ao_app->get_casing_can_host_cases());
- ui_casing_layout->setWidget(9, QFormLayout::FieldRole,
+ ui_casing_layout->setWidget(row, QFormLayout::FieldRole,
ui_casing_cm_cases_textbox);
+ //Check whether mass logging is enabled
+ row += 1;
+ ui_log_lbl = new QLabel(ui_casing_widget);
+ ui_log_lbl->setText(tr("Automatic Logging:"));
+ ui_log_lbl->setToolTip(
+ tr("If checked, all logs will be automatically written in the "
+ "/logs folder."));
- // ICLOG
+ ui_casing_layout->setWidget(row, QFormLayout::LabelRole, ui_log_lbl);
- ui_other_tab = new QWidget();
- ui_settings_tabs->addTab(ui_other_tab, tr("IC Log"));
+ ui_log_cb = new QCheckBox(ui_casing_widget);
+ ui_log_cb->setChecked(ao_app->get_auto_logging_enabled());
- ui_other_widget = new QWidget(ui_other_tab);
- ui_other_widget->setGeometry(QRect(10, 10, 361, 211));
-
- ui_other_layout = new QFormLayout(ui_other_widget);
- ui_other_layout->setLabelAlignment(Qt::AlignLeading | Qt::AlignLeft |
- Qt::AlignVCenter);
- ui_other_layout->setFormAlignment(Qt::AlignLeading | Qt::AlignLeft |
- Qt::AlignTop);
- ui_other_layout->setContentsMargins(0, 0, 0, 0);
-
- ui_other_fancy_icl_enabled_lb = new QLabel(ui_other_widget);
- ui_other_fancy_icl_enabled_lb->setText(tr("Colorful IC log:"));
- ui_other_fancy_icl_enabled_lb->setToolTip(
- tr("Enables colored text in the log."));
- ui_other_layout->setWidget(1, QFormLayout::LabelRole,
- ui_other_fancy_icl_enabled_lb);
-
- ui_other_fancy_icl_enabled_cb = new QCheckBox(ui_other_widget);
- ui_other_fancy_icl_enabled_cb->setChecked(
- ao_app->get_colored_iclog_enabled());
- ui_other_layout->setWidget(1, QFormLayout::FieldRole,
- ui_other_fancy_icl_enabled_cb);
-
- ui_other_fancy_icl_limit_lb = new QLabel(ui_other_widget);
- ui_other_fancy_icl_limit_lb->setText(tr("Only inline coloring:"));
- ui_other_fancy_icl_limit_lb->setToolTip(
- tr("Only inline coloring will be shown such as <>,|| etc."));
- ui_other_layout->setWidget(2, QFormLayout::LabelRole,
- ui_other_fancy_icl_limit_lb);
- ui_other_fancy_icl_limit_cb = new QCheckBox(ui_other_widget);
- ui_other_fancy_icl_limit_cb->setChecked(
- ao_app->colorlog_restricted_enabled());
- ui_other_layout->setWidget(2, QFormLayout::FieldRole,
- ui_other_fancy_icl_limit_cb);
-
- ui_other_mirror_icl_enabled_lb = new QLabel(ui_other_widget);
- ui_other_mirror_icl_enabled_lb->setText(tr("Mirror IC log:"));
- ui_other_mirror_icl_enabled_lb->setToolTip(
- tr("IC log will mirror the IC box. "
- "Meaning that if somebody gets interrupted nobody will know what they "
- "wanted to say. "
- "Enable for a more realistic experience."));
- ui_other_layout->setWidget(3, QFormLayout::LabelRole,
- ui_other_mirror_icl_enabled_lb);
- ui_other_mirror_icl_enabled_cb = new QCheckBox(ui_other_widget);
- ui_other_mirror_icl_enabled_cb->setChecked(ao_app->get_iclmir_enabled());
- ui_other_layout->setWidget(3, QFormLayout::FieldRole,
- ui_other_mirror_icl_enabled_cb);
-
- ui_downwards_lbl = new QLabel(ui_other_widget);
- ui_downwards_lbl->setText(tr("Log goes downwards:"));
- ui_downwards_lbl->setToolTip(
- tr("If ticked, new messages will appear at "
- "the bottom (like the OOC chatlog). The traditional "
- "(AO1) behaviour is equivalent to this being unticked."));
-
- ui_other_layout->setWidget(4, QFormLayout::LabelRole, ui_downwards_lbl);
-
- ui_downwards_cb = new QCheckBox(ui_other_widget);
- ui_downwards_cb->setChecked(p_ao_app->get_log_goes_downwards());
-
- ui_other_layout->setWidget(4, QFormLayout::FieldRole, ui_downwards_cb);
-
- ui_length_lbl = new QLabel(ui_other_widget);
- ui_length_lbl->setText(tr("Log length:"));
- ui_length_lbl->setToolTip(tr(
- "The amount of messages the IC chatlog will keep before "
- "deleting older messages. A value of 0 or below counts as 'infinite'."));
-
- ui_other_layout->setWidget(5, QFormLayout::LabelRole, ui_length_lbl);
-
- ui_length_spinbox = new QSpinBox(ui_other_widget);
- ui_length_spinbox->setMaximum(10000);
- ui_length_spinbox->setValue(p_ao_app->get_max_log_size());
-
- ui_other_layout->setWidget(5, QFormLayout::FieldRole, ui_length_spinbox);
+ ui_casing_layout->setWidget(row, QFormLayout::FieldRole, ui_log_cb);
// When we're done, we should continue the updates!
setUpdatesEnabled(true);
@@ -660,17 +730,20 @@ void AOOptionsDialog::save_pressed()
configini->setValue("show_custom_shownames", ui_showname_cb->isChecked());
configini->setValue("master", ui_ms_textbox->text());
configini->setValue("discord", ui_discord_cb->isChecked());
- configini->setValue("shakeandflash", ui_epilepsy_cb->isChecked());
configini->setValue("language", ui_language_combobox->currentText().left(2));
- configini->setValue("punctuation_delay", ui_pun_delay_cb->isChecked());
- configini->setValue("slower_blips", ui_slower_blips_cb->isChecked());
+ configini->setValue("shake", ui_shake_cb->isChecked());
+ configini->setValue("effects", ui_effects_cb->isChecked());
+ configini->setValue("framenetwork", ui_framenetwork_cb->isChecked());
+ configini->setValue("colorlog", ui_colorlog_cb->isChecked());
+ configini->setValue("stickysounds", ui_stickysounds_cb->isChecked());
+ configini->setValue("stickyeffects", ui_stickyeffects_cb->isChecked());
+ configini->setValue("stickypres", ui_stickypres_cb->isChecked());
+ configini->setValue("customchat", ui_customchat_cb->isChecked());
+ configini->setValue("automatic_logging_enabled", ui_log_cb->isChecked());
QFile *callwordsini = new QFile(ao_app->get_base_path() + "callwords.ini");
- if (!callwordsini->open(QIODevice::WriteOnly | QIODevice::Truncate |
- QIODevice::Text)) {
- // Nevermind!
- }
- else {
+ if (callwordsini->open(QIODevice::WriteOnly | QIODevice::Truncate |
+ QIODevice::Text)) {
QTextStream out(callwordsini);
out << ui_callwords_textbox->toPlainText();
callwordsini->close();
@@ -684,7 +757,7 @@ void AOOptionsDialog::save_pressed()
configini->setValue("blip_rate", ui_bliprate_spinbox->value());
configini->setValue("blank_blip", ui_blank_blips_cb->isChecked());
configini->setValue("looping_sfx", ui_loopsfx_cb->isChecked());
- configini->setValue("kill_music_on_object", ui_objectmusic_cb->isChecked());
+ configini->setValue("objection_stop_music", ui_objectmusic_cb->isChecked());
configini->setValue("casing_enabled", ui_casing_enabled_cb->isChecked());
configini->setValue("casing_defence_enabled", ui_casing_def_cb->isChecked());
@@ -694,17 +767,9 @@ void AOOptionsDialog::save_pressed()
configini->setValue("casing_juror_enabled", ui_casing_jur_cb->isChecked());
configini->setValue("casing_steno_enabled", ui_casing_steno_cb->isChecked());
configini->setValue("casing_cm_enabled", ui_casing_cm_cb->isChecked());
- configini->setValue("casing_wit_enabled", ui_casing_wit_cb->isChecked());
configini->setValue("casing_can_host_cases",
ui_casing_cm_cases_textbox->text());
- configini->setValue("color_iclog_enabled",
- ui_other_fancy_icl_enabled_cb->isChecked());
- configini->setValue("mirror_iclog_enabled",
- ui_other_mirror_icl_enabled_cb->isChecked());
- configini->setValue("mirror_iclog_restricted",
- ui_other_fancy_icl_limit_cb->isChecked());
-
callwordsini->close();
done(0);
}