forked from 0ad/0ad
SessionStart event sent to GUI objects upon starting a game
This was SVN commit r1608.
This commit is contained in:
parent
daebe3fec1
commit
15bb170328
@ -264,6 +264,12 @@ void CGUI::TickObjects()
|
||||
m_Tooltip.Update(pNearest, m_MousePos, this);
|
||||
}
|
||||
|
||||
void CGUI::SendEventToAll(CStr EventName)
|
||||
{
|
||||
GUI<CStr>::RecurseObject(0, m_BaseObject,
|
||||
&IGUIObject::ScriptEvent, EventName);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Constructor / Destructor
|
||||
//-------------------------------------------------------------------
|
||||
|
@ -95,10 +95,15 @@ public:
|
||||
void Process();
|
||||
|
||||
/**
|
||||
* Sends a "Tick" event to every object
|
||||
* Performs processing that should happen every frame (including the "Tick" event)
|
||||
*/
|
||||
void TickObjects();
|
||||
|
||||
/**
|
||||
* Sends a specified event to every object
|
||||
*/
|
||||
void SendEventToAll(CStr EventName);
|
||||
|
||||
/**
|
||||
* Displays the whole GUI
|
||||
*/
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
#include "Game.h"
|
||||
#include "CLogger.h"
|
||||
#ifndef NO_GUI
|
||||
#include "gui/CGUI.h"
|
||||
#endif
|
||||
|
||||
CGame *g_Game=NULL;
|
||||
|
||||
@ -195,6 +198,10 @@ PSRETURN CGame::StartGame(CGameAttributes *pAttribs)
|
||||
m_Simulation.Initialize(pAttribs);
|
||||
|
||||
m_GameStarted=true;
|
||||
|
||||
#ifndef NO_GUI
|
||||
g_GUI.SendEventToAll("sessionstart");
|
||||
#endif
|
||||
}
|
||||
catch (PSERROR_Game e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user