From 79cdabe3aa308834e064c4f4c7e5a9300d4713d2 Mon Sep 17 00:00:00 2001 From: ArseniyShestakov Date: Tue, 23 Dec 2014 07:10:33 +0300 Subject: [PATCH 1/6] CCreatureWindow: correct caption for "Ok" button This one is fixes issue 1396 --- client/windows/CCreatureWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/windows/CCreatureWindow.cpp b/client/windows/CCreatureWindow.cpp index e30f2d16e..3685e999a 100644 --- a/client/windows/CCreatureWindow.cpp +++ b/client/windows/CCreatureWindow.cpp @@ -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); } From 8a697f2ba3fe37ea225050e1f9cf5bc71cb1362b Mon Sep 17 00:00:00 2001 From: ArseniyShestakov Date: Tue, 23 Dec 2014 07:12:42 +0300 Subject: [PATCH 2/6] Fix disabling of dismiss button for last troop Fix issue 1994 --- client/windows/CCreatureWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/windows/CCreatureWindow.cpp b/client/windows/CCreatureWindow.cpp index 3685e999a..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 = [=]() { From 94d0e5486a966e168e214b8a012207564ec8b657 Mon Sep 17 00:00:00 2001 From: ArseniyShestakov Date: Tue, 23 Dec 2014 07:38:58 +0300 Subject: [PATCH 3/6] CSplitWindow: added input check This one fixes issue 1952 --- client/windows/GUIClasses.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) 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) From 150c8425f5681b62c8a75ed3731ed0e96afeaf21 Mon Sep 17 00:00:00 2001 From: ArseniyShestakov Date: Wed, 24 Dec 2014 00:39:48 +0300 Subject: [PATCH 4/6] Fix town income on View Towns screen This is fix issue 1996 --- client/windows/CKingdomInterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); From 36e05402d8b9a45cf5347cb114a43b772e6953eb Mon Sep 17 00:00:00 2001 From: ArseniyShestakov Date: Wed, 24 Dec 2014 03:21:28 +0300 Subject: [PATCH 5/6] Fix text label and location on sell articacts windows This one fixes issue 1998 --- client/windows/CTradeWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/windows/CTradeWindow.cpp b/client/windows/CTradeWindow.cpp index a75960bf3..3cd9514c2 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; } From edccd605648edbbe549ad0d7eee4b50e39634589 Mon Sep 17 00:00:00 2001 From: ArseniyShestakov Date: Wed, 24 Dec 2014 03:22:48 +0300 Subject: [PATCH 6/6] Tiny improvement for resources selection boxes This one is related to issue 562 --- client/windows/CTradeWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/windows/CTradeWindow.cpp b/client/windows/CTradeWindow.cpp index 3cd9514c2..52d7cf571 100644 --- a/client/windows/CTradeWindow.cpp +++ b/client/windows/CTradeWindow.cpp @@ -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;