mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Version 0.9.4.15 - Alpha (see changelog.txt)
This commit is contained in:
parent
7c8df81518
commit
2fc9df1deb
@ -1,3 +1,9 @@
|
||||
================================================
|
||||
Version 0.9.4.15 - Alpha (January 5 - 2013)
|
||||
================================================
|
||||
[ADDED] a new base method: GetInternals()
|
||||
[ADDED] a new tooltip method: SetFollowObject(bool)
|
||||
|
||||
================================================
|
||||
Version 0.9.4.14 - Alpha (January 4 - 2013)
|
||||
================================================
|
||||
|
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.14"
|
||||
loveframes.info.version = "0.9.4.15"
|
||||
loveframes.info.stage = "Alpha"
|
||||
|
||||
-- library configurations
|
||||
|
@ -756,6 +756,21 @@ function newobject:GetChildren()
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: GetInternals()
|
||||
- desc: returns the object's internals
|
||||
--]]---------------------------------------------------------
|
||||
function newobject:GetChildren()
|
||||
|
||||
local internals = self.internals
|
||||
|
||||
if internals then
|
||||
return internals
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: IsTopList()
|
||||
- desc: returns true if the object is the top most list
|
||||
@ -975,9 +990,11 @@ end
|
||||
--]]---------------------------------------------------------
|
||||
function newobject:IsTopInternal()
|
||||
|
||||
local internals = self.parent.internals
|
||||
local parent = self.parent
|
||||
local internals = parent.internals
|
||||
local topitem = internals[#internals]
|
||||
|
||||
if internals[#internals] ~= self then
|
||||
if topitem ~= self then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
|
@ -30,7 +30,8 @@ function newobject:initialize(parent, text, tabnumber, tip, image, onopened, onc
|
||||
if tip then
|
||||
self.tooltip = loveframes.objects["tooltip"]:new(self, tip)
|
||||
self.tooltip:SetFollowCursor(false)
|
||||
self.tooltip:SetOffsets(0, -5)
|
||||
self.tooltip:SetFollowObject(true)
|
||||
self.tooltip:SetOffsets(0, -(self.tooltip.text:GetHeight() + 12))
|
||||
end
|
||||
|
||||
if image then
|
||||
|
@ -25,6 +25,7 @@ function newobject:initialize(object, text, width)
|
||||
self.internal = true
|
||||
self.show = false
|
||||
self.followcursor = true
|
||||
self.followobject = false
|
||||
self.alwaysupdate = true
|
||||
|
||||
-- create the object's text
|
||||
@ -78,10 +79,15 @@ function newobject:update(dt)
|
||||
self.visible = ovisible
|
||||
if ohover and ovisible then
|
||||
local top = self:IsTopInternal()
|
||||
if self.followcursor then
|
||||
local followcursor = self.followcursor
|
||||
local followobject = self.followobject
|
||||
if followcursor then
|
||||
local x, y = love.mouse.getPosition()
|
||||
self.x = x + self.xoffset
|
||||
self.y = y - self.height + self.yoffset
|
||||
elseif followobject then
|
||||
self.x = object.x + self.xoffset
|
||||
self.y = object.y + self.yoffset
|
||||
end
|
||||
if not top then
|
||||
self:MoveToTop()
|
||||
@ -216,4 +222,15 @@ function newobject:SetFont(font)
|
||||
|
||||
self.text:SetFont(font)
|
||||
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: SetFollowObject(bool)
|
||||
- desc: sets whether or not the tooltip should follow
|
||||
it's assigned object
|
||||
--]]---------------------------------------------------------
|
||||
function newobject:SetFollowObject(bool)
|
||||
|
||||
self.followobject = bool
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user