ConsoleMethod ActionMap::isActive()
by Shaderman · 06/13/2009 (2:20 am) · 4 comments
Just add these lines to engine/source/sim/actionMap.cc (TGB), engine/sim/actionMap.cc (TGE) or source/sim/actionMap.cpp (TGEA):
The method returns either true or false.
ConsoleMethod( ActionMap, isActive, bool, 2, 2, "() Use the isActive method to determine if an ActionMap is active.n"
"@return Returns true if the ActionMap is active, false otherwise.n")
{
SimSet* pActionMapSet = Sim::getActiveActionMapSet();
SimSet::iterator iter;
if ( (iter = find(pActionMapSet->begin(), pActionMapSet->end(), object)) == pActionMapSet->end() )
return false; // not found (not active)
else
return true; // found (active)
}The method returns either true or false.
#2
06/15/2009 (7:21 am)
Thanks! This may help me out too... I have a lot of actionmaps in my project.
#3
07/30/2009 (9:41 am)
What this can be used for? :-)
#4
(Quoted from TDN).
With this resource, you can check if an ActionMap is active (in use).
Hope this helps.
07/30/2009 (10:25 am)
Just in case you don't know what ActionMaps are:Quote:Game action maps are arranged in a stack for processing - so individual parts of the game can define specific actions - for example when the player jumps into a vehicle it could push a vehicle action map and pop the default player action map.
(Quoted from TDN).
With this resource, you can check if an ActionMap is active (in use).
Hope this helps.
Torque 3D Owner Ron Nelson