1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +02:00

Merge pull request #4098 from IvanSavenko/launcher_settings_update

Launcher settings update
This commit is contained in:
Ivan Savenko 2024-06-10 18:21:17 +03:00 committed by GitHub
commit 2d98ec708c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 1150 additions and 563 deletions

View File

@ -31,10 +31,8 @@ InputSourceGameController::InputSourceGameController():
configTriggerTreshold(settings["input"]["controllerTriggerTreshold"].Float()),
configAxisDeadZone(settings["input"]["controllerAxisDeadZone"].Float()),
configAxisFullZone(settings["input"]["controllerAxisFullZone"].Float()),
configPointerSpeed(settings["input"]["controllerPointerSpeed"].Float()),
configPointerScale(settings["input"]["controllerPointerScale"].Float()),
configPanningSpeed(settings["input"]["controllerPanningSpeed"].Float()),
configPanningScale(settings["input"]["controllerPanningScale"].Float()),
configAxisSpeed(settings["input"]["controllerAxisSpeed"].Float()),
configAxisScale(settings["input"]["controllerAxisScale"].Float()),
cursorAxisValueX(0),
cursorAxisValueY(0),
cursorPlanDisX(0.0),
@ -274,12 +272,12 @@ void InputSourceGameController::handleCursorUpdate(int32_t deltaTimeMs)
if(vstd::isAlmostZero(cursorAxisValueX))
cursorPlanDisX = 0;
else
cursorPlanDisX += deltaTimeSeconds * configPointerSpeed * scaleAxis(cursorAxisValueX, configPointerScale);
cursorPlanDisX += deltaTimeSeconds * configAxisSpeed * scaleAxis(cursorAxisValueX, configAxisScale);
if (vstd::isAlmostZero(cursorAxisValueY))
cursorPlanDisY = 0;
else
cursorPlanDisY += deltaTimeSeconds * configPointerSpeed * scaleAxis(cursorAxisValueY, configPointerScale);
cursorPlanDisY += deltaTimeSeconds * configAxisSpeed * scaleAxis(cursorAxisValueY, configAxisScale);
int moveDisX = getMoveDis(cursorPlanDisX);
int moveDisY = getMoveDis(cursorPlanDisY);
@ -308,8 +306,8 @@ void InputSourceGameController::handleScrollUpdate(int32_t deltaTimeMs)
return;
}
float deltaTimeSeconds = static_cast<float>(deltaTimeMs) / 1000;
scrollPlanDisX += deltaTimeSeconds * configPanningSpeed * scaleAxis(scrollAxisValueX, configPanningScale);
scrollPlanDisY += deltaTimeSeconds * configPanningSpeed * scaleAxis(scrollAxisValueY, configPanningScale);
scrollPlanDisX += deltaTimeSeconds * configAxisSpeed * scaleAxis(scrollAxisValueX, configAxisScale);
scrollPlanDisY += deltaTimeSeconds * configAxisSpeed * scaleAxis(scrollAxisValueY, configAxisScale);
int moveDisX = getMoveDis(scrollPlanDisX);
int moveDisY = getMoveDis(scrollPlanDisY);
if(moveDisX != 0 || moveDisY != 0)

View File

@ -42,10 +42,8 @@ class InputSourceGameController
const double configTriggerTreshold;
const double configAxisDeadZone;
const double configAxisFullZone;
const double configPointerSpeed;
const double configPointerScale;
const double configPanningSpeed;
const double configPanningScale;
const double configAxisSpeed;
const double configAxisScale;
void openGameController(int index);
int getJoystickIndex(SDL_GameController * controller);

View File

@ -71,7 +71,7 @@
},
"gameDataLanguage" : {
"type" : "string",
"enum" : [ "auto", "english", "czech", "chinese", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian", "vietnamese", "other_cp1250", "other_cp1251", "other_cp1252" ],
"enum" : [ "auto", "english", "czech", "chinese", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian", "vietnamese" ],
"default" : "auto"
},
"lastSave" : {
@ -116,7 +116,7 @@
},
"hapticFeedback" : {
"type" : "boolean",
"default" : false
"default" : true
},
"autosaveCountLimit" : {
"type" : "number",
@ -247,10 +247,8 @@
"controllerTriggerTreshold",
"controllerAxisDeadZone",
"controllerAxisFullZone",
"controllerPointerSpeed",
"controllerPointerScale",
"controllerPanningSpeed",
"controllerPanningScale",
"controllerAxisSpeed",
"controllerAxisScale"
],
"properties" : {
"radialWheelGarrisonSwipe" : {
@ -293,19 +291,11 @@
"type" : "number",
"default" : 1.0
},
"controllerPointerSpeed" : {
"controllerAxisSpeed" : {
"type" : "number",
"default" : 1000
},
"controllerPointerScale" : {
"type" : "number",
"default" : 2
},
"controllerPanningSpeed" : {
"type" : "number",
"default" : 1000
},
"controllerPanningScale" : {
"controllerAxisScale" : {
"type" : "number",
"default" : 2
}

View File

@ -18,7 +18,7 @@
#include <QListWidget>
// list of language names, for generation of translations. Do not use directly, use Languages namespace instead
static const std::array<std::string, 20> languageTranslatedNamesGenerator = {
static const std::array<std::string, 17> languageTranslatedNamesGenerator = {
{
QT_TRANSLATE_NOOP("Language", "Czech"),
QT_TRANSLATE_NOOP("Language", "Chinese"),
@ -37,9 +37,6 @@ static const std::array<std::string, 20> languageTranslatedNamesGenerator = {
QT_TRANSLATE_NOOP("Language", "Turkish"),
QT_TRANSLATE_NOOP("Language", "Ukrainian"),
QT_TRANSLATE_NOOP("Language", "Vietnamese"),
QT_TRANSLATE_NOOP("Language", "Other (East European)"),
QT_TRANSLATE_NOOP("Language", "Other (Cyrillic Script)"),
QT_TRANSLATE_NOOP("Language", "Other (West European)"),
}
};
@ -73,9 +70,6 @@ QString Languages::generateLanguageName(const Languages::Options & language)
QString localizedName = QApplication::translate("Language", language.nameEnglish.c_str());
QString nativeName = language.nameNative.c_str();
if(!language.hasTranslation)
return localizedName;
if(activeLanguage == language.identifier)
return nativeName;
@ -105,9 +99,6 @@ void Languages::fillLanguages(QComboBox * widget, bool includeAll)
for(const auto & language : Languages::getLanguageList())
{
if (!language.hasTranslation && !includeAll)
continue;
QString displayName = generateLanguageName(language);
QVariant userData = QString::fromStdString(language.identifier);
@ -141,9 +132,6 @@ void Languages::fillLanguages(QListWidget * widget, bool includeAll)
for(const auto & language : Languages::getLanguageList())
{
if (!language.hasTranslation && !includeAll)
continue;
QString displayName = generateLanguageName(language);
QVariant userData = QString::fromStdString(language.identifier);

View File

@ -15,8 +15,8 @@
namespace Ui
{
class MainWindow;
const QString teamName = "VCMI Team";
const QString appName = "VCMI Launcher";
const QString teamName = "vcmi";
const QString appName = "launcher";
}
class QTableWidgetItem;

View File

@ -330,9 +330,6 @@ QString CModListView::genModInfoText(CModEntry & mod)
for(const auto & language : Languages::getLanguageList())
{
if (!language.hasTranslation)
continue;
QString languageID = QString::fromStdString(language.identifier);
if (languageID != baseLanguageID && !mod.getValue(languageID).isValid())

View File

@ -17,7 +17,6 @@
#include "../helper.h"
#include "../jsonutils.h"
#include "../languages.h"
#include "../launcherdirs.h"
#include <QFileInfo>
#include <QGuiApplication>
@ -35,12 +34,19 @@ QString resolutionToString(const QSize & resolution)
return QString{"%1x%2"}.arg(resolution.width()).arg(resolution.height());
}
static const std::string cursorTypesList[] =
static constexpr std::array cursorTypesList =
{
"hardware",
"software"
};
static constexpr std::array upscalingFilterTypes =
{
"nearest",
"linear",
"best"
};
}
void CSettingsView::setDisplayList()
@ -65,16 +71,36 @@ void CSettingsView::setDisplayList()
}
}
void CSettingsView::setCheckbuttonState(QToolButton * button, bool checked)
{
button->setChecked(checked);
updateCheckbuttonText(button);
}
void CSettingsView::updateCheckbuttonText(QToolButton * button)
{
if (button->isChecked())
button->setText(tr("On"));
else
button->setText(tr("Off"));
}
void CSettingsView::loadSettings()
{
ui->comboBoxShowIntro->setCurrentIndex(settings["video"]["showIntro"].Bool());
setCheckbuttonState(ui->buttonShowIntro, settings["video"]["showIntro"].Bool());
#ifdef VCMI_MOBILE
ui->comboBoxFullScreen->hide();
ui->labelFullScreen->hide();
#else
ui->labelReservedArea->hide();
ui->spinBoxReservedArea->hide();
ui->sliderReservedArea->hide();
ui->labelRelativeCursorMode->hide();
ui->buttonRelativeCursorMode->hide();
ui->sliderRelativeCursorSpeed->hide();
ui->labelRelativeCursorSpeed->hide();
ui->buttonHapticFeedback->hide();
ui->labelHapticFeedback->hide();
if (settings["video"]["realFullscreen"].Bool())
ui->comboBoxFullScreen->setCurrentIndex(2);
else
@ -85,8 +111,8 @@ void CSettingsView::loadSettings()
ui->spinBoxInterfaceScaling->setValue(settings["video"]["resolution"]["scaling"].Float());
ui->spinBoxFramerateLimit->setValue(settings["video"]["targetfps"].Float());
ui->spinBoxFramerateLimit->setDisabled(settings["video"]["vsync"].Bool());
ui->checkBoxVSync->setChecked(settings["video"]["vsync"].Bool());
ui->spinBoxReservedArea->setValue(std::round(settings["video"]["reservedWidth"].Float() * 100));
setCheckbuttonState(ui->buttonVSync, settings["video"]["vsync"].Bool());
ui->sliderReservedArea->setValue(std::round(settings["video"]["reservedWidth"].Float() * 100));
ui->comboBoxFriendlyAI->setCurrentText(QString::fromStdString(settings["server"]["friendlyAI"].String()));
ui->comboBoxNeutralAI->setCurrentText(QString::fromStdString(settings["server"]["neutralAI"].String()));
@ -97,7 +123,7 @@ void CSettingsView::loadSettings()
ui->spinBoxNetworkPort->setValue(settings["server"]["localPort"].Integer());
ui->comboBoxAutoCheck->setCurrentIndex(settings["launcher"]["autoCheckRepositories"].Bool());
setCheckbuttonState(ui->buttonAutoCheck, settings["launcher"]["autoCheckRepositories"].Bool());
ui->lineEditRepositoryDefault->setText(QString::fromStdString(settings["launcher"]["defaultRepositoryURL"].String()));
ui->lineEditRepositoryExtra->setText(QString::fromStdString(settings["launcher"]["extraRepositoryURL"].String()));
@ -105,16 +131,15 @@ void CSettingsView::loadSettings()
ui->lineEditRepositoryDefault->setEnabled(settings["launcher"]["defaultRepositoryEnabled"].Bool());
ui->lineEditRepositoryExtra->setEnabled(settings["launcher"]["extraRepositoryEnabled"].Bool());
ui->checkBoxRepositoryDefault->setChecked(settings["launcher"]["defaultRepositoryEnabled"].Bool());
ui->checkBoxRepositoryExtra->setChecked(settings["launcher"]["extraRepositoryEnabled"].Bool());
setCheckbuttonState(ui->buttonRepositoryDefault, settings["launcher"]["defaultRepositoryEnabled"].Bool());
setCheckbuttonState(ui->buttonRepositoryExtra, settings["launcher"]["extraRepositoryEnabled"].Bool());
ui->checkBoxIgnoreSslErrors->setChecked(settings["launcher"]["ignoreSslErrors"].Bool());
ui->comboBoxAutoSave->setCurrentIndex(settings["general"]["saveFrequency"].Integer() > 0 ? 1 : 0);
setCheckbuttonState(ui->buttonIgnoreSslErrors, settings["launcher"]["ignoreSslErrors"].Bool());
setCheckbuttonState(ui->buttonAutoSave, settings["general"]["saveFrequency"].Integer() > 0);
ui->spinBoxAutoSaveLimit->setValue(settings["general"]["autosaveCountLimit"].Integer());
ui->checkBoxAutoSavePrefix->setChecked(settings["general"]["useSavePrefix"].Bool());
setCheckbuttonState(ui->buttonAutoSavePrefix, settings["general"]["useSavePrefix"].Bool());
ui->lineEditAutoSavePrefix->setText(QString::fromStdString(settings["general"]["savePrefix"].String()));
ui->lineEditAutoSavePrefix->setEnabled(settings["general"]["useSavePrefix"].Bool());
@ -123,8 +148,26 @@ void CSettingsView::loadSettings()
fillValidRenderers();
std::string cursorType = settings["video"]["cursor"].String();
size_t cursorTypeIndex = boost::range::find(cursorTypesList, cursorType) - cursorTypesList;
ui->comboBoxCursorType->setCurrentIndex((int)cursorTypeIndex);
int cursorTypeIndex = vstd::find_pos(cursorTypesList, cursorType);
setCheckbuttonState(ui->buttonCursorType, cursorTypeIndex);
std::string upscalingFilter = settings["video"]["scalingMode"].String();
int upscalingFilterIndex = vstd::find_pos(upscalingFilterTypes, upscalingFilter);
ui->comboBoxUpscalingFilter->setCurrentIndex(upscalingFilterIndex);
ui->sliderMusicVolume->setValue(settings["general"]["music"].Integer());
ui->sliderSoundVolume->setValue(settings["general"]["sound"].Integer());
setCheckbuttonState(ui->buttonRelativeCursorMode, settings["general"]["userRelativePointer"].Bool());
ui->sliderRelativeCursorSpeed->setValue(settings["general"]["relativePointerSpeedMultiplier"].Integer());
setCheckbuttonState(ui->buttonHapticFeedback, settings["launcher"]["hapticFeedback"].Bool());
ui->sliderLongTouchDuration->setValue(settings["general"]["longTouchTimeMilliseconds"].Integer());
ui->slideToleranceDistanceMouse->setValue(settings["input"]["mouseToleranceDistance"].Integer());
ui->sliderToleranceDistanceTouch->setValue(settings["input"]["touchToleranceDistance"].Integer());
ui->sliderToleranceDistanceController->setValue(settings["input"]["shortcutToleranceDistance"].Integer());
ui->sliderControllerSticksSensitivity->setValue(settings["input"]["controllerAxisSpeed"].Integer());
ui->sliderControllerSticksAcceleration->setValue(settings["input"]["controllerAxisScale"].Float() * 100);
ui->lineEditGameLobbyHost->setText(QString::fromStdString(settings["lobby"]["hostname"].String()));
ui->spinBoxNetworkPortLobby->setValue(settings["lobby"]["port"].Integer());
}
void CSettingsView::fillValidResolutions()
@ -318,10 +361,11 @@ void CSettingsView::on_comboBoxFullScreen_currentIndexChanged(int index)
fillValidScalingRange();
}
void CSettingsView::on_comboBoxAutoCheck_currentIndexChanged(int index)
void CSettingsView::on_buttonAutoCheck_toggled(bool value)
{
Settings node = settings.write["launcher"]["autoCheckRepositories"];
node->Bool() = index;
node->Bool() = value;
updateCheckbuttonText(ui->buttonAutoCheck);
}
void CSettingsView::on_comboBoxDisplayIndex_currentIndexChanged(int index)
@ -356,16 +400,18 @@ void CSettingsView::on_spinBoxNetworkPort_valueChanged(int arg1)
node->Float() = arg1;
}
void CSettingsView::on_comboBoxShowIntro_currentIndexChanged(int index)
void CSettingsView::on_buttonShowIntro_toggled(bool value)
{
Settings node = settings.write["video"]["showIntro"];
node->Bool() = index;
node->Bool() = value;
updateCheckbuttonText(ui->buttonShowIntro);
}
void CSettingsView::on_comboBoxAutoSave_currentIndexChanged(int index)
void CSettingsView::on_buttonAutoSave_toggled(bool value)
{
Settings node = settings.write["general"]["saveFrequency"];
node->Integer() = index;
node->Integer() = value ? 1 : 0;
updateCheckbuttonText(ui->buttonAutoSave);
}
void CSettingsView::on_comboBoxLanguage_currentIndexChanged(int index)
@ -395,16 +441,15 @@ void CSettingsView::showEvent(QShowEvent * event)
QWidget::showEvent(event);
}
void CSettingsView::on_comboBoxCursorType_currentIndexChanged(int index)
void CSettingsView::on_buttonCursorType_toggled(bool value)
{
Settings node = settings.write["video"]["cursor"];
node->String() = cursorTypesList[index];
node->String() = cursorTypesList[value ? 1 : 0];
updateCheckbuttonText(ui->buttonCursorType);
}
void CSettingsView::loadTranslation()
{
Languages::fillLanguages(ui->comboBoxLanguageBase, true);
QString baseLanguage = Languages::getHeroesDataLanguage();
auto * mainWindow = dynamic_cast<MainWindow *>(qApp->activeWindow());
@ -474,25 +519,20 @@ void CSettingsView::on_pushButtonTranslation_clicked()
}
}
void CSettingsView::on_comboBoxLanguageBase_currentIndexChanged(int index)
{
Settings node = settings.write["general"]["gameDataLanguage"];
QString selectedLanguage = ui->comboBoxLanguageBase->itemData(index).toString();
node->String() = selectedLanguage.toStdString();
}
void CSettingsView::on_checkBoxRepositoryDefault_stateChanged(int arg1)
void CSettingsView::on_buttonRepositoryDefault_toggled(bool value)
{
Settings node = settings.write["launcher"]["defaultRepositoryEnabled"];
node->Bool() = arg1;
ui->lineEditRepositoryDefault->setEnabled(arg1);
node->Bool() = value;
ui->lineEditRepositoryDefault->setEnabled(value);
updateCheckbuttonText(ui->buttonRepositoryDefault);
}
void CSettingsView::on_checkBoxRepositoryExtra_stateChanged(int arg1)
void CSettingsView::on_buttonRepositoryExtra_toggled(bool value)
{
Settings node = settings.write["launcher"]["extraRepositoryEnabled"];
node->Bool() = arg1;
ui->lineEditRepositoryExtra->setEnabled(arg1);
node->Bool() = value;
ui->lineEditRepositoryExtra->setEnabled(value);
updateCheckbuttonText(ui->buttonRepositoryExtra);
}
void CSettingsView::on_lineEditRepositoryExtra_textEdited(const QString &arg1)
@ -524,11 +564,12 @@ void CSettingsView::on_spinBoxFramerateLimit_valueChanged(int arg1)
node->Float() = arg1;
}
void CSettingsView::on_checkBoxVSync_stateChanged(int arg1)
void CSettingsView::on_buttonVSync_toggled(bool value)
{
Settings node = settings.write["video"]["vsync"];
node->Bool() = arg1;
node->Bool() = value;
ui->spinBoxFramerateLimit->setDisabled(settings["video"]["vsync"].Bool());
updateCheckbuttonText(ui->buttonVSync);
}
void CSettingsView::on_comboBoxEnemyPlayerAI_currentTextChanged(const QString &arg1)
@ -543,11 +584,12 @@ void CSettingsView::on_comboBoxAlliedPlayerAI_currentTextChanged(const QString &
node->String() = arg1.toUtf8().data();
}
void CSettingsView::on_checkBoxAutoSavePrefix_stateChanged(int arg1)
void CSettingsView::on_buttonAutoSavePrefix_toggled(bool value)
{
Settings node = settings.write["general"]["useSavePrefix"];
node->Bool() = arg1;
ui->lineEditAutoSavePrefix->setEnabled(arg1);
node->Bool() = value;
ui->lineEditAutoSavePrefix->setEnabled(value);
updateCheckbuttonText(ui->buttonAutoSavePrefix);
}
void CSettingsView::on_spinBoxAutoSaveLimit_valueChanged(int arg1)
@ -556,13 +598,13 @@ void CSettingsView::on_spinBoxAutoSaveLimit_valueChanged(int arg1)
node->Float() = arg1;
}
void CSettingsView::on_lineEditAutoSavePrefix_textEdited(const QString &arg1)
void CSettingsView::on_lineEditAutoSavePrefix_textEdited(const QString & arg1)
{
Settings node = settings.write["general"]["savePrefix"];
node->String() = arg1.toStdString();
}
void CSettingsView::on_spinBoxReservedArea_valueChanged(int arg1)
void CSettingsView::on_sliderReservedArea_valueChanged(int arg1)
{
Settings node = settings.write["video"]["reservedWidth"];
node->Float() = float(arg1) / 100; // percentage -> ratio
@ -574,8 +616,95 @@ void CSettingsView::on_comboBoxRendererType_currentTextChanged(const QString &ar
node->String() = arg1.toStdString();
}
void CSettingsView::on_checkBoxIgnoreSslErrors_clicked(bool checked)
void CSettingsView::on_buttonIgnoreSslErrors_clicked(bool checked)
{
Settings node = settings.write["launcher"]["ignoreSslErrors"];
node->Bool() = checked;
updateCheckbuttonText(ui->buttonIgnoreSslErrors);
}
void CSettingsView::on_comboBoxUpscalingFilter_currentIndexChanged(int index)
{
Settings node = settings.write["video"]["scalingMode"];
node->String() = upscalingFilterTypes[index];
}
void CSettingsView::on_sliderMusicVolume_valueChanged(int value)
{
Settings node = settings.write["general"]["music"];
node->Integer() = value;
}
void CSettingsView::on_sliderSoundVolume_valueChanged(int value)
{
Settings node = settings.write["general"]["sound"];
node->Integer() = value;
}
void CSettingsView::on_buttonRelativeCursorMode_toggled(bool value)
{
Settings node = settings.write["general"]["userRelativePointer"];
node->Bool() = value;
updateCheckbuttonText(ui->buttonRelativeCursorMode);
}
void CSettingsView::on_sliderRelativeCursorSpeed_valueChanged(int value)
{
Settings node = settings.write["general"]["relativePointerSpeedMultiplier"];
node->Float() = value / 100.0;
}
void CSettingsView::on_buttonHapticFeedback_toggled(bool value)
{
Settings node = settings.write["general"]["hapticFeedback"];
node->Bool() = value;
updateCheckbuttonText(ui->buttonHapticFeedback);
}
void CSettingsView::on_sliderLongTouchDuration_valueChanged(int value)
{
Settings node = settings.write["general"]["longTouchTimeMilliseconds"];
node->Integer() = value;
}
void CSettingsView::on_slideToleranceDistanceMouse_valueChanged(int value)
{
Settings node = settings.write["input"]["mouseToleranceDistance"];
node->Integer() = value;
}
void CSettingsView::on_sliderToleranceDistanceTouch_valueChanged(int value)
{
Settings node = settings.write["input"]["touchToleranceDistance"];
node->Integer() = value;
}
void CSettingsView::on_sliderToleranceDistanceController_valueChanged(int value)
{
Settings node = settings.write["input"]["shortcutToleranceDistance"];
node->Integer() = value;
}
void CSettingsView::on_lineEditGameLobbyHost_textChanged(const QString & arg1)
{
Settings node = settings.write["lobby"]["hostname"];
node->String() = arg1.toStdString();
}
void CSettingsView::on_spinBoxNetworkPortLobby_valueChanged(int arg1)
{
Settings node = settings.write["lobby"]["port"];
node->Integer() = arg1;
}
void CSettingsView::on_sliderControllerSticksAcceleration_valueChanged(int value)
{
Settings node = settings.write["input"]["configAxisScale"];
node->Integer() = value / 100.0;
}
void CSettingsView::on_sliderControllerSticksSensitivity_valueChanged(int value)
{
Settings node = settings.write["input"]["configAxisSpeed"];
node->Integer() = value;
}

View File

@ -28,6 +28,9 @@ public:
void changeEvent(QEvent *event) override;
void showEvent(QShowEvent * event) override;
void setCheckbuttonState(QToolButton * button, bool checked);
void updateCheckbuttonText(QToolButton * button);
public slots:
void fillValidResolutions();
@ -38,45 +41,45 @@ private slots:
void on_comboBoxNeutralAI_currentTextChanged(const QString & arg1);
void on_comboBoxEnemyAI_currentTextChanged(const QString & arg1);
void on_spinBoxNetworkPort_valueChanged(int arg1);
void on_comboBoxShowIntro_currentIndexChanged(int index);
void on_comboBoxAutoCheck_currentIndexChanged(int index);
void on_buttonShowIntro_toggled(bool value);
void on_buttonAutoCheck_toggled(bool value);
void on_comboBoxDisplayIndex_currentIndexChanged(int index);
void on_comboBoxAutoSave_currentIndexChanged(int index);
void on_buttonAutoSave_toggled(bool value);
void on_comboBoxLanguage_currentIndexChanged(int index);
void on_comboBoxCursorType_currentIndexChanged(int index);
void on_buttonCursorType_toggled(bool value);
void on_pushButtonTranslation_clicked();
void on_comboBoxLanguageBase_currentIndexChanged(int index);
void on_checkBoxRepositoryDefault_stateChanged(int arg1);
void on_checkBoxRepositoryExtra_stateChanged(int arg1);
void on_buttonRepositoryDefault_toggled(bool value);
void on_buttonRepositoryExtra_toggled(bool value);
void on_lineEditRepositoryExtra_textEdited(const QString &arg1);
void on_spinBoxInterfaceScaling_valueChanged(int arg1);
void on_refreshRepositoriesButton_clicked();
void on_spinBoxFramerateLimit_valueChanged(int arg1);
void on_checkBoxVSync_stateChanged(int arg1);
void on_buttonVSync_toggled(bool value);
void on_comboBoxEnemyPlayerAI_currentTextChanged(const QString &arg1);
void on_comboBoxAlliedPlayerAI_currentTextChanged(const QString &arg1);
void on_checkBoxAutoSavePrefix_stateChanged(int arg1);
void on_buttonAutoSavePrefix_toggled(bool value);
void on_spinBoxAutoSaveLimit_valueChanged(int arg1);
void on_lineEditAutoSavePrefix_textEdited(const QString &arg1);
void on_spinBoxReservedArea_valueChanged(int arg1);
void on_sliderReservedArea_valueChanged(int arg1);
void on_comboBoxRendererType_currentTextChanged(const QString &arg1);
void on_checkBoxIgnoreSslErrors_clicked(bool checked);
void on_buttonIgnoreSslErrors_clicked(bool checked);
void on_comboBoxUpscalingFilter_currentIndexChanged(int index);
void on_sliderMusicVolume_valueChanged(int value);
void on_sliderSoundVolume_valueChanged(int value);
void on_buttonRelativeCursorMode_toggled(bool value);
void on_sliderRelativeCursorSpeed_valueChanged(int value);
void on_buttonHapticFeedback_toggled(bool value);
void on_sliderLongTouchDuration_valueChanged(int value);
void on_slideToleranceDistanceMouse_valueChanged(int value);
void on_sliderToleranceDistanceTouch_valueChanged(int value);
void on_sliderToleranceDistanceController_valueChanged(int value);
void on_lineEditGameLobbyHost_textChanged(const QString &arg1);
void on_spinBoxNetworkPortLobby_valueChanged(int arg1);
void on_sliderControllerSticksAcceleration_valueChanged(int value);
void on_sliderControllerSticksSensitivity_valueChanged(int value);
private:
Ui::CSettingsView * ui;

File diff suppressed because it is too large Load Diff

View File

@ -43,11 +43,6 @@ enum class ELanguages
UKRAINIAN,
VIETNAMESE,
// Pseudo-languages, that have no translations but can define H3 encoding to use
OTHER_CP1250,
OTHER_CP1251,
OTHER_CP1252,
COUNT
};
@ -73,36 +68,29 @@ struct Options
/// Ruleset for plural forms in this language
EPluralForms pluralForms = EPluralForms::NONE;
/// VCMI supports translations into this language
bool hasTranslation = false;
};
inline const auto & getLanguageList()
{
static const std::array<Options, 20> languages
static const std::array<Options, 17> languages
{ {
{ "czech", "Czech", "Čeština", "CP1250", "cs", "%d.%m.%Y %T", EPluralForms::CZ_3, true },
{ "chinese", "Chinese", "简体中文", "GBK", "zh", "%F %T", EPluralForms::VI_1, true }, // Note: actually Simplified Chinese
{ "english", "English", "English", "CP1252", "en", "%F %T", EPluralForms::EN_2, true }, // English uses international date/time format here
{ "finnish", "Finnish", "Suomi", "CP1252", "fi", "%d.%m.%Y %T", EPluralForms::EN_2, true },
{ "french", "French", "Français", "CP1252", "fr", "%d/%m/%Y %T", EPluralForms::FR_2, true },
{ "german", "German", "Deutsch", "CP1252", "de", "%d.%m.%Y %T", EPluralForms::EN_2, true },
{ "hungarian", "Hungarian", "Magyar", "CP1250", "hu", "%Y. %m. %d. %T", EPluralForms::EN_2, true },
{ "italian", "Italian", "Italiano", "CP1250", "it", "%d/%m/%Y %T", EPluralForms::EN_2, true },
{ "korean", "Korean", "한국어", "CP949", "ko", "%F %T", EPluralForms::VI_1, true },
{ "polish", "Polish", "Polski", "CP1250", "pl", "%d.%m.%Y %T", EPluralForms::PL_3, true },
{ "portuguese", "Portuguese", "Português", "CP1252", "pt", "%d/%m/%Y %T", EPluralForms::EN_2, true }, // Note: actually Brazilian Portuguese
{ "russian", "Russian", "Русский", "CP1251", "ru", "%d.%m.%Y %T", EPluralForms::UK_3, true },
{ "spanish", "Spanish", "Español", "CP1252", "es", "%d/%m/%Y %T", EPluralForms::EN_2, true },
{ "swedish", "Swedish", "Svenska", "CP1252", "sv", "%F %T", EPluralForms::EN_2, true },
{ "turkish", "Turkish", "Türkçe", "CP1254", "tr", "%d.%m.%Y %T", EPluralForms::EN_2, true },
{ "ukrainian", "Ukrainian", "Українська", "CP1251", "uk", "%d.%m.%Y %T", EPluralForms::UK_3, true },
{ "vietnamese", "Vietnamese", "Tiếng Việt", "UTF-8", "vi", "%d/%m/%Y %T", EPluralForms::VI_1, true }, // Fan translation uses special encoding
{ "other_cp1250", "Other (East European)", "", "CP1250", "", "", EPluralForms::NONE, false },
{ "other_cp1251", "Other (Cyrillic Script)", "", "CP1251", "", "", EPluralForms::NONE, false },
{ "other_cp1252", "Other (West European)", "", "CP1252", "", "", EPluralForms::NONE, false }
{ "czech", "Czech", "Čeština", "CP1250", "cs", "%d.%m.%Y %T", EPluralForms::CZ_3 },
{ "chinese", "Chinese", "简体中文", "GBK", "zh", "%F %T", EPluralForms::VI_1 }, // Note: actually Simplified Chinese
{ "english", "English", "English", "CP1252", "en", "%F %T", EPluralForms::EN_2 }, // English uses international date/time format here
{ "finnish", "Finnish", "Suomi", "CP1252", "fi", "%d.%m.%Y %T", EPluralForms::EN_2 },
{ "french", "French", "Français", "CP1252", "fr", "%d/%m/%Y %T", EPluralForms::FR_2 },
{ "german", "German", "Deutsch", "CP1252", "de", "%d.%m.%Y %T", EPluralForms::EN_2 },
{ "hungarian", "Hungarian", "Magyar", "CP1250", "hu", "%Y. %m. %d. %T", EPluralForms::EN_2 },
{ "italian", "Italian", "Italiano", "CP1250", "it", "%d/%m/%Y %T", EPluralForms::EN_2 },
{ "korean", "Korean", "한국어", "CP949", "ko", "%F %T", EPluralForms::VI_1 },
{ "polish", "Polish", "Polski", "CP1250", "pl", "%d.%m.%Y %T", EPluralForms::PL_3 },
{ "portuguese", "Portuguese", "Português", "CP1252", "pt", "%d/%m/%Y %T", EPluralForms::EN_2 }, // Note: actually Brazilian Portuguese
{ "russian", "Russian", "Русский", "CP1251", "ru", "%d.%m.%Y %T", EPluralForms::UK_3 },
{ "spanish", "Spanish", "Español", "CP1252", "es", "%d/%m/%Y %T", EPluralForms::EN_2 },
{ "swedish", "Swedish", "Svenska", "CP1252", "sv", "%F %T", EPluralForms::EN_2 },
{ "turkish", "Turkish", "Türkçe", "CP1254", "tr", "%d.%m.%Y %T", EPluralForms::EN_2 },
{ "ukrainian", "Ukrainian", "Українська", "CP1251", "uk", "%d.%m.%Y %T", EPluralForms::UK_3 },
{ "vietnamese", "Vietnamese", "Tiếng Việt", "UTF-8", "vi", "%d/%m/%Y %T", EPluralForms::VI_1 }, // Fan translation uses special encoding
} };
static_assert(languages.size() == static_cast<size_t>(ELanguages::COUNT), "Languages array is missing a value!");

View File

@ -417,9 +417,6 @@ bool CModHandler::validateTranslations(TModID modName) const
for(const auto & language : Languages::getLanguageList())
{
if (!language.hasTranslation)
continue;
if (mod.config[language.identifier].isNull())
continue;

View File

@ -17,8 +17,8 @@ VCMI_LIB_NAMESPACE_END
namespace Ui
{
class MainWindow;
const QString teamName = "VCMI Team";
const QString appName = "VCMI Map Editor";
const QString teamName = "vcmi";
const QString appName = "mapeditor";
}
class MainWindow : public QMainWindow