Added: run_action and stop_action lua to simulate key_press actions

--HG--
branch : ark
hg/ark
Ulu Kyn 5 years ago
parent e3dc99e078
commit 58e24f9c58

@ -223,6 +223,31 @@ bool CActionsManager::valide(const CAction::CName &name) const
return false;
}// valide //
// ***************************************************************************
void CActionsManager::validate(const CAction::CName &name)
{
// Recover the pointer on "actionName" if it exists.
TActionsMap::iterator it = _Actions.find(name);
if(it != _Actions.end())
{
it->second.Valide = true;
}
}
// ***************************************************************************
void CActionsManager::unvalidate(const CAction::CName &name)
{
// Recover the pointer on "actionName" if it exists.
TActionsMap::iterator it = _Actions.find(name);
if(it != _Actions.end())
{
it->second.Valide = false;
}
}
// ***************************************************************************
bool CActionsManager::isActionPresentInContext(const CAction::CName &name) const
{

@ -364,6 +364,8 @@ public:
/// Return if the Action is valide.
bool valide(const CAction::CName &name) const;
void validate(const CAction::CName &name);
void unvalidate(const CAction::CName &name);
// Return true if the action is present in current (global) context
bool isActionPresentInContext(const CAction::CName &name) const;

@ -295,6 +295,31 @@ class CAHRearView : public IActionHandler
};
REGISTER_ACTION_HANDLER (CAHRearView, "rear_view");
// ------------------------------------------------------------------------------------------------
class CAHRunAction : public IActionHandler
{
virtual void execute (CCtrlBase * /* pCaller */, const string &Params)
{
CActionsManager *pAM = &Actions;
pAM->validate(CAction::CName(Params.c_str(), ""));
}
};
REGISTER_ACTION_HANDLER (CAHRunAction, "run_action");
// ------------------------------------------------------------------------------------------------
class CAHStopAction : public IActionHandler
{
virtual void execute (CCtrlBase * /* pCaller */, const string &Params)
{
CActionsManager *pAM = &Actions;
pAM->unvalidate(CAction::CName(Params.c_str(), ""));
}
};
REGISTER_ACTION_HANDLER (CAHStopAction, "stop_action");
// ------------------------------------------------------------------------------------------------
class CAHCameraUp : public IActionHandler
{

Loading…
Cancel
Save