1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Minor fixes.

This commit is contained in:
Michał W. Urbańczyk 2009-04-14 14:19:46 +00:00
parent 985b4930e4
commit f3ffeea72e
4 changed files with 18 additions and 28 deletions

View File

@ -1602,13 +1602,7 @@ void CAdvMapInt::select(const CArmedInstance *sel )
townList.selected = pos; townList.selected = pos;
terrain.currentPath = NULL; terrain.currentPath = NULL;
} }
else townList.draw(screen);
{ heroList.draw(screen);
int pos = heroList.getPosOfHero(sel); infoBar.draw(screen);
heroList.selected = pos;
terrain.currentPath = heroList.items[pos].second;
}
townList.draw(screen2);
heroList.draw(screen2);
infoBar.draw(screen2);
} }

View File

@ -90,7 +90,7 @@ void CCallback::recruitCreatures(const CGObjectInstance *obj, ui32 ID, ui32 amou
bool CCallback::dismissCreature(const CArmedInstance *obj, int stackPos) bool CCallback::dismissCreature(const CArmedInstance *obj, int stackPos)
{ {
if(((player>=0) && obj->tempOwner != player) || obj->army.slots.size()<2) if(((player>=0) && obj->tempOwner != player) || (obj->army.slots.size()<2 && obj->needsLastStack()))
return false; return false;
DisbandCreature pack(stackPos,obj->id); DisbandCreature pack(stackPos,obj->id);

View File

@ -278,14 +278,14 @@ void CHeroGSlot::clickLeft(boost::logic::tribool down)
{ {
highlight = true; highlight = true;
owner->garr->highlighted = NULL; owner->garr->highlighted = NULL;
//LOCPLINT->totalRedraw(); show(screen2);
} }
hover(false);hover(true); //refresh statusbar hover(false);hover(true); //refresh statusbar
} }
if(indeterminate(down) && !isItIn(&other->pos,LOCPLINT->current->motion.x,LOCPLINT->current->motion.y)) if(indeterminate(down) && !isItIn(&other->pos,LOCPLINT->current->motion.x,LOCPLINT->current->motion.y))
{ {
other->highlight = highlight = false; other->highlight = highlight = false;
//LOCPLINT->totalRedraw(); show(screen2);
} }
} }

View File

@ -217,7 +217,7 @@ void CGarrisonSlot::clickLeft(tribool down)
LOCPLINT->pushInt(creWindow); LOCPLINT->pushInt(creWindow);
owner->highlighted = NULL; owner->highlighted = NULL;
//show(); show(screen2);
refr = true; refr = true;
delete pom2; delete pom2;
} }
@ -273,7 +273,7 @@ void CGarrisonSlot::clickLeft(tribool down)
{ {
if(creature) if(creature)
owner->highlighted = this; owner->highlighted = this;
//show(); show(screen2);
refr = true; refr = true;
} }
if(refr) {hover(false); hover(true); } //to refresh statusbar if(refr) {hover(false); hover(true); } //to refresh statusbar
@ -500,7 +500,7 @@ void CGarrisonInt::recreateSlots()
{ {
//ignoreEvent = true; //ignoreEvent = true;
activeteSlots(); activeteSlots();
//show(); //show(screen2);
} }
} }
void CGarrisonInt::splitClick() void CGarrisonInt::splitClick()
@ -508,7 +508,7 @@ void CGarrisonInt::splitClick()
if(!highlighted) if(!highlighted)
return; return;
splitting = !splitting; splitting = !splitting;
//show(); show(screen2);
} }
void CGarrisonInt::splitStacks(int am2) void CGarrisonInt::splitStacks(int am2)
{ {
@ -2731,14 +2731,13 @@ void CHeroList::select(int which)
selected = which; selected = which;
LOCPLINT->adventureInt->selection = NULL; LOCPLINT->adventureInt->selection = NULL;
LOCPLINT->adventureInt->terrain.currentPath = NULL; LOCPLINT->adventureInt->terrain.currentPath = NULL;
//draw(); draw(screen);
LOCPLINT->adventureInt->infoBar.draw(NULL); LOCPLINT->adventureInt->infoBar.draw(screen);
} }
if (which>=items.size()) if (which>=items.size())
return; return;
selected = which; selected = which;
LOCPLINT->adventureInt->centerOn(items[which].first->pos);
LOCPLINT->adventureInt->selection = items[which].first;
//recalculationg path in case of something has changed on map //recalculationg path in case of something has changed on map
if(items[which].second) if(items[which].second)
{ {
@ -2750,11 +2749,8 @@ void CHeroList::select(int which)
{ {
LOCPLINT->adventureInt->terrain.currentPath = NULL; LOCPLINT->adventureInt->terrain.currentPath = NULL;
} }
LOCPLINT->adventureInt->select(items[which].first);
//recalculated and assigned //recalculated and assigned
//draw();
//LOCPLINT->adventureInt->townList.draw();
//LOCPLINT->adventureInt->infoBar.draw(NULL);
LOCPLINT->cb->setSelection(items[which].first);
} }
void CHeroList::clickLeft(tribool down) void CHeroList::clickLeft(tribool down)
@ -2798,7 +2794,7 @@ void CHeroList::clickLeft(tribool down)
from--; from--;
if (from<0) if (from<0)
from=0; from=0;
//draw(); draw(screen2);
} }
} }
else if (!pressed) //down else if (!pressed) //down
@ -2811,7 +2807,7 @@ void CHeroList::clickLeft(tribool down)
//if (from<items.size()-5) //if (from<items.size()-5)
// from=items.size()-5; // from=items.size()-5;
//draw(); draw(screen2);
} }
} }
else else
@ -3117,7 +3113,7 @@ void CTownList::clickLeft(tribool down)
if (from<0) if (from<0)
from=0; from=0;
//draw(); draw(screen2);
} }
} }
else if (!pressed) //down else if (!pressed) //down
@ -3130,7 +3126,7 @@ void CTownList::clickLeft(tribool down)
//if (from<items.size()-5) //if (from<items.size()-5)
// from=items.size()-5; // from=items.size()-5;
//draw(); draw(screen2);
} }
} }
else else