From 186e3dc86bb04936db008c8e2618694417962c1b Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Mon, 16 Jan 2012 03:54:53 -0200 Subject: [PATCH] add numpad keys in lua const --- modules/addon_terminal/commands.lua | 11 +++++++++++ modules/core_lib/const.lua | 22 +++++++++++++++++++++- modules/game/game.otmod | 2 +- modules/game_viplist/viplist.lua | 2 +- src/otclient/luafunctions.cpp | 1 + src/otclient/ui/uiitem.cpp | 3 +++ 6 files changed, 38 insertions(+), 3 deletions(-) diff --git a/modules/addon_terminal/commands.lua b/modules/addon_terminal/commands.lua index d3444160..ee255e8d 100644 --- a/modules/addon_terminal/commands.lua +++ b/modules/addon_terminal/commands.lua @@ -9,7 +9,18 @@ function drawDebugBoxes(enable) g_ui.setDebugBoxesDrawing(enable) end +function hideMap() + local map = rootWidget:recursiveGetChildById('gameMapPanel') + if map then map:hide() end +end + +function showMap() + local map = rootWidget:recursiveGetChildById('gameMapPanel') + if map then map:show() end +end + function displayItem(id) local itemWidget = createWidget('Item', rootWidget) itemWidget:setItem(Item.create(id)) end + diff --git a/modules/core_lib/const.lua b/modules/core_lib/const.lua index 654bcc76..ee41e514 100644 --- a/modules/core_lib/const.lua +++ b/modules/core_lib/const.lua @@ -163,6 +163,16 @@ KeyF9 = 137 KeyF10 = 138 KeyF11 = 139 KeyF12 = 140 +KeyNumpad0 = 141 +KeyNumpad1 = 142 +KeyNumpad2 = 143 +KeyNumpad3 = 144 +KeyNumpad4 = 145 +KeyNumpad5 = 146 +KeyNumpad6 = 147 +KeyNumpad7 = 148 +KeyNumpad8 = 149 +KeyNumpad9 = 150 KeyCodeDescs = { [KeyUnknown] = 'Unknown', @@ -272,5 +282,15 @@ KeyCodeDescs = { [KeyF9] = 'F9', [KeyF10] = 'F10', [KeyF11] = 'F11', - [KeyF12] = 'F12' + [KeyF12] = 'F12', + [KeyNumpad0] = 'Numpad0', + [KeyNumpad1] = 'Numpad1', + [KeyNumpad2] = 'Numpad2', + [KeyNumpad3] = 'Numpad3', + [KeyNumpad4] = 'Numpad4', + [KeyNumpad5] = 'Numpad5', + [KeyNumpad6] = 'Numpad6', + [KeyNumpad7] = 'Numpad7', + [KeyNumpad8] = 'Numpad8', + [KeyNumpad9] = 'Numpad9' } \ No newline at end of file diff --git a/modules/game/game.otmod b/modules/game/game.otmod index cc5d2814..7187fcb1 100644 --- a/modules/game/game.otmod +++ b/modules/game/game.otmod @@ -7,7 +7,7 @@ Module dependencies: - game_healthbar - game_inventory - //- game_skills + - game_skills - game_textmessage - game_viplist - game_console diff --git a/modules/game_viplist/viplist.lua b/modules/game_viplist/viplist.lua index 6ec5d994..20248f59 100644 --- a/modules/game_viplist/viplist.lua +++ b/modules/game_viplist/viplist.lua @@ -7,7 +7,7 @@ local addVipWindow = nil -- public functions function VipList.create() vipWindow = displayUI('viplist.otui', { parent = Game.gameRightPanel }) - vipWindow:hide() + --vipWindow:hide() TopMenu.addGameButton('vipListButton', 'VIP list', '/core_styles/icons/viplist.png', VipList.toggle) end diff --git a/src/otclient/luafunctions.cpp b/src/otclient/luafunctions.cpp index d8ad7f84..462c5b61 100644 --- a/src/otclient/luafunctions.cpp +++ b/src/otclient/luafunctions.cpp @@ -186,6 +186,7 @@ void OTClient::registerLuaFunctions() g_lua.bindClassStaticFunction("open", std::bind(&Game::open, &g_game, _1, _2)); g_lua.bindClassStaticFunction("use", std::bind(&Game::use, &g_game, _1)); g_lua.bindClassStaticFunction("useWith", std::bind(&Game::useWith, &g_game, _1, _2)); + g_lua.bindClassStaticFunction("useHotkey", std::bind(&Game::useHotkey, &g_game, _1, _2)); g_lua.bindClassStaticFunction("walk", std::bind(&Game::walk, &g_game, _1)); g_lua.bindClassStaticFunction("forceWalk", std::bind(&Game::forceWalk, &g_game, _1)); g_lua.bindClassStaticFunction("attack", std::bind(&Game::attack, &g_game, _1)); diff --git a/src/otclient/ui/uiitem.cpp b/src/otclient/ui/uiitem.cpp index 6d552880..b0c9693e 100644 --- a/src/otclient/ui/uiitem.cpp +++ b/src/otclient/ui/uiitem.cpp @@ -39,7 +39,10 @@ void UIItem::draw() std::string count = Fw::tostring(m_item->getData()); m_font->renderText(count, Rect(m_rect.topLeft(), m_rect.bottomRight() - Point(3, 0)), Fw::AlignBottomRight, Color(231, 231, 231)); } + + //m_font->renderText(Fw::unsafeCast(m_item->getId()), m_rect); } + drawChildren(); }