Explorar o código

* Fixed in game scenario info and save game screens
* AI will now use tlog6 (teal color) for logs

Michał W. Urbańczyk %!s(int64=13) %!d(string=hai) anos
pai
achega
4f182744e7

+ 1 - 1
AI/StupidAI/StupidAI.cpp

@@ -243,7 +243,7 @@ void CStupidAI::battleStacksRemoved(const BattleStacksRemoved & bsr)
 
 void CStupidAI::print(const std::string &text) const
 {
-	tlog0 << "CStupidAI [" << this <<"]: " << text << std::endl;
+	tlog6 << "CStupidAI [" << this <<"]: " << text << std::endl;
 }
 
 BattleAction CStupidAI::goTowards(const CStack * stack, BattleHex hex)

+ 4 - 2
AI/VCAI/StdInc.h

@@ -33,9 +33,11 @@ using boost::format;
 using boost::str;
 
 
+extern CLogger &aiLogger;
+
 #define INDENT AILogger::Tab ___dummy_ind
-#define PNLOG(txt) {int i = logger.lvl; while(i--) tlog4 << "\t"; tlog4 << txt << "\n";}
-#define BNLOG(txt, formattingEls) {int i = logger.lvl; while(i--) tlog4 << "\t"; tlog4 << (boost::format(txt) % formattingEls) << "\n";}
+#define PNLOG(txt) {int i = logger.lvl; while(i--) aiLogger << "\t"; aiLogger << txt << "\n";}
+#define BNLOG(txt, formattingEls) {int i = logger.lvl; while(i--) aiLogger << "\t"; aiLogger << (boost::format(txt) % formattingEls) << "\n";}
 //#define LOG_ENTRY PNLOG("Entered " __FUNCTION__)
 #define LOG_ENTRY
 

+ 3 - 0
AI/VCAI/VCAI.cpp

@@ -4,6 +4,9 @@
 
 #define I_AM_ELEMENTAR return CGoal(*this).setisElementar(true)
 
+
+CLogger &aiLogger = tlog6;
+
 const int ACTUAL_RESOURCE_COUNT = 7;
 
 const double SAFE_ATTACK_CONSTANT = 2.5;

+ 3 - 3
client/CPreGame.cpp

@@ -1529,7 +1529,8 @@ InfoCard::InfoCard( bool Network )
 	{
 		bg = new CPicture(BitmapHandler::loadBitmap("GSELPOP1.bmp"), 0, 0, true);
 		CGuiHandler::moveChild(bg, this, parent);
-		parent->children.insert(parent->children.begin()+1, bg);
+		auto it = vstd::find(parent->children, this); //our position among parent children
+		parent->children.insert(it, bg); //put BG before us
 		parent->children.pop_back();
 		pos.w = bg->pos.w;
 		pos.h = bg->pos.h;
@@ -1728,8 +1729,6 @@ void InfoCard::showAll(SDL_Surface * to)
 			printAtLoc(name, 26, 39, FONT_BIG, Colors::Jasmine, to);
 		else
 			printAtLoc("Unnamed", 26, 39, FONT_BIG, Colors::Jasmine, to);
-
-
 	}
 }
 
@@ -2536,6 +2535,7 @@ CScenarioInfo::CScenarioInfo(const CMapHeader *mapHeader, const StartInfo *start
 	card = new InfoCard();
 	opt = new OptionsTab();
 	opt->recreate();
+	card->changeSelection(current);
 
 	card->difficulty->select(startInfo->difficulty, 0);
 	back = new CAdventureMapButton("", CGI->generaltexth->zelp[105].second, bind(&CGuiHandler::popIntTotally, &GH, this), 584, 535, "SCNRBACK.DEF", SDLK_ESCAPE);

+ 6 - 0
client/UIFramework/CGuiHandler.cpp

@@ -107,6 +107,12 @@ void CGuiHandler::totalRedraw()
 	for(int i=0;i<objsToBlit.size();i++)
 		objsToBlit[i]->showAll(screen2);
 
+// 	static int a = 0;
+// 	if(a)
+// 	{
+// 		SDL_SaveBMP(screen, "s1.bmp");
+// 		SDL_SaveBMP(screen2, "s2.bmp");
+// 	}
 	blitAt(screen2,0,0,screen);
 }