add numpad keys in lua const
This commit is contained in:
		
							parent
							
								
									de0e4a1acf
								
							
						
					
					
						commit
						186e3dc86b
					
				| 
						 | 
					@ -9,7 +9,18 @@ function drawDebugBoxes(enable)
 | 
				
			||||||
  g_ui.setDebugBoxesDrawing(enable)
 | 
					  g_ui.setDebugBoxesDrawing(enable)
 | 
				
			||||||
end
 | 
					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)
 | 
					function displayItem(id)
 | 
				
			||||||
  local itemWidget = createWidget('Item', rootWidget)
 | 
					  local itemWidget = createWidget('Item', rootWidget)
 | 
				
			||||||
  itemWidget:setItem(Item.create(id))
 | 
					  itemWidget:setItem(Item.create(id))
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -163,6 +163,16 @@ KeyF9 = 137
 | 
				
			||||||
KeyF10 = 138
 | 
					KeyF10 = 138
 | 
				
			||||||
KeyF11 = 139
 | 
					KeyF11 = 139
 | 
				
			||||||
KeyF12 = 140
 | 
					KeyF12 = 140
 | 
				
			||||||
 | 
					KeyNumpad0 = 141
 | 
				
			||||||
 | 
					KeyNumpad1 = 142
 | 
				
			||||||
 | 
					KeyNumpad2 = 143
 | 
				
			||||||
 | 
					KeyNumpad3 = 144
 | 
				
			||||||
 | 
					KeyNumpad4 = 145
 | 
				
			||||||
 | 
					KeyNumpad5 = 146
 | 
				
			||||||
 | 
					KeyNumpad6 = 147
 | 
				
			||||||
 | 
					KeyNumpad7 = 148
 | 
				
			||||||
 | 
					KeyNumpad8 = 149
 | 
				
			||||||
 | 
					KeyNumpad9 = 150
 | 
				
			||||||
 | 
					
 | 
				
			||||||
KeyCodeDescs = {
 | 
					KeyCodeDescs = {
 | 
				
			||||||
  [KeyUnknown] = 'Unknown',
 | 
					  [KeyUnknown] = 'Unknown',
 | 
				
			||||||
| 
						 | 
					@ -272,5 +282,15 @@ KeyCodeDescs = {
 | 
				
			||||||
  [KeyF9] = 'F9',
 | 
					  [KeyF9] = 'F9',
 | 
				
			||||||
  [KeyF10] = 'F10',
 | 
					  [KeyF10] = 'F10',
 | 
				
			||||||
  [KeyF11] = 'F11',
 | 
					  [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'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@ Module
 | 
				
			||||||
  dependencies:
 | 
					  dependencies:
 | 
				
			||||||
    - game_healthbar
 | 
					    - game_healthbar
 | 
				
			||||||
    - game_inventory
 | 
					    - game_inventory
 | 
				
			||||||
    //- game_skills
 | 
					    - game_skills
 | 
				
			||||||
    - game_textmessage
 | 
					    - game_textmessage
 | 
				
			||||||
    - game_viplist
 | 
					    - game_viplist
 | 
				
			||||||
    - game_console
 | 
					    - game_console
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@ local addVipWindow = nil
 | 
				
			||||||
-- public functions
 | 
					-- public functions
 | 
				
			||||||
function VipList.create()
 | 
					function VipList.create()
 | 
				
			||||||
  vipWindow = displayUI('viplist.otui', { parent = Game.gameRightPanel })
 | 
					  vipWindow = displayUI('viplist.otui', { parent = Game.gameRightPanel })
 | 
				
			||||||
  vipWindow:hide()
 | 
					  --vipWindow:hide()
 | 
				
			||||||
  TopMenu.addGameButton('vipListButton', 'VIP list', '/core_styles/icons/viplist.png', VipList.toggle)
 | 
					  TopMenu.addGameButton('vipListButton', 'VIP list', '/core_styles/icons/viplist.png', VipList.toggle)
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -186,6 +186,7 @@ void OTClient::registerLuaFunctions()
 | 
				
			||||||
    g_lua.bindClassStaticFunction<Game>("open", std::bind(&Game::open, &g_game, _1, _2));
 | 
					    g_lua.bindClassStaticFunction<Game>("open", std::bind(&Game::open, &g_game, _1, _2));
 | 
				
			||||||
    g_lua.bindClassStaticFunction<Game>("use", std::bind(&Game::use, &g_game, _1));
 | 
					    g_lua.bindClassStaticFunction<Game>("use", std::bind(&Game::use, &g_game, _1));
 | 
				
			||||||
    g_lua.bindClassStaticFunction<Game>("useWith", std::bind(&Game::useWith, &g_game, _1, _2));
 | 
					    g_lua.bindClassStaticFunction<Game>("useWith", std::bind(&Game::useWith, &g_game, _1, _2));
 | 
				
			||||||
 | 
					    g_lua.bindClassStaticFunction<Game>("useHotkey", std::bind(&Game::useHotkey, &g_game, _1, _2));
 | 
				
			||||||
    g_lua.bindClassStaticFunction<Game>("walk", std::bind(&Game::walk, &g_game, _1));
 | 
					    g_lua.bindClassStaticFunction<Game>("walk", std::bind(&Game::walk, &g_game, _1));
 | 
				
			||||||
    g_lua.bindClassStaticFunction<Game>("forceWalk", std::bind(&Game::forceWalk, &g_game, _1));
 | 
					    g_lua.bindClassStaticFunction<Game>("forceWalk", std::bind(&Game::forceWalk, &g_game, _1));
 | 
				
			||||||
    g_lua.bindClassStaticFunction<Game>("attack", std::bind(&Game::attack, &g_game, _1));
 | 
					    g_lua.bindClassStaticFunction<Game>("attack", std::bind(&Game::attack, &g_game, _1));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,7 +39,10 @@ void UIItem::draw()
 | 
				
			||||||
            std::string count = Fw::tostring(m_item->getData());
 | 
					            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(count, Rect(m_rect.topLeft(), m_rect.bottomRight() - Point(3, 0)), Fw::AlignBottomRight, Color(231, 231, 231));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //m_font->renderText(Fw::unsafeCast<std::string>(m_item->getId()), m_rect);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    drawChildren();
 | 
					    drawChildren();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue