Version 1.9

This commit is contained in:
OTCv8
2020-01-21 23:45:52 +01:00
parent 11ad766308
commit be8704ee92
56 changed files with 3517 additions and 483 deletions

View File

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

View File

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

View File

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