From 37d943fc2891d40479946c9f6e4a19f2bc9ea52c Mon Sep 17 00:00:00 2001 From: Henrique Santiago Date: Sun, 29 Apr 2012 20:06:23 -0300 Subject: [PATCH] npctrade closing trade and focusing window --- modules/game_npctrade/npctrade.lua | 4 +--- modules/game_npctrade/npctrade.otui | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/game_npctrade/npctrade.lua b/modules/game_npctrade/npctrade.lua index 47a3c8da..22ee9650 100644 --- a/modules/game_npctrade/npctrade.lua +++ b/modules/game_npctrade/npctrade.lua @@ -201,9 +201,6 @@ end -- public functions function NPCTrade.init() - cacheItems = {} - cacheGoods = {} - npcWindow = displayUI('npctrade.otui') npcWindow:setVisible(false) @@ -292,6 +289,7 @@ function NPCTrade.show() npcWindow:show() npcWindow:raise() + npcWindow:focus() end end diff --git a/modules/game_npctrade/npctrade.otui b/modules/game_npctrade/npctrade.otui index 2a7a3e81..bfe4b647 100644 --- a/modules/game_npctrade/npctrade.otui +++ b/modules/game_npctrade/npctrade.otui @@ -33,8 +33,7 @@ MainWindow id: npcWindow !text: tr('NPC Trade') size: 550 515 - - @onEscape: NPCTrade.hide() + @onEscape: g_game.closeNpcTrade() TabButton id: buyTab @@ -264,4 +263,4 @@ MainWindow width: 64 anchors.right: parent.right anchors.bottom: parent.bottom - @onClick: NPCTrade.hide() + @onClick: g_game.closeNpcTrade()