diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2021-06-06 23:23:33 -0500 |
|---|---|---|
| committer | oldmud0 <oldmud0@users.noreply.github.com> | 2021-06-06 23:23:33 -0500 |
| commit | 9ecd7c453c3b34a976869e517f9414a4b91fdb0f (patch) | |
| tree | 8a901493f6ebf1dee5792bfa2d24b60fb90cdfba /src/aooptionsdialog.cpp | |
| parent | 2ef7b206e24d9af112c8b466c006aa98e072e235 (diff) | |
| parent | 97f3d7a8bc43ee78691153bb60993ba734dbefde (diff) | |
Merge branch 'master' into feature/mounting
Diffstat (limited to 'src/aooptionsdialog.cpp')
| -rw-r--r-- | src/aooptionsdialog.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index 6b425908..5f3dbf02 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -334,6 +334,20 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_showname_cb); + row +=1; + ui_default_showname_lbl = new QLabel(ui_form_layout_widget); + ui_default_showname_lbl->setText(tr("Default showname:")); + ui_default_showname_lbl->setToolTip( + tr("Your showname will be automatically set to this value " + "when you join a server.")); + + ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_default_showname_lbl); + + ui_default_showname_textbox = new QLineEdit(ui_form_layout_widget); + ui_default_showname_textbox->setMaxLength(30); + + ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_default_showname_textbox); + row += 1; ui_net_divider = new QFrame(ui_form_layout_widget); ui_net_divider->setFrameShape(QFrame::HLine); @@ -391,6 +405,20 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) ui_language_combobox); row += 1; + ui_scaling_label = new QLabel(ui_form_layout_widget); + ui_scaling_label->setText(tr("Scaling:")); + ui_scaling_label->setToolTip( + tr("Sets the default scaling method, if there is not one already defined " + "specifically for the character.")); + ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_scaling_label); + + ui_scaling_combobox = new QComboBox(ui_form_layout_widget); + // Corresponds with Qt::TransformationMode enum. Please don't change the order. + ui_scaling_combobox->addItem(tr("Pixel"), "fast"); + ui_scaling_combobox->addItem(tr("Smooth"), "smooth"); + ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_scaling_combobox); + + row += 1; ui_shake_lbl = new QLabel(ui_form_layout_widget); ui_shake_lbl->setText(tr("Allow Screenshake:")); ui_shake_lbl->setToolTip( @@ -1029,6 +1057,9 @@ void AOOptionsDialog::update_values() { break; } } + Qt::TransformationMode scaling = ao_app->get_scaling(ao_app->get_default_scaling()); + ui_scaling_combobox->setCurrentIndex(scaling); + // Let's fill the callwords text edit with the already present callwords. ui_callwords_textbox->document()->clear(); foreach (QString callword, ao_app->get_call_words()) { @@ -1042,7 +1073,7 @@ void AOOptionsDialog::update_values() { ui_log_newline_cb->setChecked(ao_app->get_log_newline()); ui_log_timestamp_cb->setChecked(ao_app->get_log_timestamp()); ui_log_ic_actions_cb->setChecked(ao_app->get_log_ic_actions()); - ui_desync_logs_cb->setChecked(ao_app->get_log_timestamp()); + ui_desync_logs_cb->setChecked(ao_app->is_desyncrhonized_logs_enabled()); ui_instant_objection_cb->setChecked(ao_app->is_instant_objection_enabled()); ui_showname_cb->setChecked(ao_app->get_showname_enabled_by_default()); ui_discord_cb->setChecked(ao_app->is_discord_enabled()); @@ -1077,6 +1108,7 @@ void AOOptionsDialog::update_values() { ui_sfx_volume_spinbox->setValue(ao_app->get_default_sfx()); ui_blips_volume_spinbox->setValue(ao_app->get_default_blip()); ui_bliprate_spinbox->setValue(ao_app->read_blip_rate()); + ui_default_showname_textbox->setText(ao_app->get_default_showname()); auto *defaultMount = new QListWidgetItem(tr("%1 (default)") .arg(ao_app->get_base_path())); @@ -1109,9 +1141,11 @@ void AOOptionsDialog::save_pressed() configini->setValue("chat_ratelimit", ui_chat_ratelimit_spinbox->value()); configini->setValue("default_username", ui_username_textbox->text()); configini->setValue("show_custom_shownames", ui_showname_cb->isChecked()); + configini->setValue("default_showname", ui_default_showname_textbox->text()); configini->setValue("master", ui_ms_textbox->text()); configini->setValue("discord", ui_discord_cb->isChecked()); configini->setValue("language", ui_language_combobox->currentText().left(2)); + configini->setValue("default_scaling", ui_scaling_combobox->currentData()); configini->setValue("shake", ui_shake_cb->isChecked()); configini->setValue("effects", ui_effects_cb->isChecked()); configini->setValue("framenetwork", ui_framenetwork_cb->isChecked()); |
