Commit 22c92dda authored by Gerhard Stein's avatar Gerhard Stein

new event which bundles some messages together.

parent ee8ed389
......@@ -88,6 +88,22 @@ struct EventSendBitmapDialogMsg : EventSendDialog
};
/**
* This event collects a vector of EventSendBitmapDialogMsg event, so all
* the message boxes are loading at once and display one by one holding the paused game
*/
struct EventSendBitmapDialogMessages : CEvent
{
EventSendBitmapDialogMessages( std::vector< SmartPointer<EventSendBitmapDialogMsg> > lMsgs ) :
msgs(lMsgs) {}
std::vector< SmartPointer<EventSendBitmapDialogMsg> > msgs;
};
/**
* \description small structure which holds a matching selection text to an event.
* It is used
......
......@@ -242,6 +242,18 @@ void CPlayGameGalaxy::process()
mMessageBoxes.push_back( pMsgBox );
eventContainer.pop_Event();
}
else if( EventSendBitmapDialogMessages *ev = eventContainer.occurredEvent<EventSendBitmapDialogMessages>() )
{
std::vector< SmartPointer<EventSendBitmapDialogMsg> >::iterator it = ev->msgs.begin();
for( ; it != ev->msgs.end() ; it++ )
{
CMessageBoxBitmapGalaxy *pMsgBox = new CMessageBoxBitmapGalaxy( (*it)->Msg, (*it)->BitmapID, (*it)->Direction );
pMsgBox->init();
mMessageBoxes.push_back( pMsgBox );
}
eventContainer.pop_Event();
}
else if( EventSendDialog *ev = eventContainer.occurredEvent<EventSendDialog>() )
{
CMessageBoxGalaxy *pMsgBox = new CMessageBoxGalaxy( ev->Msg );
......
......@@ -138,12 +138,17 @@ void CCouncilMember::getTouchedBy(CSpriteObject &theObject)
}
std::vector< SmartPointer<EventSendBitmapDialogMsg> > msgs;
msgs.push_back( new EventSendBitmapDialogMsg(104, elder_text[0], LEFT) );
msgs.push_back( new EventSendBitmapDialogMsg(106, elder_text[1], RIGHT) );
EventContainer.add( new EventSendBitmapDialogMsg(104, elder_text[0], LEFT) );
EventContainer.add( new EventSendBitmapDialogMsg(106, elder_text[1], RIGHT) );
if(rescuedelders == 7)
EventContainer.add( new EventSendBitmapDialogMsg(106, g_pBehaviorEngine->getString(answermap[8]), RIGHT) );
msgs.push_back( new EventSendBitmapDialogMsg(106, g_pBehaviorEngine->getString(answermap[8]), RIGHT) );
EventContainer.add( new EventSendBitmapDialogMessages(msgs) );
EventContainer.add( new EventExitLevel(mp_Map->getLevel(), true) );
rescuedelders++;
......
......@@ -74,9 +74,14 @@ void CLindsey::getTouchedBy(CSpriteObject &theObject)
}
EventContainer.add( new EventSendBitmapDialogMsg(108, lindsey_text[0], LEFT) );
EventContainer.add( new EventSendBitmapDialogMsg(108, lindsey_text[1], LEFT) );
EventContainer.add( new EventSendBitmapDialogMsg(106, lindsey_text[2], RIGHT) );
std::vector< SmartPointer<EventSendBitmapDialogMsg> > msgs;
msgs.push_back( new EventSendBitmapDialogMsg(108, lindsey_text[0], LEFT) );
msgs.push_back( new EventSendBitmapDialogMsg(108, lindsey_text[1], LEFT) );
msgs.push_back( new EventSendBitmapDialogMsg(106, lindsey_text[2], RIGHT) );
EventContainer.add( new EventSendBitmapDialogMessages(msgs) );
exists = false;
}
......
......@@ -27,7 +27,7 @@ public:
void processRender(const CRect<float> &RectDispCoordFloat);
// Defines in character units how tall and wide the entire text is.
CRect<int> mTextDim;
CRect<unsigned int> mTextDim;
private:
std::list<std::string> mTextList;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment