mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Merge branch 'develop' into feature/nullkiller2
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "../widgets/MiscWidgets.h"
|
||||
#include "../widgets/CComponent.h"
|
||||
#include "../widgets/CGarrisonInt.h"
|
||||
#include "../widgets/CTextInput.h"
|
||||
#include "../widgets/Buttons.h"
|
||||
#include "../widgets/TextControls.h"
|
||||
#include "../widgets/RadialMenu.h"
|
||||
@@ -1435,7 +1436,15 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
|
||||
garr->setRedrawParent(true);
|
||||
|
||||
heroes = std::make_shared<HeroSlots>(town, Point(241, 387), Point(241, 483), garr, true);
|
||||
title = std::make_shared<CLabel>(85, 387, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, town->getNameTranslated());
|
||||
title = std::make_shared<CTextInputWithConfirm>(Rect(83, 386, 140, 20), FONT_MEDIUM, ETextAlignment::TOPLEFT, town->getNameTranslated(), true, [this](){
|
||||
std::string name = title->getText();
|
||||
std::string originalName = LIBRARY->generaltexth->translate(town->getNameTextID());
|
||||
if(name == originalName)
|
||||
name = ""; // use textID again
|
||||
GAME->interface()->cb->setTownName(town, name);
|
||||
});
|
||||
if(town->tempOwner != GAME->interface()->playerID) // disable changing for allied towns
|
||||
title->deactivate();
|
||||
income = std::make_shared<CLabel>(195, 443, FONT_SMALL, ETextAlignment::CENTER);
|
||||
icon = std::make_shared<CAnimImage>(AnimationPath::builtin("ITPT"), 0, 0, 15, 387);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user