diff options
author | Aki <nthirtyone@gmail.com> | 2017-08-13 02:26:55 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-08-13 02:26:55 +0200 |
commit | b1cf14d64a2d3e28683db87190c4b2c7799c259d (patch) | |
tree | e45dac5cc6ce5265e3e3e2c914eb7cc92a820b8b /not/Selector.lua | |
parent | 0dd01913fe0eefc7ba4bc0797877f40fdedf9315 (diff) | |
parent | ed62b573417bdc85bec616f6016846b02de4c906 (diff) | |
download | roflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.zip roflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.tar.gz roflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.tar.bz2 |
Merge branch 'multi'maps
Diffstat (limited to 'not/Selector.lua')
-rw-r--r-- | not/Selector.lua | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/not/Selector.lua b/not/Selector.lua index 8e03457..ef78778 100644 --- a/not/Selector.lua +++ b/not/Selector.lua @@ -1,3 +1,5 @@ +require "not.Element" + --- `Selector` -- Used in Menu for selecting various things from list. Works for each Controller set or globally. --[[ @@ -12,39 +14,29 @@ selector:new(menu) :set("global", false) -- true: single selector; false: selector for each controller set present :init() ]] -Selector = { - parent = --[[not.Menu]]nil, - x = 0, - y = 0, - width = 0, - height = 0, - margin = 0, - focused = false, - global = false, - delay = 2, - first = false, - list, - sets, - locks, - selections, - shape = "portrait", - sprite, - quads, - icons_i, - icons_q -} +Selector = Element:extends() --- `Selector` is a child of `Element`. -require "not.Element" -Selector.__index = Selector -setmetatable(Selector, Element) +Selector.width = 0 +Selector.height = 0 +Selector.margin = 0 +Selector.focused = false +Selector.global = false +Selector.delay = 2 +Selector.first = false +Selector.list = --[[]]nil +Selector.sets = --[[]]nil +Selector.locks = --[[]]nil +Selector.selections = --[[]]nil +Selector.shape = "portrait" +Selector.sprite = --[[]]nil +Selector.quads = --[[]]nil +Selector.icons_i = --[[]]nil +Selector.icons_q = --[[]]nil -- Constructor function Selector:new (parent) - local o = setmetatable({}, self) - o.parent = parent - o.sprite, o.quads = parent:getSheet() - return o + Selector.__super.new(self, parent) + self.sprite, self.quads = parent:getSheet() end -- Size of single block |