diff --git a/code/ryzom/client/src/actions.cpp b/code/ryzom/client/src/actions.cpp index 7aeaee537..707ea6803 100644 --- a/code/ryzom/client/src/actions.cpp +++ b/code/ryzom/client/src/actions.cpp @@ -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 { diff --git a/code/ryzom/client/src/actions.h b/code/ryzom/client/src/actions.h index b177c1818..3a00d1321 100644 --- a/code/ryzom/client/src/actions.h +++ b/code/ryzom/client/src/actions.h @@ -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; diff --git a/code/ryzom/client/src/interface_v3/action_handler_move.cpp b/code/ryzom/client/src/interface_v3/action_handler_move.cpp index d402f1750..df545f4c3 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_move.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_move.cpp @@ -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 {