1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-02 00:10:22 +02:00

Added translatable strings for roads & rivers, for use in editor

This commit is contained in:
Ivan Savenko 2023-01-09 01:19:56 +02:00
parent 4f3ea0d1d9
commit c6d62c6297
5 changed files with 9 additions and 4 deletions

View File

@ -2,6 +2,7 @@
"waterRiver": "waterRiver":
{ {
"index": 1, "index": 1,
"text" : "Water river",
"shortIdentifier": "rw", //must be 2 characters "shortIdentifier": "rw", //must be 2 characters
"tilesFilename": "clrrvr", "tilesFilename": "clrrvr",
"delta": "clrdelt" "delta": "clrdelt"
@ -9,6 +10,7 @@
"iceRiver": "iceRiver":
{ {
"index": 2, "index": 2,
"text" : "Ice river",
"shortIdentifier": "ri", "shortIdentifier": "ri",
"tilesFilename": "icyrvr", "tilesFilename": "icyrvr",
"delta": "icedelt" "delta": "icedelt"
@ -16,6 +18,7 @@
"mudRiver": "mudRiver":
{ {
"index": 3, "index": 3,
"text" : "Mud river",
"shortIdentifier": "rm", "shortIdentifier": "rm",
"tilesFilename": "mudrvr", "tilesFilename": "mudrvr",
"delta": "muddelt" "delta": "muddelt"
@ -23,6 +26,7 @@
"lavaRiver": "lavaRiver":
{ {
"index": 4, "index": 4,
"text" : "Lava river",
"shortIdentifier": "rl", "shortIdentifier": "rl",
"tilesFilename": "lavrvr", "tilesFilename": "lavrvr",
"delta": "lavdelt" "delta": "lavdelt"

View File

@ -2,6 +2,7 @@
"dirtRoad": "dirtRoad":
{ {
"index": 1, "index": 1,
"text" : "Dirt road",
"shortIdentifier": "pd", //must be 2 characters "shortIdentifier": "pd", //must be 2 characters
"tilesFilename": "dirtrd", "tilesFilename": "dirtrd",
"moveCost": 75 "moveCost": 75
@ -9,6 +10,7 @@
"gravelRoad": "gravelRoad":
{ {
"index": 2, "index": 2,
"text" : "Gravel road",
"shortIdentifier": "pg", "shortIdentifier": "pg",
"tilesFilename": "gravrd", "tilesFilename": "gravrd",
"moveCost": 65 "moveCost": 65
@ -16,6 +18,7 @@
"cobblestoneRoad": "cobblestoneRoad":
{ {
"index": 3, "index": 3,
"text" : "Cobblestone road",
"shortIdentifier": "pc", "shortIdentifier": "pc",
"tilesFilename": "cobbrd", "tilesFilename": "cobbrd",
"moveCost": 50 "moveCost": 50

View File

@ -557,7 +557,7 @@ void MainWindow::loadObjectsTree()
//adding roads //adding roads
for(auto & road : VLC->roadTypeHandler->objects) for(auto & road : VLC->roadTypeHandler->objects)
{ {
QPushButton *b = new QPushButton(QString::fromStdString(road->tilesFilename)); QPushButton *b = new QPushButton(QString::fromStdString(road->getNameTranslated()));
ui->roadLayout->addWidget(b); ui->roadLayout->addWidget(b);
connect(b, &QPushButton::clicked, this, [this, road]{ roadOrRiverButtonClicked(road->getIndex(), true); }); connect(b, &QPushButton::clicked, this, [this, road]{ roadOrRiverButtonClicked(road->getIndex(), true); });
} }
@ -566,7 +566,7 @@ void MainWindow::loadObjectsTree()
//adding rivers //adding rivers
for(auto & river : VLC->riverTypeHandler->objects) for(auto & river : VLC->riverTypeHandler->objects)
{ {
QPushButton *b = new QPushButton(QString::fromStdString(river->tilesFilename)); QPushButton *b = new QPushButton(QString::fromStdString(river->getNameTranslated()));
ui->riverLayout->addWidget(b); ui->riverLayout->addWidget(b);
connect(b, &QPushButton::clicked, this, [this, river]{ roadOrRiverButtonClicked(river->getIndex(), false); }); connect(b, &QPushButton::clicked, this, [this, river]{ roadOrRiverButtonClicked(river->getIndex(), false); });
} }

View File

@ -4,7 +4,6 @@
#include <QGraphicsScene> #include <QGraphicsScene>
#include <QStandardItemModel> #include <QStandardItemModel>
#include "mapcontroller.h" #include "mapcontroller.h"
//#include "../lib/TerrainHandler.h"
#include "resourceExtractor/ResourceConverter.h" #include "resourceExtractor/ResourceConverter.h"
class ObjectBrowser; class ObjectBrowser;

View File

@ -13,7 +13,6 @@
#include "maphandler.h" #include "maphandler.h"
#include "mapview.h" #include "mapview.h"
#include "../lib/mapping/CMap.h" #include "../lib/mapping/CMap.h"
//#include "../lib/TerrainHandler.h"
class MainWindow; class MainWindow;
class MapController class MapController