sonic-radiance/sonic-radiance.love/scenes/menus/options/init.lua

35 lines
837 B
Lua
Raw Normal View History

local Scene = require "game.scenes"
2020-08-01 16:06:08 +02:00
local OptionsMenu = Scene:extend()
2020-08-16 09:54:11 +02:00
local OptionMenu = require "scenes.menus.options.menu"
2020-08-01 16:06:08 +02:00
local gui = require "game.modules.gui"
local MenuBack = require "game.modules.gui.menuback"
2020-08-01 16:06:08 +02:00
function OptionsMenu:new()
OptionsMenu.super.new(self, true, true)
2020-08-01 16:06:08 +02:00
self.keyDetector = {}
self.keyDetector.widget = nil
OptionMenu()
MenuBack()
2020-08-01 16:06:08 +02:00
end
function OptionsMenu:changeKey(widget)
self.keyDetector.widget = widget
end
function OptionsMenu:keypressed( key )
if (self.keyDetector.widget ~= nil) then
self.assets:playSFX("mSelect")
self.gui.elements["optionMenu"].isVisible = true
self.gui:delayFocus("optionMenu", 0.1)
2020-08-01 16:06:08 +02:00
self.keyDetector.widget:receiveKey( key )
self.keyDetector.isActive = false
self.keyDetector.widget = nil
2020-08-01 16:06:08 +02:00
end
end
return OptionsMenu