mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-13 11:40:38 +02:00
Moved new texts to config
This commit is contained in:
parent
e2ad8bbf58
commit
3a3306863a
@ -29,6 +29,13 @@
|
||||
"vcmi.capitalColors.5" : "Purple",
|
||||
"vcmi.capitalColors.6" : "Teal",
|
||||
"vcmi.capitalColors.7" : "Pink",
|
||||
|
||||
"vcmi.radialWheel.mergeSameUnit" : "Merge same creatures",
|
||||
"vcmi.radialWheel.showUnitInformation" : "Show creature information",
|
||||
"vcmi.radialWheel.splitSingleUnit" : "Split off single creature",
|
||||
"vcmi.radialWheel.splitUnitEqually" : "Split creaturess equally",
|
||||
"vcmi.radialWheel.moveUnit" : "Move creatures to another army",
|
||||
"vcmi.radialWheel.splitUnit" : "Split creature to another slot",
|
||||
|
||||
"vcmi.mainMenu.tutorialNotImplemented" : "Sorry, tutorial is not implemented yet\n",
|
||||
"vcmi.mainMenu.highscoresNotImplemented" : "Sorry, high scores menu is not implemented yet\n",
|
||||
|
@ -363,12 +363,12 @@ void CGarrisonSlot::gesture(bool on, const Point & initialPosition, const Point
|
||||
bool hasAnyEmptySlots = hasOtherEmptySlots || hasOwnEmptySlots;
|
||||
|
||||
std::vector<RadialMenuConfig> menuElements = {
|
||||
{ RadialMenuConfig::ITEM_NW, hasSameUnit, "stackMerge", "Merge same units", [this](){owner->bulkMergeStacks(this);} },
|
||||
{ RadialMenuConfig::ITEM_NE, stackExists, "stackInfo", "Show unit information", [this](){viewInfo();} },
|
||||
{ RadialMenuConfig::ITEM_WW, hasOwnEmptySlots, "stackSplitOne", "Split off single unit", [this](){splitIntoParts(this->getGarrison(), 1); } },
|
||||
{ RadialMenuConfig::ITEM_EE, hasOwnEmptySlots, "stackSplitEqual", "Split unit equally", [this](){owner->bulkSmartSplitStack(this);} },
|
||||
{ RadialMenuConfig::ITEM_SW, hasOtherEmptySlots, "heroMove", "Move unit to another army", [this](){owner->moveStackToAnotherArmy(this);} },
|
||||
{ RadialMenuConfig::ITEM_SE, hasAnyEmptySlots, "heroSwap", "Split unit to another slot", [this](){ owner->selectSlot(this); owner->splitClick();} },
|
||||
{ RadialMenuConfig::ITEM_NW, hasSameUnit, "stackMerge", "vcmi.radialWheel.mergeSameUnit", [this](){owner->bulkMergeStacks(this);} },
|
||||
{ RadialMenuConfig::ITEM_NE, stackExists, "stackInfo", "vcmi.radialWheel.showUnitInformation", [this](){viewInfo();} },
|
||||
{ RadialMenuConfig::ITEM_WW, hasOwnEmptySlots, "stackSplitOne", "vcmi.radialWheel.splitSingleUnit", [this](){splitIntoParts(this->getGarrison(), 1); } },
|
||||
{ RadialMenuConfig::ITEM_EE, hasOwnEmptySlots, "stackSplitEqual", "vcmi.radialWheel.splitUnitEqually", [this](){owner->bulkSmartSplitStack(this);} },
|
||||
{ RadialMenuConfig::ITEM_SW, hasOtherEmptySlots, "heroMove", "vcmi.radialWheel.moveUnit", [this](){owner->moveStackToAnotherArmy(this);} },
|
||||
{ RadialMenuConfig::ITEM_SE, hasAnyEmptySlots, "heroSwap", "vcmi.radialWheel.splitUnit", [this](){ owner->selectSlot(this); owner->splitClick();} },
|
||||
};
|
||||
|
||||
GH.windows().createAndPushWindow<RadialMenu>(pos.center(), menuElements);
|
||||
|
@ -16,6 +16,9 @@
|
||||
#include "../gui/CGuiHandler.h"
|
||||
#include "../gui/WindowHandler.h"
|
||||
#include "../render/IImage.h"
|
||||
#include "../CGameInfo.h"
|
||||
|
||||
#include "../../lib/CGeneralTextHandler.h"
|
||||
|
||||
RadialMenuItem::RadialMenuItem(const std::string & imageName, const std::string & hoverText, const std::function<void()> & callback)
|
||||
: callback(callback)
|
||||
@ -66,7 +69,7 @@ void RadialMenu::addItem(const Point & offset, bool enabled, const std::string &
|
||||
if (!enabled)
|
||||
return;
|
||||
|
||||
auto item = std::make_shared<RadialMenuItem>(path, hoverText, callback);
|
||||
auto item = std::make_shared<RadialMenuItem>(path, CGI->generaltexth->translate(hoverText), callback);
|
||||
|
||||
item->moveBy(offset);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user