1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Define touchscreen mode at first launch

This commit is contained in:
nordsoft 2023-04-07 01:36:00 +04:00 committed by Nordsoft91
parent 52b53ab307
commit 3e6a656e4c
2 changed files with 17 additions and 0 deletions

View File

@ -102,6 +102,7 @@ void FirstLaunchView::on_comboBoxLanguage_currentIndexChanged(int index)
void FirstLaunchView::enterSetup()
{
setupPlatformSettings();
Languages::fillLanguages(ui->listWidgetLanguage, false);
}
@ -158,6 +159,19 @@ void FirstLaunchView::exitSetup()
mainWindow->exitSetup();
}
// Initial platform-dependend settings
void FirstLaunchView::setupPlatformSettings()
{
#if defined(VCMI_MOBILE)
bool touchscreenMode = true;
#else
bool touchscreenMode = false
#endif
Settings node = settings.write["battle"]["touchscreenMode"];
node->Bool() = touchscreenMode;
}
// Tab Language
void FirstLaunchView::languageSelected(const QString & selectedLanguage)
{

View File

@ -38,6 +38,9 @@ class FirstLaunchView : public QWidget
void activateTabModPreset();
void exitSetup();
// Initial platform-dependend settings
void setupPlatformSettings();
// Tab Language
void languageSelected(const QString & languageCode);