2021-08-21 17:00:42 +02:00
|
|
|
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"
|
2021-04-05 14:20:25 +02:00
|
|
|
local MenuBack = require "game.modules.gui.menuback"
|
2020-08-01 16:32:09 +02:00
|
|
|
|
2020-08-01 16:06:08 +02:00
|
|
|
function OptionsMenu:new()
|
2021-09-16 20:59:57 +02:00
|
|
|
OptionsMenu.super.new(self, true, true)
|
2020-08-01 16:06:08 +02:00
|
|
|
|
|
|
|
self.keyDetector = {}
|
|
|
|
self.keyDetector.widget = nil
|
2020-08-01 16:32:09 +02:00
|
|
|
|
2021-09-16 20:59:57 +02:00
|
|
|
OptionMenu()
|
|
|
|
MenuBack()
|
2020-08-01 16:06:08 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function OptionsMenu:changeKey(widget)
|
|
|
|
self.keyDetector.widget = widget
|
|
|
|
end
|
|
|
|
|
|
|
|
function OptionsMenu:keypressed( key )
|
2021-09-16 20:59:57 +02:00
|
|
|
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
|
2021-09-16 20:59:57 +02:00
|
|
|
self.keyDetector.widget = nil
|
2020-08-01 16:06:08 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return OptionsMenu
|