- tab buttons are now scrollable via the mouse wheel

- added the SetActiveSkin function to the util library
This commit is contained in:
Kenny Shields 2012-05-06 14:09:37 -04:00
parent 846f7cb60f
commit 5877855d4e
2 changed files with 47 additions and 5 deletions

View File

@ -138,7 +138,9 @@ function tabs:mousepressed(x, y, button)
return return
end end
if self.hover == true and button == "l" then if self.hover == true then
if button == "l" then
local baseparent = self:GetBaseParent() local baseparent = self:GetBaseParent()
@ -148,6 +150,32 @@ function tabs:mousepressed(x, y, button)
end end
end
if button == "wu" then
local buttonheight = self:GetHeightOfButtons()
local col = loveframes.util.BoundingBox(self.x, x, self.y, y, self.width, 1, buttonheight, 1)
local visible = self.internals[#self.internals - 1]:GetVisible()
if col == true and visible == true then
self.offsetx = self.offsetx + 5
end
end
if button == "wd" then
local buttonheight = self:GetHeightOfButtons()
local col = loveframes.util.BoundingBox(self.x, x, self.y, y, self.width, 1, buttonheight, 1)
local visible = self.internals[#self.internals]:GetVisible()
if col == true and visible == true then
self.offsetx = self.offsetx - 5
end
end
for k, v in ipairs(self.internals) do for k, v in ipairs(self.internals) do
v:mousepressed(x, y, button) v:mousepressed(x, y, button)
end end

View File

@ -6,6 +6,20 @@
-- util library -- util library
loveframes.util = {} loveframes.util = {}
--[[---------------------------------------------------------
- func: SetActiveSkin(name)
- desc: sets the active skin
--]]---------------------------------------------------------
function loveframes.util.SetActiveSkin(name)
loveframes.config["ACTIVESKIN"] = name
end
--[[---------------------------------------------------------
- func: GetActiveSkin()
- desc: gets the active skin
--]]---------------------------------------------------------
function loveframes.util.GetActiveSkin() function loveframes.util.GetActiveSkin()
local index = loveframes.config["ACTIVESKIN"] local index = loveframes.config["ACTIVESKIN"]