|
@@ -3,9 +3,9 @@
|
|
|
|
|
|
#include <zlib.h>
|
|
|
#include "../lib/CStopWatch.h"
|
|
|
-#include "SDL_Extensions.h"
|
|
|
+#include "UIFramework/SDL_Extensions.h"
|
|
|
#include "CGameInfo.h"
|
|
|
-#include "CCursorHandler.h"
|
|
|
+#include "UIFramework/CCursorHandler.h"
|
|
|
#include "CAnimation.h"
|
|
|
#include "CDefHandler.h"
|
|
|
#include "../lib/CDefObjInfoHandler.h"
|
|
@@ -23,7 +23,6 @@
|
|
|
#include "../lib/Connection.h"
|
|
|
#include "../lib/VCMIDirs.h"
|
|
|
#include "../lib/map.h"
|
|
|
-#include "AdventureMapButton.h"
|
|
|
#include "GUIClasses.h"
|
|
|
#include "CPlayerInterface.h"
|
|
|
#include "../CCallback.h"
|
|
@@ -40,6 +39,7 @@
|
|
|
#include "../lib/CFileUtility.h"
|
|
|
#include "../lib/GameConstants.h"
|
|
|
#include "UIFramework/CGuiHandler.h"
|
|
|
+#include "UIFramework/CIntObjectClasses.h"
|
|
|
|
|
|
/*
|
|
|
* CPreGame.cpp, part of VCMI engine
|
|
@@ -311,7 +311,7 @@ static boost::function<void()> genCommand(CMenuScreen* menu, std::vector<std::st
|
|
|
}
|
|
|
break; case 4://exit
|
|
|
{
|
|
|
- return boost::bind(CInfoWindow::showYesNoDialog, boost::ref(CGI->generaltexth->allTexts[69]), (const std::vector<SComponent*>*)0, do_quit, 0, false, 1);
|
|
|
+ return boost::bind(CInfoWindow::showYesNoDialog, boost::ref(CGI->generaltexth->allTexts[69]), (const std::vector<CComponent*>*)0, do_quit, 0, false, 1);
|
|
|
}
|
|
|
break; case 5://highscores
|
|
|
{
|
|
@@ -324,7 +324,7 @@ static boost::function<void()> genCommand(CMenuScreen* menu, std::vector<std::st
|
|
|
return boost::function<void()>();
|
|
|
}
|
|
|
|
|
|
-AdventureMapButton* CMenuEntry::createButton(CMenuScreen* parent, const JsonNode& button)
|
|
|
+CAdventureMapButton* CMenuEntry::createButton(CMenuScreen* parent, const JsonNode& button)
|
|
|
{
|
|
|
boost::function<void()> command = genCommand(parent, parent->menuNameToEntry, button["command"].String());
|
|
|
|
|
@@ -332,7 +332,7 @@ AdventureMapButton* CMenuEntry::createButton(CMenuScreen* parent, const JsonNode
|
|
|
if (!button["help"].isNull() && button["help"].Float() > 0)
|
|
|
help = CGI->generaltexth->zelp[button["help"].Float()];
|
|
|
|
|
|
- return new AdventureMapButton(help, command, button["x"].Float(), button["y"].Float(), button["name"].String(), button["hotkey"].Float());
|
|
|
+ return new CAdventureMapButton(help, command, button["x"].Float(), button["y"].Float(), button["name"].String(), button["hotkey"].Float());
|
|
|
}
|
|
|
|
|
|
CMenuEntry::CMenuEntry(CMenuScreen* parent, const JsonNode &config)
|
|
@@ -361,11 +361,11 @@ CreditsScreen::CreditsScreen()
|
|
|
std::string text = bitmaph->getTextFile("CREDITS");
|
|
|
size_t firstQuote = text.find('\"')+1;
|
|
|
text = text.substr(firstQuote, text.find('\"', firstQuote) - firstQuote );
|
|
|
- credits = new CTextBox(text, SRect(450, 600, 350, 32000), 0, FONT_CREDITS, CENTER, zwykly);
|
|
|
+ credits = new CTextBox(text, Rect(450, 600, 350, 32000), 0, FONT_CREDITS, CENTER, Colors::Cornsilk);
|
|
|
credits->pos.h = credits->maxH;
|
|
|
}
|
|
|
|
|
|
-void CreditsScreen::show(SDL_Surface *to)
|
|
|
+void CreditsScreen::show(SDL_Surface * to)
|
|
|
{
|
|
|
static int count = 0;
|
|
|
count++;
|
|
@@ -542,20 +542,20 @@ CSelectionScreen::CSelectionScreen(CMenuScreen::EState Type, CMenuScreen::EMulti
|
|
|
{
|
|
|
card->difficulty->onChange = bind(&CSelectionScreen::difficultyChange, this, _1);
|
|
|
card->difficulty->select(1, 0);
|
|
|
- AdventureMapButton *select = new AdventureMapButton(CGI->generaltexth->zelp[45], bind(&CSelectionScreen::toggleTab, this, sel), 411, 75, "GSPBUTT.DEF", SDLK_s);
|
|
|
+ CAdventureMapButton *select = new CAdventureMapButton(CGI->generaltexth->zelp[45], bind(&CSelectionScreen::toggleTab, this, sel), 411, 75, "GSPBUTT.DEF", SDLK_s);
|
|
|
select->addTextOverlay(CGI->generaltexth->allTexts[500], FONT_SMALL);
|
|
|
|
|
|
- AdventureMapButton *opts = new AdventureMapButton(CGI->generaltexth->zelp[46], bind(&CSelectionScreen::toggleTab, this, opt), 411, 503, "GSPBUTT.DEF", SDLK_a);
|
|
|
+ CAdventureMapButton *opts = new CAdventureMapButton(CGI->generaltexth->zelp[46], bind(&CSelectionScreen::toggleTab, this, opt), 411, 503, "GSPBUTT.DEF", SDLK_a);
|
|
|
opts->addTextOverlay(CGI->generaltexth->allTexts[501], FONT_SMALL);
|
|
|
|
|
|
- AdventureMapButton *random = new AdventureMapButton(CGI->generaltexth->zelp[47], bind(&CSelectionScreen::toggleTab, this, sel), 411, 99, "GSPBUTT.DEF", SDLK_r);
|
|
|
+ CAdventureMapButton *random = new CAdventureMapButton(CGI->generaltexth->zelp[47], bind(&CSelectionScreen::toggleTab, this, sel), 411, 99, "GSPBUTT.DEF", SDLK_r);
|
|
|
random->addTextOverlay(CGI->generaltexth->allTexts[740], FONT_SMALL);
|
|
|
|
|
|
- start = new AdventureMapButton(CGI->generaltexth->zelp[103], bind(&CSelectionScreen::startGame, this), 411, 529, "SCNRBEG.DEF", SDLK_b);
|
|
|
+ start = new CAdventureMapButton(CGI->generaltexth->zelp[103], bind(&CSelectionScreen::startGame, this), 411, 529, "SCNRBEG.DEF", SDLK_b);
|
|
|
|
|
|
if(network)
|
|
|
{
|
|
|
- AdventureMapButton *hideChat = new AdventureMapButton(CGI->generaltexth->zelp[48], bind(&InfoCard::toggleChat, card), 619, 75, "GSPBUT2.DEF", SDLK_h);
|
|
|
+ CAdventureMapButton *hideChat = new CAdventureMapButton(CGI->generaltexth->zelp[48], bind(&InfoCard::toggleChat, card), 619, 75, "GSPBUT2.DEF", SDLK_h);
|
|
|
hideChat->addTextOverlay(CGI->generaltexth->allTexts[531], FONT_SMALL);
|
|
|
|
|
|
if(multiPlayer == CMenuScreen::MULTI_NETWORK_GUEST)
|
|
@@ -572,15 +572,15 @@ CSelectionScreen::CSelectionScreen(CMenuScreen::EState Type, CMenuScreen::EMulti
|
|
|
break;
|
|
|
case CMenuScreen::loadGame:
|
|
|
sel->recActions = 255;
|
|
|
- start = new AdventureMapButton(CGI->generaltexth->zelp[103], bind(&CSelectionScreen::startGame, this), 411, 529, "SCNRLOD.DEF", SDLK_l);
|
|
|
+ start = new CAdventureMapButton(CGI->generaltexth->zelp[103], bind(&CSelectionScreen::startGame, this), 411, 529, "SCNRLOD.DEF", SDLK_l);
|
|
|
break;
|
|
|
case CMenuScreen::saveGame:
|
|
|
sel->recActions = 255;
|
|
|
- start = new AdventureMapButton("", CGI->generaltexth->zelp[103].second, bind(&CSelectionScreen::startGame, this), 411, 529, "SCNRSAV.DEF");
|
|
|
+ start = new CAdventureMapButton("", CGI->generaltexth->zelp[103].second, bind(&CSelectionScreen::startGame, this), 411, 529, "SCNRSAV.DEF");
|
|
|
break;
|
|
|
case CMenuScreen::campaignList:
|
|
|
sel->recActions = 255;
|
|
|
- start = new AdventureMapButton(std::pair<std::string, std::string>(), bind(&CSelectionScreen::startCampaign, this), 411, 529, "SCNRLOD.DEF", SDLK_b);
|
|
|
+ start = new CAdventureMapButton(std::pair<std::string, std::string>(), bind(&CSelectionScreen::startCampaign, this), 411, 529, "SCNRLOD.DEF", SDLK_b);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -597,7 +597,7 @@ CSelectionScreen::CSelectionScreen(CMenuScreen::EState Type, CMenuScreen::EMulti
|
|
|
backName = "SCNRBACK.DEF";
|
|
|
}
|
|
|
|
|
|
- back = new AdventureMapButton("", CGI->generaltexth->zelp[105].second, bind(&CGuiHandler::popIntTotally, &GH, this), 581, 529, backName, SDLK_ESCAPE);
|
|
|
+ back = new CAdventureMapButton("", CGI->generaltexth->zelp[105].second, bind(&CGuiHandler::popIntTotally, &GH, this), 581, 529, backName, SDLK_ESCAPE);
|
|
|
|
|
|
if(network)
|
|
|
{
|
|
@@ -792,7 +792,7 @@ void CSelectionScreen::startGame()
|
|
|
{
|
|
|
std::string hlp = CGI->generaltexth->allTexts[493]; //%s exists. Overwrite?
|
|
|
boost::algorithm::replace_first(hlp, "%s", sel->txt->text);
|
|
|
- LOCPLINT->showYesNoDialog(hlp, std::vector<SComponent*>(), overWrite, 0, false);
|
|
|
+ LOCPLINT->showYesNoDialog(hlp, std::vector<CComponent*>(), overWrite, 0, false);
|
|
|
}
|
|
|
else
|
|
|
overWrite();
|
|
@@ -1089,7 +1089,7 @@ SelectionTab::SelectionTab(CMenuScreen::EState Type, const boost::function<void(
|
|
|
positions = 16;
|
|
|
}
|
|
|
if(tabType == CMenuScreen::saveGame)
|
|
|
- txt = new CTextInput(SRect(32, 539, 350, 20), SPoint(-32, -25), "GSSTRIP.bmp", 0);
|
|
|
+ txt = new CTextInput(Rect(32, 539, 350, 20), Point(-32, -25), "GSSTRIP.bmp", 0);
|
|
|
break;
|
|
|
case CMenuScreen::campaignList:
|
|
|
getFiles(toParse, GameConstants::DATA_DIR + "/Maps", "h3c"); //get all campaigns
|
|
@@ -1129,7 +1129,7 @@ SelectionTab::SelectionTab(CMenuScreen::EState Type, const boost::function<void(
|
|
|
int sizes[] = {36, 72, 108, 144, 0};
|
|
|
const char * names[] = {"SCSMBUT.DEF", "SCMDBUT.DEF", "SCLGBUT.DEF", "SCXLBUT.DEF", "SCALBUT.DEF"};
|
|
|
for(int i = 0; i < 5; i++)
|
|
|
- new AdventureMapButton("", CGI->generaltexth->zelp[54+i].second, bind(&SelectionTab::filter, this, sizes[i], true), 158 + 47*i, 46, names[i]);
|
|
|
+ new CAdventureMapButton("", CGI->generaltexth->zelp[54+i].second, bind(&SelectionTab::filter, this, sizes[i], true), 158 + 47*i, 46, names[i]);
|
|
|
}
|
|
|
|
|
|
//sort buttons buttons
|
|
@@ -1137,14 +1137,14 @@ SelectionTab::SelectionTab(CMenuScreen::EState Type, const boost::function<void(
|
|
|
int xpos[] = {23, 55, 88, 121, 306, 339};
|
|
|
const char * names[] = {"SCBUTT1.DEF", "SCBUTT2.DEF", "SCBUTCP.DEF", "SCBUTT3.DEF", "SCBUTT4.DEF", "SCBUTT5.DEF"};
|
|
|
for(int i = 0; i < 6; i++)
|
|
|
- new AdventureMapButton("", CGI->generaltexth->zelp[107+i].second, bind(&SelectionTab::sortBy, this, i), xpos[i], 86, names[i]);
|
|
|
+ new CAdventureMapButton("", CGI->generaltexth->zelp[107+i].second, bind(&SelectionTab::sortBy, this, i), xpos[i], 86, names[i]);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//sort by buttons
|
|
|
- new AdventureMapButton("", "", bind(&SelectionTab::sortBy, this, _numOfMaps), 23, 86, "CamCusM.DEF"); //by num of maps
|
|
|
- new AdventureMapButton("", "", bind(&SelectionTab::sortBy, this, _name), 55, 86, "CamCusL.DEF"); //by name
|
|
|
+ new CAdventureMapButton("", "", bind(&SelectionTab::sortBy, this, _numOfMaps), 23, 86, "CamCusM.DEF"); //by num of maps
|
|
|
+ new CAdventureMapButton("", "", bind(&SelectionTab::sortBy, this, _name), 55, 86, "CamCusL.DEF"); //by name
|
|
|
}
|
|
|
|
|
|
slider = new CSlider(372, 86, tabType != CMenuScreen::saveGame ? 480 : 430, bind(&SelectionTab::sliderMove, this, _1), positions, curItems.size(), 0, false, 1);
|
|
@@ -1270,9 +1270,9 @@ void SelectionTab::printMaps(SDL_Surface *to)
|
|
|
CMapInfo *currentItem = curItems[elemIdx];
|
|
|
|
|
|
if (elemIdx == selectionPos)
|
|
|
- itemColor=tytulowy;
|
|
|
+ itemColor=Colors::Jasmine;
|
|
|
else
|
|
|
- itemColor=zwykly;
|
|
|
+ itemColor=Colors::Cornsilk;
|
|
|
|
|
|
if(tabType != CMenuScreen::campaignList)
|
|
|
{
|
|
@@ -1367,7 +1367,7 @@ void SelectionTab::printMaps(SDL_Surface *to)
|
|
|
#undef POS
|
|
|
}
|
|
|
|
|
|
-void SelectionTab::showAll( SDL_Surface * to )
|
|
|
+void SelectionTab::showAll(SDL_Surface * to)
|
|
|
{
|
|
|
CIntObject::showAll(to);
|
|
|
printMaps(to);
|
|
@@ -1388,10 +1388,10 @@ void SelectionTab::showAll( SDL_Surface * to )
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- CSDL_Ext::printAtMiddle(title, pos.x+205, pos.y+28, FONT_MEDIUM, tytulowy, to); //Select a Scenario to Play
|
|
|
+ CSDL_Ext::printAtMiddle(title, pos.x+205, pos.y+28, FONT_MEDIUM, Colors::Jasmine, to); //Select a Scenario to Play
|
|
|
if(tabType != CMenuScreen::campaignList)
|
|
|
{
|
|
|
- CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[510], pos.x+87, pos.y+62, FONT_SMALL, tytulowy, to); //Map sizes
|
|
|
+ CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[510], pos.x+87, pos.y+62, FONT_SMALL, Colors::Jasmine, to); //Map sizes
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1447,7 +1447,7 @@ void SelectionTab::onDoubleClick()
|
|
|
int SelectionTab::getLine()
|
|
|
{
|
|
|
int line = -1;
|
|
|
- SPoint clickPos(GH.current->button.x, GH.current->button.y);
|
|
|
+ Point clickPos(GH.current->button.x, GH.current->button.y);
|
|
|
clickPos = clickPos - pos.topLeft();
|
|
|
|
|
|
if (clickPos.y > 115 && clickPos.y < 564 && clickPos.x > 22 && clickPos.x < 371)
|
|
@@ -1475,7 +1475,7 @@ void SelectionTab::selectFName( const std::string &fname )
|
|
|
|
|
|
|
|
|
|
|
|
-CChatBox::CChatBox(const SRect &rect)
|
|
|
+CChatBox::CChatBox(const Rect &rect)
|
|
|
{
|
|
|
OBJ_CONSTRUCTION;
|
|
|
pos += rect;
|
|
@@ -1483,9 +1483,9 @@ CChatBox::CChatBox(const SRect &rect)
|
|
|
captureAllKeys = true;
|
|
|
|
|
|
const int height = graphics->fonts[FONT_SMALL]->height;
|
|
|
- inputBox = new CTextInput(SRect(0, rect.h - height, rect.w, height));
|
|
|
+ inputBox = new CTextInput(Rect(0, rect.h - height, rect.w, height));
|
|
|
inputBox->used &= ~KEYBOARD;
|
|
|
- chatHistory = new CTextBox("", SRect(0, 0, rect.w, rect.h - height), 1);
|
|
|
+ chatHistory = new CTextBox("", Rect(0, 0, rect.w, rect.h - height), 1);
|
|
|
|
|
|
SDL_Color green = {0,252,0};
|
|
|
chatHistory->color = green;
|
|
@@ -1518,13 +1518,13 @@ InfoCard::InfoCard( bool Network )
|
|
|
used = RCLICK;
|
|
|
mapDescription = NULL;
|
|
|
|
|
|
- SRect descriptionRect(26, 149, 320, 115);
|
|
|
+ Rect descriptionRect(26, 149, 320, 115);
|
|
|
mapDescription = new CTextBox("", descriptionRect, 1);
|
|
|
|
|
|
if(SEL->screenType == CMenuScreen::campaignList)
|
|
|
{
|
|
|
CSelectionScreen *ss = static_cast<CSelectionScreen*>(parent);
|
|
|
- CGuiHandler::moveChild(new CPicture(*ss->bg, descriptionRect + SPoint(-393, 0)), this, mapDescription, true); //move subpicture bg to our description control (by default it's our (Infocard) child)
|
|
|
+ CGuiHandler::moveChild(new CPicture(*ss->bg, descriptionRect + Point(-393, 0)), this, mapDescription, true); //move subpicture bg to our description control (by default it's our (Infocard) child)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1571,24 +1571,24 @@ InfoCard::~InfoCard()
|
|
|
delete sFlags;
|
|
|
}
|
|
|
|
|
|
-void InfoCard::showAll( SDL_Surface * to )
|
|
|
+void InfoCard::showAll(SDL_Surface * to)
|
|
|
{
|
|
|
CIntObject::showAll(to);
|
|
|
|
|
|
//blit texts
|
|
|
if(SEL->screenType != CMenuScreen::campaignList)
|
|
|
{
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[390] + ":", 24, 400, FONT_SMALL, zwykly, to); //Allies
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[391] + ":", 190, 400, FONT_SMALL, zwykly, to); //Enemies
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[494], 33, 430, FONT_SMALL, tytulowy, to);//"Map Diff:"
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[492] + ":", 133,430, FONT_SMALL, tytulowy, to); //player difficulty
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[218] + ":", 290,430, FONT_SMALL, tytulowy, to); //"Rating:"
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[495], 26, 22, FONT_SMALL, tytulowy, to); //Scenario Name:
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[390] + ":", 24, 400, FONT_SMALL, Colors::Cornsilk, to); //Allies
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[391] + ":", 190, 400, FONT_SMALL, Colors::Cornsilk, to); //Enemies
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[494], 33, 430, FONT_SMALL, Colors::Jasmine, to);//"Map Diff:"
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[492] + ":", 133,430, FONT_SMALL, Colors::Jasmine, to); //player difficulty
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[218] + ":", 290,430, FONT_SMALL, Colors::Jasmine, to); //"Rating:"
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[495], 26, 22, FONT_SMALL, Colors::Jasmine, to); //Scenario Name:
|
|
|
if(!chatOn)
|
|
|
{
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[496], 26, 132, FONT_SMALL, tytulowy, to); //Scenario Description:
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[497], 26, 283, FONT_SMALL, tytulowy, to); //Victory Condition:
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[498], 26, 339, FONT_SMALL, tytulowy, to); //Loss Condition:
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[496], 26, 132, FONT_SMALL, Colors::Jasmine, to); //Scenario Description:
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[497], 26, 283, FONT_SMALL, Colors::Jasmine, to); //Victory Condition:
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[498], 26, 339, FONT_SMALL, Colors::Jasmine, to); //Loss Condition:
|
|
|
}
|
|
|
else //players list
|
|
|
{
|
|
@@ -1598,7 +1598,7 @@ void InfoCard::showAll( SDL_Surface * to )
|
|
|
{
|
|
|
if(i->second.human)
|
|
|
{
|
|
|
- printAtLoc(i->second.name, 24, 285 + playerSoFar++ * graphics->fonts[FONT_SMALL]->height, FONT_SMALL, zwykly, to);
|
|
|
+ printAtLoc(i->second.name, 24, 285 + playerSoFar++ * graphics->fonts[FONT_SMALL]->height, FONT_SMALL, Colors::Cornsilk, to);
|
|
|
playerNames.erase(i->second.human);
|
|
|
}
|
|
|
}
|
|
@@ -1606,7 +1606,7 @@ void InfoCard::showAll( SDL_Surface * to )
|
|
|
playerSoFar = 0;
|
|
|
for (std::map<ui32, std::string>::const_iterator i = playerNames.begin(); i != playerNames.end(); i++)
|
|
|
{
|
|
|
- printAtLoc(i->second, 193, 285 + playerSoFar++ * graphics->fonts[FONT_SMALL]->height, FONT_SMALL, zwykly, to);
|
|
|
+ printAtLoc(i->second, 193, 285 + playerSoFar++ * graphics->fonts[FONT_SMALL]->height, FONT_SMALL, Colors::Cornsilk, to);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1625,7 +1625,7 @@ void InfoCard::showAll( SDL_Surface * to )
|
|
|
if (temp>20) temp=0;
|
|
|
std::string sss = CGI->generaltexth->victoryConditions[temp];
|
|
|
if (temp && SEL->current->mapHeader->victoryCondition.allowNormalVictory) sss+= "/" + CGI->generaltexth->victoryConditions[0];
|
|
|
- printAtLoc(sss, 60, 307, FONT_SMALL, zwykly, to);
|
|
|
+ printAtLoc(sss, 60, 307, FONT_SMALL, Colors::Cornsilk, to);
|
|
|
|
|
|
temp = SEL->current->mapHeader->victoryCondition.condition;
|
|
|
if (temp>12) temp=11;
|
|
@@ -1635,7 +1635,7 @@ void InfoCard::showAll( SDL_Surface * to )
|
|
|
temp = SEL->current->mapHeader->lossCondition.typeOfLossCon+1;
|
|
|
if (temp>20) temp=0;
|
|
|
sss = CGI->generaltexth->lossCondtions[temp];
|
|
|
- printAtLoc(sss, 60, 366, FONT_SMALL, zwykly, to);
|
|
|
+ printAtLoc(sss, 60, 366, FONT_SMALL, Colors::Cornsilk, to);
|
|
|
|
|
|
temp=SEL->current->mapHeader->lossCondition.typeOfLossCon;
|
|
|
if (temp>12) temp=3;
|
|
@@ -1645,7 +1645,7 @@ void InfoCard::showAll( SDL_Surface * to )
|
|
|
//difficulty
|
|
|
assert(SEL->current->mapHeader->difficulty <= 4);
|
|
|
std::string &diff = CGI->generaltexth->arraytxt[142 + SEL->current->mapHeader->difficulty];
|
|
|
- printAtMiddleLoc(diff, 62, 472, FONT_SMALL, zwykly, to);
|
|
|
+ printAtMiddleLoc(diff, 62, 472, FONT_SMALL, Colors::Cornsilk, to);
|
|
|
|
|
|
//selecting size icon
|
|
|
switch (SEL->current->mapHeader->width)
|
|
@@ -1670,7 +1670,7 @@ void InfoCard::showAll( SDL_Surface * to )
|
|
|
|
|
|
|
|
|
if(SEL->screenType == CMenuScreen::loadGame)
|
|
|
- printToLoc((static_cast<const CMapInfo*>(SEL->current))->date,308,34, FONT_SMALL, zwykly, to);
|
|
|
+ printToLoc((static_cast<const CMapInfo*>(SEL->current))->date,308,34, FONT_SMALL, Colors::Cornsilk, to);
|
|
|
|
|
|
//print flags
|
|
|
int fx = 34 + graphics->fonts[FONT_SMALL]->getWidth(CGI->generaltexth->allTexts[390].c_str());
|
|
@@ -1709,7 +1709,7 @@ void InfoCard::showAll( SDL_Surface * to )
|
|
|
tob="200%";
|
|
|
break;
|
|
|
}
|
|
|
- printAtMiddleLoc(tob, 311, 472, FONT_SMALL, zwykly, to);
|
|
|
+ printAtMiddleLoc(tob, 311, 472, FONT_SMALL, Colors::Cornsilk, to);
|
|
|
}
|
|
|
|
|
|
//blit description
|
|
@@ -1726,9 +1726,9 @@ void InfoCard::showAll( SDL_Surface * to )
|
|
|
|
|
|
//name
|
|
|
if (name.length())
|
|
|
- printAtLoc(name, 26, 39, FONT_BIG, tytulowy, to);
|
|
|
+ printAtLoc(name, 26, 39, FONT_BIG, Colors::Jasmine, to);
|
|
|
else
|
|
|
- printAtLoc("Unnamed", 26, 39, FONT_BIG, tytulowy, to);
|
|
|
+ printAtLoc("Unnamed", 26, 39, FONT_BIG, Colors::Jasmine, to);
|
|
|
|
|
|
|
|
|
}
|
|
@@ -1753,7 +1753,7 @@ void InfoCard::changeSelection( const CMapInfo *to )
|
|
|
|
|
|
void InfoCard::clickRight( tribool down, bool previousState )
|
|
|
{
|
|
|
- static const SRect flagArea(19, 397, 335, 23);
|
|
|
+ static const Rect flagArea(19, 397, 335, 23);
|
|
|
if(down && SEL->current && isItInLoc(flagArea, GH.current->motion.x, GH.current->motion.y))
|
|
|
showTeamsPopup();
|
|
|
}
|
|
@@ -1761,14 +1761,14 @@ void InfoCard::clickRight( tribool down, bool previousState )
|
|
|
void InfoCard::showTeamsPopup()
|
|
|
{
|
|
|
SDL_Surface *bmp = CMessage::drawBox1(256, 90 + 50 * SEL->current->mapHeader->howManyTeams);
|
|
|
- CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[657], 128, 30, FONT_MEDIUM, tytulowy, bmp); //{Team Alignments}
|
|
|
+ CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[657], 128, 30, FONT_MEDIUM, Colors::Jasmine, bmp); //{Team Alignments}
|
|
|
|
|
|
for(int i = 0; i < SEL->current->mapHeader->howManyTeams; i++)
|
|
|
{
|
|
|
std::vector<ui8> flags;
|
|
|
std::string hlp = CGI->generaltexth->allTexts[656]; //Team %d
|
|
|
hlp.replace(hlp.find("%d"), 2, boost::lexical_cast<std::string>(i+1));
|
|
|
- CSDL_Ext::printAtMiddle(hlp, 128, 65 + 50*i, FONT_SMALL, zwykly, bmp);
|
|
|
+ CSDL_Ext::printAtMiddle(hlp, 128, 65 + 50*i, FONT_SMALL, Colors::Cornsilk, bmp);
|
|
|
|
|
|
for(int j = 0; j < GameConstants::PLAYER_LIMIT; j++)
|
|
|
if((SEL->current->mapHeader->players[j].canHumanPlay || SEL->current->mapHeader->players[j].canComputerPlay)
|
|
@@ -1831,18 +1831,18 @@ OptionsTab::~OptionsTab()
|
|
|
|
|
|
}
|
|
|
|
|
|
-void OptionsTab::showAll( SDL_Surface * to )
|
|
|
+void OptionsTab::showAll(SDL_Surface * to)
|
|
|
{
|
|
|
CIntObject::showAll(to);
|
|
|
- printAtMiddleLoc(CGI->generaltexth->allTexts[515], 222, 30, FONT_BIG, tytulowy, to);
|
|
|
- printAtMiddleWBLoc(CGI->generaltexth->allTexts[516], 222, 58, FONT_SMALL, 55, zwykly, to); //Select starting options, handicap, and name for each player in the game.
|
|
|
- printAtMiddleWBLoc(CGI->generaltexth->allTexts[517], 107, 102, FONT_SMALL, 14, tytulowy, to); //Player Name Handicap Type
|
|
|
- printAtMiddleWBLoc(CGI->generaltexth->allTexts[518], 197, 102, FONT_SMALL, 10, tytulowy, to); //Starting Town
|
|
|
- printAtMiddleWBLoc(CGI->generaltexth->allTexts[519], 273, 102, FONT_SMALL, 10, tytulowy, to); //Starting Hero
|
|
|
- printAtMiddleWBLoc(CGI->generaltexth->allTexts[520], 349, 102, FONT_SMALL, 10, tytulowy, to); //Starting Bonus
|
|
|
- printAtMiddleLoc(CGI->generaltexth->allTexts[521], 222, 538, FONT_SMALL, tytulowy, to); // Player Turn Duration
|
|
|
+ printAtMiddleLoc(CGI->generaltexth->allTexts[515], 222, 30, FONT_BIG, Colors::Jasmine, to);
|
|
|
+ printAtMiddleWBLoc(CGI->generaltexth->allTexts[516], 222, 58, FONT_SMALL, 55, Colors::Cornsilk, to); //Select starting options, handicap, and name for each player in the game.
|
|
|
+ printAtMiddleWBLoc(CGI->generaltexth->allTexts[517], 107, 102, FONT_SMALL, 14, Colors::Jasmine, to); //Player Name Handicap Type
|
|
|
+ printAtMiddleWBLoc(CGI->generaltexth->allTexts[518], 197, 102, FONT_SMALL, 10, Colors::Jasmine, to); //Starting Town
|
|
|
+ printAtMiddleWBLoc(CGI->generaltexth->allTexts[519], 273, 102, FONT_SMALL, 10, Colors::Jasmine, to); //Starting Hero
|
|
|
+ printAtMiddleWBLoc(CGI->generaltexth->allTexts[520], 349, 102, FONT_SMALL, 10, Colors::Jasmine, to); //Starting Bonus
|
|
|
+ printAtMiddleLoc(CGI->generaltexth->allTexts[521], 222, 538, FONT_SMALL, Colors::Jasmine, to); // Player Turn Duration
|
|
|
if (turnDuration)
|
|
|
- printAtMiddleLoc(CGI->generaltexth->turnDurations[turnDuration->value], 319,559, FONT_SMALL, zwykly, to);//Turn duration value
|
|
|
+ printAtMiddleLoc(CGI->generaltexth->turnDurations[turnDuration->value], 319,559, FONT_SMALL, Colors::Cornsilk, to);//Turn duration value
|
|
|
}
|
|
|
|
|
|
void OptionsTab::nextCastle( int player, int dir )
|
|
@@ -2129,7 +2129,7 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry( OptionsTab *owner, PlayerSet
|
|
|
serial++;
|
|
|
}
|
|
|
|
|
|
- pos = parent->pos + SPoint(54, 122 + serial*50);
|
|
|
+ pos = parent->pos + Point(54, 122 + serial*50);
|
|
|
|
|
|
static const char *flags[] = {"AOFLGBR.DEF", "AOFLGBB.DEF", "AOFLGBY.DEF", "AOFLGBG.DEF",
|
|
|
"AOFLGBO.DEF", "AOFLGBP.DEF", "AOFLGBT.DEF", "AOFLGBS.DEF"};
|
|
@@ -2139,12 +2139,12 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry( OptionsTab *owner, PlayerSet
|
|
|
bg = new CPicture(BitmapHandler::loadBitmap(bgs[s.color]), 0, 0, true);
|
|
|
if(SEL->screenType == CMenuScreen::newGame)
|
|
|
{
|
|
|
- btns[0] = new AdventureMapButton(CGI->generaltexth->zelp[132], bind(&OptionsTab::nextCastle, owner, s.color, -1), 107, 5, "ADOPLFA.DEF");
|
|
|
- btns[1] = new AdventureMapButton(CGI->generaltexth->zelp[133], bind(&OptionsTab::nextCastle, owner, s.color, +1), 168, 5, "ADOPRTA.DEF");
|
|
|
- btns[2] = new AdventureMapButton(CGI->generaltexth->zelp[148], bind(&OptionsTab::nextHero, owner, s.color, -1), 183, 5, "ADOPLFA.DEF");
|
|
|
- btns[3] = new AdventureMapButton(CGI->generaltexth->zelp[149], bind(&OptionsTab::nextHero, owner, s.color, +1), 244, 5, "ADOPRTA.DEF");
|
|
|
- btns[4] = new AdventureMapButton(CGI->generaltexth->zelp[164], bind(&OptionsTab::nextBonus, owner, s.color, -1), 259, 5, "ADOPLFA.DEF");
|
|
|
- btns[5] = new AdventureMapButton(CGI->generaltexth->zelp[165], bind(&OptionsTab::nextBonus, owner, s.color, +1), 320, 5, "ADOPRTA.DEF");
|
|
|
+ btns[0] = new CAdventureMapButton(CGI->generaltexth->zelp[132], bind(&OptionsTab::nextCastle, owner, s.color, -1), 107, 5, "ADOPLFA.DEF");
|
|
|
+ btns[1] = new CAdventureMapButton(CGI->generaltexth->zelp[133], bind(&OptionsTab::nextCastle, owner, s.color, +1), 168, 5, "ADOPRTA.DEF");
|
|
|
+ btns[2] = new CAdventureMapButton(CGI->generaltexth->zelp[148], bind(&OptionsTab::nextHero, owner, s.color, -1), 183, 5, "ADOPLFA.DEF");
|
|
|
+ btns[3] = new CAdventureMapButton(CGI->generaltexth->zelp[149], bind(&OptionsTab::nextHero, owner, s.color, +1), 244, 5, "ADOPRTA.DEF");
|
|
|
+ btns[4] = new CAdventureMapButton(CGI->generaltexth->zelp[164], bind(&OptionsTab::nextBonus, owner, s.color, -1), 259, 5, "ADOPLFA.DEF");
|
|
|
+ btns[5] = new CAdventureMapButton(CGI->generaltexth->zelp[165], bind(&OptionsTab::nextBonus, owner, s.color, +1), 320, 5, "ADOPRTA.DEF");
|
|
|
}
|
|
|
else
|
|
|
for(int i = 0; i < 6; i++)
|
|
@@ -2166,7 +2166,7 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry( OptionsTab *owner, PlayerSet
|
|
|
&& SEL->current->mapHeader->players[s.color].canHumanPlay
|
|
|
&& SEL->multiPlayer != CMenuScreen::MULTI_NETWORK_GUEST)
|
|
|
{
|
|
|
- flag = new AdventureMapButton(CGI->generaltexth->zelp[180], bind(&OptionsTab::flagPressed, owner, s.color), -43, 2, flags[s.color]);
|
|
|
+ flag = new CAdventureMapButton(CGI->generaltexth->zelp[180], bind(&OptionsTab::flagPressed, owner, s.color), -43, 2, flags[s.color]);
|
|
|
flag->hoverable = true;
|
|
|
}
|
|
|
else
|
|
@@ -2174,18 +2174,18 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry( OptionsTab *owner, PlayerSet
|
|
|
|
|
|
defActions &= ~SHARE_POS;
|
|
|
town = new SelectedBox(TOWN, s.color);
|
|
|
- town->pos += pos + SPoint(119, 2);
|
|
|
+ town->pos += pos + Point(119, 2);
|
|
|
hero = new SelectedBox(HERO, s.color);
|
|
|
- hero->pos += pos + SPoint(195, 2);
|
|
|
+ hero->pos += pos + Point(195, 2);
|
|
|
bonus = new SelectedBox(BONUS, s.color);
|
|
|
- bonus->pos += pos + SPoint(271, 2);
|
|
|
+ bonus->pos += pos + Point(271, 2);
|
|
|
}
|
|
|
|
|
|
-void OptionsTab::PlayerOptionsEntry::showAll( SDL_Surface * to )
|
|
|
+void OptionsTab::PlayerOptionsEntry::showAll(SDL_Surface * to)
|
|
|
{
|
|
|
CIntObject::showAll(to);
|
|
|
- printAtMiddleLoc(s.name, 55, 10, FONT_SMALL, zwykly, to);
|
|
|
- printAtMiddleWBLoc(CGI->generaltexth->arraytxt[206+whoCanPlay], 28, 34, FONT_TINY, 8, zwykly, to);
|
|
|
+ printAtMiddleLoc(s.name, 55, 10, FONT_SMALL, Colors::Cornsilk, to);
|
|
|
+ printAtMiddleWBLoc(CGI->generaltexth->arraytxt[206+whoCanPlay], 28, 34, FONT_TINY, 8, Colors::Cornsilk, to);
|
|
|
}
|
|
|
|
|
|
void OptionsTab::PlayerOptionsEntry::selectButtons()
|
|
@@ -2229,13 +2229,13 @@ void OptionsTab::PlayerOptionsEntry::selectButtons()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void OptionsTab::SelectedBox::showAll( SDL_Surface * to )
|
|
|
+void OptionsTab::SelectedBox::showAll(SDL_Surface * to)
|
|
|
{
|
|
|
//PlayerSettings &s = SEL->sInfo.playerInfos[player];
|
|
|
SDL_Surface *toBlit = getImg();
|
|
|
const std::string *toPrint = getText();
|
|
|
blitAt(toBlit, pos, to);
|
|
|
- printAtMiddleLoc(*toPrint, 23, 39, FONT_TINY, zwykly, to);
|
|
|
+ printAtMiddleLoc(*toPrint, 23, 39, FONT_TINY, Colors::Cornsilk, to);
|
|
|
}
|
|
|
|
|
|
OptionsTab::SelectedBox::SelectedBox( SelType Which, ui8 Player )
|
|
@@ -2445,7 +2445,7 @@ void OptionsTab::SelectedBox::clickRight( tribool down, bool previousState )
|
|
|
}
|
|
|
|
|
|
if(description)
|
|
|
- CSDL_Ext::printAtMiddleWB(*description, 125, 145, FONT_SMALL, 37, zwykly, bmp);
|
|
|
+ CSDL_Ext::printAtMiddleWB(*description, 125, 145, FONT_SMALL, 37, Colors::Cornsilk, bmp);
|
|
|
}
|
|
|
else if(val == -2)
|
|
|
{
|
|
@@ -2456,7 +2456,7 @@ void OptionsTab::SelectedBox::clickRight( tribool down, bool previousState )
|
|
|
bmp = CMessage::drawBox1(256, 319);
|
|
|
title = &CGI->generaltexth->allTexts[80];
|
|
|
|
|
|
- CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[79], 135, 137, FONT_MEDIUM, tytulowy, bmp);
|
|
|
+ CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[79], 135, 137, FONT_MEDIUM, Colors::Jasmine, bmp);
|
|
|
|
|
|
const CTown &t = CGI->townh->towns[val];
|
|
|
//print creatures
|
|
@@ -2465,7 +2465,7 @@ void OptionsTab::SelectedBox::clickRight( tribool down, bool previousState )
|
|
|
{
|
|
|
int c = t.basicCreatures[i];
|
|
|
blitAt(graphics->smallImgs[c], x, y, bmp);
|
|
|
- CSDL_Ext::printAtMiddleWB(CGI->creh->creatures[c]->nameSing, x + 16, y + 45, FONT_TINY, 10, zwykly, bmp);
|
|
|
+ CSDL_Ext::printAtMiddleWB(CGI->creh->creatures[c]->nameSing, x + 16, y + 45, FONT_TINY, 10, Colors::Cornsilk, bmp);
|
|
|
|
|
|
if(i == 2)
|
|
|
{
|
|
@@ -2485,24 +2485,24 @@ void OptionsTab::SelectedBox::clickRight( tribool down, bool previousState )
|
|
|
bmp = CMessage::drawBox1(320, 255);
|
|
|
title = &CGI->generaltexth->allTexts[77];
|
|
|
|
|
|
- CSDL_Ext::printAtMiddle(*title, 167, 36, FONT_MEDIUM, tytulowy, bmp);
|
|
|
- CSDL_Ext::printAtMiddle(*subTitle + " - " + h->heroClass->name, 160, 99, FONT_SMALL, zwykly, bmp);
|
|
|
+ CSDL_Ext::printAtMiddle(*title, 167, 36, FONT_MEDIUM, Colors::Jasmine, bmp);
|
|
|
+ CSDL_Ext::printAtMiddle(*subTitle + " - " + h->heroClass->name, 160, 99, FONT_SMALL, Colors::Cornsilk, bmp);
|
|
|
|
|
|
blitAt(getImg(), 136, 56, bmp);
|
|
|
|
|
|
//print specialty
|
|
|
- CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[78], 166, 132, FONT_MEDIUM, tytulowy, bmp);
|
|
|
+ CSDL_Ext::printAtMiddle(CGI->generaltexth->allTexts[78], 166, 132, FONT_MEDIUM, Colors::Jasmine, bmp);
|
|
|
blitAt(graphics->un44->ourImages[val].bitmap, 140, 150, bmp);
|
|
|
- CSDL_Ext::printAtMiddle(CGI->generaltexth->hTxts[val].bonusName, 166, 203, FONT_SMALL, zwykly, bmp);
|
|
|
+ CSDL_Ext::printAtMiddle(CGI->generaltexth->hTxts[val].bonusName, 166, 203, FONT_SMALL, Colors::Cornsilk, bmp);
|
|
|
|
|
|
GH.pushInt(new CInfoPopup(bmp, true));
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if(title)
|
|
|
- CSDL_Ext::printAtMiddle(*title, 135, 36, FONT_MEDIUM, tytulowy, bmp);
|
|
|
+ CSDL_Ext::printAtMiddle(*title, 135, 36, FONT_MEDIUM, Colors::Jasmine, bmp);
|
|
|
if(subTitle)
|
|
|
- CSDL_Ext::printAtMiddle(*subTitle, 127, 103, FONT_SMALL, zwykly, bmp);
|
|
|
+ CSDL_Ext::printAtMiddle(*subTitle, 127, 103, FONT_SMALL, Colors::Cornsilk, bmp);
|
|
|
|
|
|
blitAt(getImg(), 104, 60, bmp);
|
|
|
|
|
@@ -2539,7 +2539,7 @@ CScenarioInfo::CScenarioInfo(const CMapHeader *mapHeader, const StartInfo *start
|
|
|
opt->recreate();
|
|
|
|
|
|
card->difficulty->select(startInfo->difficulty, 0);
|
|
|
- back = new AdventureMapButton("", CGI->generaltexth->zelp[105].second, bind(&CGuiHandler::popIntTotally, &GH, this), 584, 535, "SCNRBACK.DEF", SDLK_ESCAPE);
|
|
|
+ back = new CAdventureMapButton("", CGI->generaltexth->zelp[105].second, bind(&CGuiHandler::popIntTotally, &GH, this), 584, 535, "SCNRBACK.DEF", SDLK_ESCAPE);
|
|
|
}
|
|
|
|
|
|
CScenarioInfo::~CScenarioInfo()
|
|
@@ -2616,14 +2616,14 @@ CMultiMode::CMultiMode()
|
|
|
blitAt(CPicture("MUMAP.bmp"), 16, 77, *bg); //blit img
|
|
|
pos = bg->center(); //center, window has size of bg graphic
|
|
|
|
|
|
- bar = new CGStatusBar(new CPicture(SRect(7, 465, 440, 18), 0));//226, 472
|
|
|
- txt = new CTextInput(SRect(19, 436, 334, 16), *bg);
|
|
|
+ bar = new CGStatusBar(new CPicture(Rect(7, 465, 440, 18), 0));//226, 472
|
|
|
+ txt = new CTextInput(Rect(19, 436, 334, 16), *bg);
|
|
|
txt->setText(GDefaultOptions.playerName); //Player
|
|
|
|
|
|
- btns[0] = new AdventureMapButton(CGI->generaltexth->zelp[266], bind(&CMultiMode::openHotseat, this), 373, 78, "MUBHOT.DEF");
|
|
|
- btns[1] = new AdventureMapButton("Host TCP/IP game", "", bind(&CMultiMode::hostTCP, this), 373, 78 + 57*1, "MUBHOST.DEF");
|
|
|
- btns[2] = new AdventureMapButton("Join TCP/IP game", "", bind(&CMultiMode::joinTCP, this), 373, 78 + 57*2, "MUBJOIN.DEF");
|
|
|
- btns[6] = new AdventureMapButton(CGI->generaltexth->zelp[288], bind(&CGuiHandler::popIntTotally, ref(GH), this), 373, 424, "MUBCANC.DEF", SDLK_ESCAPE);
|
|
|
+ btns[0] = new CAdventureMapButton(CGI->generaltexth->zelp[266], bind(&CMultiMode::openHotseat, this), 373, 78, "MUBHOT.DEF");
|
|
|
+ btns[1] = new CAdventureMapButton("Host TCP/IP game", "", bind(&CMultiMode::hostTCP, this), 373, 78 + 57*1, "MUBHOST.DEF");
|
|
|
+ btns[2] = new CAdventureMapButton("Join TCP/IP game", "", bind(&CMultiMode::joinTCP, this), 373, 78 + 57*2, "MUBJOIN.DEF");
|
|
|
+ btns[6] = new CAdventureMapButton(CGI->generaltexth->zelp[288], bind(&CGuiHandler::popIntTotally, ref(GH), this), 373, 424, "MUBCANC.DEF", SDLK_ESCAPE);
|
|
|
}
|
|
|
|
|
|
void CMultiMode::openHotseat()
|
|
@@ -2653,18 +2653,18 @@ CHotSeatPlayers::CHotSeatPlayers(const std::string &firstPlayer)
|
|
|
|
|
|
std::string text = CGI->generaltexth->allTexts[446];
|
|
|
boost::replace_all(text, "\t","\n");
|
|
|
- SRect boxRect(25, 20, 315, 50);
|
|
|
- title = new CTextBox(text, boxRect, 0, FONT_BIG, CENTER, zwykly);//HOTSEAT Please enter names
|
|
|
+ Rect boxRect(25, 20, 315, 50);
|
|
|
+ title = new CTextBox(text, boxRect, 0, FONT_BIG, CENTER, Colors::Cornsilk);//HOTSEAT Please enter names
|
|
|
|
|
|
for(int i = 0; i < ARRAY_COUNT(txt); i++)
|
|
|
{
|
|
|
- txt[i] = new CTextInput(SRect(60, 85 + i*30, 280, 16), *bg);
|
|
|
+ txt[i] = new CTextInput(Rect(60, 85 + i*30, 280, 16), *bg);
|
|
|
txt[i]->cb += boost::bind(&CHotSeatPlayers::onChange, this, _1);
|
|
|
}
|
|
|
|
|
|
- ok = new AdventureMapButton(CGI->generaltexth->zelp[560], bind(&CHotSeatPlayers::enterSelectionScreen, this), 95, 338, "MUBCHCK.DEF", SDLK_RETURN);
|
|
|
- cancel = new AdventureMapButton(CGI->generaltexth->zelp[561], bind(&CGuiHandler::popIntTotally, ref(GH), this), 205, 338, "MUBCANC.DEF", SDLK_ESCAPE);
|
|
|
- bar = new CGStatusBar(new CPicture(SRect(7, 381, 348, 18), 0));//226, 472
|
|
|
+ ok = new CAdventureMapButton(CGI->generaltexth->zelp[560], bind(&CHotSeatPlayers::enterSelectionScreen, this), 95, 338, "MUBCHCK.DEF", SDLK_RETURN);
|
|
|
+ cancel = new CAdventureMapButton(CGI->generaltexth->zelp[561], bind(&CGuiHandler::popIntTotally, ref(GH), this), 205, 338, "MUBCANC.DEF", SDLK_ESCAPE);
|
|
|
+ bar = new CGStatusBar(new CPicture(Rect(7, 381, 348, 18), 0));//226, 472
|
|
|
|
|
|
txt[0]->setText(firstPlayer, true);
|
|
|
txt[0]->giveFocus();
|
|
@@ -2711,31 +2711,31 @@ CBonusSelection::CBonusSelection( CCampaignState * _ourCampaign )
|
|
|
|
|
|
blitAt(panel, 456, 6, background);
|
|
|
|
|
|
- startB = new AdventureMapButton("", "", bind(&CBonusSelection::startMap, this), 475, 536, "CBBEGIB.DEF", SDLK_RETURN);
|
|
|
- backB = new AdventureMapButton("", "", bind(&CBonusSelection::goBack, this), 624, 536, "CBCANCB.DEF", SDLK_ESCAPE);
|
|
|
+ startB = new CAdventureMapButton("", "", bind(&CBonusSelection::startMap, this), 475, 536, "CBBEGIB.DEF", SDLK_RETURN);
|
|
|
+ backB = new CAdventureMapButton("", "", bind(&CBonusSelection::goBack, this), 624, 536, "CBCANCB.DEF", SDLK_ESCAPE);
|
|
|
startB->setState(CButtonBase::BLOCKED);
|
|
|
|
|
|
//campaign name
|
|
|
if (ourCampaign->camp->header.name.length())
|
|
|
- printAtLoc(ourCampaign->camp->header.name, 481, 28, FONT_BIG, tytulowy, background);
|
|
|
+ printAtLoc(ourCampaign->camp->header.name, 481, 28, FONT_BIG, Colors::Jasmine, background);
|
|
|
else
|
|
|
- printAtLoc("Unnamed", 481, 28, FONT_BIG, tytulowy, background);
|
|
|
+ printAtLoc("Unnamed", 481, 28, FONT_BIG, Colors::Jasmine, background);
|
|
|
|
|
|
//map size icon
|
|
|
sizes = CDefHandler::giveDef("SCNRMPSZ.DEF");
|
|
|
|
|
|
|
|
|
//campaign description
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[38], 481, 63, FONT_SMALL, tytulowy, background);
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[38], 481, 63, FONT_SMALL, Colors::Jasmine, background);
|
|
|
|
|
|
- cmpgDesc = new CTextBox(ourCampaign->camp->header.description, SRect(480, 86, 286, 117), 1);
|
|
|
+ cmpgDesc = new CTextBox(ourCampaign->camp->header.description, Rect(480, 86, 286, 117), 1);
|
|
|
cmpgDesc->showAll(background);
|
|
|
|
|
|
//map description
|
|
|
- mapDesc = new CTextBox("", SRect(480, 280, 286, 117), 1);
|
|
|
+ mapDesc = new CTextBox("", Rect(480, 280, 286, 117), 1);
|
|
|
|
|
|
//bonus choosing
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[71], 511, 432, FONT_MEDIUM, zwykly, background); //Choose a bonus:
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[71], 511, 432, FONT_MEDIUM, Colors::Cornsilk, background); //Choose a bonus:
|
|
|
bonuses = new CHighlightableButtonsGroup(bind(&CBonusSelection::selectBonus, this, _1));
|
|
|
|
|
|
//set left part of window
|
|
@@ -2765,15 +2765,15 @@ CBonusSelection::CBonusSelection( CCampaignState * _ourCampaign )
|
|
|
}
|
|
|
|
|
|
//allies / enemies
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[390] + ":", 486, 407, FONT_SMALL, zwykly, background); //Allies
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[391] + ":", 619, 407, FONT_SMALL, zwykly, background); //Enemies
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[390] + ":", 486, 407, FONT_SMALL, Colors::Cornsilk, background); //Allies
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[391] + ":", 619, 407, FONT_SMALL, Colors::Cornsilk, background); //Enemies
|
|
|
|
|
|
SDL_FreeSurface(panel);
|
|
|
|
|
|
//difficulty
|
|
|
std::vector<std::string> difficulty;
|
|
|
boost::split(difficulty, CGI->generaltexth->allTexts[492], boost::is_any_of(" "));
|
|
|
- printAtLoc(difficulty.back(), 689, 432, FONT_MEDIUM, zwykly, background); //Difficulty
|
|
|
+ printAtLoc(difficulty.back(), 689, 432, FONT_MEDIUM, Colors::Cornsilk, background); //Difficulty
|
|
|
|
|
|
//difficulty pics
|
|
|
for (int b=0; b<ARRAY_COUNT(diffPics); ++b)
|
|
@@ -2789,8 +2789,8 @@ CBonusSelection::CBonusSelection( CCampaignState * _ourCampaign )
|
|
|
//difficulty selection buttons
|
|
|
if (ourCampaign->camp->header.difficultyChoosenByPlayer)
|
|
|
{
|
|
|
- diffLb = new AdventureMapButton("", "", bind(&CBonusSelection::changeDiff, this, false), 694, 508, "SCNRBLF.DEF");
|
|
|
- diffRb = new AdventureMapButton("", "", bind(&CBonusSelection::changeDiff, this, true), 738, 508, "SCNRBRT.DEF");
|
|
|
+ diffLb = new CAdventureMapButton("", "", bind(&CBonusSelection::changeDiff, this, false), 694, 508, "SCNRBLF.DEF");
|
|
|
+ diffRb = new CAdventureMapButton("", "", bind(&CBonusSelection::changeDiff, this, true), 738, 508, "SCNRBRT.DEF");
|
|
|
}
|
|
|
|
|
|
//load miniflags
|
|
@@ -2815,7 +2815,7 @@ void CBonusSelection::goBack()
|
|
|
GH.popIntTotally(this);
|
|
|
}
|
|
|
|
|
|
-void CBonusSelection::showAll( SDL_Surface * to )
|
|
|
+void CBonusSelection::showAll(SDL_Surface * to)
|
|
|
{
|
|
|
blitAt(background, pos.x, pos.y, to);
|
|
|
CIntObject::showAll(to);
|
|
@@ -2879,7 +2879,7 @@ void CBonusSelection::selectMap( int whichOne )
|
|
|
updateBonusSelection();
|
|
|
}
|
|
|
|
|
|
-void CBonusSelection::show( SDL_Surface * to )
|
|
|
+void CBonusSelection::show(SDL_Surface * to)
|
|
|
{
|
|
|
//blitAt(background, pos.x, pos.y, to);
|
|
|
|
|
@@ -2887,12 +2887,12 @@ void CBonusSelection::show( SDL_Surface * to )
|
|
|
std::string mapName = ourHeader->name;
|
|
|
|
|
|
if (mapName.length())
|
|
|
- printAtLoc(mapName, 481, 219, FONT_BIG, tytulowy, to);
|
|
|
+ printAtLoc(mapName, 481, 219, FONT_BIG, Colors::Jasmine, to);
|
|
|
else
|
|
|
- printAtLoc("Unnamed", 481, 219, FONT_BIG, tytulowy, to);
|
|
|
+ printAtLoc("Unnamed", 481, 219, FONT_BIG, Colors::Jasmine, to);
|
|
|
|
|
|
//map description
|
|
|
- printAtLoc(CGI->generaltexth->allTexts[496], 481, 253, FONT_SMALL, tytulowy, to);
|
|
|
+ printAtLoc(CGI->generaltexth->allTexts[496], 481, 253, FONT_SMALL, Colors::Jasmine, to);
|
|
|
|
|
|
mapDesc->showAll(to); //showAll because CTextBox has no show()
|
|
|
|
|
@@ -3117,7 +3117,7 @@ void CBonusSelection::updateBonusSelection()
|
|
|
CAnimation * anim = new CAnimation();
|
|
|
anim->setCustom(picName, 0);
|
|
|
bonusButton->setImage(anim);
|
|
|
- bonusButton->borderColor = Colors::Yellow; // yellow border
|
|
|
+ bonusButton->borderColor = Colors::Maize; // yellow border
|
|
|
bonuses->addButton(bonusButton);
|
|
|
}
|
|
|
if (active)
|
|
@@ -3240,7 +3240,7 @@ void CBonusSelection::CRegion::clickRight( tribool down, bool previousState )
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void CBonusSelection::CRegion::show( SDL_Surface * to )
|
|
|
+void CBonusSelection::CRegion::show(SDL_Surface * to)
|
|
|
{
|
|
|
//const SCampPositions::SRegionDesc & desc = owner->campDescriptions[owner->ourCampaign->camp->header.mapVersion].regions[myNumber];
|
|
|
if (!accessible)
|
|
@@ -3495,7 +3495,7 @@ CCampaignScreen::CCampaignButton::CCampaignButton(const JsonNode &config )
|
|
|
used |= LCLICK | HOVER;
|
|
|
image = new CPicture(config["image"].String());
|
|
|
|
|
|
- hoverLabel = new CLabel(pos.w / 2, pos.h + 20, FONT_MEDIUM, CENTER, tytulowy, "");
|
|
|
+ hoverLabel = new CLabel(pos.w / 2, pos.h + 20, FONT_MEDIUM, CENTER, Colors::Jasmine, "");
|
|
|
CGuiHandler::moveChild(hoverLabel, this, parent);
|
|
|
}
|
|
|
|
|
@@ -3524,7 +3524,7 @@ void CCampaignScreen::CCampaignButton::hover(bool on)
|
|
|
hoverLabel->setTxt(" ");
|
|
|
}
|
|
|
|
|
|
-void CCampaignScreen::CCampaignButton::show(SDL_Surface *to)
|
|
|
+void CCampaignScreen::CCampaignButton::show(SDL_Surface * to)
|
|
|
{
|
|
|
if (status == CCampaignScreen::DISABLED)
|
|
|
return;
|
|
@@ -3546,14 +3546,14 @@ void CCampaignScreen::CCampaignButton::show(SDL_Surface *to)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-AdventureMapButton* CCampaignScreen::createExitButton(const JsonNode& button)
|
|
|
+CAdventureMapButton* CCampaignScreen::createExitButton(const JsonNode& button)
|
|
|
{
|
|
|
std::pair<std::string, std::string> help;
|
|
|
if (!button["help"].isNull() && button["help"].Float() > 0)
|
|
|
help = CGI->generaltexth->zelp[button["help"].Float()];
|
|
|
|
|
|
boost::function<void()> close = boost::bind(&CGuiHandler::popIntTotally, &GH, this);
|
|
|
- return new AdventureMapButton(help, close, button["x"].Float(), button["y"].Float(), button["name"].String(), button["hotkey"].Float());
|
|
|
+ return new CAdventureMapButton(help, close, button["x"].Float(), button["y"].Float(), button["name"].String(), button["hotkey"].Float());
|
|
|
}
|
|
|
|
|
|
|