mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-04-30 03:09:20 +02:00
Minor bug fixes
This commit is contained in:
parent
6bc4188d7a
commit
dbfad99ca4
@ -113,9 +113,21 @@ context.setSpellTimeout = function()
|
|||||||
context.lastSpell = context.now
|
context.lastSpell = context.now
|
||||||
end
|
end
|
||||||
|
|
||||||
context.use = g_game.useInventoryItem
|
context.use = function(thing, subtype)
|
||||||
context.usewith = g_game.useInventoryItemWith
|
if type(thing) == 'number' then
|
||||||
context.useWith = g_game.useInventoryItemWith
|
return g_game.useInventoryItem(thing, subtype)
|
||||||
|
else
|
||||||
|
return g_game.use(thing)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
context.usewith = function(thing, target, subtype)
|
||||||
|
if type(thing) == 'number' then
|
||||||
|
return g_game.useInventoryItemWith(thing, target, subtype)
|
||||||
|
else
|
||||||
|
return g_game.useWith(item, target, subtype)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
context.useWith = context.usewith
|
||||||
|
|
||||||
context.useRune = function(itemid, target, lastSpellTimeout)
|
context.useRune = function(itemid, target, lastSpellTimeout)
|
||||||
if context.lastRuneUse == nil then
|
if context.lastRuneUse == nil then
|
||||||
|
@ -928,7 +928,6 @@ function updateSize()
|
|||||||
local height = gameMapPanel:getHeight()
|
local height = gameMapPanel:getHeight()
|
||||||
local width = gameMapPanel:getWidth()
|
local width = gameMapPanel:getWidth()
|
||||||
|
|
||||||
print("updatesize")
|
|
||||||
if not classic then
|
if not classic then
|
||||||
local rheight = gameRootPanel:getHeight()
|
local rheight = gameRootPanel:getHeight()
|
||||||
local rwidth = gameRootPanel:getWidth()
|
local rwidth = gameRootPanel:getWidth()
|
||||||
|
@ -60,6 +60,7 @@ function timeleftTranslation(timeleft, forPreyTimeleft) -- in seconds
|
|||||||
end
|
end
|
||||||
function init()
|
function init()
|
||||||
connect(g_game, {
|
connect(g_game, {
|
||||||
|
onGameStart = check,
|
||||||
onGameEnd = hide,
|
onGameEnd = hide,
|
||||||
onResourceBalance = onResourceBalance,
|
onResourceBalance = onResourceBalance,
|
||||||
onPreyFreeRolls = onPreyFreeRolls,
|
onPreyFreeRolls = onPreyFreeRolls,
|
||||||
@ -73,11 +74,14 @@ function init()
|
|||||||
|
|
||||||
preyWindow = g_ui.displayUI('prey')
|
preyWindow = g_ui.displayUI('prey')
|
||||||
preyWindow:hide()
|
preyWindow:hide()
|
||||||
preyButton = modules.client_topmenu.addRightGameToggleButton('preyButton', tr('Preys'), '/images/topbuttons/prey', toggle)
|
if g_game.isOnline() then
|
||||||
|
check()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function terminate()
|
function terminate()
|
||||||
disconnect(g_game, {
|
disconnect(g_game, {
|
||||||
|
onGameStart = check,
|
||||||
onGameEnd = hide,
|
onGameEnd = hide,
|
||||||
onResourceBalance = onResourceBalance,
|
onResourceBalance = onResourceBalance,
|
||||||
onPreyFreeRolls = onPreyFreeRolls,
|
onPreyFreeRolls = onPreyFreeRolls,
|
||||||
@ -89,7 +93,9 @@ function terminate()
|
|||||||
onPreySelection = onPreySelection
|
onPreySelection = onPreySelection
|
||||||
})
|
})
|
||||||
|
|
||||||
preyButton:destroy()
|
if preyButton then
|
||||||
|
preyButton:destroy()
|
||||||
|
end
|
||||||
preyWindow:destroy()
|
preyWindow:destroy()
|
||||||
if msgWindow then
|
if msgWindow then
|
||||||
msgWindow:destroy()
|
msgWindow:destroy()
|
||||||
@ -97,6 +103,17 @@ function terminate()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function check()
|
||||||
|
if g_game.getFeature(GamePrey) then
|
||||||
|
if not preyButton then
|
||||||
|
preyButton = modules.client_topmenu.addRightGameToggleButton('preyButton', tr('Preys'), '/images/topbuttons/prey', toggle)
|
||||||
|
end
|
||||||
|
elseif preyButton then
|
||||||
|
preyButton:destroy()
|
||||||
|
preyButton = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function hide()
|
function hide()
|
||||||
preyWindow:hide()
|
preyWindow:hide()
|
||||||
if msgWindow then
|
if msgWindow then
|
||||||
@ -106,6 +123,9 @@ function hide()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function show()
|
function show()
|
||||||
|
if not g_game.getFeature(GamePrey) then
|
||||||
|
return hide()
|
||||||
|
end
|
||||||
preyWindow:show()
|
preyWindow:show()
|
||||||
preyWindow:raise()
|
preyWindow:raise()
|
||||||
preyWindow:focus()
|
preyWindow:focus()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user