diff --git a/changelog.txt b/changelog.txt index 69ea1ed..f9a3bf3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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) ================================================ diff --git a/init.lua b/init.lua index 89f109e..27d641a 100644 --- a/init.lua +++ b/init.lua @@ -9,7 +9,7 @@ loveframes = {} -- library info loveframes.info = {} loveframes.info.author = "Kenny Shields" -loveframes.info.version = "0.9.5.4" +loveframes.info.version = "0.9.5.5" loveframes.info.stage = "Alpha" -- library configurations @@ -101,6 +101,7 @@ function loveframes.draw() local base = loveframes.base local r, g, b, a = love.graphics.getColor() + local font = love.graphics.getFont() base:draw() @@ -109,6 +110,10 @@ function loveframes.draw() love.graphics.setColor(r, g, b, a) + if font then + love.graphics.setFont(font) + end + end --[[--------------------------------------------------------- diff --git a/objects/base.lua b/objects/base.lua index 8560e78..76e4414 100644 --- a/objects/base.lua +++ b/objects/base.lua @@ -355,7 +355,7 @@ end --[[--------------------------------------------------------- - func: Center() - 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) @@ -380,7 +380,7 @@ end --[[--------------------------------------------------------- - func: CenterX() - - desc: centers the object by it's x value + - desc: centers the object by its x value --]]--------------------------------------------------------- function newobject:CenterX() @@ -399,7 +399,7 @@ end --[[--------------------------------------------------------- - func: CenterY() - - desc: centers the object by it's y value + - desc: centers the object by its y value --]]--------------------------------------------------------- function newobject:CenterY() @@ -880,7 +880,7 @@ end --[[--------------------------------------------------------- - func: IsTopChild() - 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() @@ -897,7 +897,7 @@ end --[[--------------------------------------------------------- - 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 --]]--------------------------------------------------------- function newobject:MoveToTop() @@ -980,7 +980,7 @@ end --[[--------------------------------------------------------- - 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 --]]--------------------------------------------------------- function newobject:SetRetainSize(bool) @@ -991,7 +991,7 @@ end --[[--------------------------------------------------------- - 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 --]]--------------------------------------------------------- function newobject:GetRetainSize() @@ -1003,7 +1003,7 @@ end --[[--------------------------------------------------------- - func: IsActive() - desc: gets whether or not the object is active within - it's parent's child table + its parent's child table --]]--------------------------------------------------------- function newobject:IsActive() @@ -1023,7 +1023,7 @@ end --[[--------------------------------------------------------- - 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 --]]--------------------------------------------------------- function newobject:GetParents() @@ -1047,7 +1047,7 @@ end --[[--------------------------------------------------------- - func: IsTopInternal() - 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 --]]--------------------------------------------------------- function newobject:IsTopInternal() diff --git a/objects/frame.lua b/objects/frame.lua index 54d9b8f..5e32fd4 100644 --- a/objects/frame.lua +++ b/objects/frame.lua @@ -518,7 +518,7 @@ end --[[--------------------------------------------------------- - func: SetParentLocked(bool) - 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) @@ -529,7 +529,7 @@ end --[[--------------------------------------------------------- - func: GetParentLocked(bool) - 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() diff --git a/objects/imagebutton.lua b/objects/imagebutton.lua index 9f0f2d1..a42cde4 100644 --- a/objects/imagebutton.lua +++ b/objects/imagebutton.lua @@ -274,7 +274,7 @@ end --[[--------------------------------------------------------- - 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() diff --git a/objects/internal/tooltip.lua b/objects/internal/tooltip.lua index a94a6ee..1640d7e 100644 --- a/objects/internal/tooltip.lua +++ b/objects/internal/tooltip.lua @@ -247,7 +247,7 @@ end --[[--------------------------------------------------------- - func: SetFollowObject(bool) - desc: sets whether or not the tooltip should follow - it's assigned object + its assigned object --]]--------------------------------------------------------- function newobject:SetFollowObject(bool) diff --git a/objects/list.lua b/objects/list.lua index f03834f..6284bc3 100644 --- a/objects/list.lua +++ b/objects/list.lua @@ -250,7 +250,7 @@ function newobject:AddItem(object) 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.parent = self object.state = self.state @@ -258,7 +258,7 @@ function newobject:AddItem(object) -- insert the item object into the list object's children table table.insert(children, object) - -- resize the list and redo it's layout + -- resize the list and redo its layout self:CalculateSize() self:RedoLayout() diff --git a/objects/numberbox.lua b/objects/numberbox.lua index 427dbc4..98cbdb8 100644 --- a/objects/numberbox.lua +++ b/objects/numberbox.lua @@ -17,7 +17,7 @@ function newobject:initialize() self.height = 20 self.value = 0 self.increaseamount = 1 - self.descreaseamount = 1 + self.decreaseamount = 1 self.min = -100 self.max = 100 self.delay = 0 @@ -308,20 +308,20 @@ function newobject:GetIncreaseAmount() end --[[--------------------------------------------------------- - - func: SetDescreaseAmount(amount) + - func: SetDecreaseAmount(amount) - desc: sets the object's decrease amount --]]--------------------------------------------------------- -function newobject:SetDescreaseAmount(amount) +function newobject:SetDecreaseAmount(amount) self.decreaseamount = amount end --[[--------------------------------------------------------- - - func: GetDescreaseAmount() + - func: GetDecreaseAmount() - desc: gets the object's decrease amount --]]--------------------------------------------------------- -function newobject:GetDescreaseAmount() +function newobject:GetDecreaseAmount() return self.decreaseamount @@ -461,9 +461,9 @@ function newobject:ModifyValue(type) end end elseif type == "subtract" then - local descreaseamount = self.descreaseamount + local decreaseamount = self.decreaseamount local min = self.min - self.value = value - descreaseamount + self.value = value - decreaseamount if self.value < min then self.value = min end diff --git a/objects/progressbar.lua b/objects/progressbar.lua index 6d4e400..f23b8f5 100644 --- a/objects/progressbar.lua +++ b/objects/progressbar.lua @@ -299,7 +299,7 @@ end --[[--------------------------------------------------------- - 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 --]]--------------------------------------------------------- function newobject:GetCompleted() diff --git a/objects/text.lua b/objects/text.lua index 737dc1f..87ff0c7 100644 --- a/objects/text.lua +++ b/objects/text.lua @@ -484,7 +484,7 @@ end --[[--------------------------------------------------------- - func: SetShadow(bool) - desc: sets whether or not the object should draw a - shadow behind it's text + shadow behind its text --]]--------------------------------------------------------- function newobject:SetShadow(bool) @@ -495,7 +495,7 @@ end --[[--------------------------------------------------------- - func: GetShadow() - desc: gets whether or not the object should draw a - shadow behind it's text + shadow behind its text --]]--------------------------------------------------------- function newobject:GetShadow() diff --git a/objects/textinput.lua b/objects/textinput.lua index b196b4c..21a45ce 100644 --- a/objects/textinput.lua +++ b/objects/textinput.lua @@ -19,6 +19,8 @@ function newobject:initialize() self.width = 200 self.height = 25 self.delay = 0 + self.repeatdelay = 0.80 + self.repeatrate = 0.02 self.offsetx = 0 self.offsety = 0 self.indincatortime = 0 @@ -106,6 +108,7 @@ function newobject:update(dt) local hbar = self.hbar local inputobject = loveframes.inputobject local internals = self.internals + local repeatrate = self.repeatrate -- move to parent if there is a parent if parent ~= base then @@ -122,7 +125,7 @@ function newobject:update(dt) if keydown ~= "none" then if time > delay then self:RunKey(keydown, unicode) - self.delay = time + 0.02 + self.delay = time + repeatrate end end @@ -440,8 +443,9 @@ function newobject:keypressed(key, unicode) local lctrl = love.keyboard.isDown("lctrl") local rctrl = love.keyboard.isDown("rctrl") local focus = self.focus + local repeatdelay = self.repeatdelay - self.delay = time + 0.80 + self.delay = time + repeatdelay self.keydown = key if (lctrl or rctrl) and focus then @@ -1565,4 +1569,44 @@ function newobject:GetAutoScroll() return self.autoscroll +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 \ No newline at end of file diff --git a/skins/Blue/skin.lua b/skins/Blue/skin.lua index 077ad86..d818fea 100644 --- a/skins/Blue/skin.lua +++ b/skins/Blue/skin.lua @@ -587,7 +587,7 @@ end --[[--------------------------------------------------------- - 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) diff --git a/skins/Orange/skin.lua b/skins/Orange/skin.lua index 66086d5..0d3a6bc 100644 --- a/skins/Orange/skin.lua +++ b/skins/Orange/skin.lua @@ -587,7 +587,7 @@ end --[[--------------------------------------------------------- - 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) diff --git a/util.lua b/util.lua index d74c435..91d6e7e 100644 --- a/util.lua +++ b/util.lua @@ -123,7 +123,7 @@ end --[[--------------------------------------------------------- - func: GetDirectoryContents(directory, table) - desc: gets the contents of a directory and all of - it's subdirectories + its subdirectories --]]--------------------------------------------------------- function loveframes.util.GetDirectoryContents(dir, t) @@ -259,24 +259,4 @@ 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 \ No newline at end of file