Version 0.9.5.5 - Alpha (see changelog.txt)

This commit is contained in:
Kenny Shields 2013-03-23 15:50:44 -04:00
parent 6bbdde17a8
commit cfa6c17108
14 changed files with 95 additions and 52 deletions

View File

@ -1,3 +1,17 @@
================================================
Version 0.9.5.5 - Alpha (March 23 - 2013)
================================================
[ADDED] a new textinput method: SetRepeatDelay(delay)
[ADDED] a new textinput method: GetRepeatDelay()
[ADDED] a new textinput method: SetRepeatRate(rate)
[ADDED] a new textinput method: GetRepeatRate()
[FIXED] several typos in the numberbox object's code
[CHANGED] love frames now resets the active font to the font used before calling loveframes.draw()
[REMOVED] loveframes.util.CheckForUpdates()
================================================ ================================================
Version 0.9.5.4 - Alpha (March 5 - 2013) Version 0.9.5.4 - Alpha (March 5 - 2013)
================================================ ================================================

View File

@ -9,7 +9,7 @@ loveframes = {}
-- library info -- library info
loveframes.info = {} loveframes.info = {}
loveframes.info.author = "Kenny Shields" loveframes.info.author = "Kenny Shields"
loveframes.info.version = "0.9.5.4" loveframes.info.version = "0.9.5.5"
loveframes.info.stage = "Alpha" loveframes.info.stage = "Alpha"
-- library configurations -- library configurations
@ -101,6 +101,7 @@ function loveframes.draw()
local base = loveframes.base local base = loveframes.base
local r, g, b, a = love.graphics.getColor() local r, g, b, a = love.graphics.getColor()
local font = love.graphics.getFont()
base:draw() base:draw()
@ -109,6 +110,10 @@ function loveframes.draw()
love.graphics.setColor(r, g, b, a) love.graphics.setColor(r, g, b, a)
if font then
love.graphics.setFont(font)
end
end end
--[[--------------------------------------------------------- --[[---------------------------------------------------------

View File

@ -355,7 +355,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: Center() - func: Center()
- desc: centers the object in the game window or in - desc: centers the object in the game window or in
it's parent if it has one its parent if it has one
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:Center(area) function newobject:Center(area)
@ -380,7 +380,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: CenterX() - func: CenterX()
- desc: centers the object by it's x value - desc: centers the object by its x value
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:CenterX() function newobject:CenterX()
@ -399,7 +399,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: CenterY() - func: CenterY()
- desc: centers the object by it's y value - desc: centers the object by its y value
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:CenterY() function newobject:CenterY()
@ -880,7 +880,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: IsTopChild() - func: IsTopChild()
- desc: returns true if the object is the top most child - desc: returns true if the object is the top most child
in it's parent's children table or false if not in its parent's children table or false if not
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:IsTopChild() function newobject:IsTopChild()
@ -897,7 +897,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: MoveToTop() - func: MoveToTop()
- desc: moves the object to the top of it's parent's - desc: moves the object to the top of its parent's
children table children table
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:MoveToTop() function newobject:MoveToTop()
@ -980,7 +980,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: SetRetainSize(bool) - func: SetRetainSize(bool)
- desc: sets whether or not the object should retain it's - desc: sets whether or not the object should retain its
size when another object tries to resize it size when another object tries to resize it
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:SetRetainSize(bool) function newobject:SetRetainSize(bool)
@ -991,7 +991,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: GetRetainSize() - func: GetRetainSize()
- desc: gets whether or not the object should retain it's - desc: gets whether or not the object should retain its
size when another object tries to resize it size when another object tries to resize it
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:GetRetainSize() function newobject:GetRetainSize()
@ -1003,7 +1003,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: IsActive() - func: IsActive()
- desc: gets whether or not the object is active within - desc: gets whether or not the object is active within
it's parent's child table its parent's child table
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:IsActive() function newobject:IsActive()
@ -1023,7 +1023,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: GetParents() - func: GetParents()
- desc: returns a table of the object's parents and it's - desc: returns a table of the object's parents and its
sub-parents sub-parents
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:GetParents() function newobject:GetParents()
@ -1047,7 +1047,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: IsTopInternal() - func: IsTopInternal()
- desc: returns true if the object is the top most - desc: returns true if the object is the top most
internal in it's parent's internals table or internal in its parent's internals table or
false if not false if not
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:IsTopInternal() function newobject:IsTopInternal()

View File

@ -518,7 +518,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: SetParentLocked(bool) - func: SetParentLocked(bool)
- desc: sets whether the frame can be moved passed the - desc: sets whether the frame can be moved passed the
boundaries of it's parent or not boundaries of its parent or not
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:SetParentLocked(bool) function newobject:SetParentLocked(bool)
@ -529,7 +529,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: GetParentLocked(bool) - func: GetParentLocked(bool)
- desc: gets whether the frame can be moved passed the - desc: gets whether the frame can be moved passed the
boundaries of it's parent or not boundaries of its parent or not
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:GetParentLocked() function newobject:GetParentLocked()

View File

@ -274,7 +274,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: SizeToImage() - func: SizeToImage()
- desc: makes the object the same size as it's image - desc: makes the object the same size as its image
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:SizeToImage() function newobject:SizeToImage()

View File

@ -247,7 +247,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: SetFollowObject(bool) - func: SetFollowObject(bool)
- desc: sets whether or not the tooltip should follow - desc: sets whether or not the tooltip should follow
it's assigned object its assigned object
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:SetFollowObject(bool) function newobject:SetFollowObject(bool)

View File

@ -250,7 +250,7 @@ function newobject:AddItem(object)
local children = self.children local children = self.children
-- remove the item object from it's current parent and make it's new parent the list object -- remove the item object from its current parent and make its new parent the list object
object:Remove() object:Remove()
object.parent = self object.parent = self
object.state = self.state object.state = self.state
@ -258,7 +258,7 @@ function newobject:AddItem(object)
-- insert the item object into the list object's children table -- insert the item object into the list object's children table
table.insert(children, object) table.insert(children, object)
-- resize the list and redo it's layout -- resize the list and redo its layout
self:CalculateSize() self:CalculateSize()
self:RedoLayout() self:RedoLayout()

View File

@ -17,7 +17,7 @@ function newobject:initialize()
self.height = 20 self.height = 20
self.value = 0 self.value = 0
self.increaseamount = 1 self.increaseamount = 1
self.descreaseamount = 1 self.decreaseamount = 1
self.min = -100 self.min = -100
self.max = 100 self.max = 100
self.delay = 0 self.delay = 0
@ -308,20 +308,20 @@ function newobject:GetIncreaseAmount()
end end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: SetDescreaseAmount(amount) - func: SetDecreaseAmount(amount)
- desc: sets the object's decrease amount - desc: sets the object's decrease amount
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:SetDescreaseAmount(amount) function newobject:SetDecreaseAmount(amount)
self.decreaseamount = amount self.decreaseamount = amount
end end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: GetDescreaseAmount() - func: GetDecreaseAmount()
- desc: gets the object's decrease amount - desc: gets the object's decrease amount
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:GetDescreaseAmount() function newobject:GetDecreaseAmount()
return self.decreaseamount return self.decreaseamount
@ -461,9 +461,9 @@ function newobject:ModifyValue(type)
end end
end end
elseif type == "subtract" then elseif type == "subtract" then
local descreaseamount = self.descreaseamount local decreaseamount = self.decreaseamount
local min = self.min local min = self.min
self.value = value - descreaseamount self.value = value - decreaseamount
if self.value < min then if self.value < min then
self.value = min self.value = min
end end

View File

@ -299,7 +299,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: GetCompleted() - func: GetCompleted()
- desc: gets whether or not the object has reached it's - desc: gets whether or not the object has reached its
maximum value maximum value
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:GetCompleted() function newobject:GetCompleted()

View File

@ -484,7 +484,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: SetShadow(bool) - func: SetShadow(bool)
- desc: sets whether or not the object should draw a - desc: sets whether or not the object should draw a
shadow behind it's text shadow behind its text
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:SetShadow(bool) function newobject:SetShadow(bool)
@ -495,7 +495,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: GetShadow() - func: GetShadow()
- desc: gets whether or not the object should draw a - desc: gets whether or not the object should draw a
shadow behind it's text shadow behind its text
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:GetShadow() function newobject:GetShadow()

View File

@ -19,6 +19,8 @@ function newobject:initialize()
self.width = 200 self.width = 200
self.height = 25 self.height = 25
self.delay = 0 self.delay = 0
self.repeatdelay = 0.80
self.repeatrate = 0.02
self.offsetx = 0 self.offsetx = 0
self.offsety = 0 self.offsety = 0
self.indincatortime = 0 self.indincatortime = 0
@ -106,6 +108,7 @@ function newobject:update(dt)
local hbar = self.hbar local hbar = self.hbar
local inputobject = loveframes.inputobject local inputobject = loveframes.inputobject
local internals = self.internals local internals = self.internals
local repeatrate = self.repeatrate
-- move to parent if there is a parent -- move to parent if there is a parent
if parent ~= base then if parent ~= base then
@ -122,7 +125,7 @@ function newobject:update(dt)
if keydown ~= "none" then if keydown ~= "none" then
if time > delay then if time > delay then
self:RunKey(keydown, unicode) self:RunKey(keydown, unicode)
self.delay = time + 0.02 self.delay = time + repeatrate
end end
end end
@ -440,8 +443,9 @@ function newobject:keypressed(key, unicode)
local lctrl = love.keyboard.isDown("lctrl") local lctrl = love.keyboard.isDown("lctrl")
local rctrl = love.keyboard.isDown("rctrl") local rctrl = love.keyboard.isDown("rctrl")
local focus = self.focus local focus = self.focus
local repeatdelay = self.repeatdelay
self.delay = time + 0.80 self.delay = time + repeatdelay
self.keydown = key self.keydown = key
if (lctrl or rctrl) and focus then if (lctrl or rctrl) and focus then
@ -1566,3 +1570,43 @@ function newobject:GetAutoScroll()
return self.autoscroll return self.autoscroll
end end
--[[---------------------------------------------------------
- func: SetRepeatDelay(delay)
- desc: sets the object's repeat delay
--]]---------------------------------------------------------
function newobject:SetRepeatDelay(delay)
self.repeatdelay = delay
end
--[[---------------------------------------------------------
- func: GetRepeatDelay()
- desc: gets the object's repeat delay
--]]---------------------------------------------------------
function newobject:GetRepeatDelay()
return self.repeatdelay
end
--[[---------------------------------------------------------
- func: SetRepeatRate(rate)
- desc: sets the object's repeat rate
--]]---------------------------------------------------------
function newobject:SetRepeatRate(rate)
self.repeatrate = rate
end
--[[---------------------------------------------------------
- func: GetRepeatRate()
- desc: gets the object's repeat rate
--]]---------------------------------------------------------
function newobject:GetRepeatRate()
return self.repeatrate
end

View File

@ -587,7 +587,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: DrawList(object) - func: DrawList(object)
- desc: used to draw over the object and it's children - desc: used to draw over the object and its children
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function skin.DrawOverList(object) function skin.DrawOverList(object)

View File

@ -587,7 +587,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: DrawList(object) - func: DrawList(object)
- desc: used to draw over the object and it's children - desc: used to draw over the object and its children
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function skin.DrawOverList(object) function skin.DrawOverList(object)

View File

@ -123,7 +123,7 @@ end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: GetDirectoryContents(directory, table) - func: GetDirectoryContents(directory, table)
- desc: gets the contents of a directory and all of - desc: gets the contents of a directory and all of
it's subdirectories its subdirectories
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function loveframes.util.GetDirectoryContents(dir, t) function loveframes.util.GetDirectoryContents(dir, t)
@ -260,23 +260,3 @@ function loveframes.util.Error(message)
error("[Love Frames] " ..message) error("[Love Frames] " ..message)
end 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