فهرست منبع

Remove excessive totalRedraw's

Ivan Savenko 2 سال پیش
والد
کامیت
c81d57ab8c
4فایلهای تغییر یافته به همراه5 افزوده شده و 6 حذف شده
  1. 2 1
      client/CPlayerInterface.cpp
  2. 1 0
      client/adventureMap/CAdvMapInt.cpp
  3. 1 1
      client/adventureMap/CList.cpp
  4. 1 4
      client/adventureMap/CMinimap.cpp

+ 2 - 1
client/CPlayerInterface.cpp

@@ -583,6 +583,7 @@ void CPlayerInterface::heroInGarrisonChange(const CGTownInstance *town)
 		castleInt->garr->setArmy(town->visitingHero, 1);
 		castleInt->garr->recreateSlots();
 		castleInt->heroes->update();
+		castleInt->redraw();
 	}
 	for (auto isa : GH.listInt)
 	{
@@ -591,9 +592,9 @@ void CPlayerInterface::heroInGarrisonChange(const CGTownInstance *town)
 		{
 			ki->townChanged(town);
 			ki->updateGarrisons();
+			ki->redraw();
 		}
 	}
-	GH.totalRedraw();
 }
 void CPlayerInterface::heroVisitsTown(const CGHeroInstance* hero, const CGTownInstance * town)
 {

+ 1 - 0
client/adventureMap/CAdvMapInt.cpp

@@ -1404,6 +1404,7 @@ void CAdvMapInt::aiTurnStarted()
 	mapAudio->onEnemyTurnStarted();
 	adventureInt->minimap->setAIRadar(true);
 	adventureInt->infoBar->startEnemyTurn(LOCPLINT->cb->getCurrentPlayer());
+	adventureInt->minimap->showAll(screen);//force refresh on inactive object
 	adventureInt->infoBar->showAll(screen);//force refresh on inactive object
 }
 

+ 1 - 1
client/adventureMap/CList.cpp

@@ -77,7 +77,7 @@ void CList::CListItem::onSelect(bool on)
 	if(on)
 		selection = genSelection();
 	select(on);
-	GH.totalRedraw();
+	redraw();
 }
 
 CList::CList(int Size, Point position, std::string btnUp, std::string btnDown, size_t listAmount, int helpUp, int helpDown, CListBox::CreateFunc create)

+ 1 - 4
client/adventureMap/CMinimap.cpp

@@ -222,10 +222,7 @@ void CMinimap::setAIRadar(bool on)
 		aiShield->disable();
 		update();
 	}
-
-	// this may happen during AI turn when this interface is inactive
-	// force redraw in order to properly update interface
-	GH.totalRedraw();
+	redraw();
 }
 
 void CMinimap::updateTile(const int3 &pos)