mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +02:00
Fixed texts:
- added new texts to translate.json - implemented texts for abilities Remaining TODO's: - handling of stack artifact - handling of commander artifacts - stack experience
This commit is contained in:
parent
3e9ad21ca9
commit
e4e9d71143
@ -181,6 +181,10 @@ void CStackWindow::CWindowSection::createStackInfo(bool showExp, bool showArt)
|
|||||||
morale->set(parent->info->stackNode);
|
morale->set(parent->info->stackNode);
|
||||||
auto luck = new MoraleLuckBox(false, genRect(42, 42, 375, 110));
|
auto luck = new MoraleLuckBox(false, genRect(42, 42, 375, 110));
|
||||||
luck->set(parent->info->stackNode);
|
luck->set(parent->info->stackNode);
|
||||||
|
|
||||||
|
//TODO: artifacts
|
||||||
|
|
||||||
|
//TODO: stack artifacts
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStackWindow::CWindowSection::createActiveSpells()
|
void CStackWindow::CWindowSection::createActiveSpells()
|
||||||
@ -334,6 +338,8 @@ void CStackWindow::CWindowSection::createCommanderAbilities()
|
|||||||
{
|
{
|
||||||
parent->setSelection(skillID, icon);
|
parent->setSelection(skillID, icon);
|
||||||
};
|
};
|
||||||
|
icon->text = stack->bonusToString(bonus, true);
|
||||||
|
icon->hoverText = stack->bonusToString(bonus, false);
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
if (skillID >= 100)
|
if (skillID >= 100)
|
||||||
@ -355,11 +361,6 @@ void CStackWindow::CWindowSection::createCommanderAbilities()
|
|||||||
leftBtn->block(true);
|
leftBtn->block(true);
|
||||||
rightBtn->block(true);
|
rightBtn->block(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
pos.h += bg2->pos.h;
|
|
||||||
/*
|
|
||||||
bonusItems.push_back (new CBonusItem (genRect(0, 0, 251, 57), stack->bonusToString(b, false), stack->bonusToString(b, true), stack->bonusToGraphics(b)));
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStackWindow::setSelection(si32 newSkill, CClickableObject * newIcon)
|
void CStackWindow::setSelection(si32 newSkill, CClickableObject * newIcon)
|
||||||
@ -463,6 +464,7 @@ void CStackWindow::CWindowSection::createButtonPanel()
|
|||||||
{
|
{
|
||||||
for (size_t i=0; i<2; i++)
|
for (size_t i=0; i<2; i++)
|
||||||
{
|
{
|
||||||
|
std::string btnIDs[2] = { "showSkills", "showBonuses" };
|
||||||
auto onSwitch = [&, i]()
|
auto onSwitch = [&, i]()
|
||||||
{
|
{
|
||||||
parent->switchButtons[parent->activeTab]->enable();
|
parent->switchButtons[parent->activeTab]->enable();
|
||||||
@ -471,7 +473,8 @@ void CStackWindow::CWindowSection::createButtonPanel()
|
|||||||
parent->redraw(); // FIXME: enable/disable don't redraw screen themselves
|
parent->redraw(); // FIXME: enable/disable don't redraw screen themselves
|
||||||
};
|
};
|
||||||
|
|
||||||
parent->switchButtons[i] = new CAdventureMapButton(std::make_pair("",""), onSwitch, 302 + i*40, 5, "stackWindow/upgradeButton");
|
const JsonNode & text = VLC->generaltexth->localizedTexts["creatureWindow"][btnIDs[i]];
|
||||||
|
parent->switchButtons[i] = new CAdventureMapButton(text["label"].String(), text["help"].String(), onSwitch, 302 + i*40, 5, "stackWindow/upgradeButton");
|
||||||
parent->switchButtons[i]->addOverlay(new CAnimImage("stackWindow/switchModeIcons", i));
|
parent->switchButtons[i]->addOverlay(new CAnimImage("stackWindow/switchModeIcons", i));
|
||||||
}
|
}
|
||||||
parent->switchButtons[parent->activeTab]->disable();
|
parent->switchButtons[parent->activeTab]->disable();
|
||||||
@ -544,7 +547,8 @@ CIntObject * CStackWindow::switchTab(size_t index)
|
|||||||
activeTab = 0;
|
activeTab = 0;
|
||||||
auto ret = new CWindowSection(this);
|
auto ret = new CWindowSection(this);
|
||||||
ret->createCommander();
|
ret->createCommander();
|
||||||
ret->createCommanderAbilities();
|
if (info->levelupInfo)
|
||||||
|
ret->createCommanderAbilities();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -27,8 +27,8 @@ public:
|
|||||||
|
|
||||||
std::function<void()> callback; //TODO: create more generic clickable class than AdvMapButton?
|
std::function<void()> callback; //TODO: create more generic clickable class than AdvMapButton?
|
||||||
|
|
||||||
void clickLeft(tribool down, bool previousState);
|
void clickLeft(tribool down, bool previousState) override;
|
||||||
void clickRight(tribool down, bool previousState){};
|
//void clickRight(tribool down, bool previousState){};
|
||||||
|
|
||||||
void setObject(CIntObject * object);
|
void setObject(CIntObject * object);
|
||||||
};
|
};
|
||||||
|
@ -1147,14 +1147,15 @@ CHoverableArea::~CHoverableArea()
|
|||||||
|
|
||||||
void LRClickableAreaWText::clickLeft(tribool down, bool previousState)
|
void LRClickableAreaWText::clickLeft(tribool down, bool previousState)
|
||||||
{
|
{
|
||||||
if(!down && previousState)
|
if(!down && previousState && !text.empty())
|
||||||
{
|
{
|
||||||
LOCPLINT->showInfoDialog(text);
|
LOCPLINT->showInfoDialog(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void LRClickableAreaWText::clickRight(tribool down, bool previousState)
|
void LRClickableAreaWText::clickRight(tribool down, bool previousState)
|
||||||
{
|
{
|
||||||
adventureInt->handleRightClick(text, down);
|
if (!text.empty())
|
||||||
|
adventureInt->handleRightClick(text, down);
|
||||||
}
|
}
|
||||||
|
|
||||||
LRClickableAreaWText::LRClickableAreaWText()
|
LRClickableAreaWText::LRClickableAreaWText()
|
||||||
|
@ -54,5 +54,18 @@
|
|||||||
"anyOf" : "Any of the following:",
|
"anyOf" : "Any of the following:",
|
||||||
"allOf" : "All of the following:",
|
"allOf" : "All of the following:",
|
||||||
"noneOf" : "None of the following:"
|
"noneOf" : "None of the following:"
|
||||||
|
},
|
||||||
|
"creatureWindow" :
|
||||||
|
{
|
||||||
|
"showBonuses" :
|
||||||
|
{
|
||||||
|
"label" : "Switch to bonuses view",
|
||||||
|
"help" : "Displays all active bonuses of the commander"
|
||||||
|
},
|
||||||
|
"showSkills" :
|
||||||
|
{
|
||||||
|
"label" : "Switch to skills view",
|
||||||
|
"help" : "Displays all learned skills of the commander"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user