summaryrefslogtreecommitdiffhomepage
path: root/config
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-06-27 09:02:03 +0200
committerAki <nthirtyone@gmail.com>2017-06-27 09:02:03 +0200
commitbaf04a055dbc66b80c29a406907a0a595ac55f00 (patch)
tree49559118c1c6246cf7f954e9f706bae6f29e5057 /config
parent2c458f0c756ebe577083a7cc972a07e870cb0ba9 (diff)
downloadroflnauts-baf04a055dbc66b80c29a406907a0a595ac55f00.zip
roflnauts-baf04a055dbc66b80c29a406907a0a595ac55f00.tar.gz
roflnauts-baf04a055dbc66b80c29a406907a0a595ac55f00.tar.bz2
Moved ui elements to use new oop lib
Diffstat (limited to 'config')
-rw-r--r--config/menus/credits.lua8
-rw-r--r--config/menus/host.lua16
-rw-r--r--config/menus/main.lua20
-rw-r--r--config/menus/select.lua26
-rw-r--r--config/menus/settings.lua18
5 files changed, 44 insertions, 44 deletions
diff --git a/config/menus/credits.lua b/config/menus/credits.lua
index 77cba62..6a2ab50 100644
--- a/config/menus/credits.lua
+++ b/config/menus/credits.lua
@@ -1,20 +1,20 @@
local menu = ...
-local button = require "not.Button"
-local element = require "not.Element"
+local Button = require "not.Button"
+local Element = require "not.Element"
local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale()
local bx = width/2-29
return {
- button:new(menu)
+ Button(menu)
:setText("Go back")
:setPosition(bx,144)
:set("active", function (self)
self.parent:open("main")
end)
,
- element:new(menu)
+ Element(menu)
:setPosition(width/2, 30)
:set("draw", function (self, scale)
local x,y = self:getPosition()
diff --git a/config/menus/host.lua b/config/menus/host.lua
index b318a5b..fff683c 100644
--- a/config/menus/host.lua
+++ b/config/menus/host.lua
@@ -1,18 +1,18 @@
local menu = ...
-local button = require "not.Button"
-local selector = require "not.Selector"
+local Button = require "not.Button"
+local Selector = require "not.Selector"
local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale()
local bx = width/2-29
-local map_selector = selector:new(menu)
+local map_Selector = Selector(menu)
require "iconsList"
local icons, maps = getMapsIconsList()
return {
- map_selector
+ map_Selector
:setPosition(width/2, 40)
:setSize(80, 42)
:setMargin(0)
@@ -24,18 +24,18 @@ return {
:set("shape", "panorama")
:init()
,
- button:new(menu)
+ Button(menu)
:setText("Next")
:setPosition(bx,101)
:set("isEnabled", function ()
- return map_selector:isLocked()
+ return map_Selector:isLocked()
end)
:set("active", function (self)
- MAP = map_selector:getFullSelection(true)[1][1] -- please, don't kill me for this, kek
+ MAP = map_Selector:getFullSelection(true)[1][1] -- please, don't kill me for this, kek
self.parent:open("select")
end)
,
- button:new(menu)
+ Button(menu)
:setText("Go back")
:setPosition(bx,117)
:set("active", function (self)
diff --git a/config/menus/main.lua b/config/menus/main.lua
index 236c011..d65c57d 100644
--- a/config/menus/main.lua
+++ b/config/menus/main.lua
@@ -1,8 +1,8 @@
local menu = ...
-local button = require "not.Button"
-local header = require "not.Header"
-local element = require "not.Element"
+local Button = require "not.Button"
+local Header = require "not.Header"
+local Element = require "not.Element"
local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale()
local bx = width/2-29
@@ -10,40 +10,40 @@ local bx = width/2-29
local awesometwo = love.graphics.newImage("assets/two.png")
return {
- button:new(menu)
+ Button(menu)
:setText("Start")
:setPosition(bx, 80)
:set("active", function (self)
self.parent:open("host")
end)
,
- button:new(menu)
+ Button(menu)
:setText("Join")
:setPosition(bx, 96)
:set("isEnabled", function (self)
return false
end)
,
- button:new(menu)
+ Button(menu)
:setText("Settings")
:setPosition(bx, 112)
:set("active", function (self)
self.parent:open("settings")
end)
,
- button:new(menu)
+ Button(menu)
:setText("Credits")
:setPosition(bx, 128)
:set("active", function (self)
self.parent:open("credits")
end)
,
- button:new(menu)
+ Button(menu)
:setText("Exit")
:setPosition(bx, 144)
:set("active", love.event.quit)
,
- element:new(menu)
+ Element(menu)
:setPosition(width/2, 15)
:set("draw", function (self, scale)
local x,y = self:getPosition()
@@ -52,7 +52,7 @@ return {
love.graphics.draw(awesometwo, x*scale, y*scale, 0, scale, scale, 35)
end)
,
- header:new(menu)
+ Header(menu)
:setText("Roflnauts")
:setPosition(width/2,40)
,
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)
,
diff --git a/config/menus/settings.lua b/config/menus/settings.lua
index ae0403d..a1c6507 100644
--- a/config/menus/settings.lua
+++ b/config/menus/settings.lua
@@ -1,15 +1,15 @@
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()/getRealScale(), love.graphics.getHeight()/getRealScale()
local bx = width/2-29
local keys = {"Left", "Right", "Up", "Down", "Attack", "Jump"}
-local dimmer = element:new(menu)
+local dimmer = Element(menu)
:setPosition(width/2, 15)
:set("visible", false)
:set("currentControl", "Left") -- it actually means control that is being set CURRENTLY
@@ -65,7 +65,7 @@ local controlreleased = function(self, set, action, key)
end
local a = {
- button:new(menu)
+ Button(menu)
:setText("Keyboard 1")
:setPosition(bx,80)
:set("setNumber", function () return 1 end)
@@ -74,7 +74,7 @@ local a = {
:set("stopChange", stopChange)
:set("active", startChange)
,
- button:new(menu)
+ Button(menu)
:setText("Keyboard 2")
:setPosition(bx,96)
:set("setNumber", function () return 2 end)
@@ -83,7 +83,7 @@ local a = {
:set("stopChange", stopChange)
:set("active", startChange)
,
- button:new(menu)
+ Button(menu)
:setText("Gamepad 1")
:setPosition(bx,112)
:set("setNumber", function () return 3 end)
@@ -92,7 +92,7 @@ local a = {
:set("stopChange", stopChange)
:set("active", startChange)
,
- button:new(menu)
+ Button(menu)
:setText("Gamepad 2")
:setPosition(bx,128)
:set("setNumber", function () return 4 end)
@@ -101,7 +101,7 @@ local a = {
:set("stopChange", stopChange)
:set("active", startChange)
,
- button:new(menu)
+ Button(menu)
:setText("Go back")
:setPosition(bx,144)
:set("active", function (self)