1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

* improved minimap

* live event handling on adventure map
* added CCallback
* minor stuff (as usual)
This commit is contained in:
Michał W. Urbańczyk
2007-08-27 14:15:03 +00:00
parent 4162103cf1
commit 210123ac33
11 changed files with 73 additions and 13 deletions

View File

@@ -81,6 +81,15 @@ void KeyInterested::deactivate()
LOCPLINT->
keyinterested.erase(std::find(LOCPLINT->keyinterested.begin(),LOCPLINT->keyinterested.end(),this));
}
void MotionInterested::activate()
{
LOCPLINT->motioninterested.push_back(this);
}
void MotionInterested::deactivate()
{
LOCPLINT->
motioninterested.erase(std::find(LOCPLINT->motioninterested.begin(),LOCPLINT->motioninterested.end(),this));
}
CPlayerInterface::CPlayerInterface(int Player, int serial)
{
playerID=Player;
@@ -111,7 +120,7 @@ void CPlayerInterface::yourTurn()
CGI->screenh->updateScreen();
LOCPLINT->adventureInt->updateScreen = false;
if(SDL_PollEvent(&sEvent)) //wait for event...
while (SDL_PollEvent(&sEvent)) //wait for event...
{
handleEvent(&sEvent);
}
@@ -259,6 +268,13 @@ void CPlayerInterface::handleEvent(SDL_Event *sEvent)
hoverable[i]->hover(false);
}
}
for(int i=0; i<motioninterested.size();i++)
{
if (isItIn(&motioninterested[i]->pos,sEvent->motion.x,sEvent->motion.y))
{
motioninterested[i]->mouseMoved(sEvent->motion);
}
}
if(sEvent->motion.x<15)
{
LOCPLINT->adventureInt->scrollingLeft = true;