Changed: fusion selection and creation handler

--HG--
branch : menu_navi
hg/feature/menu-navi
Inky 5 years ago
parent 0f3f64cdc2
commit b2b16e3cce

@ -4610,9 +4610,9 @@ public:
REGISTER_ACTION_HANDLER( CHandlerSortTribeFame, "sort_tribefame");
// ***************************************************************************
class CHandlerCharselNaviGetKeys : public IActionHandler
class CHandlerOutgameNaviGetKeys : public IActionHandler
{
virtual void execute (CCtrlBase *pCaller, const string &Params)
virtual void execute (CCtrlBase *pCaller, const std::string &Params)
{
if (!pCaller->getParent())
return;
@ -4629,44 +4629,18 @@ class CHandlerCharselNaviGetKeys : public IActionHandler
if (Driver->AsyncListener.isKeyPushed(KeyRETURN)) event = 2;
if (Driver->AsyncListener.isKeyPushed(KeyDOWN)) event = 3;
if (Driver->AsyncListener.isKeyPushed(KeyUP)) event = 4;
if (event != -1)
CLuaManager::getInstance().executeLuaScript(toString("outgame:eventCharselKeyGet(%i)", event));
}
// reset previous input
Driver->AsyncListener.reset();
}
};
REGISTER_ACTION_HANDLER( CHandlerCharselNaviGetKeys, "navigate_charsel" );
// ***************************************************************************
class CHandlerCharcreateGetKeys : public IActionHandler
{
virtual void execute (CCtrlBase *pCaller, const string &Params)
{
if (!pCaller->getParent())
return;
if (pCaller->getParent()->getId() != "ui:outgame")
return;
if (Params.empty())
{
sint32 event = -1;
if (Driver->AsyncListener.isKeyPushed(KeyESCAPE)) event = 0;
//if (Driver->AsyncListener.isKeyPushed(KeyDELETE)) event = 1;
if (Driver->AsyncListener.isKeyPushed(KeyRETURN)) event = 2;
if (Driver->AsyncListener.isKeyPushed(KeyDOWN)) event = 3;
if (Driver->AsyncListener.isKeyPushed(KeyUP)) event = 4;
if (Driver->AsyncListener.isKeyPushed(KeyI)) event = 5;
if (Driver->AsyncListener.isKeyPushed(KeyP)) event = 6;
std::string id = "create";
if (pCaller->getId() == "ui:outgame:charsel")
id = "sel";
if (event != -1)
CLuaManager::getInstance().executeLuaScript(toString("outgame:eventCharcreateKeyGet(%i)", event));
CLuaManager::getInstance().executeLuaScript(toString("outgame:eventChar%sKeyGet(%i)", id.c_str(), event));
}
// reset previous input
Driver->AsyncListener.reset();
}
};
REGISTER_ACTION_HANDLER( CHandlerCharcreateGetKeys, "navigate_charcreate" );
REGISTER_ACTION_HANDLER( CHandlerOutgameNaviGetKeys, "navigate_outgame" );

Loading…
Cancel
Save