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