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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user