mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Version 0.9.5.5 - Alpha (see changelog.txt)
This commit is contained in:
parent
6bbdde17a8
commit
cfa6c17108
@ -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)
|
||||
================================================
|
||||
|
7
init.lua
7
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
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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
|
||||
@ -1566,3 +1570,43 @@ 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
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
22
util.lua
22
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)
|
||||
|
||||
@ -260,23 +260,3 @@ 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