diff --git a/mapeditor/CMakeLists.txt b/mapeditor/CMakeLists.txt index 4041bcd1e..3a2c6191b 100644 --- a/mapeditor/CMakeLists.txt +++ b/mapeditor/CMakeLists.txt @@ -21,6 +21,7 @@ set(editor_SRCS mapsettings/loseconditions.cpp mapsettings/eventsettings.cpp mapsettings/rumorsettings.cpp + mapsettings/translations.cpp playersettings.cpp playerparams.cpp scenelayer.cpp @@ -58,6 +59,7 @@ set(editor_HEADERS mapsettings/loseconditions.h mapsettings/eventsettings.h mapsettings/rumorsettings.h + mapsettings/translations.h playersettings.h playerparams.h scenelayer.h @@ -85,6 +87,7 @@ set(editor_FORMS mapsettings/loseconditions.ui mapsettings/eventsettings.ui mapsettings/rumorsettings.ui + mapsettings/translations.ui playersettings.ui playerparams.ui validator.ui diff --git a/mapeditor/icons/translations.png b/mapeditor/icons/translations.png new file mode 100644 index 000000000..0b0317386 Binary files /dev/null and b/mapeditor/icons/translations.png differ diff --git a/mapeditor/mainwindow.cpp b/mapeditor/mainwindow.cpp index 8242ee5ec..5a18d1fc3 100644 --- a/mapeditor/mainwindow.cpp +++ b/mapeditor/mainwindow.cpp @@ -42,6 +42,7 @@ #include "objectbrowser.h" #include "inspector/inspector.h" #include "mapsettings/mapsettings.h" +#include "mapsettings/translations.h" #include "playersettings.h" #include "validator.h" @@ -300,6 +301,7 @@ void MainWindow::initializeMap(bool isNew) //enable settings ui->actionMapSettings->setEnabled(true); ui->actionPlayers_settings->setEnabled(true); + ui->actionTranslations->setEnabled(true); //set minimal players count if(isNew) @@ -1239,3 +1241,10 @@ void MainWindow::on_actionExport_triggered() } } + +void MainWindow::on_actionTranslations_triggered() +{ + auto translationsDialog = new Translations(*controller.map(), this); + translationsDialog->show(); +} + diff --git a/mapeditor/mainwindow.h b/mapeditor/mainwindow.h index f509b0882..3954ca173 100644 --- a/mapeditor/mainwindow.h +++ b/mapeditor/mainwindow.h @@ -117,6 +117,8 @@ private slots: void on_actionExport_triggered(); + void on_actionTranslations_triggered(); + public slots: void treeViewSelected(const QModelIndex &selected, const QModelIndex &deselected); diff --git a/mapeditor/mainwindow.ui b/mapeditor/mainwindow.ui index 159a1ec98..6f7b0da5f 100644 --- a/mapeditor/mainwindow.ui +++ b/mapeditor/mainwindow.ui @@ -51,7 +51,7 @@ 0 0 1024 - 22 + 37 @@ -70,6 +70,7 @@ + @@ -140,6 +141,7 @@ + @@ -754,7 +756,7 @@ 0 0 128 - 251 + 236 @@ -797,7 +799,7 @@ 0 0 128 - 251 + 236 @@ -833,7 +835,7 @@ 0 0 128 - 251 + 236 @@ -1237,6 +1239,21 @@ Export as... + + + false + + + + icons:translations.pngicons:translations.png + + + Translations + + + Ctrl+T + + diff --git a/mapeditor/mapsettings/translations.cpp b/mapeditor/mapsettings/translations.cpp new file mode 100644 index 000000000..e8f181551 --- /dev/null +++ b/mapeditor/mapsettings/translations.cpp @@ -0,0 +1,43 @@ +/* + * translations.cpp, part of VCMI engine + * + * Authors: listed in file AUTHORS in main folder + * + * License: GNU General Public License v2.0 or later + * Full text of license available in license.txt file, in main folder + * + */ + +#include "translations.h" +#include "ui_translations.h" + +Translations::Translations(CMapHeader & mh, QWidget *parent) : + QDialog(parent), + ui(new Ui::Translations), + mapHeader(mh) +{ + ui->setupUi(this); +} + +Translations::~Translations() +{ + delete ui; +} + +void Translations::on_languageSelect_currentIndexChanged(int index) +{ + +} + + +void Translations::on_supportedCheck_toggled(bool checked) +{ + +} + + +void Translations::on_translationsTable_itemChanged(QTableWidgetItem *item) +{ + +} + diff --git a/mapeditor/mapsettings/translations.h b/mapeditor/mapsettings/translations.h new file mode 100644 index 000000000..1444e6f25 --- /dev/null +++ b/mapeditor/mapsettings/translations.h @@ -0,0 +1,38 @@ +/* + * translations.h, part of VCMI engine + * + * Authors: listed in file AUTHORS in main folder + * + * License: GNU General Public License v2.0 or later + * Full text of license available in license.txt file, in main folder + * + */ + +#pragma once + +#include +#include "../lib/mapping/CMapHeader.h" + +namespace Ui { +class Translations; +} + +class Translations : public QDialog +{ + Q_OBJECT + +public: + explicit Translations(CMapHeader & mapHeader, QWidget *parent = nullptr); + ~Translations(); + +private slots: + void on_languageSelect_currentIndexChanged(int index); + + void on_supportedCheck_toggled(bool checked); + + void on_translationsTable_itemChanged(QTableWidgetItem *item); + +private: + Ui::Translations *ui; + CMapHeader & mapHeader; +}; diff --git a/mapeditor/mapsettings/translations.ui b/mapeditor/mapsettings/translations.ui new file mode 100644 index 000000000..41b6b8578 --- /dev/null +++ b/mapeditor/mapsettings/translations.ui @@ -0,0 +1,84 @@ + + + Translations + + + + 0 + 0 + 989 + 641 + + + + Map translations + + + true + + + + + + + + + 0 + 0 + + + + Language + + + + + + + + 0 + 0 + + + + + + + + Suppported + + + + + + + + + 240 + + + true + + + false + + + 24 + + + + String ID + + + + + Text + + + + + + + + +