parent
717d7c57c0
commit
8dbd8b45a8
1 changed files with 31 additions and 4 deletions
|
@ -15,6 +15,7 @@ local CharacterWidget = baseWidget:extend()
|
|||
|
||||
local TeamWidget = menu.BaseWidget:extend()
|
||||
local ViewWidget = menu.BaseWidget:extend()
|
||||
local SaveExitWidget = menu.BaseWidget:extend()
|
||||
|
||||
function PauseScreen:new(scene, menu, widget)
|
||||
self.menuSelected = menu or "main"
|
||||
|
@ -31,15 +32,22 @@ function PauseScreen:setMenu()
|
|||
menu.BaseWidget(self.scene, "main", "Chao", ">")
|
||||
menu.BaseWidget(self.scene, "main", "Encylopedia", ">")
|
||||
menu.BaseWidget(self.scene, "main", "Options", ">")
|
||||
menu.BaseWidget(self.scene, "main", "Save / Exit", ">")
|
||||
menu.BaseWidget(self.scene, "main", "Resume", ">")
|
||||
self.scene.menusystem.menus["main"]:addSubMenu("save", "Save / Exit")
|
||||
SaveExitWidget(self.scene, "main", "Resume", false, false)
|
||||
|
||||
SaveExitWidget(self.scene, "save", "Save game", true, false)
|
||||
SaveExitWidget(self.scene, "save", "Save and exit", true, true)
|
||||
SaveExitWidget(self.scene, "save", "Exit game", false, true)
|
||||
|
||||
self.scene.menusystem.menus["main"]:finalize()
|
||||
|
||||
CharacterMenu(self.scene)
|
||||
for i, name in ipairs(game.characters.team) do
|
||||
CharacterWidget(self.scene, name)
|
||||
end
|
||||
self.scene.menusystem.menus["character"].isLocked = true
|
||||
|
||||
self.scene.menusystem.menus[self.menuSelected]:getFocus()
|
||||
self.scene.menusystem:switchMenu(self.menuSelected)
|
||||
if (self.widgetSelected ~= nil) then
|
||||
self.scene.menusystem.menus[self.menuSelected].widget.selected = self.widgetSelected
|
||||
end
|
||||
|
@ -55,7 +63,7 @@ function CharacterMenu:new(scene)
|
|||
end
|
||||
|
||||
function CharacterMenu:cancelAction()
|
||||
self.scene.menusystem.menus["main"]:getFocus()
|
||||
self.scene.menusystem:switchMenu("main")
|
||||
end
|
||||
|
||||
-- Hero custom widget
|
||||
|
@ -115,4 +123,23 @@ function ViewWidget:action()
|
|||
self.scene.screens.mainmenu[self.nextView](self.scene)
|
||||
end
|
||||
|
||||
-- Save & Exit Widget
|
||||
function SaveExitWidget:new(scene, menu, name, save, exit)
|
||||
SaveExitWidget.super.new(self, scene, menu, name, "")
|
||||
self.exit = exit
|
||||
self.save = save
|
||||
end
|
||||
|
||||
function SaveExitWidget:action()
|
||||
if (self.save) then
|
||||
game:write()
|
||||
end
|
||||
if (self.exit) then
|
||||
scenes.debug.menu()
|
||||
else
|
||||
self.scene:unpause()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return PauseScreen
|
||||
|
|
Loading…
Reference in a new issue