SessionStart event sent to GUI objects upon starting a game

This was SVN commit r1608.
This commit is contained in:
Ykkrosh 2005-01-01 17:30:55 +00:00
parent daebe3fec1
commit 15bb170328
3 changed files with 19 additions and 1 deletions

View File

@ -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
//-------------------------------------------------------------------

View File

@ -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
*/

View File

@ -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)
{