diff options
author | Aki <nthirtyone@gmail.com> | 2017-06-27 09:02:03 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-06-27 09:02:03 +0200 |
commit | baf04a055dbc66b80c29a406907a0a595ac55f00 (patch) | |
tree | 49559118c1c6246cf7f954e9f706bae6f29e5057 /config/menus/select.lua | |
parent | 2c458f0c756ebe577083a7cc972a07e870cb0ba9 (diff) | |
download | roflnauts-baf04a055dbc66b80c29a406907a0a595ac55f00.zip roflnauts-baf04a055dbc66b80c29a406907a0a595ac55f00.tar.gz roflnauts-baf04a055dbc66b80c29a406907a0a595ac55f00.tar.bz2 |
Moved ui elements to use new oop lib
Diffstat (limited to 'config/menus/select.lua')
-rw-r--r-- | config/menus/select.lua | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/config/menus/select.lua b/config/menus/select.lua index fd897d2..431e620 100644 --- a/config/menus/select.lua +++ b/config/menus/select.lua @@ -1,20 +1,20 @@ local menu = ... -local button = require "not.Button" -local selector = require "not.Selector" -local element = require "not.Element" +local Button = require "not.Button" +local Selector = require "not.Selector" +local Element = require "not.Element" local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() local bx = width/2-29 -local naut_selector = selector:new(menu) -local start_button = button:new(menu) +local naut_Selector = Selector(menu) +local start_Button = Button(menu) require "iconsList" local nautsIcons, nautsList = getNautsIconsList() return { - naut_selector + naut_Selector :setPosition(width/2,60) :setMargin(8) :setSize(32, 32) @@ -24,30 +24,30 @@ return { :set("icons_q", nautsIcons) :init() , - start_button + start_Button :setText("Force start") :setPosition(bx,134) :set("isEnabled", function () - if #naut_selector:getFullSelection(false) > 1 then + if #naut_Selector:getFullSelection(false) > 1 then return true end return false end) :set("active", function (self) - local nauts = naut_selector:getFullSelection(false) + local nauts = naut_Selector:getFullSelection(false) if #nauts > 1 then changeScene(World(MAP, nauts)) end end) , - button:new(menu) + Button(menu) :setText("Go back") :setPosition(bx,150) :set("active", function (self) self.parent:open("host") end) , - element:new(menu) + Element(menu) :setPosition(bx, 101) :set("the_final_countdown", 9) :set("draw", function (self, scale) @@ -62,14 +62,14 @@ return { end end) :set("update", function (self, dt) - local total = #naut_selector:getFullSelection(false) + local total = #naut_Selector:getFullSelection(false) if total > 1 then self.the_final_countdown = self.the_final_countdown - dt else self.the_final_countdown = 9 end if self.the_final_countdown < 0 then - start_button:active() + start_Button:active() end end) , |