From 43fa5953e4c9f226c2579097b3f42bd97bc587c4 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 20 Aug 2016 19:02:38 +0200 Subject: Config files directory; soon to be moved --- config/menumain.lua | 1 + 1 file changed, 1 insertion(+) create mode 100644 config/menumain.lua (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua new file mode 100644 index 0000000..a4374ad --- /dev/null +++ b/config/menumain.lua @@ -0,0 +1 @@ +return {"Start", "Join", "Settings", "Credits", "Exit"} \ No newline at end of file -- cgit v1.1 From 6e9aa28e70ec842db643a06609454fff54b5d86a Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 22 Aug 2016 02:24:32 +0200 Subject: Werking! --- config/menumain.lua | 29 ++++++++++++++++++++++++++++- config/menustart.lua | 11 +++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 config/menustart.lua (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua index a4374ad..7c8ddf9 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -1 +1,28 @@ -return {"Start", "Join", "Settings", "Credits", "Exit"} \ No newline at end of file +local button = require "button" + +return { + button + :new("start") + :setPosition(10,40) + :set("active", function () + changeScene(Menu:new("menustart")) + end) + , + button + :new("join") + :setPosition(10,50) + , + button + :new("settings") + :setPosition(10,60) + , + button + :new("credits") + :setPosition(10,70) + , + button + :new("exit") + :setPosition(10,80) + :set("active", love.event.quit) + , +} \ No newline at end of file diff --git a/config/menustart.lua b/config/menustart.lua new file mode 100644 index 0000000..03ca2f2 --- /dev/null +++ b/config/menustart.lua @@ -0,0 +1,11 @@ +local button = require "button" + +return { + button + :new("WORKED") + :setPosition(10,40) + :set("active", function () + changeScene(Menu:new("menumain")) + end) + , +} \ No newline at end of file -- cgit v1.1 From e57a5b0b77c1ba3a2f05371c551d0e61fc9ce709 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 22 Aug 2016 17:10:20 +0200 Subject: Graphics, animation, general improvements --- config/menumain.lua | 46 +++++++++++++++++++++++++++++++--------------- config/menustart.lua | 6 ++++-- 2 files changed, 35 insertions(+), 17 deletions(-) (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua index 7c8ddf9..543a858 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -1,28 +1,44 @@ +local menu = ... + local button = require "button" +local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local button_x = width/2-29 + return { - button - :new("start") - :setPosition(10,40) + button:new(menu) + :setText("start") + :setPosition(button_x,60) :set("active", function () changeScene(Menu:new("menustart")) end) , - button - :new("join") - :setPosition(10,50) + button:new(menu) + :setText("join") + :setPosition(button_x,76) , - button - :new("settings") - :setPosition(10,60) + button:new(menu) + :setText("settings") + :setPosition(button_x,92) , - button - :new("credits") - :setPosition(10,70) + button:new(menu) + :setText("credits") + :setPosition(button_x,108) , - button - :new("exit") - :setPosition(10,80) + button:new(menu) + :setText("exit") + :setPosition(button_x,124) :set("active", love.event.quit) , + button:new(menu) + :setText("NEVER") + :setPosition(button_x,140) + :set("focus", function (self, next) + if next then + self.parent:next() + else + self.parent:previous() + end + end) + , } \ No newline at end of file diff --git a/config/menustart.lua b/config/menustart.lua index 03ca2f2..46015a9 100644 --- a/config/menustart.lua +++ b/config/menustart.lua @@ -1,8 +1,10 @@ +local menu = ... + local button = require "button" return { - button - :new("WORKED") + button:new(menu) + :setText("Go back") :setPosition(10,40) :set("active", function () changeScene(Menu:new("menumain")) -- cgit v1.1 From 3aeabc496465cbd2569d9b0f5687242f374b4375 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 22 Aug 2016 17:23:18 +0200 Subject: change elements not menu object --- config/menumain.lua | 4 ++-- config/menustart.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua index 543a858..def1ab7 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -9,8 +9,8 @@ return { button:new(menu) :setText("start") :setPosition(button_x,60) - :set("active", function () - changeScene(Menu:new("menustart")) + :set("active", function (self) + self.parent:load("menustart") end) , button:new(menu) diff --git a/config/menustart.lua b/config/menustart.lua index 46015a9..2472df5 100644 --- a/config/menustart.lua +++ b/config/menustart.lua @@ -6,8 +6,8 @@ return { button:new(menu) :setText("Go back") :setPosition(10,40) - :set("active", function () - changeScene(Menu:new("menumain")) + :set("active", function (self) + self.parent:load("menumain") end) , } \ No newline at end of file -- cgit v1.1 From 213c783bdde0fe5bf9709e19168a8e5049c7b13a Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 22 Aug 2016 18:27:14 +0200 Subject: game title --- config/menumain.lua | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua index def1ab7..629284c 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -1,44 +1,38 @@ local menu = ... local button = require "button" +local header = require "header" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() local button_x = width/2-29 return { button:new(menu) - :setText("start") - :setPosition(button_x,60) + :setText("Start") + :setPosition(button_x, 80) :set("active", function (self) self.parent:load("menustart") end) , button:new(menu) - :setText("join") - :setPosition(button_x,76) + :setText("Join") + :setPosition(button_x, 96) , button:new(menu) - :setText("settings") - :setPosition(button_x,92) + :setText("Settings") + :setPosition(button_x, 112) , button:new(menu) - :setText("credits") - :setPosition(button_x,108) + :setText("Credits") + :setPosition(button_x, 128) , button:new(menu) - :setText("exit") - :setPosition(button_x,124) + :setText("Exit") + :setPosition(button_x, 144) :set("active", love.event.quit) , - button:new(menu) - :setText("NEVER") - :setPosition(button_x,140) - :set("focus", function (self, next) - if next then - self.parent:next() - else - self.parent:previous() - end - end) + header:new(menu) + :setText("Roflnauts") + :setPosition(width/2,40) , } \ No newline at end of file -- cgit v1.1 From d41d75e723cfd7d49456da1e27d98f0c806afaca Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 23 Aug 2016 18:15:55 +0200 Subject: 2 --- config/menumain.lua | 12 ++++++++++++ config/menustart.lua | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua index 629284c..24f66ef 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -2,6 +2,7 @@ local menu = ... local button = require "button" local header = require "header" +local element = require "element" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() local button_x = width/2-29 @@ -31,6 +32,17 @@ return { :setPosition(button_x, 144) :set("active", love.event.quit) , + element:new(menu) + :setPosition(width/2, 15) + :set("sprite", love.graphics.newImage("assets/two.png")) + :set("draw", function (self, scale) + local x,y = self:getPosition() + love.graphics.setColor(255, 255, 255, 255) + love.graphics.setFont(Bold) + love.graphics.print("1", (x-17)*scale, y*scale, 0, scale*2, scale*2, 12) + love.graphics.print("1", (x+13)*scale, y*scale, 0, scale*2, scale*2, 12) + end) + , header:new(menu) :setText("Roflnauts") :setPosition(width/2,40) diff --git a/config/menustart.lua b/config/menustart.lua index 2472df5..1830f0d 100644 --- a/config/menustart.lua +++ b/config/menustart.lua @@ -1,11 +1,14 @@ local menu = ... local button = require "button" +local selector = require "selector" + +local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() return { button:new(menu) :setText("Go back") - :setPosition(10,40) + :setPosition(10,height-25) :set("active", function (self) self.parent:load("menumain") end) -- cgit v1.1 From 6bd45fd9a32439b50b114c39eee569a58d354b73 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 23 Aug 2016 18:21:12 +0200 Subject: Obsolete; bug --- config/menumain.lua | 1 - 1 file changed, 1 deletion(-) (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua index 24f66ef..f442c8d 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -34,7 +34,6 @@ return { , element:new(menu) :setPosition(width/2, 15) - :set("sprite", love.graphics.newImage("assets/two.png")) :set("draw", function (self, scale) local x,y = self:getPosition() love.graphics.setColor(255, 255, 255, 255) -- cgit v1.1 From 9b8f5e3d356be281d8ef25227b087bb99b07b58d Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 23 Aug 2016 19:24:06 +0200 Subject: start > select --- config/menumain.lua | 2 +- config/menuselect.lua | 16 ++++++++++++++++ config/menustart.lua | 16 ---------------- 3 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 config/menuselect.lua delete mode 100644 config/menustart.lua (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua index f442c8d..2d92817 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -12,7 +12,7 @@ return { :setText("Start") :setPosition(button_x, 80) :set("active", function (self) - self.parent:load("menustart") + self.parent:load("menuselect") end) , button:new(menu) diff --git a/config/menuselect.lua b/config/menuselect.lua new file mode 100644 index 0000000..1830f0d --- /dev/null +++ b/config/menuselect.lua @@ -0,0 +1,16 @@ +local menu = ... + +local button = require "button" +local selector = require "selector" + +local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() + +return { + button:new(menu) + :setText("Go back") + :setPosition(10,height-25) + :set("active", function (self) + self.parent:load("menumain") + end) + , +} \ No newline at end of file diff --git a/config/menustart.lua b/config/menustart.lua deleted file mode 100644 index 1830f0d..0000000 --- a/config/menustart.lua +++ /dev/null @@ -1,16 +0,0 @@ -local menu = ... - -local button = require "button" -local selector = require "selector" - -local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() - -return { - button:new(menu) - :setText("Go back") - :setPosition(10,height-25) - :set("active", function (self) - self.parent:load("menumain") - end) - , -} \ No newline at end of file -- cgit v1.1 From 3ab0342ad678ceec3b708ac56e2b7e5bd70185ac Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 04:57:56 +0200 Subject: Add selector to select menu cfg --- config/menuselect.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'config') diff --git a/config/menuselect.lua b/config/menuselect.lua index 1830f0d..fcfcc16 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -13,4 +13,10 @@ return { self.parent:load("menumain") end) , + selector:new(menu) + :setPosition(10,10) + :set("list", require "nautslist") + :set("global", false) + :init() + , } \ No newline at end of file -- cgit v1.1 From 3139857cee53affa1c642f92da8d6a595a18c52e Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 04:59:23 +0200 Subject: And moved it to top --- config/menuselect.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/menuselect.lua b/config/menuselect.lua index fcfcc16..b1ce2cd 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -6,6 +6,12 @@ local selector = require "selector" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() return { + selector:new(menu) + :setPosition(10,10) + :set("list", require "nautslist") + :set("global", false) + :init() + , button:new(menu) :setText("Go back") :setPosition(10,height-25) @@ -13,10 +19,4 @@ return { self.parent:load("menumain") end) , - selector:new(menu) - :setPosition(10,10) - :set("list", require "nautslist") - :set("global", false) - :init() - , } \ No newline at end of file -- cgit v1.1 From 2aef35b0bbb72595977cddc2c2bbb3f65beb6bc6 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 05:30:57 +0200 Subject: Draw me like one of your french girls --- config/menuselect.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/menuselect.lua b/config/menuselect.lua index b1ce2cd..c070f4c 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -8,8 +8,11 @@ local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.get return { selector:new(menu) :setPosition(10,10) + :setSpacing(42, 0) :set("list", require "nautslist") :set("global", false) + :set("sprite", love.graphics.newImage("assets/portraits.png")) + :set("quads", require "portraits") :init() , button:new(menu) -- cgit v1.1 From 5c9146f74c1cd522c22a9affa403cf1f4b96921d Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 07:10:02 +0200 Subject: Now it's fine --- config/menuselect.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/menuselect.lua b/config/menuselect.lua index c070f4c..ffdda7f 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -7,8 +7,9 @@ local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.get return { selector:new(menu) - :setPosition(10,10) - :setSpacing(42, 0) + :setPosition(width/2,10) + :setMargin(8) + :setSize(32, 32) :set("list", require "nautslist") :set("global", false) :set("sprite", love.graphics.newImage("assets/portraits.png")) -- cgit v1.1 From 1213e1e2831805ebb5d193702e02c59c2927e54a Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 13:29:13 +0200 Subject: Almost the same functionality --- config/menumain.lua | 12 ++++++------ config/menuselect.lua | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 9 deletions(-) (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua index 2d92817..cb53714 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -5,31 +5,31 @@ local header = require "header" local element = require "element" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() -local button_x = width/2-29 +local bx = width/2-29 return { button:new(menu) :setText("Start") - :setPosition(button_x, 80) + :setPosition(bx, 80) :set("active", function (self) self.parent:load("menuselect") end) , button:new(menu) :setText("Join") - :setPosition(button_x, 96) + :setPosition(bx, 96) , button:new(menu) :setText("Settings") - :setPosition(button_x, 112) + :setPosition(bx, 112) , button:new(menu) :setText("Credits") - :setPosition(button_x, 128) + :setPosition(bx, 128) , button:new(menu) :setText("Exit") - :setPosition(button_x, 144) + :setPosition(bx, 144) :set("active", love.event.quit) , element:new(menu) diff --git a/config/menuselect.lua b/config/menuselect.lua index ffdda7f..8d646ba 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -4,10 +4,13 @@ local button = require "button" local selector = require "selector" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local bx = width/2-29 + +local naut_selector = selector:new(menu) return { - selector:new(menu) - :setPosition(width/2,10) + naut_selector + :setPosition(width/2,60) :setMargin(8) :setSize(32, 32) :set("list", require "nautslist") @@ -17,8 +20,15 @@ return { :init() , button:new(menu) + :setText("Force start") + :setPosition(bx,101) + :set("active", function (self) + changeScene(World:new(nil,naut_selector:getFullSelection(false))) + end) + , + button:new(menu) :setText("Go back") - :setPosition(10,height-25) + :setPosition(bx,117) :set("active", function (self) self.parent:load("menumain") end) -- cgit v1.1 From 8b0698abc1290cbdbfef3c8b48a2dc7a0388c9d1 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 14:19:18 +0200 Subject: Blink button, fix empty error --- config/menuselect.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/menuselect.lua b/config/menuselect.lua index 8d646ba..c3a05c1 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -23,7 +23,12 @@ return { :setText("Force start") :setPosition(bx,101) :set("active", function (self) - changeScene(World:new(nil,naut_selector:getFullSelection(false))) + local nauts = naut_selector:getFullSelection(false) + if #nauts > 1 then + changeScene(World:new(nil, nauts)) + else + self:blink() + end end) , button:new(menu) -- cgit v1.1 From aafcac7057e0ef7904d96446f88b2d26b12e0ab5 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 14:53:05 +0200 Subject: I don't regret this --- config/menumain.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'config') diff --git a/config/menumain.lua b/config/menumain.lua index cb53714..c0607d6 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -18,14 +18,23 @@ return { button:new(menu) :setText("Join") :setPosition(bx, 96) + :set("active", function (self) + self:blink() + end) , button:new(menu) :setText("Settings") :setPosition(bx, 112) + :set("active", function (self) + self:blink() + end) , button:new(menu) :setText("Credits") :setPosition(bx, 128) + :set("active", function (self) + self:blink() + end) , button:new(menu) :setText("Exit") -- cgit v1.1 From b19ec990880a3f2529ac8a7833337a0984094a23 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 19:03:40 +0200 Subject: Autostart+new menu --- config/menuhost.lua | 24 ++++++++++++++++++++++++ config/menumain.lua | 2 +- config/menuselect.lua | 36 ++++++++++++++++++++++++++++++++---- 3 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 config/menuhost.lua (limited to 'config') diff --git a/config/menuhost.lua b/config/menuhost.lua new file mode 100644 index 0000000..3ad10db --- /dev/null +++ b/config/menuhost.lua @@ -0,0 +1,24 @@ +local menu = ... + +local button = require "button" +local selector = require "selector" + +local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local bx = width/2-29 + +return { + button:new(menu) + :setText("Select") + :setPosition(bx,101) + :set("active", function (self) + self.parent:load("menuselect") + end) + , + button:new(menu) + :setText("Go back") + :setPosition(bx,117) + :set("active", function (self) + self.parent:load("menumain") + end) + , +} \ No newline at end of file diff --git a/config/menumain.lua b/config/menumain.lua index c0607d6..2ca2c59 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -12,7 +12,7 @@ return { :setText("Start") :setPosition(bx, 80) :set("active", function (self) - self.parent:load("menuselect") + self.parent:load("menuhost") end) , button:new(menu) diff --git a/config/menuselect.lua b/config/menuselect.lua index c3a05c1..af71b5f 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -2,11 +2,13 @@ local menu = ... local button = require "button" local selector = require "selector" +local element = require "element" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() local bx = width/2-29 local naut_selector = selector:new(menu) +local start_button = button:new(menu) return { naut_selector @@ -19,9 +21,9 @@ return { :set("quads", require "portraits") :init() , - button:new(menu) + start_button :setText("Force start") - :setPosition(bx,101) + :setPosition(bx,134) :set("active", function (self) local nauts = naut_selector:getFullSelection(false) if #nauts > 1 then @@ -33,9 +35,35 @@ return { , button:new(menu) :setText("Go back") - :setPosition(bx,117) + :setPosition(bx,150) :set("active", function (self) - self.parent:load("menumain") + self.parent:load("menuhost") + end) + , + element:new(menu) + :setPosition(bx, 101) + :set("the_final_countdown", 9) + :set("draw", function (self, scale) + if self.the_final_countdown ~= 9 then + local x,y = self:getPosition() + local countdown = math.max(1, math.ceil(self.the_final_countdown)) + love.graphics.setColor(255, 255, 255, 255) + love.graphics.setFont(Font) + love.graphics.print("Autostart in:", (x-16)*scale, (y+10)*scale, 0, scale, scale) + love.graphics.setFont(Bold) + love.graphics.printf(countdown, (x+40)*scale, (y)*scale, 36, "center", 0, scale, scale) + end + end) + :set("update", function (self, dt) + 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() + end end) , } \ No newline at end of file -- cgit v1.1 From 65e2f701a6c0cfbf53506678771839f7f6d12cbf Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 24 Aug 2016 22:14:10 +0200 Subject: map selection --- config/menuhost.lua | 13 +++++++++++++ config/menuselect.lua | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/menuhost.lua b/config/menuhost.lua index 3ad10db..53972b3 100644 --- a/config/menuhost.lua +++ b/config/menuhost.lua @@ -6,11 +6,24 @@ local selector = require "selector" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() local bx = width/2-29 +local map_selector = selector:new(menu) + return { + map_selector + :setPosition(width/2, 10) + :setSize(80, 42) + :setMargin(0) + :set("global", true) + :set("list", require "maplist") + :set("sprite", love.graphics.newImage("assets/placeholder-map-icon.png")) + :set("quads", require "mapicons") + :init() + , button:new(menu) :setText("Select") :setPosition(bx,101) :set("active", function (self) + MAP = map_selector:getFullSelection(true)[1][1] self.parent:load("menuselect") end) , diff --git a/config/menuselect.lua b/config/menuselect.lua index af71b5f..20ea607 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -27,7 +27,7 @@ return { :set("active", function (self) local nauts = naut_selector:getFullSelection(false) if #nauts > 1 then - changeScene(World:new(nil, nauts)) + changeScene(World:new(MAP, nauts)) else self:blink() end -- cgit v1.1 From ac6d4307fc9f7713b996eb8d36a8d0d3756efc00 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 25 Aug 2016 16:44:13 +0200 Subject: THIS NEED REAL CLEANUP --- config/menuhost.lua | 5 +++-- config/menuselect.lua | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/menuhost.lua b/config/menuhost.lua index 53972b3..878ec71 100644 --- a/config/menuhost.lua +++ b/config/menuhost.lua @@ -15,8 +15,9 @@ return { :setMargin(0) :set("global", true) :set("list", require "maplist") - :set("sprite", love.graphics.newImage("assets/placeholder-map-icon.png")) - :set("quads", require "mapicons") + :set("icons_i", love.graphics.newImage("assets/placeholder-map-icon.png")) + :set("icons_q", require "mapicons") + :set("shape", "panorama") :init() , button:new(menu) diff --git a/config/menuselect.lua b/config/menuselect.lua index 20ea607..31cf02e 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -17,8 +17,8 @@ return { :setSize(32, 32) :set("list", require "nautslist") :set("global", false) - :set("sprite", love.graphics.newImage("assets/portraits.png")) - :set("quads", require "portraits") + :set("icons_i", love.graphics.newImage("assets/portraits.png")) + :set("icons_q", require "nautsicons") :init() , start_button -- cgit v1.1 From ab82b9f8ee76ef8327765ed59639c3f3c65fce8f Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 26 Aug 2016 15:52:25 +0200 Subject: allow first --- config/menuhost.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/menuhost.lua b/config/menuhost.lua index 878ec71..6e52482 100644 --- a/config/menuhost.lua +++ b/config/menuhost.lua @@ -10,10 +10,11 @@ local map_selector = selector:new(menu) return { map_selector - :setPosition(width/2, 10) + :setPosition(width/2, 40) :setSize(80, 42) :setMargin(0) :set("global", true) + :set("first", true) :set("list", require "maplist") :set("icons_i", love.graphics.newImage("assets/placeholder-map-icon.png")) :set("icons_q", require "mapicons") -- cgit v1.1 From 96b4407ae6410affd0db1e6d6d657d4f65d32235 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 28 Aug 2016 20:41:48 +0200 Subject: No blinking; buttons enabled/disabled --- config/menuhost.lua | 3 +++ config/menumain.lua | 12 ++++++------ config/menuselect.lua | 8 ++++++-- 3 files changed, 15 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/menuhost.lua b/config/menuhost.lua index 6e52482..487b75f 100644 --- a/config/menuhost.lua +++ b/config/menuhost.lua @@ -24,6 +24,9 @@ return { button:new(menu) :setText("Select") :setPosition(bx,101) + :set("isEnabled", function () + return map_selector:isLocked() + end) :set("active", function (self) MAP = map_selector:getFullSelection(true)[1][1] self.parent:load("menuselect") diff --git a/config/menumain.lua b/config/menumain.lua index 2ca2c59..e1bd89f 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -18,22 +18,22 @@ return { button:new(menu) :setText("Join") :setPosition(bx, 96) - :set("active", function (self) - self:blink() + :set("isEnabled", function (self) + return false end) , button:new(menu) :setText("Settings") :setPosition(bx, 112) - :set("active", function (self) - self:blink() + :set("isEnabled", function (self) + return false end) , button:new(menu) :setText("Credits") :setPosition(bx, 128) - :set("active", function (self) - self:blink() + :set("isEnabled", function (self) + return false end) , button:new(menu) diff --git a/config/menuselect.lua b/config/menuselect.lua index 31cf02e..c79396c 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -24,12 +24,16 @@ return { start_button :setText("Force start") :setPosition(bx,134) + :set("isEnabled", function () + if #naut_selector:getFullSelection(false) > 1 then + return true + end + return false + end) :set("active", function (self) local nauts = naut_selector:getFullSelection(false) if #nauts > 1 then changeScene(World:new(MAP, nauts)) - else - self:blink() end end) , -- cgit v1.1 From adb0938f960312fef6f73640526e94d9bd3ce4ba Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 28 Aug 2016 23:48:31 +0200 Subject: Credits menu --- config/menucredits.lua | 24 ++++++++++++++++++++++++ config/menumain.lua | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 config/menucredits.lua (limited to 'config') diff --git a/config/menucredits.lua b/config/menucredits.lua new file mode 100644 index 0000000..975c962 --- /dev/null +++ b/config/menucredits.lua @@ -0,0 +1,24 @@ +local menu = ... + +local button = require "button" +local element = require "element" + +local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local bx = width/2-29 + +return { + button:new(menu) + :setText("Go back") + :setPosition(bx,144) + :set("active", function (self) + self.parent:load("menumain") + end) + , + element:new(menu) + :setPosition(width/2, 30) + :set("draw", function (self, scale) + local x,y = self:getPosition() + love.graphics.printf("The year is 3587. Conflict spans the stars as huge robot armies are locked in an enduring stalemate. In their bid for galactic supremacy, they call upon the most powerful group of mercenaries in the universe: the Awesomenauts!", (x-100)*scale, (y+10)*scale, 200, "center", 0, scale, scale) + end) + , +} \ No newline at end of file diff --git a/config/menumain.lua b/config/menumain.lua index e1bd89f..70666b3 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -32,8 +32,8 @@ return { button:new(menu) :setText("Credits") :setPosition(bx, 128) - :set("isEnabled", function (self) - return false + :set("active", function (self) + self.parent:load("menucredits") end) , button:new(menu) -- cgit v1.1 From 01304063655a31e102f312f6293e7aa4c7582d3f Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 13 Sep 2016 15:38:37 +0200 Subject: Text changes --- config/menucredits.lua | 2 +- config/menuhost.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/menucredits.lua b/config/menucredits.lua index 975c962..9d38da4 100644 --- a/config/menucredits.lua +++ b/config/menucredits.lua @@ -18,7 +18,7 @@ return { :setPosition(width/2, 30) :set("draw", function (self, scale) local x,y = self:getPosition() - love.graphics.printf("The year is 3587. Conflict spans the stars as huge robot armies are locked in an enduring stalemate. In their bid for galactic supremacy, they call upon the most powerful group of mercenaries in the universe: the Awesomenauts!", (x-100)*scale, (y+10)*scale, 200, "center", 0, scale, scale) + love.graphics.printf("A game by the Awesomenauts community including:\nSeltzy, PlasmaWisp, ParaDoX, MilkingChicken, Burningdillo, Bronkey and Aki.\n\n04font was used.\n\nBased on a game by Jan Willem Nijman, Paul Veer and Bits_Beats XOXO.\n\nAwesomenauts is property of Ronimo Games.", (x-110)*scale, (y+10)*scale, 220, "left", 0, scale, scale) end) , } \ No newline at end of file diff --git a/config/menuhost.lua b/config/menuhost.lua index 487b75f..bd7a3b9 100644 --- a/config/menuhost.lua +++ b/config/menuhost.lua @@ -22,7 +22,7 @@ return { :init() , button:new(menu) - :setText("Select") + :setText("Next") :setPosition(bx,101) :set("isEnabled", function () return map_selector:isLocked() -- cgit v1.1 From bdc2e0ee9420eaf99ad9502ad061f124e17e00b8 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 6 Oct 2016 14:05:56 +0200 Subject: New empty menu for settings --- config/menusettings.lua | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 config/menusettings.lua (limited to 'config') diff --git a/config/menusettings.lua b/config/menusettings.lua new file mode 100644 index 0000000..fc7d62e --- /dev/null +++ b/config/menusettings.lua @@ -0,0 +1,7 @@ +local menu = ... + +local button = require "button" +local selector = require "selector" + +local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local bx = width/2-29 -- cgit v1.1 From 35262a7245bcd9ebf937d07ab3326655d96e5d2e Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 6 Oct 2016 14:43:11 +0200 Subject: Fixed scaling of fullscreen menu in different ratios --- config/menuhost.lua | 2 +- config/menumain.lua | 6 +++--- config/menuselect.lua | 2 +- config/menusettings.lua | 10 ++++++++++ 4 files changed, 15 insertions(+), 5 deletions(-) (limited to 'config') diff --git a/config/menuhost.lua b/config/menuhost.lua index bd7a3b9..af7dad1 100644 --- a/config/menuhost.lua +++ b/config/menuhost.lua @@ -28,7 +28,7 @@ return { return map_selector:isLocked() end) :set("active", function (self) - MAP = map_selector:getFullSelection(true)[1][1] + MAP = map_selector:getFullSelection(true)[1][1] -- please, don't kill me for this, kek self.parent:load("menuselect") end) , diff --git a/config/menumain.lua b/config/menumain.lua index 70666b3..e312b51 100644 --- a/config/menumain.lua +++ b/config/menumain.lua @@ -4,7 +4,7 @@ local button = require "button" local header = require "header" local element = require "element" -local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() local bx = width/2-29 return { @@ -25,8 +25,8 @@ return { button:new(menu) :setText("Settings") :setPosition(bx, 112) - :set("isEnabled", function (self) - return false + :set("active", function (self) + self.parent:load("menusettings") end) , button:new(menu) diff --git a/config/menuselect.lua b/config/menuselect.lua index c79396c..19f46ab 100644 --- a/config/menuselect.lua +++ b/config/menuselect.lua @@ -4,7 +4,7 @@ local button = require "button" local selector = require "selector" local element = require "element" -local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() local bx = width/2-29 local naut_selector = selector:new(menu) diff --git a/config/menusettings.lua b/config/menusettings.lua index fc7d62e..380828d 100644 --- a/config/menusettings.lua +++ b/config/menusettings.lua @@ -5,3 +5,13 @@ local selector = require "selector" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() local bx = width/2-29 + +return { + button:new(menu) + :setText("Go back") + :setPosition(bx,117) + :set("active", function (self) + self.parent:load("menumain") + end) + , +} \ No newline at end of file -- cgit v1.1 From 82f0f11c9098da300439f62fdd175b6699fd150c Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 6 Oct 2016 14:45:05 +0200 Subject: Oops! --- config/menuhost.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/menuhost.lua b/config/menuhost.lua index af7dad1..710839d 100644 --- a/config/menuhost.lua +++ b/config/menuhost.lua @@ -3,7 +3,7 @@ local menu = ... local button = require "button" local selector = require "selector" -local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() +local width, height = love.graphics.getWidth()/getScale(), love.graphics.getHeight()/getScale() local bx = width/2-29 local map_selector = selector:new(menu) -- cgit v1.1 From 73bcd524906c51d43b22b3ea68c64b38f130bea6 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 20 Dec 2016 06:02:05 +0100 Subject: I have no idea why I have put everything in one commit --- config/menusettings.lua | 96 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/menusettings.lua b/config/menusettings.lua index 380828d..1b19e84 100644 --- a/config/menusettings.lua +++ b/config/menusettings.lua @@ -2,16 +2,106 @@ local menu = ... local button = require "button" local selector = require "selector" +local element = require "element" local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale() local bx = width/2-29 -return { +local keys = {"Left", "Right", "Up", "Down", "Attack", "Jump"} + +local dimmer = element:new(menu) + :setPosition(width/2, 15) + :set("visible", false) + :set("currentControl", "Left") + :set("draw", function (self, scale) + if self.visible then + love.graphics.setColor(0, 0, 0, 210) + love.graphics.rectangle("fill",0,0,width*getRealScale(),height*getRealScale()) + love.graphics.setColor(120, 255, 120, 255) + love.graphics.printf("Press new key for: \n> " .. self.currentControl .. " <", (width/2-110)*scale, (height/2-4)*scale, 220, "center", 0, scale, scale) + love.graphics.setColor(255, 255, 255, 255) + end + end) + +-- CHANGER functions +local isEnabled = function (self) + if Controller.getSets()[self.setNumber()] and not self.inProgress then + return true + else + return false + end +end +local startChange = function (self) + dimmer:set("visible", true):set("currentControl", "Left") + self.parent.allowMove = false + self.inProgress = true + self.currentKey = 0 + self.newSet = {} +end +local controlreleased = function(self, set, action, key) + if self.inProgress then + if self.currentKey > 0 and self.currentKey < 7 then + table.insert(self.newSet, key) + dimmer:set("currentControl", keys[self.currentKey+1]) + end + if self.currentKey > 5 then + dimmer:set("visible", false) + self.parent.allowMove = true + self.inProgress = false + table.insert(self.newSet, Controller.sets[self.setNumber()][7]) + print(self.newSet[7]) + Settings.change(self.setNumber(), self.newSet[1], self.newSet[2], self.newSet[3], self.newSet[4], self.newSet[5], self.newSet[6], self.newSet[7]) + else + self.currentKey = self.currentKey + 1 + end + end +end + +local a = { + button:new(menu) + :setText("Keyboard 1") + :setPosition(bx,80) + :set("setNumber", function () return 1 end) + :set("isEnabled", isEnabled) + :set("controlreleased", controlreleased) + :set("stopChange", stopChange) + :set("active", startChange) + , + button:new(menu) + :setText("Keyboard 2") + :setPosition(bx,96) + :set("setNumber", function () return 2 end) + :set("isEnabled", isEnabled) + :set("controlreleased", controlreleased) + :set("stopChange", stopChange) + :set("active", startChange) + , + button:new(menu) + :setText("Gamepad 1") + :setPosition(bx,112) + :set("setNumber", function () return 3 end) + :set("isEnabled", isEnabled) + :set("controlreleased", controlreleased) + :set("stopChange", stopChange) + :set("active", startChange) + , + button:new(menu) + :setText("Gamepad 2") + :setPosition(bx,128) + :set("setNumber", function () return 4 end) + :set("isEnabled", isEnabled) + :set("controlreleased", controlreleased) + :set("stopChange", stopChange) + :set("active", startChange) + , button:new(menu) :setText("Go back") - :setPosition(bx,117) + :setPosition(bx,144) :set("active", function (self) self.parent:load("menumain") end) , -} \ No newline at end of file + dimmer +} + +return a \ No newline at end of file -- cgit v1.1