mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
Version 0.9.4.14 - Alpha (see changelog.txt)
This commit is contained in:
parent
6c05801552
commit
7c8df81518
@ -1,3 +1,12 @@
|
||||
================================================
|
||||
Version 0.9.4.14 - Alpha (January 4 - 2013)
|
||||
================================================
|
||||
[ADDED] a new util library function: loveframes.util.CheckForUpdates() (note: this function is meant to be used by the developer and is never called internally by Love Frames)
|
||||
[ADDED] a new callback for the tabbutton object: OnOpened(object)
|
||||
[ADDED] a new callback for the tabbutton object: OnClosed(object)
|
||||
|
||||
[CHANGED] tabs:AddTab(name, object, tip, image) now accepts two new optional arguments for tabbutton callbacks (ex: tabs:AddTab(name, object, tip, image, onopened, onclosed))
|
||||
|
||||
================================================
|
||||
Version 0.9.4.13 - Alpha (January 4 - 2013)
|
||||
================================================
|
||||
|
@ -642,19 +642,17 @@ function loveframes.debug.ExamplesMenu()
|
||||
local images = {"accept.png", "add.png", "application.png", "building.png", "bin.png", "database.png", "box.png", "brick.png"}
|
||||
|
||||
for i=1, 20 do
|
||||
|
||||
local image = "resources/images/" .. images[math.random(1, #images)]
|
||||
local panel1 = loveframes.Create("panel")
|
||||
panel1.Draw = function()
|
||||
end
|
||||
|
||||
local text1 = loveframes.Create("text", panel1)
|
||||
text1:SetText("Tab " ..i)
|
||||
tabs1:AddTab("Tab " ..i, panel1, "Tab " ..i, "resources/images/" ..images[math.random(1, #images)])
|
||||
tabs1:AddTab("Tab " ..i, panel1, "Tab " ..i, image)
|
||||
text1:SetAlwaysUpdate(true)
|
||||
text1.Update = function(object, dt)
|
||||
object:Center()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
2
init.lua
2
init.lua
@ -9,7 +9,7 @@ loveframes = {}
|
||||
-- library info
|
||||
loveframes.info = {}
|
||||
loveframes.info.author = "Kenny Shields"
|
||||
loveframes.info.version = "0.9.4.13"
|
||||
loveframes.info.version = "0.9.4.14"
|
||||
loveframes.info.stage = "Alpha"
|
||||
|
||||
-- library configurations
|
||||
|
@ -10,7 +10,7 @@ local newobject = loveframes.NewObject("tabbutton", "loveframes_object_tabbutton
|
||||
- func: initialize()
|
||||
- desc: initializes the object
|
||||
--]]---------------------------------------------------------
|
||||
function newobject:initialize(parent, text, tabnumber, tip, image)
|
||||
function newobject:initialize(parent, text, tabnumber, tip, image, onopened, onclosed)
|
||||
|
||||
self.type = "tabbutton"
|
||||
self.font = loveframes.smallfont
|
||||
@ -24,6 +24,8 @@ function newobject:initialize(parent, text, tabnumber, tip, image)
|
||||
self.internal = true
|
||||
self.down = false
|
||||
self.image = nil
|
||||
self.OnOpened = nil
|
||||
self.OnClosed = nil
|
||||
|
||||
if tip then
|
||||
self.tooltip = loveframes.objects["tooltip"]:new(self, tip)
|
||||
@ -35,6 +37,14 @@ function newobject:initialize(parent, text, tabnumber, tip, image)
|
||||
self:SetImage(image)
|
||||
end
|
||||
|
||||
if onopened then
|
||||
self.OnOpened = onopened
|
||||
end
|
||||
|
||||
if onclosed then
|
||||
self.OnClosed = onclosed
|
||||
end
|
||||
|
||||
-- apply template properties to the object
|
||||
loveframes.templates.ApplyToObject(self)
|
||||
|
||||
@ -148,7 +158,18 @@ function newobject:mousereleased(x, y, button)
|
||||
|
||||
if hover and button == "l" then
|
||||
if button == "l" then
|
||||
local tab = self.parent.tab
|
||||
local internals = parent.internals
|
||||
local onopened = self.OnOpened
|
||||
local prevtab = internals[tab]
|
||||
local onclosed = prevtab.OnClosed
|
||||
parent:SwitchToTab(tabnumber)
|
||||
if onopened then
|
||||
onopened(self)
|
||||
end
|
||||
if onclosed then
|
||||
onclosed(prevtab)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -26,7 +26,6 @@ function newobject:initialize()
|
||||
self.autosize = true
|
||||
self.internal = false
|
||||
self.tooltipfont = loveframes.basicfontsmall
|
||||
self.tabs = {}
|
||||
self.internals = {}
|
||||
self.children = {}
|
||||
|
||||
@ -239,7 +238,7 @@ end
|
||||
- func: AddTab(name, object, tip, image)
|
||||
- desc: adds a new tab to the tab panel
|
||||
--]]---------------------------------------------------------
|
||||
function newobject:AddTab(name, object, tip, image)
|
||||
function newobject:AddTab(name, object, tip, image, onopened, onclosed)
|
||||
|
||||
local padding = self.padding
|
||||
local autosize = self.autosize
|
||||
@ -253,7 +252,7 @@ function newobject:AddTab(name, object, tip, image)
|
||||
object.staticy = 0
|
||||
|
||||
table.insert(self.children, object)
|
||||
internals[tabnumber] = loveframes.objects["tabbutton"]:new(self, name, tabnumber, tip, image)
|
||||
internals[tabnumber] = loveframes.objects["tabbutton"]:new(self, name, tabnumber, tip, image, onopened, onclosed)
|
||||
self.tabnumber = tabnumber + 1
|
||||
|
||||
for k, v in ipairs(internals) do
|
||||
|
20
util.lua
20
util.lua
@ -258,3 +258,23 @@ function loveframes.util.Error(message)
|
||||
error("[Love Frames] " ..message)
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: loveframes.util.CheckForUpdates()
|
||||
- desc: checks for more recent versions of Love Frames
|
||||
--]]---------------------------------------------------------
|
||||
function loveframes.util.CheckForUpdates()
|
||||
|
||||
local info = loveframes.info
|
||||
local version = info.version
|
||||
local stage = info.stage
|
||||
local socket = require("socket.http")
|
||||
local b, c, h = socket.request("http://update.nikolairesokav.com/?id=loveframes&version=" ..version.. "&stage=" ..stage)
|
||||
|
||||
if c == 200 then
|
||||
return b
|
||||
else
|
||||
return "An error occurred while checking for updates. Please try again later."
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user