From a6810abd1c8cc9956cb4b8cc2f00258780eee3a8 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 1 Aug 2017 04:10:11 +0200 Subject: Ingame settings now support changing display modes --- config/menus/settings.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'config/menus') diff --git a/config/menus/settings.lua b/config/menus/settings.lua index 59f9234..7102bea 100644 --- a/config/menus/settings.lua +++ b/config/menus/settings.lua @@ -68,8 +68,29 @@ if background == nil or not background:is(require "not.MenuBackground") then background = require "not.MenuBackground"(menu) end +local displayTypes = {["fullscreen"] = "fullscreen", ["1"] = "1x", ["2"] = "2x", ["3"] = "3x", ["4"] = "4x", ["5"] = "5x"} +local displayButton = Button(menu) +:set("types", displayTypes) +:setText(displayTypes[Settings.current.display]) +:setPosition(bx,64) +:set("enabled", true) +:set("isEnabled", function (self) return self.enabled end) +:set("active", function (self) + self.parent.inputBreakTimer = 0.2 + if Settings.current.display == "fullscreen" then + Settings.current.display = "1" + elseif Settings.current.display == "5" then + Settings.current.display = "fullscreen" + else + Settings.current.display = tostring(tonumber(Settings.current.display) + 1) + end + self:setText(self.types[Settings.current.display]) + Settings.reload() +end) + local a = { background, + displayButton, Button(menu) :setText("Keyboard 1") :setPosition(bx,80) -- cgit v1.1