From 90e508032c71d4e62bd06ab75e09119b4307a664 Mon Sep 17 00:00:00 2001 From: Inky Date: Fri, 21 Jun 2019 02:03:36 +0300 Subject: [PATCH] Changed: character selection handler --HG-- branch : menu_navi --- .../src/interface_v3/action_handler_game.cpp | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index 9ccdf1b11..6548ce412 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -4609,3 +4609,30 @@ public: }; REGISTER_ACTION_HANDLER( CHandlerSortTribeFame, "sort_tribefame"); +// *************************************************************************** +class CHandlerCharselNaviGetKeys : public IActionHandler +{ + virtual void execute (CCtrlBase *pCaller, const string &Params) + { + const std::string ui = pCaller->getParent()->getId(); + if (ui != "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 (event != -1) + CLuaManager::getInstance().executeLuaScript(toString("outgame:eventCharselKeyGet(%i)", event)); + } + // reset previous input + Driver->AsyncListener.reset(); + } +}; +REGISTER_ACTION_HANDLER( CHandlerCharselNaviGetKeys, "navigate_charsel" );