1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-20 20:23:03 +02:00

reset tutorial button

This commit is contained in:
Laserlicht 2024-06-20 21:33:45 +02:00
parent 650dfcbed8
commit d818e8e663
4 changed files with 902 additions and 860 deletions

View File

@ -33,6 +33,7 @@ namespace Helper
void loadSettings()
{
settings.init("config/settings.json", "vcmi:settings");
persistentStorage.init("config/persistentStorage.json", "");
}
void enableScrollBySwiping(QObject * scrollTarget)

View File

@ -90,6 +90,12 @@ void CSettingsView::loadSettings()
#ifdef VCMI_MOBILE
ui->comboBoxFullScreen->hide();
ui->labelFullScreen->hide();
if(!persistentStorage["gui"]["tutorialCompleted0"].Bool() && !persistentStorage["gui"]["tutorialCompleted1"].Bool())
{
ui->labelResetTutorialTouchscreen->hide();
ui->pushButtonResetTutorialTouchscreen->hide();
}
#else
ui->labelReservedArea->hide();
ui->sliderReservedArea->hide();
@ -99,6 +105,8 @@ void CSettingsView::loadSettings()
ui->labelRelativeCursorSpeed->hide();
ui->buttonHapticFeedback->hide();
ui->labelHapticFeedback->hide();
ui->labelResetTutorialTouchscreen->hide();
ui->pushButtonResetTutorialTouchscreen->hide();
if (settings["video"]["realFullscreen"].Bool())
ui->comboBoxFullScreen->setCurrentIndex(2);
else
@ -525,6 +533,16 @@ void CSettingsView::on_pushButtonTranslation_clicked()
}
}
void CSettingsView::on_pushButtonResetTutorialTouchscreen_clicked()
{
Settings node0 = persistentStorage.write["gui"]["tutorialCompleted0"];
node0->Bool() = false;
Settings node1 = persistentStorage.write["gui"]["tutorialCompleted1"];
node1->Bool() = false;
ui->pushButtonResetTutorialTouchscreen->hide();
}
void CSettingsView::on_buttonRepositoryDefault_toggled(bool value)
{
Settings node = settings.write["launcher"]["defaultRepositoryEnabled"];

View File

@ -49,6 +49,7 @@ private slots:
void on_comboBoxLanguage_currentIndexChanged(int index);
void on_buttonCursorType_toggled(bool value);
void on_pushButtonTranslation_clicked();
void on_pushButtonResetTutorialTouchscreen_clicked();
void on_buttonRepositoryDefault_toggled(bool value);
void on_buttonRepositoryExtra_toggled(bool value);
void on_lineEditRepositoryExtra_textEdited(const QString &arg1);

File diff suppressed because it is too large Load Diff