浏览代码

* reduntant quotation marks from artifact descriptions are removed
* fixed map scrolling with ctrl+arrows when some windows are opened

Michał W. Urbańczyk 16 年之前
父节点
当前提交
ab1a759458
共有 4 个文件被更改,包括 40 次插入31 次删除
  1. 19 25
      CAdvmapInterface.cpp
  2. 0 1
      CAdvmapInterface.h
  3. 13 3
      CPlayerInterface.cpp
  4. 8 2
      hch/CArtHandler.cpp

+ 19 - 25
CAdvmapInterface.cpp

@@ -1373,14 +1373,30 @@ void CAdvMapInt::activate()
 	heroList.activate();
 	townList.activate();
 	terrain.activate();
-	KeyInterested::activate();
 
 	LOCPLINT->cingconsole->activate();
 }
 void CAdvMapInt::deactivate()
 {
-	KeyInterested::deactivate();
-	hide();
+	scrollingDir = 0;
+	CGI->curh->changeGraphic(0,0);
+	kingOverview.deactivate();
+	underground.deactivate();
+	questlog.deactivate();
+	sleepWake.deactivate();
+	moveHero.deactivate();
+	spellbook.deactivate();
+	advOptions.deactivate();
+	sysOptions.deactivate();
+	nextHero.deactivate();
+	endTurn.deactivate();
+	minimap.deactivate();
+	heroList.deactivate();
+	townList.deactivate();
+	terrain.deactivate();
+	if(std::find(LOCPLINT->timeinterested.begin(),LOCPLINT->timeinterested.end(),&infoBar)!=LOCPLINT->timeinterested.end())
+		LOCPLINT->timeinterested.erase(std::find(LOCPLINT->timeinterested.begin(),LOCPLINT->timeinterested.end(),&infoBar));
+	infoBar.mode=-1;
 
 	LOCPLINT->cingconsole->deactivate();
 
@@ -1418,28 +1434,6 @@ void CAdvMapInt::showAll(SDL_Surface *to)
 	infoBar.draw(to);
 	LOCPLINT->cingconsole->show(to);
 }
-void CAdvMapInt::hide()
-{
-	CGI->curh->changeGraphic(0,0);
-	kingOverview.deactivate();
-	underground.deactivate();
-	questlog.deactivate();
-	sleepWake.deactivate();
-	moveHero.deactivate();
-	spellbook.deactivate();
-	advOptions.deactivate();
-	sysOptions.deactivate();
-	nextHero.deactivate();
-	endTurn.deactivate();
-	minimap.deactivate();
-	heroList.deactivate();
-	townList.deactivate();
-	terrain.deactivate();
-	if(std::find(LOCPLINT->timeinterested.begin(),LOCPLINT->timeinterested.end(),&infoBar)!=LOCPLINT->timeinterested.end())
-		LOCPLINT->timeinterested.erase(std::find(LOCPLINT->timeinterested.begin(),LOCPLINT->timeinterested.end(),&infoBar));
-	infoBar.mode=-1;
-
-}
 void CAdvMapInt::show(SDL_Surface *to)
 {
 	++animValHitCount; //for animations

+ 0 - 1
CAdvmapInterface.h

@@ -112,7 +112,6 @@ public:
 /*****************************/
 class CAdvMapInt : public CMainInterface, public KeyInterested //adventure map interface
 {
-	void hide(); //deactivates advmap interface
 public:
 	CAdvMapInt(int Player);
 	~CAdvMapInt();

+ 13 - 3
CPlayerInterface.cpp

@@ -1195,6 +1195,7 @@ void CPlayerInterface::yourTurn()
 
 		adventureInt->showAll(screen);
 		pushInt(adventureInt);
+		adventureInt->KeyInterested::activate();
 
 		timeHandler th;
 		th.getDif();
@@ -1243,9 +1244,17 @@ void CPlayerInterface::yourTurn()
 				delete ev;
 			}
 
-			if(objsToBlit.size() > 1)
-				blitAt(screen2,0,0,screen); //blit background
-			objsToBlit.back()->show(screen); //blit active interface/window
+			if(!adventureInt->active && adventureInt->scrollingDir) //player force map scrolling though interface is disabled
+			{
+				totalRedraw();
+			}
+			else
+			{
+				//update only top interface and draw background
+				if(objsToBlit.size() > 1)
+					blitAt(screen2,0,0,screen); //blit background
+				objsToBlit.back()->show(screen); //blit active interface/window
+			}
 
 			CGI->curh->draw1();
 			CSDL_Ext::update(screen);
@@ -1254,6 +1263,7 @@ void CPlayerInterface::yourTurn()
 			SDL_framerateDelay(mainFPSmng);
 		}
 
+		adventureInt->KeyInterested::deactivate();
 		popInt(adventureInt);
 
 		cb->endTurn();

+ 8 - 2
hch/CArtHandler.cpp

@@ -55,6 +55,7 @@ void CArtHandler::loadArtifacts(bool onlyTxt)
 	for (int i=0; i<ARTIFACTS_QUANTITY; i++)
 	{
 		CArtifact nart;
+		nart.id=i;
 		loadToIt(VLC->generaltexth->artifNames[i],buf,it,4);
 		loadToIt(pom,buf,it,4);
 		nart.price=atoi(pom.c_str());
@@ -66,8 +67,13 @@ void CArtHandler::loadArtifacts(bool onlyTxt)
 		}
 		loadToIt(pom,buf,it,4);
 		nart.aClass = classes[pom[0]];
-		loadToIt(VLC->generaltexth->artifDescriptions[i],buf,it,3);
-		nart.id=i;
+
+		//load description and remove quotation marks
+		std::string &desc = VLC->generaltexth->artifDescriptions[i];
+		loadToIt(desc,buf,it,3);
+		if(desc[0] == '\"' && desc[desc.size()-1] == '\"')
+			desc = desc.substr(1,desc.size()-2);
+
 		if(!onlyTxt)
 			artifacts.push_back(nart);
 	}