From d6190b4757a4cfe73e30ef6df065cb95ff3bb088 Mon Sep 17 00:00:00 2001 From: Kenny Shields Date: Sun, 2 Sep 2012 17:13:13 -0400 Subject: [PATCH] Version 0.9.3.1 - Alpha (see changelog.txt) --- changelog.txt | 11 ++++- debug.lua | 4 +- init.lua | 6 +-- objects/base.lua | 4 +- objects/button.lua | 4 +- objects/checkbox.lua | 4 +- objects/collapsiblecategory.lua | 4 +- objects/columnlist.lua | 4 +- objects/frame.lua | 4 +- objects/image.lua | 4 +- objects/imagebutton.lua | 4 +- objects/internal/closebutton.lua | 4 +- .../columnlist/columnlist-listarea.lua | 4 +- .../internal/columnlist/columnlist-row.lua | 4 +- .../internal/columnlist/coulmnlist-header.lua | 4 +- objects/internal/modalbackground.lua | 4 +- .../internal/multichoice/multichoice-list.lua | 4 +- .../internal/multichoice/multichoice-row.lua | 4 +- objects/internal/scrollable/scrollarea.lua | 4 +- objects/internal/scrollable/scrollbar.lua | 4 +- objects/internal/scrollable/scrollbody.lua | 4 +- objects/internal/scrollable/scrollbutton.lua | 4 +- objects/internal/sliderbutton.lua | 4 +- objects/internal/tabbutton.lua | 4 +- objects/internal/tooltip.lua | 4 +- objects/list.lua | 4 +- objects/multichoice.lua | 4 +- objects/panel.lua | 4 +- objects/progressbar.lua | 11 +++-- objects/slider.lua | 4 +- objects/tabs.lua | 4 +- objects/text.lua | 4 +- objects/textinput.lua | 49 ++++++++----------- skins.lua | 4 +- skins/Blue/skin.lua | 4 +- skins/Orange/skin.lua | 4 +- templates.lua | 4 +- util.lua | 4 +- 38 files changed, 108 insertions(+), 105 deletions(-) diff --git a/changelog.txt b/changelog.txt index 8d2a01b..d852020 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,16 @@ +================================================ +Version 0.9.3.1 - Alpha (Spetember 2 - 2012) +================================================ +[ADDED] numpad enter key support for textinput.OnEnter + +[FIXED] duplicate progressbar:GetCompleted() in progressbar.lua + +[CHANGED] textinput.OnTextEnterd to textinput.OnTextChanged +[CHANGED] textinput.OnTextChanged is now also called when the backspace key is pressed + ================================================ Version 0.9.3 - Alpha (Spetember 1 - 2012) ================================================ - [ADDED] a new base method: GetParents() [ADDED] a new base method: IsTopInternal() [ADDED] a new base method: IsInternal() diff --git a/debug.lua b/debug.lua index 080d6cd..0189bb4 100644 --- a/debug.lua +++ b/debug.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- debug library diff --git a/init.lua b/init.lua index 5c84d74..e57d3b7 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- central library table @@ -9,7 +9,7 @@ loveframes = {} -- library info loveframes.info = {} loveframes.info.author = "Nikolai Resokav" -loveframes.info.version = "0.9.3" +loveframes.info.version = "0.9.3.1" loveframes.info.stage = "Alpha" -- library configurations diff --git a/objects/base.lua b/objects/base.lua index 6ae917e..8c78c35 100644 --- a/objects/base.lua +++ b/objects/base.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- base object diff --git a/objects/button.lua b/objects/button.lua index fc90f1d..21f1c3e 100644 --- a/objects/button.lua +++ b/objects/button.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- button clas diff --git a/objects/checkbox.lua b/objects/checkbox.lua index 4ace82a..4232633 100644 --- a/objects/checkbox.lua +++ b/objects/checkbox.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- checkbox class diff --git a/objects/collapsiblecategory.lua b/objects/collapsiblecategory.lua index 1b74ec7..1c41d64 100644 --- a/objects/collapsiblecategory.lua +++ b/objects/collapsiblecategory.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- button clas diff --git a/objects/columnlist.lua b/objects/columnlist.lua index 3658dcd..fc64f3d 100644 --- a/objects/columnlist.lua +++ b/objects/columnlist.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- columnlist object diff --git a/objects/frame.lua b/objects/frame.lua index 69d998b..6b2b821 100644 --- a/objects/frame.lua +++ b/objects/frame.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- frame class diff --git a/objects/image.lua b/objects/image.lua index 78f0235..d1a9750 100644 --- a/objects/image.lua +++ b/objects/image.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- progress bar class diff --git a/objects/imagebutton.lua b/objects/imagebutton.lua index 08dd847..0b9a496 100644 --- a/objects/imagebutton.lua +++ b/objects/imagebutton.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- imagebutton clas diff --git a/objects/internal/closebutton.lua b/objects/internal/closebutton.lua index f4382e3..fcde956 100644 --- a/objects/internal/closebutton.lua +++ b/objects/internal/closebutton.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- closebutton clas diff --git a/objects/internal/columnlist/columnlist-listarea.lua b/objects/internal/columnlist/columnlist-listarea.lua index b790044..000811a 100644 --- a/objects/internal/columnlist/columnlist-listarea.lua +++ b/objects/internal/columnlist/columnlist-listarea.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- columnlistarea object diff --git a/objects/internal/columnlist/columnlist-row.lua b/objects/internal/columnlist/columnlist-row.lua index 5809fad..b77e3d6 100644 --- a/objects/internal/columnlist/columnlist-row.lua +++ b/objects/internal/columnlist/columnlist-row.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- columnlistrow object diff --git a/objects/internal/columnlist/coulmnlist-header.lua b/objects/internal/columnlist/coulmnlist-header.lua index 6da0742..2f076df 100644 --- a/objects/internal/columnlist/coulmnlist-header.lua +++ b/objects/internal/columnlist/coulmnlist-header.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- columnlistheader object diff --git a/objects/internal/modalbackground.lua b/objects/internal/modalbackground.lua index 8f2f9e9..faf0691 100644 --- a/objects/internal/modalbackground.lua +++ b/objects/internal/modalbackground.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- modalbackground class diff --git a/objects/internal/multichoice/multichoice-list.lua b/objects/internal/multichoice/multichoice-list.lua index cc00868..dd03375 100644 --- a/objects/internal/multichoice/multichoice-list.lua +++ b/objects/internal/multichoice/multichoice-list.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- multichoicelist class diff --git a/objects/internal/multichoice/multichoice-row.lua b/objects/internal/multichoice/multichoice-row.lua index 60b84f3..e5aa543 100644 --- a/objects/internal/multichoice/multichoice-row.lua +++ b/objects/internal/multichoice/multichoice-row.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- multichoicerow class diff --git a/objects/internal/scrollable/scrollarea.lua b/objects/internal/scrollable/scrollarea.lua index 3e1425b..92b34e3 100644 --- a/objects/internal/scrollable/scrollarea.lua +++ b/objects/internal/scrollable/scrollarea.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- scrollbar class diff --git a/objects/internal/scrollable/scrollbar.lua b/objects/internal/scrollable/scrollbar.lua index 4614d03..7af1525 100644 --- a/objects/internal/scrollable/scrollbar.lua +++ b/objects/internal/scrollable/scrollbar.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- scrollbar class diff --git a/objects/internal/scrollable/scrollbody.lua b/objects/internal/scrollable/scrollbody.lua index d02fe00..c53ed2e 100644 --- a/objects/internal/scrollable/scrollbody.lua +++ b/objects/internal/scrollable/scrollbody.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- scrollbar class diff --git a/objects/internal/scrollable/scrollbutton.lua b/objects/internal/scrollable/scrollbutton.lua index 3245c31..2f92658 100644 --- a/objects/internal/scrollable/scrollbutton.lua +++ b/objects/internal/scrollable/scrollbutton.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- scrollbutton clas diff --git a/objects/internal/sliderbutton.lua b/objects/internal/sliderbutton.lua index de9782a..3ef21d2 100644 --- a/objects/internal/sliderbutton.lua +++ b/objects/internal/sliderbutton.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- closebutton clas diff --git a/objects/internal/tabbutton.lua b/objects/internal/tabbutton.lua index 80d7556..78d9dc0 100644 --- a/objects/internal/tabbutton.lua +++ b/objects/internal/tabbutton.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- tabbutton clas diff --git a/objects/internal/tooltip.lua b/objects/internal/tooltip.lua index a35a1e3..7bb3c47 100644 --- a/objects/internal/tooltip.lua +++ b/objects/internal/tooltip.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- tooltip clas diff --git a/objects/list.lua b/objects/list.lua index 244c352..d8b2014 100644 --- a/objects/list.lua +++ b/objects/list.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- list class diff --git a/objects/multichoice.lua b/objects/multichoice.lua index a5b07d6..2fa3aed 100644 --- a/objects/multichoice.lua +++ b/objects/multichoice.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- progress bar class diff --git a/objects/panel.lua b/objects/panel.lua index b544904..ee19f34 100644 --- a/objects/panel.lua +++ b/objects/panel.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- panel class diff --git a/objects/progressbar.lua b/objects/progressbar.lua index 45d1c37..efa476c 100644 --- a/objects/progressbar.lua +++ b/objects/progressbar.lua @@ -1,9 +1,9 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ --- progress bar class +-- progressbar class progressbar = class("progressbar", base) progressbar:include(loveframes.templates.default) @@ -287,9 +287,10 @@ end --[[--------------------------------------------------------- - func: GetCompleted() - - desc: gets the value of object.completed + - desc: gets whether or not the object has reached it's + maximum value --]]--------------------------------------------------------- -function progressbar:GetLerpRate() +function progressbar:GetCompleted() return self.completed diff --git a/objects/slider.lua b/objects/slider.lua index b77986c..e634d2c 100644 --- a/objects/slider.lua +++ b/objects/slider.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- text clas diff --git a/objects/tabs.lua b/objects/tabs.lua index 8e76d65..9035ecf 100644 --- a/objects/tabs.lua +++ b/objects/tabs.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- tabs class diff --git a/objects/text.lua b/objects/text.lua index 889c9aa..d91793c 100644 --- a/objects/text.lua +++ b/objects/text.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ --[[------------------------------------------------ diff --git a/objects/textinput.lua b/objects/textinput.lua index 4fa13c9..1329f26 100644 --- a/objects/textinput.lua +++ b/objects/textinput.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- textinput clas @@ -39,7 +39,7 @@ function textinput:initialize() self.focus = false self.internal = false self.OnEnter = nil - self.OnTextEntered = nil + self.OnTextChanged = nil end @@ -259,30 +259,20 @@ function textinput:RunKey(key, unicode) self.unicode = unicode if key == "left" then - if self.alltextselected == true then - self.alltextselected = false - self.blinknum = 0 - else - self:MoveBlinker(-1) - if blinkx <= self.x and blinknum ~= 0 then - local width = self.font:getWidth(self.text:sub(blinknum, blinknum + 1)) - self.xoffset = self.xoffset + width - elseif blinknum == 0 and self.xoffset ~= 0 then - self.xoffset = 0 - end + self:MoveBlinker(-1) + if blinkx <= self.x and blinknum ~= 0 then + local width = self.font:getWidth(self.text:sub(blinknum, blinknum + 1)) + self.xoffset = self.xoffset + width + elseif blinknum == 0 and self.xoffset ~= 0 then + self.xoffset = 0 end elseif key == "right" then - if self.alltextselected == true then - self.alltextselected = false - self.blinknum = #self.text - else - self:MoveBlinker(1) - if blinkx >= self.x + swidth and blinknum ~= #self.text then - local width = self.font:getWidth(self.text:sub(blinknum, blinknum)) - self.xoffset = self.xoffset - width*2 - elseif blinknum == #self.text and self.xoffset ~= ((0 - font:getWidth(self.text)) + swidth) and font:getWidth(self.text) + self.textxoffset > self.width then - self.xoffset = ((0 - font:getWidth(self.text)) + swidth) - end + self:MoveBlinker(1) + if blinkx >= self.x + swidth and blinknum ~= #self.text then + local width = self.font:getWidth(self.text:sub(blinknum, blinknum)) + self.xoffset = self.xoffset - width*2 + elseif blinknum == #self.text and self.xoffset ~= ((0 - font:getWidth(self.text)) + swidth) and font:getWidth(self.text) + self.textxoffset > self.width then + self.xoffset = ((0 - font:getWidth(self.text)) + swidth) end end @@ -291,12 +281,15 @@ function textinput:RunKey(key, unicode) if text ~= "" then self.text = self:RemoveFromeText(blinknum) self:MoveBlinker(-1) + if self.OnTextChanged then + self.OnTextChanged(self, "") + end end local cwidth = font:getWidth(self.text:sub(#self.text)) if self.xoffset ~= 0 then self.xoffset = self.xoffset + cwidth end - elseif key == "return" then + elseif key == "return" or key == "kpenter" then if self.OnEnter ~= nil then self.OnEnter(self, self.text) end @@ -349,8 +342,8 @@ function textinput:RunKey(key, unicode) self:MoveBlinker(1) end - if self.OnTextEntered then - self.OnTextEntered(self, ckey) + if self.OnTextChanged then + self.OnTextChanged(self, ckey) end local cwidth = font:getWidth(ckey) diff --git a/skins.lua b/skins.lua index eddcc61..ad8c101 100644 --- a/skins.lua +++ b/skins.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ loveframes.skins = {} diff --git a/skins/Blue/skin.lua b/skins/Blue/skin.lua index 1fcda1e..400f774 100644 --- a/skins/Blue/skin.lua +++ b/skins/Blue/skin.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- skin table diff --git a/skins/Orange/skin.lua b/skins/Orange/skin.lua index bf37e3c..de1236c 100644 --- a/skins/Orange/skin.lua +++ b/skins/Orange/skin.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- skin table diff --git a/templates.lua b/templates.lua index 1ebf838..4f4223f 100644 --- a/templates.lua +++ b/templates.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- templates diff --git a/util.lua b/util.lua index 3b586d7..e556ab8 100644 --- a/util.lua +++ b/util.lua @@ -1,6 +1,6 @@ --[[------------------------------------------------ - -- LÖVE Frames -- - -- By Kenny Shields -- + -- Löve Frames -- + -- Copyright 2012 Kenny Shields -- --]]------------------------------------------------ -- util library