1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

better UI

This commit is contained in:
Laserlicht 2024-09-28 02:34:18 +02:00
parent 3559f9f923
commit afb90c076d
6 changed files with 10 additions and 4 deletions

View File

@ -61,7 +61,7 @@
"vcmi.spellResearch.canNotAfford" : "You can't afford to research a spell.",
"vcmi.spellResearch.comeAgain" : "Research has already been done today. Come back tomorrow.",
"vcmi.spellResearch.pay" : "Would you like to research a new spell and replace this?",
"vcmi.spellResearch.pay" : "Would you like to research this new spell and replace the old one?",
"vcmi.mainMenu.serverConnecting" : "Connecting...",
"vcmi.mainMenu.serverAddressEnter" : "Enter address:",

View File

@ -60,7 +60,7 @@
"vcmi.spellResearch.canNotAfford" : "Ihr könnt es Euch nicht leisten, einen Zauberspruch zu erforschen.",
"vcmi.spellResearch.comeAgain" : "Die Forschung wurde heute bereits abgeschlossen. Kommt morgen wieder.",
"vcmi.spellResearch.pay" : "Möchtet Ihr einen neuen Zauberspruch erforschen und diesen ersetzen?",
"vcmi.spellResearch.pay" : "Möchtet Ihr diesen neuen Zauberspruch erforschen und den alten ersetzen?",
"vcmi.mainMenu.serverConnecting" : "Verbinde...",
"vcmi.mainMenu.serverAddressEnter" : "Addresse eingeben:",

View File

@ -70,6 +70,7 @@ void CComponent::init(ComponentType Type, ComponentSubType Subtype, std::optiona
customSubtitle = ValText;
size = imageSize;
font = fnt;
newLine = false;
assert(size < sizeInvalid);
@ -471,7 +472,8 @@ void CComponentBox::placeComponents(bool selectable)
//start next row
if ((pos.w != 0 && rows.back().width + comp->pos.w + distance > pos.w) // row is full
|| rows.back().comps >= componentsInRow)
|| rows.back().comps >= componentsInRow
|| (prevComp && prevComp->newLine))
{
prevComp = nullptr;
rows.push_back (RowData (0,0,0));

View File

@ -52,6 +52,7 @@ public:
std::string customSubtitle;
ESize size; //component size.
EFonts font; //Font size of label
bool newLine; //Line break after component
std::string getDescription() const;
std::string getSubtitle() const;

View File

@ -2053,9 +2053,11 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition)
cost[EGameResID::GEMS] = (level + 1) * 2;
std::vector<std::shared_ptr<CComponent>> resComps;
resComps.push_back(std::make_shared<CComponent>(ComponentType::SPELL_SCROLL, town->spells[level].at(town->spellsAtLevel(level, false))));
resComps.back()->newLine = true;
for(TResources::nziterator i(cost); i.valid(); i++)
{
resComps.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE, i->resType, i->resVal));
resComps.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE, i->resType, i->resVal, CComponent::ESize::medium));
}
if(LOCPLINT->cb->getResourceAmount().canAfford(cost))

View File

@ -44,6 +44,7 @@ public:
void showInfoDialog(InfoWindow * iw) override {}
void changeSpells(const CGHeroInstance * hero, bool give, const std::set<SpellID> &spells) override {}
void setTownSpells(const CGTownInstance * town, int level, const std::vector<SpellID> spells) override {}
bool removeObject(const CGObjectInstance * obj, const PlayerColor & initiator) override {return false;}
void createBoat(const int3 & visitablePosition, BoatId type, PlayerColor initiator) override {}
void setOwner(const CGObjectInstance * objid, PlayerColor owner) override {}