diff --git a/client/windows/CCreatureWindow.cpp b/client/windows/CCreatureWindow.cpp index e30f2d16e..7d3833643 100644 --- a/client/windows/CCreatureWindow.cpp +++ b/client/windows/CCreatureWindow.cpp @@ -528,7 +528,7 @@ void CStackWindow::CWindowSection::createButtonPanel() OBJ_CONSTRUCTION_CAPTURING_ALL; createBackground("button-panel"); - if (parent->info->dismissInfo) + if (parent->info->dismissInfo->callback) { auto onDismiss = [=]() { @@ -597,7 +597,7 @@ void CStackWindow::CWindowSection::createButtonPanel() parent->switchButtons[parent->activeTab]->disable(); } - auto exitBtn = new CButton(Point(382, 5), "hsbtns.def", CGI->generaltexth->zelp[445], [=]{ parent->close(); }, SDLK_RETURN); + auto exitBtn = new CButton(Point(382, 5), "hsbtns.def", CGI->generaltexth->zelp[447], [=]{ parent->close(); }, SDLK_RETURN); exitBtn->assignedKeys.insert(SDLK_ESCAPE); } diff --git a/client/windows/CKingdomInterface.cpp b/client/windows/CKingdomInterface.cpp index c7859e26b..fee18111e 100644 --- a/client/windows/CKingdomInterface.cpp +++ b/client/windows/CKingdomInterface.cpp @@ -782,7 +782,7 @@ CTownItem::CTownItem(const CGTownInstance* Town): background = new CAnimImage("OVSLOT", 6); name = new CLabel(74, 8, FONT_SMALL, TOPLEFT, Colors::WHITE, town->name); - income = new CLabel( 190, 60, FONT_SMALL, CENTER, Colors::WHITE, boost::lexical_cast(town->dailyIncome())); + income = new CLabel( 190, 60, FONT_SMALL, CENTER, Colors::WHITE, boost::lexical_cast(town->dailyIncome()[Res::GOLD])); hall = new CTownInfo( 69, 31, town, true); fort = new CTownInfo(111, 31, town, false); @@ -813,7 +813,7 @@ void CTownItem::updateGarrisons() void CTownItem::update() { - std::string incomeVal = boost::lexical_cast(town->dailyIncome()); + std::string incomeVal = boost::lexical_cast(town->dailyIncome()[Res::GOLD]); if (incomeVal != income->text) income->setText(incomeVal); diff --git a/client/windows/CTradeWindow.cpp b/client/windows/CTradeWindow.cpp index a75960bf3..52d7cf571 100644 --- a/client/windows/CTradeWindow.cpp +++ b/client/windows/CTradeWindow.cpp @@ -734,8 +734,8 @@ CMarketplaceWindow::CMarketplaceWindow(const IMarket *Market, const CGHeroInstan break; case EMarketMode::ARTIFACT_RESOURCE: //%s's Artifacts - new CLabel(152, 102, FONT_SMALL, CENTER, Colors::WHITE, - boost::str(boost::format(CGI->generaltexth->allTexts[272]) % hero->name)); + new CLabel(152, 56, FONT_SMALL, CENTER, Colors::WHITE, + boost::str(boost::format(CGI->generaltexth->allTexts[271]) % hero->name)); break; } @@ -1011,8 +1011,8 @@ void CMarketplaceWindow::getBaseForPositions(EType type, int &dx, int &dy, int & dy = 79; x = 39; y = 180; - h = 66; - w = 74; + h = 68; + w = 70; break; case PLAYER: dx = 83; diff --git a/client/windows/GUIClasses.cpp b/client/windows/GUIClasses.cpp index bd106291b..f3bfe5cf1 100644 --- a/client/windows/GUIClasses.cpp +++ b/client/windows/GUIClasses.cpp @@ -400,14 +400,25 @@ CSplitWindow::CSplitWindow(const CCreature * creature, std::function(text), left); - slider->moveTo(rightAmount - rightMin); - } - catch(boost::bad_lexical_cast &) + int amount = 0; + if (text.length()) { + try + { + amount = boost::lexical_cast(text); + } + catch(boost::bad_lexical_cast &) + { + amount = left ? leftAmount : rightAmount; + } + + int total = leftAmount + rightAmount; + if (amount > total) + amount = total; } + + setAmount(amount, left); + slider->moveTo(rightAmount - rightMin); } void CSplitWindow::setAmount(int value, bool left)