Merge pull request #176 from Quintinon/master

Minor Tweaks to UI and Fixed an error in NPC Trade
master
Ben Dol 12 years ago
commit 493202afcf

@ -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, {

@ -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

@ -81,6 +81,15 @@ function UIMiniWindow:setup()
self:minimize() self:minimize()
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()

@ -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

@ -94,7 +94,7 @@ function onAddVip(id, name, state)
local nameLower = name:lower() local nameLower = name:lower()
local childrenCount = vipList:getChildCount() local childrenCount = vipList:getChildCount()
for i=1,childrenCount do for i=1,childrenCount do
local child = vipList:getChildByIndex(i) local child = vipList:getChildByIndex(i)
if state == VipState.Online and child.vipState ~= VipState.Online then if state == VipState.Online and child.vipState ~= VipState.Online then

Loading…
Cancel
Save