1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-07 00:58:39 +02:00
- minor improvement to resolution selection dialog
- removed (hopefully) all cases where neutral faction uses id -1
This commit is contained in:
Ivan Savenko
2012-09-29 15:10:56 +00:00
parent f30ee8ff04
commit b1557bc6c4
4 changed files with 28 additions and 29 deletions

View File

@ -1246,11 +1246,10 @@ CCreaturePic::CCreaturePic(int x, int y, const CCreature *cre, bool Big, bool An
pos.x+=x;
pos.y+=y;
si8 faction = 0;//FIXME: support neutral faction
if (vstd::contains(CGI->townh->factions, cre->faction))
{
faction = cre->faction;
}
TFaction faction = cre->faction;
assert(vstd::contains(CGI->townh->factions, cre->faction));
if(Big)
bg = new CPicture(CGI->townh->factions[faction].creatureBg130);
else
@ -2866,6 +2865,7 @@ void CMarketplaceWindow::updateTraderText()
CAltarWindow::CAltarWindow(const IMarket *Market, const CGHeroInstance *Hero /*= NULL*/, EMarketMode::EMarketMode Mode)
:CTradeWindow((Mode == EMarketMode::CREATURE_EXP ? "ALTARMON.bmp" : "ALTRART2.bmp"), Market, Hero, Mode)
{
OBJ_CONSTRUCTION_CAPTURING_ALL;
if(Mode == EMarketMode::CREATURE_EXP)
{
//%s's Creatures
@ -3302,7 +3302,7 @@ CSystemOptionsWindow::CSystemOptionsWindow():
static const std::string fsHelp = "{Fullscreen}\n\n If selected, VCMI will run in fullscreen mode, othervice VCMI will run in window";
static const std::string cwLabel = "Classic creature window";
static const std::string cwHelp = "{Classic creature window}\n\n Enable original Heroes 3 creature window instead of new window from VCMI";
static const std::string rsLabel = "Select resolution";
static const std::string rsLabel = "Resolution";
static const std::string rsHelp = "{Select resolution}\n\n Change in-game screen resolution. Will only affect adventure map. Game restart required to apply new resolution.";
OBJ_CONSTRUCTION_CAPTURING_ALL;
@ -3403,6 +3403,13 @@ CSystemOptionsWindow::CSystemOptionsWindow():
fullscreen->select(settings["video"]["fullscreen"].Bool());
gameResButton = new CAdventureMapButton("", rsHelp, boost::bind(&CSystemOptionsWindow::selectGameRes, this), 28, 275,"SYSOB12", SDLK_g);
std::string resText;
resText += boost::lexical_cast<std::string>(settings["video"]["screenRes"]["width"].Float());
resText += "x";
resText += boost::lexical_cast<std::string>(settings["video"]["screenRes"]["height"].Float());
gameResLabel = new CLabel(170, 292, FONT_MEDIUM, CENTER, Colors::Jasmine, resText);
}
void CSystemOptionsWindow::selectGameRes()
@ -3426,9 +3433,8 @@ void CSystemOptionsWindow::selectGameRes()
void CSystemOptionsWindow::setGameRes(int index)
{
config::CConfigHandler::GuiOptionsMap::const_iterator iter = conf.guiOptions.begin();
while (index--)
iter++;
auto iter = conf.guiOptions.begin();
std::advance(iter, index);
//do not set resolution to illegal one (0x0)
assert(iter!=conf.guiOptions.end() && iter->first.first > 0 && iter->first.second > 0);
@ -3436,6 +3442,12 @@ void CSystemOptionsWindow::setGameRes(int index)
Settings gameRes = settings.write["video"]["screenRes"];
gameRes["width"].Float() = iter->first.first;
gameRes["height"].Float() = iter->first.second;
std::string resText;
resText += boost::lexical_cast<std::string>(iter->first.first);
resText += "x";
resText += boost::lexical_cast<std::string>(iter->first.second);
gameResLabel->setTxt(resText);
}
void CSystemOptionsWindow::toggleReminder(bool on)