From 0f3f64cdc231ee71cef004353551a478f04824d4 Mon Sep 17 00:00:00 2001 From: Inky Date: Tue, 25 Jun 2019 15:52:28 +0300 Subject: [PATCH] Changed: character creation handler Todo: fusion both handler --HG-- branch : menu_navi --- .../src/interface_v3/action_handler_game.cpp | 32 +++++++++++++++++++ 1 file changed, 32 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 a9dcb54ea..c35493475 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -4638,3 +4638,35 @@ class CHandlerCharselNaviGetKeys : public IActionHandler } }; 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; + + if (event != -1) + CLuaManager::getInstance().executeLuaScript(toString("outgame:eventCharcreateKeyGet(%i)", event)); + } + // reset previous input + Driver->AsyncListener.reset(); + } +}; +REGISTER_ACTION_HANDLER( CHandlerCharcreateGetKeys, "navigate_charcreate" ); \ No newline at end of file