Merge with ark

--HG--
branch : yubo
hg/yubo
Ulu Kyn 5 years ago
commit 8221ee2eb9

@ -223,6 +223,31 @@ bool CActionsManager::valide(const CAction::CName &name) const
return false; return false;
}// valide // }// 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 bool CActionsManager::isActionPresentInContext(const CAction::CName &name) const
{ {

@ -364,6 +364,8 @@ public:
/// Return if the Action is valide. /// Return if the Action is valide.
bool valide(const CAction::CName &name) const; 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 // Return true if the action is present in current (global) context
bool isActionPresentInContext(const CAction::CName &name) const; bool isActionPresentInContext(const CAction::CName &name) const;

@ -295,6 +295,31 @@ class CAHRearView : public IActionHandler
}; };
REGISTER_ACTION_HANDLER (CAHRearView, "rear_view"); 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 class CAHCameraUp : public IActionHandler
{ {

@ -2513,6 +2513,14 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
CClientConfig::SSysInfoParam::TMode mode = CClientConfig::SSysInfoParam::Normal; CClientConfig::SSysInfoParam::TMode mode = CClientConfig::SSysInfoParam::Normal;
CRGBA color = CRGBA::White; CRGBA color = CRGBA::White;
// If broadcast, parse lua code
if (toLower(cat) == "bc" && str.size() > 3 && str[0]=='@' && str[1]=='L' && str[2]=='U' && str[3]=='A')
{
string code = str.substr(4, str.size()-4).toString();
if (!code.empty())
CLuaManager::getInstance().executeLuaScript(code);
return;
}
map<string, CClientConfig::SSysInfoParam>::const_iterator it = ClientCfg.SystemInfoParams.find(toLower(cat)); map<string, CClientConfig::SSysInfoParam>::const_iterator it = ClientCfg.SystemInfoParams.find(toLower(cat));
if (it != ClientCfg.SystemInfoParams.end()) if (it != ClientCfg.SystemInfoParams.end())
@ -2543,6 +2551,7 @@ void CInterfaceManager::displaySystemInfo(const ucstring &str, const string &cat
else if ( (mode == CClientConfig::SSysInfoParam::Around || mode == CClientConfig::SSysInfoParam::CenterAround) else if ( (mode == CClientConfig::SSysInfoParam::Around || mode == CClientConfig::SSysInfoParam::CenterAround)
&& PeopleInterraction.AroundMe.Window) && PeopleInterraction.AroundMe.Window)
PeopleInterraction.ChatInput.AroundMe.displayMessage(str, color, 2); PeopleInterraction.ChatInput.AroundMe.displayMessage(str, color, 2);
} }
// *************************************************************************** // ***************************************************************************

Loading…
Cancel
Save