modules changes

* speedup widget destruction checks
* rework outfit module using grid layout and the new design
* fixes in console, terminal, textmessage modules
This commit is contained in:
Eduardo Bart
2012-03-22 18:47:52 -03:00
parent 159eb98df2
commit 33458a3e39
41 changed files with 335 additions and 234 deletions

View File

@@ -1,5 +1,5 @@
-- private variables
local m_mouseGrabberWidget
local mouseGrabberWidget
-- private functions
local function onGameKeyPress(self, keyCode, keyboardModifiers)
@@ -41,7 +41,7 @@ end
-- public functions
function g_game.startUseWith(thing)
g_game.selectedThing = thing
m_mouseGrabberWidget:grabMouse()
mouseGrabberWidget:grabMouse()
Mouse.setTargetCursor()
end
@@ -49,11 +49,11 @@ function g_game.createInterface()
rootWidget:moveChildToIndex(g_game.gameUi, 1)
g_game.gameMapPanel = g_game.gameUi:getChildById('gameMapPanel')
g_game.gameRightPanel = g_game.gameUi:getChildById('gameRightPanel')
GameInterface.getRightPanel() = g_game.gameUi:getChildById('gameRightPanel')
g_game.gameBottomPanel = g_game.gameUi:getChildById('gameBottomPanel')
m_mouseGrabberWidget = g_game.gameUi:getChildById('mouseGrabber')
mouseGrabberWidget = g_game.gameUi:getChildById('mouseGrabber')
connect(g_game.gameUi, { onKeyPress = onGameKeyPress })
connect(m_mouseGrabberWidget, { onMouseRelease = onUseWithMouseRelease })
connect(mouseGrabberWidget, { onMouseRelease = onUseWithMouseRelease })
end
function g_game.destroyInterface()

View File

@@ -19,7 +19,7 @@ function g_game.processMouseAction(menuPosition, mouseButton, autoWalk, lookThin
return true
end
if not Options.classicControl then
if not Options.getOption('classicControl') then
if keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton then
g_game.createThingMenu(menuPosition, lookThing, useThing, creatureThing)
return true