Browse Source

Merge branch 'feature/freegfx' into refactoring/guiClasses

Conflicts:
	client/windows/CHeroWindow.cpp
	client/windows/CQuestLog.cpp
	client/windows/GUIClasses.cpp
Ivan Savenko 11 years ago
parent
commit
77a73fbaa9

BIN
Mods/vcmi/Data/StackQueueLarge.png


BIN
Mods/vcmi/Data/StackQueueSmall.png


BIN
Mods/vcmi/Data/questDialog.png


+ 8 - 0
Mods/vcmi/Sprites/buttons/commander.json

@@ -0,0 +1,8 @@
+{
+	"basepath" : "buttons/",
+	"images" :
+	[
+		{ "frame" : 0, "file" : "commanderNormal.png"},
+		{ "frame" : 1, "file" : "commanderPressed.png"}
+	]
+}

BIN
Mods/vcmi/Sprites/buttons/commanderNormal.png


BIN
Mods/vcmi/Sprites/buttons/commanderPressed.png


+ 8 - 0
Mods/vcmi/Sprites/buttons/resolution.json

@@ -0,0 +1,8 @@
+{
+	"basepath" : "buttons/",
+	"images" :
+	[
+		{ "frame" : 0, "file" : "resolutionNormal.png"},
+		{ "frame" : 1, "file" : "resolutionPressed.png"}
+	]
+}

BIN
Mods/vcmi/Sprites/buttons/resolutionNormal.png


BIN
Mods/vcmi/Sprites/buttons/resolutionPressed.png


+ 1 - 0
client/CPreGame.cpp

@@ -1759,6 +1759,7 @@ void CRandomMapTab::addButtonsToGroup(CToggleGroup * group, const std::vector<st
 
 void CRandomMapTab::deactivateButtonsFrom(CToggleGroup * group, int startId)
 {
+	logGlobal->infoStream() << "Blocking buttons from " << startId;
 	for(auto toggle : group->buttons)
 	{
 		if (auto button = dynamic_cast<CToggleButton*>(toggle.second))

+ 1 - 1
client/battle/CBattleInterfaceClasses.cpp

@@ -703,7 +703,7 @@ CStackQueue::StackBox::StackBox(bool small):
     small(small)
 {
 	OBJ_CONSTRUCTION_CAPTURING_ALL;
-	bg = new CPicture(small ? "StackQueueBgSmall" : "StackQueueBgBig" );
+	bg = new CPicture(small ? "StackQueueSmall" : "StackQueueLarge" );
 
 	if (small)
 	{

+ 3 - 3
client/widgets/Buttons.cpp

@@ -196,7 +196,7 @@ void CButton::clickRight(tribool down, bool previousState)
 
 void CButton::hover (bool on)
 {
-	if(hoverable)
+	if(hoverable && !isBlocked())
 	{
 		if(on)
 			setState(HIGHLIGHTED);
@@ -204,8 +204,8 @@ void CButton::hover (bool on)
 			setState(NORMAL);
 	}
 
-	if(pressedL && on)
-		setState(PRESSED);
+	/*if(pressedL && on) // WTF is this? When this is used?
+		setState(PRESSED);*/
 
 	std::string name = hoverTexts[getState()].empty()
 		? hoverTexts[getState()]

+ 1 - 1
client/windows/CHeroWindow.cpp

@@ -118,7 +118,7 @@ CHeroWindow::CHeroWindow(const CGHeroInstance *hero):
 	if (hero->commander)
 	{
 		auto texts = CGI->generaltexth->localizedTexts["heroWindow"]["openCommander"];
-		commanderButton = new CButton (Point(317, 18), "chftke.def", CButton::tooltip(texts), [&]{ commanderWindow(); }, SDLK_c);
+		commanderButton = new CButton (Point(317, 18), "buttons/commander", CButton::tooltip(texts), [&]{ commanderWindow(); }, SDLK_c);
 	}
 
 	//right list of heroes

+ 8 - 8
client/windows/CQuestLog.cpp

@@ -115,7 +115,7 @@ void CQuestMinimap::showAll(SDL_Surface * to)
 }
 
 CQuestLog::CQuestLog (const std::vector<QuestInfo> & Quests) :
-	CWindowObject(PLAYER_COLORED, "QuestLog.pcx"),
+	CWindowObject(PLAYER_COLORED | BORDERED, "questDialog.pcx"),
 	questIndex(0),
 	currentQuest(nullptr),
 	quests (Quests),
@@ -127,12 +127,12 @@ CQuestLog::CQuestLog (const std::vector<QuestInfo> & Quests) :
 
 void CQuestLog::init()
 {
-	minimap = new CQuestMinimap (Rect (47, 33, 144, 144));
-	description = new CTextBox ("", Rect(245, 33, 350, 355), 1, FONT_MEDIUM, TOPLEFT, Colors::WHITE);
-	ok = new CButton(Point(547, 401), "IOKAY.DEF", CGI->generaltexth->zelp[445], boost::bind(&CQuestLog::close,this), SDLK_RETURN);
+	minimap = new CQuestMinimap (Rect (33, 18, 144, 144));
+	description = new CTextBox ("", Rect(221, 18, 350, 355), 1, FONT_MEDIUM, TOPLEFT, Colors::WHITE);
+	ok = new CButton(Point(533, 386), "IOKAY.DEF", CGI->generaltexth->zelp[445], boost::bind(&CQuestLog::close,this), SDLK_RETURN);
 
 	if (quests.size() > QUEST_COUNT)
-		slider = new CSlider(Point(203, 199), 230, boost::bind (&CQuestLog::sliderMoved, this, _1), QUEST_COUNT, quests.size(), false);
+		slider = new CSlider(Point(189, 184), 230, boost::bind (&CQuestLog::sliderMoved, this, _1), QUEST_COUNT, quests.size(), false, CSlider::BROWN);
 
 	for (int i = 0; i < quests.size(); ++i)
 	{
@@ -140,7 +140,7 @@ void CQuestLog::init()
 		quests[i].quest->getRolloverText (text, false);
 		if (quests[i].obj)
 			text.addReplacement (quests[i].obj->getObjectName()); //get name of the object
-		CQuestLabel * label = new CQuestLabel (Rect(28, 199 + i * 24, 172,30), FONT_SMALL, TOPLEFT, Colors::WHITE, text.toString());
+		CQuestLabel * label = new CQuestLabel (Rect(14, 184 + i * 24, 172,30), FONT_SMALL, TOPLEFT, Colors::WHITE, text.toString());
 		label->callback = boost::bind(&CQuestLog::selectQuest, this, i);
 		labels.push_back(label);
 	}
@@ -150,7 +150,7 @@ void CQuestLog::init()
 
 void CQuestLog::showAll(SDL_Surface * to)
 {
-	CIntObject::showAll (to);
+	CWindowObject::showAll (to);
 	for (auto label : labels)
 	{
 		label->show(to); //shows only if active
@@ -168,7 +168,7 @@ void CQuestLog::recreateQuestList (int newpos)
 {
 	for (int i = 0; i < labels.size(); ++i)
 	{
-		labels[i]->pos = Rect (pos.x + 28, pos.y + 207 + (i-newpos) * 25, 173, 23);
+		labels[i]->pos = Rect (pos.x + 14, pos.y + 192 + (i-newpos) * 25, 173, 23);
 		if (i >= newpos && i < newpos + QUEST_COUNT)
 		{
 			labels[i]->activate();

+ 2 - 3
client/windows/GUIClasses.cpp

@@ -606,9 +606,8 @@ CSystemOptionsWindow::CSystemOptionsWindow():
 
 	onFullscreenChanged([&](const JsonNode &newState){ fullscreen->setSelected(newState.Bool());});
 
-	gameResButton = new CButton(Point(28, 275),"SYSOB12", CButton::tooltip(texts["resolutionButton"]),
-	                                        boost::bind(&CSystemOptionsWindow::selectGameRes, this),
-	                                        SDLK_g);
+	gameResButton = new CButton(Point(28, 275),"buttons/resolution", CButton::tooltip(texts["resolutionButton"]),
+	                                        boost::bind(&CSystemOptionsWindow::selectGameRes, this), SDLK_g);
 
 	std::string resText;
 	resText += boost::lexical_cast<std::string>(settings["video"]["screenRes"]["width"].Float());