Merge pull request #176 from Quintinon/master

Minor Tweaks to UI and Fixed an error in NPC Trade
This commit is contained in:
Ben Dol 2013-01-08 03:47:38 -08:00
commit 493202afcf
5 changed files with 28 additions and 4 deletions

View File

@ -4,8 +4,12 @@ local exitWindow
local exitButton local exitButton
function Exit.init() function Exit.init()
if not g_game.isOnline() then exitButton = TopMenu.addRightButton('exitButton', tr('Exit Client'), 'exit.png', Exit.tryExit)
exitButton = TopMenu.addRightButton('exitButton', tr('Exit Client'), 'exit.png', Exit.tryExit)
if g_game.isOnline() then
exitButton:hide()
else
exitButton:show()
end end
connect(g_game, { connect(g_game, {

View File

@ -15,6 +15,17 @@ MiniWindow < UIMiniWindow
$on: $on:
image-border-bottom: 2 image-border-bottom: 2
UIWidget
id: miniwindowTopBar
anchors.top: parent.top
anchors.right: parent.right
anchors.left: parent.left
margin-right: 3
margin-left: 3
margin-top: 3
size: 258 18
phantom: true
UIButton UIButton
id: closeButton id: closeButton
anchors.top: parent.top anchors.top: parent.top

View File

@ -82,6 +82,15 @@ function UIMiniWindow:setup()
end end
end end
self:getChildById('miniwindowTopBar').onDoubleClick =
function()
if self:isOn() then
self:maximize()
else
self:minimize()
end
end
local oldParent = self:getParent() local oldParent = self:getParent()
local settings = g_settings.getNode('MiniWindows') local settings = g_settings.getNode('MiniWindows')

View File

@ -376,7 +376,7 @@ function onOpenNpcTrade(items)
newItem.price = item[5] newItem.price = item[5]
table.insert(tradeItems[SELL], newItem) table.insert(tradeItems[SELL], newItem)
else else
error("server error: item name " .. item[1] .. " has neither buy or sell price.") error("server error: item name " .. item[2] .. " has neither buy or sell price.")
end end
end end