parent
34e2bbead7
commit
ddcd393d2a
13 changed files with 41 additions and 10 deletions
|
@ -70,6 +70,7 @@ function fancy.SubMenuWidget:new(scene, menu_name, newmenu, label)
|
|||
end
|
||||
|
||||
function fancy.SubMenuWidget:action()
|
||||
self.scene.assets:playSFX("mBeep")
|
||||
self.scene.menusystem:switchMenu(self.newmenu)
|
||||
self.scene.menusystem.menus[self.newmenu]:activationAction()
|
||||
end
|
||||
|
|
|
@ -155,6 +155,7 @@ function list.SubMenuWidget:new(scene, menu_name, newmenu, label)
|
|||
end
|
||||
|
||||
function list.SubMenuWidget:action()
|
||||
self.scene.assets:playSFX("mBeep")
|
||||
self.scene.menusystem:switchMenu(self.newmenu)
|
||||
self.scene.menusystem.menus[self.newmenu]:activationAction()
|
||||
end
|
||||
|
|
|
@ -60,6 +60,7 @@ function menu.SceneWidget:new(scene, menuName, newScene, newSceneName, sceneArgu
|
|||
end
|
||||
|
||||
function menu.SceneWidget:action()
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
self.scene:flushKeys()
|
||||
if (self.sceneArgument ~= nil) then
|
||||
core.screen:startTransition(defTransitions.default, defTransitions.default,
|
||||
|
|
|
@ -13,17 +13,19 @@ local TweenManager = require "game.modules.tweenmanager"
|
|||
|
||||
function DebugMenu:new()
|
||||
DebugMenu.super.new(self)
|
||||
self.assets:batchImport("scenes.debug.commons.assets")
|
||||
self.assets:batchImport("scenes.menus.assets")
|
||||
menu.commons.MainMenu(self, "BaseMenu")
|
||||
menu.StartGameWidget(self, "BaseMenu")
|
||||
menu.commons.SceneWidget(self, "BaseMenu", scenes.options, "Options")
|
||||
self:buildDebugMenu()
|
||||
menu.TitleWidget(self, "BaseMenu")
|
||||
self.menusystem.menus["BaseMenu"]:setCancelWidget()
|
||||
menu.ExitWidget(self, "BaseMenu")
|
||||
|
||||
self.menusystem.menus["BaseMenu"]:finalize()
|
||||
self.menusystem:activate()
|
||||
self.menusystem:switchMenu("BaseMenu")
|
||||
self.menusystem:setSoundFromSceneAssets("mBeep")
|
||||
|
||||
self.panel = panels.Gamedata()
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ function menu.StartGameWidget:new(scene, menuName)
|
|||
end
|
||||
|
||||
function menu.StartGameWidget:action()
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
core.screen:startTransition(defTransitions.circle, defTransitions.default, function() scenes.overworld() end, 424/2, 240/2)
|
||||
self.scene.tweens:newTween(0, 0.5, {borderY = 0}, "inOutQuart")
|
||||
end
|
||||
|
@ -37,6 +38,7 @@ function menu.TitleWidget:new(scene, menuName)
|
|||
end
|
||||
|
||||
function menu.TitleWidget:action()
|
||||
self.scene.assets:playSFX("mBack")
|
||||
core.screen:startTransition(defTransitions.circle, radTransitions.borders, function() scenes.title(true) end, 424/2, 240/2)
|
||||
end
|
||||
|
||||
|
@ -46,6 +48,7 @@ function menu.ExitWidget:new(scene, menuName)
|
|||
end
|
||||
|
||||
function menu.ExitWidget:action()
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
love.event.quit("000")
|
||||
end
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ return {
|
|||
{"small", "assets/gui/fonts/PixelOperator.ttf", 16}
|
||||
},
|
||||
["imagefonts"] = {
|
||||
{"medium", "assets/gui/fonts/SA2font"},
|
||||
{"title", "assets/gui/fonts/SA2font"},
|
||||
},
|
||||
["sfx"] = {
|
||||
{"mBack", "assets/sfx/menus/back.wav"},
|
|
@ -10,7 +10,7 @@ local MenuBack = require "game.modules.gui.menuback"
|
|||
function OptionsMenu:new()
|
||||
OptionsMenu.super.new(self)
|
||||
|
||||
self.assets:batchImport("scenes.menus.options.assets")
|
||||
self.assets:batchImport("scenes.menus.assets")
|
||||
self:addMenu("main", true)
|
||||
self:addSubMenu("video", "Video")
|
||||
self:addSubMenu("audio", "Audio")
|
||||
|
|
|
@ -37,9 +37,8 @@ function TitleScreen:new(fromMenu)
|
|||
local fromMenu = (fromMenu == true)
|
||||
|
||||
self.borders = gui.newBorder(424, 30, 8)
|
||||
self.assets:batchImport("scenes.menus.assets")
|
||||
self.assets:addImage("logo", "assets/artworks/logo.png")
|
||||
self.assets:addImageFont("menu", "assets/gui/fonts/SA2font")
|
||||
self.assets:addFont("small", "assets/gui/fonts/PixelOperator.ttf", 16)
|
||||
self.assets:addTileset("charicons", "assets/sprites/characters/charicons")
|
||||
self.assets.fonts["small"]:setLineHeight(16/18)
|
||||
self.assets.fonts["small"]:setFilter("shadow")
|
||||
|
@ -87,8 +86,10 @@ function TitleScreen:update(dt)
|
|||
|
||||
local keys = self:getKeys(1)
|
||||
if (keys["start"].isPressed and (self.haveMenu == false)) then
|
||||
self.assets:playSFX("mSelect")
|
||||
Menu(self)
|
||||
self.haveMenu = true
|
||||
self.menusystem:setSoundFromSceneAssets("mBeep")
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -107,8 +108,8 @@ function TitleScreen:draw()
|
|||
self.assets:drawImage("logo", 240 - 32, 80 - self.logoX, 0, 1, 1, w/2, h/2)
|
||||
|
||||
if (self.canShowPressStart) and (self.showPressStart) then
|
||||
local w = self.assets.fonts["menu"]:getWidth("PRESS START")
|
||||
self.assets.fonts["menu"]:print("PRESS START", 424/2, 240/1.33, "center", 0, 1, 1)
|
||||
local w = self.assets.fonts["title"]:getWidth("PRESS START")
|
||||
self.assets.fonts["title"]:print("PRESS START", 424/2, 240/1.33, "center", 0, 1, 1)
|
||||
end
|
||||
|
||||
love.graphics.setColor(1, 1, 1, self.flashOpacity)
|
||||
|
|
|
@ -24,6 +24,7 @@ function SaveMenu:new(scene)
|
|||
end
|
||||
|
||||
function SaveMenu:cancelAction()
|
||||
self.scene.assets:playSFX("mBack")
|
||||
self.scene.menusystem:reset()
|
||||
self.scene.haveMenu = false
|
||||
end
|
||||
|
@ -61,6 +62,7 @@ function SaveWidget:drawCanvas()
|
|||
end
|
||||
|
||||
function SaveWidget:action()
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
game:read(self.saveid)
|
||||
core.screen:startTransition(radTransitions.borders, defTransitions.circle, function() scenes.debug.menu() end, 424/2, 240/2)
|
||||
end
|
||||
|
|
|
@ -86,6 +86,7 @@ function ReturnWidget:action()
|
|||
self.widgetSelected = i
|
||||
end
|
||||
end
|
||||
self.scene.assets:playSFX("mBack")
|
||||
|
||||
self.scene.screens.mainmenu["pause"](self.scene, "character", self.widgetSelected)
|
||||
end
|
||||
|
|
|
@ -66,6 +66,7 @@ function ItemsScreen:setMenu(widgetId)
|
|||
self.scene.menusystem.menus["menu"].isLocked = true
|
||||
self.scene.menusystem.menus["menu"].widget.selected = math.max(1, self.widgetIndex)
|
||||
self.scene.menusystem.menus["menu"].cursorTransition = math.max(0, self.widgetIndex - 1)
|
||||
self.scene.menusystem:setSoundFromSceneAssets("mBeep")
|
||||
end
|
||||
|
||||
function ItemsScreen:setUseMenu(item, widgetId)
|
||||
|
@ -151,6 +152,7 @@ function ItemWidget:selectAction()
|
|||
end
|
||||
|
||||
function ItemWidget:action()
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
self.scene.currentScreen:setUseMenu(self.item, self.widgetId)
|
||||
end
|
||||
|
||||
|
@ -164,6 +166,7 @@ function BackWidget:selectAction()
|
|||
end
|
||||
|
||||
function BackWidget:action()
|
||||
self.scene.assets:playSFX("mBack")
|
||||
self.scene.screens.mainmenu["pause"](self.scene, "main", 3)
|
||||
end
|
||||
|
||||
|
@ -183,6 +186,9 @@ end
|
|||
function UseWidget:action()
|
||||
if (self.itemData.usableOnMap) then
|
||||
self.scene.screens.mainmenu["useItems"](self.scene, self.pocket, self.item, self.widgetId)
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
else
|
||||
self.scene.assets:playSFX("mError")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -219,6 +225,7 @@ function DropWidget:updateSelected()
|
|||
end
|
||||
|
||||
function DropWidget:action()
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
game.loot:removeItem(self.pocket, self.item.name, self.number)
|
||||
self.scene.currentScreen.widgetIndex = self.widgetId
|
||||
self.scene.currentScreen:removeUseMenu()
|
||||
|
@ -230,6 +237,7 @@ function ResumeWidget:new(scene)
|
|||
end
|
||||
|
||||
function ResumeWidget:action()
|
||||
self.scene.assets:playSFX("mBack")
|
||||
self.scene.currentScreen:removeUseMenu()
|
||||
end
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ function PauseScreen:setMenu()
|
|||
self.scene.menusystem.menus[self.menuSelected].widget.selected = self.widgetSelected
|
||||
self.scene.menusystem.menus[self.menuSelected].cursorTransition = self.widgetSelected - 1
|
||||
end
|
||||
self.scene.menusystem:setSoundFromSceneAssets("mBeep")
|
||||
end
|
||||
|
||||
function PauseScreen:draw()
|
||||
|
@ -62,12 +63,14 @@ end
|
|||
|
||||
-- Character menu
|
||||
function CharacterMenu:cancelAction()
|
||||
self.scene.assets:playSFX("mBeep")
|
||||
self.scene.menusystem:switchMenu("main")
|
||||
end
|
||||
|
||||
-- Hero custom widget
|
||||
--
|
||||
function CharacterWidget:action()
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
self.scene.screens.mainmenu.character(self.scene, self.charName)
|
||||
end
|
||||
|
||||
|
@ -79,6 +82,7 @@ function TeamWidget:new(scene)
|
|||
end
|
||||
|
||||
function TeamWidget:action()
|
||||
self.scene.assets:playSFX("mBeep")
|
||||
self.scene.menusystem.menus["character"]:getFocus()
|
||||
end
|
||||
|
||||
|
@ -89,6 +93,7 @@ function ViewWidget:new(scene, name, view)
|
|||
end
|
||||
|
||||
function ViewWidget:action()
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
self.scene.screens.mainmenu[self.nextView](self.scene)
|
||||
end
|
||||
|
||||
|
@ -100,12 +105,16 @@ function SaveExitWidget:new(scene, menu, name, save, exit)
|
|||
end
|
||||
|
||||
function SaveExitWidget:action()
|
||||
if (self.save or self.exit) then
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
else
|
||||
self.scene.assets:playSFX("mBack")
|
||||
end
|
||||
if (self.save) then
|
||||
self.scene.world:savePosition()
|
||||
game:write()
|
||||
end
|
||||
if (self.exit) then
|
||||
|
||||
core.screen:startTransition(defTransitions.default, defTransitions.circle, function() scenes.debug.menu() end, 424/2, 240/2)
|
||||
self.scene.tweens:newTween(0, 0.3, {ringBorder=-16}, "inOutQuad")
|
||||
self.scene.tweens:newTween(0, 0.3, {timeBorder=-20}, "inOutQuad")
|
||||
|
|
|
@ -77,12 +77,14 @@ end
|
|||
-- Character menu
|
||||
function CharacterMenu:cancelAction()
|
||||
-- Switch à l'écran précédant
|
||||
self.scene.assets:playSFX("mBack")
|
||||
self.scene.currentScreen:goBack()
|
||||
end
|
||||
|
||||
-- Hero custom widget
|
||||
--
|
||||
function CharacterWidget:action()
|
||||
self.scene.assets:playSFX("mSelect")
|
||||
self.scene.currentScreen:useItem(self.charName)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue