mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 14:00:39 +00:00
add reload status to onNewDataBlock callback
and skip calling onremove/onadd if we're not reloading
This commit is contained in:
parent
2852b33cec
commit
2ae10c7ce1
28 changed files with 35 additions and 37 deletions
|
|
@ -95,7 +95,7 @@ IMPLEMENT_CALLBACK( GameBaseData, onAdd, void, ( GameBase* obj ), ( obj ),
|
|||
"}\n\n"
|
||||
"@endtsexample\n" );
|
||||
|
||||
IMPLEMENT_CALLBACK( GameBaseData, onNewDataBlock, void, ( GameBase* obj ), ( obj ),
|
||||
IMPLEMENT_CALLBACK( GameBaseData, onNewDataBlock, void, ( GameBase* obj, bool reload), ( obj, reload),
|
||||
"@brief Called when the object has a new datablock assigned.\n\n"
|
||||
"@param obj the GameBase object\n\n"
|
||||
"@see onAdd for an example\n" );
|
||||
|
|
@ -512,12 +512,12 @@ void GameBase::scriptOnAdd()
|
|||
mDataBlock->onAdd_callback( this );
|
||||
}
|
||||
|
||||
void GameBase::scriptOnNewDataBlock()
|
||||
void GameBase::scriptOnNewDataBlock(bool reload)
|
||||
{
|
||||
// Script onNewDataBlock() must be called by the leaf class
|
||||
// after everything is loaded.
|
||||
if (mDataBlock && !isGhost())
|
||||
mDataBlock->onNewDataBlock_callback( this );
|
||||
mDataBlock->onNewDataBlock_callback( this, reload);
|
||||
}
|
||||
|
||||
void GameBase::scriptOnRemove()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue