mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
picked art fixed
This commit is contained in:
@@ -114,8 +114,7 @@ CHeroSwitcher::CHeroSwitcher(CHeroWindow * owner_, Point pos_, const CGHeroInsta
|
|||||||
}
|
}
|
||||||
|
|
||||||
CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
|
CHeroWindow::CHeroWindow(const CGHeroInstance * hero)
|
||||||
: CStatusbarWindow(PLAYER_COLORED, "HeroScr4"),
|
: CStatusbarWindow(PLAYER_COLORED, "HeroScr4")
|
||||||
heroWArt(this, hero)
|
|
||||||
{
|
{
|
||||||
auto & heroscrn = CGI->generaltexth->heroscrn;
|
auto & heroscrn = CGI->generaltexth->heroscrn;
|
||||||
|
|
||||||
@@ -268,7 +267,7 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded)
|
|||||||
//primary skills support
|
//primary skills support
|
||||||
for(size_t g=0; g<primSkillAreas.size(); ++g)
|
for(size_t g=0; g<primSkillAreas.size(); ++g)
|
||||||
{
|
{
|
||||||
primSkillAreas[g]->bonusValue = heroWArt.getPrimSkillLevel(static_cast<PrimarySkill::PrimarySkill>(g));
|
primSkillAreas[g]->bonusValue = curHero->getPrimSkillLevel(static_cast<PrimarySkill::PrimarySkill>(g));
|
||||||
primSkillValues[g]->setText(std::to_string(primSkillAreas[g]->bonusValue));
|
primSkillValues[g]->setText(std::to_string(primSkillAreas[g]->bonusValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,7 +293,7 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded)
|
|||||||
expValue->setText(expstr.str());
|
expValue->setText(expstr.str());
|
||||||
|
|
||||||
std::ostringstream manastr;
|
std::ostringstream manastr;
|
||||||
manastr << curHero->mana << '/' << heroWArt.manaLimit();
|
manastr << curHero->mana << '/' << curHero->manaLimit();
|
||||||
manaValue->setText(manastr.str());
|
manaValue->setText(manastr.str());
|
||||||
|
|
||||||
//printing experience - original format does not support ui64
|
//printing experience - original format does not support ui64
|
||||||
@@ -307,7 +306,7 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded)
|
|||||||
spellPointsArea->text = CGI->generaltexth->allTexts[205];
|
spellPointsArea->text = CGI->generaltexth->allTexts[205];
|
||||||
boost::replace_first(spellPointsArea->text, "%s", curHero->getNameTranslated());
|
boost::replace_first(spellPointsArea->text, "%s", curHero->getNameTranslated());
|
||||||
boost::replace_first(spellPointsArea->text, "%d", std::to_string(curHero->mana));
|
boost::replace_first(spellPointsArea->text, "%d", std::to_string(curHero->mana));
|
||||||
boost::replace_first(spellPointsArea->text, "%d", std::to_string(heroWArt.manaLimit()));
|
boost::replace_first(spellPointsArea->text, "%d", std::to_string(curHero->manaLimit()));
|
||||||
|
|
||||||
//if we have exchange window with this curHero open
|
//if we have exchange window with this curHero open
|
||||||
bool noDismiss=false;
|
bool noDismiss=false;
|
||||||
@@ -343,8 +342,8 @@ void CHeroWindow::update(const CGHeroInstance * hero, bool redrawNeeded)
|
|||||||
formations->setSelected(curHero->formation == EArmyFormation::TIGHT ? 1 : 0);
|
formations->setSelected(curHero->formation == EArmyFormation::TIGHT ? 1 : 0);
|
||||||
formations->addCallback([=](int value){ LOCPLINT->cb->setFormation(curHero, value);});
|
formations->addCallback([=](int value){ LOCPLINT->cb->setFormation(curHero, value);});
|
||||||
|
|
||||||
morale->set(&heroWArt);
|
morale->set(curHero);
|
||||||
luck->set(&heroWArt);
|
luck->set(curHero);
|
||||||
|
|
||||||
if(redrawNeeded)
|
if(redrawNeeded)
|
||||||
redraw();
|
redraw();
|
||||||
@@ -390,5 +389,5 @@ void CHeroWindow::commanderWindow()
|
|||||||
void CHeroWindow::updateGarrisons()
|
void CHeroWindow::updateGarrisons()
|
||||||
{
|
{
|
||||||
garr->recreateSlots();
|
garr->recreateSlots();
|
||||||
morale->set(&heroWArt);
|
morale->set(curHero);
|
||||||
}
|
}
|
||||||
|
@@ -97,8 +97,6 @@ class CHeroWindow : public CStatusbarWindow, public CGarrisonHolder, public CWin
|
|||||||
std::vector<std::shared_ptr<CLabel>> secSkillNames;
|
std::vector<std::shared_ptr<CLabel>> secSkillNames;
|
||||||
std::vector<std::shared_ptr<CLabel>> secSkillValues;
|
std::vector<std::shared_ptr<CLabel>> secSkillValues;
|
||||||
|
|
||||||
CHeroWithMaybePickedArtifact heroWArt;
|
|
||||||
|
|
||||||
std::shared_ptr<CButton> quitButton;
|
std::shared_ptr<CButton> quitButton;
|
||||||
std::shared_ptr<CTextBox> dismissLabel;
|
std::shared_ptr<CTextBox> dismissLabel;
|
||||||
std::shared_ptr<CButton> dismissButton;
|
std::shared_ptr<CButton> dismissButton;
|
||||||
|
@@ -912,8 +912,6 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
|
|||||||
{
|
{
|
||||||
const CGHeroInstance * hero = heroInst.at(leftRight);
|
const CGHeroInstance * hero = heroInst.at(leftRight);
|
||||||
|
|
||||||
herosWArt[leftRight] = std::make_shared<CHeroWithMaybePickedArtifact>(this, hero);
|
|
||||||
|
|
||||||
for(int m=0; m<GameConstants::PRIMARY_SKILLS; ++m)
|
for(int m=0; m<GameConstants::PRIMARY_SKILLS; ++m)
|
||||||
primSkillValues[leftRight].push_back(std::make_shared<CLabel>(352 + (qeLayout ? 96 : 93) * leftRight, (qeLayout ? 22 : 35) + (qeLayout ? 26 : 36) * m, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE));
|
primSkillValues[leftRight].push_back(std::make_shared<CLabel>(352 + (qeLayout ? 96 : 93) * leftRight, (qeLayout ? 22 : 35) + (qeLayout ? 26 : 36) * m, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE));
|
||||||
|
|
||||||
@@ -1079,7 +1077,7 @@ void CExchangeWindow::updateWidgets()
|
|||||||
|
|
||||||
for(int m=0; m<GameConstants::PRIMARY_SKILLS; ++m)
|
for(int m=0; m<GameConstants::PRIMARY_SKILLS; ++m)
|
||||||
{
|
{
|
||||||
auto value = herosWArt[leftRight]->getPrimSkillLevel(static_cast<PrimarySkill::PrimarySkill>(m));
|
auto value = heroInst[leftRight]->getPrimSkillLevel(static_cast<PrimarySkill::PrimarySkill>(m));
|
||||||
primSkillValues[leftRight][m]->setText(std::to_string(value));
|
primSkillValues[leftRight][m]->setText(std::to_string(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,6 @@ class CToggleButton;
|
|||||||
class CGStatusBar;
|
class CGStatusBar;
|
||||||
class CTextBox;
|
class CTextBox;
|
||||||
class CResDataBar;
|
class CResDataBar;
|
||||||
class CHeroWithMaybePickedArtifact;
|
|
||||||
|
|
||||||
enum class EUserEvent;
|
enum class EUserEvent;
|
||||||
|
|
||||||
@@ -288,8 +287,6 @@ private:
|
|||||||
|
|
||||||
class CExchangeWindow : public CStatusbarWindow, public CGarrisonHolder, public CWindowWithArtifacts
|
class CExchangeWindow : public CStatusbarWindow, public CGarrisonHolder, public CWindowWithArtifacts
|
||||||
{
|
{
|
||||||
std::array<std::shared_ptr<CHeroWithMaybePickedArtifact>, 2> herosWArt;
|
|
||||||
|
|
||||||
std::array<std::shared_ptr<CLabel>, 2> titles;
|
std::array<std::shared_ptr<CLabel>, 2> titles;
|
||||||
std::vector<std::shared_ptr<CAnimImage>> primSkillImages;//shared for both heroes
|
std::vector<std::shared_ptr<CAnimImage>> primSkillImages;//shared for both heroes
|
||||||
std::array<std::vector<std::shared_ptr<CLabel>>, 2> primSkillValues;
|
std::array<std::vector<std::shared_ptr<CLabel>>, 2> primSkillValues;
|
||||||
|
Reference in New Issue
Block a user