mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-20 06:33:26 +02:00
Version 1.9
This commit is contained in:
@@ -116,6 +116,16 @@ context.onMissle = function(callback)
|
||||
return context.callback("onMissle", callback)
|
||||
end
|
||||
|
||||
-- onAnimatedText -- callback = function(thing, text)
|
||||
context.onAnimatedText = function(callback)
|
||||
return context.callback("onAnimatedText", callback)
|
||||
end
|
||||
|
||||
-- onStaticText -- callback = function(thing, text)
|
||||
context.onStaticText = function(callback)
|
||||
return context.callback("onStaticText", callback)
|
||||
end
|
||||
|
||||
-- onChannelList -- callback = function(channels)
|
||||
context.onChannelList = function(callback)
|
||||
return context.callback("onChannelList", callback)
|
||||
|
@@ -123,7 +123,7 @@ context.addIcon = function(id, options, callback)
|
||||
widget.onDragMove = function(widget, mousePos, moved)
|
||||
local parentRect = widget:getParent():getRect()
|
||||
local x = math.min(math.max(parentRect.x, mousePos.x - widget.movingReference.x), parentRect.x + parentRect.width - widget:getWidth())
|
||||
local y = math.min(math.max(parentRect.y, mousePos.y - widget.movingReference.y), parentRect.y + parentRect.height - widget:getHeight())
|
||||
local y = math.min(math.max(parentRect.y - widget:getParent():getMarginTop(), mousePos.y - widget.movingReference.y), parentRect.y + parentRect.height - widget:getHeight())
|
||||
widget:move(x, y)
|
||||
return true
|
||||
end
|
||||
@@ -141,8 +141,8 @@ context.addIcon = function(id, options, callback)
|
||||
widget:addAnchor(AnchorHorizontalCenter, 'parent', AnchorHorizontalCenter)
|
||||
widget:addAnchor(AnchorVerticalCenter, 'parent', AnchorVerticalCenter)
|
||||
|
||||
widget:setMarginTop(height * (-0.5 + config.x))
|
||||
widget:setMarginLeft(width * (-0.5 + config.y))
|
||||
widget:setMarginTop(height * (-0.5 + config.y))
|
||||
widget:setMarginLeft(width * (-0.5 + config.x))
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -153,7 +153,7 @@ context.addIcon = function(id, options, callback)
|
||||
local parentRect = parent:getRect()
|
||||
local width = parentRect.width - widget:getWidth()
|
||||
local height = parentRect.height - widget:getHeight()
|
||||
widget:setMarginTop(height * (-0.5 + config.y))
|
||||
widget:setMarginTop(-parent:getMarginTop() + height * (-0.5 + config.y))
|
||||
widget:setMarginLeft(width * (-0.5 + config.x))
|
||||
end
|
||||
|
||||
|
@@ -7,4 +7,9 @@ context.displayGeneralBox = function(title, message, buttons, onEnterCallback, o
|
||||
local box = displayGeneralBox(title, message, buttons, onEnterCallback, onEscapeCallback)
|
||||
box.botWidget = true
|
||||
return box
|
||||
end
|
||||
end
|
||||
|
||||
context.doScreenshot = function(filename)
|
||||
g_app.doScreenshot(filename)
|
||||
end
|
||||
context.screenshot = context.doScreenshot
|
||||
|
Reference in New Issue
Block a user