parent
f538ffa94a
commit
fccc4a5d8e
11 changed files with 98 additions and 42 deletions
|
@ -129,6 +129,10 @@ function Scene:drawEnd()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Scene:drawOverTransition()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
function Scene:drawWorld(dt)
|
function Scene:drawWorld(dt)
|
||||||
if (self.world ~= nil) then
|
if (self.world ~= nil) then
|
||||||
self.world:draw()
|
self.world:draw()
|
||||||
|
|
|
@ -134,6 +134,7 @@ function SceneManager:draw()
|
||||||
self.currentScene.menusystem:draw()
|
self.currentScene.menusystem:draw()
|
||||||
self.currentScene:drawEnd()
|
self.currentScene:drawEnd()
|
||||||
self.controller.screen:drawTransition()
|
self.controller.screen:drawTransition()
|
||||||
|
self.currentScene:drawOverTransition()
|
||||||
end
|
end
|
||||||
self.controller.screen:cease()
|
self.controller.screen:cease()
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,7 @@ local menu = {}
|
||||||
|
|
||||||
local RadianceListMenu = require "game.modules.menus.fancy"
|
local RadianceListMenu = require "game.modules.menus.fancy"
|
||||||
local Widget = require "core.modules.menusystem.widgets"
|
local Widget = require "core.modules.menusystem.widgets"
|
||||||
|
local defTransitions = require "core.modules.transitions"
|
||||||
|
|
||||||
menu.MainMenu = RadianceListMenu.FancyMenu:extend()
|
menu.MainMenu = RadianceListMenu.FancyMenu:extend()
|
||||||
menu.DebugMenu = RadianceListMenu.FancyMenu:extend()
|
menu.DebugMenu = RadianceListMenu.FancyMenu:extend()
|
||||||
|
@ -61,9 +62,13 @@ end
|
||||||
function menu.SceneWidget:action()
|
function menu.SceneWidget:action()
|
||||||
self.scene:flushKeys()
|
self.scene:flushKeys()
|
||||||
if (self.sceneArgument ~= nil) then
|
if (self.sceneArgument ~= nil) then
|
||||||
self.newScene(self.sceneArgument)
|
core.screen:startTransition(defTransitions.default, defTransitions.default,
|
||||||
|
function() self.newScene(self.sceneArgument) end,
|
||||||
|
0, 0)
|
||||||
else
|
else
|
||||||
self.newScene()
|
core.screen:startTransition(defTransitions.default, defTransitions.default,
|
||||||
|
function() self.newScene() end,
|
||||||
|
0, 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,13 @@ local itemutils = require "game.utils.items"
|
||||||
local gui = require "game.modules.gui"
|
local gui = require "game.modules.gui"
|
||||||
local MenuBack = require "game.modules.gui.menuback"
|
local MenuBack = require "game.modules.gui.menuback"
|
||||||
|
|
||||||
|
local TweenManager = require "game.modules.tweenmanager"
|
||||||
|
|
||||||
function DebugMenu:new()
|
function DebugMenu:new()
|
||||||
DebugMenu.super.new(self)
|
DebugMenu.super.new(self)
|
||||||
self.assets:batchImport("scenes.debug.commons.assets")
|
self.assets:batchImport("scenes.debug.commons.assets")
|
||||||
menu.commons.MainMenu(self, "BaseMenu")
|
menu.commons.MainMenu(self, "BaseMenu")
|
||||||
menu.commons.SceneWidget(self, "BaseMenu", scenes.overworld, "Start playing")
|
menu.StartGameWidget(self, "BaseMenu")
|
||||||
menu.commons.SceneWidget(self, "BaseMenu", scenes.options, "Options")
|
menu.commons.SceneWidget(self, "BaseMenu", scenes.options, "Options")
|
||||||
self:buildDebugMenu()
|
self:buildDebugMenu()
|
||||||
menu.TitleWidget(self, "BaseMenu")
|
menu.TitleWidget(self, "BaseMenu")
|
||||||
|
@ -30,6 +32,7 @@ function DebugMenu:new()
|
||||||
self.backImage = love.graphics.newImage("assets/artworks/back.png")
|
self.backImage = love.graphics.newImage("assets/artworks/back.png")
|
||||||
|
|
||||||
self.back = MenuBack()
|
self.back = MenuBack()
|
||||||
|
self.tweens = TweenManager(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function DebugMenu:buildDebugMenu()
|
function DebugMenu:buildDebugMenu()
|
||||||
|
@ -123,6 +126,7 @@ function DebugMenu:update(dt)
|
||||||
self.menusystem:activate()
|
self.menusystem:activate()
|
||||||
end
|
end
|
||||||
self.back:update(dt)
|
self.back:update(dt)
|
||||||
|
self.tweens:update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
function DebugMenu:addSubMenu(submenu, parent, name, panel, panelArgument)
|
function DebugMenu:addSubMenu(submenu, parent, name, panel, panelArgument)
|
||||||
|
@ -139,14 +143,16 @@ function DebugMenu:draw()
|
||||||
self.back:draw()
|
self.back:draw()
|
||||||
utils.graphics.resetColor()
|
utils.graphics.resetColor()
|
||||||
love.graphics.draw(self.backImage, 0, 0)
|
love.graphics.draw(self.backImage, 0, 0)
|
||||||
|
|
||||||
if (self.menusystem.isActive) then
|
if (self.menusystem.isActive) then
|
||||||
love.graphics.draw(self.borders, 0, self.borderY, 0, 1, -1)
|
|
||||||
love.graphics.draw(self.borders, 424, 240 - self.borderY, 0, -1, 1)
|
|
||||||
|
|
||||||
self.assets.fonts["small"]:print("v" .. game.version, 424 - 8, 240 - 20, "right")
|
|
||||||
|
|
||||||
self.panel:draw(240, 48)
|
self.panel:draw(240, 48)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function DebugMenu:drawOverTransition()
|
||||||
|
love.graphics.draw(self.borders, 0, self.borderY, 0, 1, -1)
|
||||||
|
love.graphics.draw(self.borders, 424, 240 - self.borderY, 0, -1, 1)
|
||||||
|
self.assets.fonts["small"]:draw("v" .. game.version, 424 - 44, 240 + 10 - self.borderY)
|
||||||
|
end
|
||||||
|
|
||||||
return DebugMenu;
|
return DebugMenu;
|
||||||
|
|
|
@ -14,6 +14,22 @@ menu.AddRemoveWidget = listMenu.BaseWidget:extend()
|
||||||
menu.ChangeLeaderWidget = listMenu.BaseWidget:extend()
|
menu.ChangeLeaderWidget = listMenu.BaseWidget:extend()
|
||||||
menu.ItemWidget = listMenu.BaseWidget:extend()
|
menu.ItemWidget = listMenu.BaseWidget:extend()
|
||||||
menu.TitleWidget = listMenu.BaseWidget:extend()
|
menu.TitleWidget = listMenu.BaseWidget:extend()
|
||||||
|
menu.StartGameWidget = listMenu.BaseWidget:extend()
|
||||||
|
|
||||||
|
|
||||||
|
-- TitleWidget
|
||||||
|
function menu.StartGameWidget:new(scene, menuName)
|
||||||
|
local str = "Start game"
|
||||||
|
if (game.exists) then
|
||||||
|
str = "Continue game"
|
||||||
|
end
|
||||||
|
menu.TitleWidget.super.new(self, scene, menuName, str, "")
|
||||||
|
end
|
||||||
|
|
||||||
|
function menu.StartGameWidget:action()
|
||||||
|
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
|
||||||
|
|
||||||
-- TitleWidget
|
-- TitleWidget
|
||||||
function menu.TitleWidget:new(scene, menuName)
|
function menu.TitleWidget:new(scene, menuName)
|
||||||
|
|
|
@ -4,7 +4,7 @@ return {
|
||||||
{"hitGFX", "assets/sprites/gfx/hit"},
|
{"hitGFX", "assets/sprites/gfx/hit"},
|
||||||
},
|
},
|
||||||
["textures"] = {
|
["textures"] = {
|
||||||
{"background", "assets/backgrounds/options.png"}
|
{"background", "assets/artworks/back.png"}
|
||||||
},
|
},
|
||||||
["fonts"] = {
|
["fonts"] = {
|
||||||
{"small", "assets/gui/fonts/PixelOperator.ttf", 16}
|
{"small", "assets/gui/fonts/PixelOperator.ttf", 16}
|
||||||
|
|
|
@ -5,6 +5,7 @@ local OptionMenu = require "scenes.menus.options.menu"
|
||||||
local Widgets = require "scenes.menus.options.widgets"
|
local Widgets = require "scenes.menus.options.widgets"
|
||||||
|
|
||||||
local gui = require "game.modules.gui"
|
local gui = require "game.modules.gui"
|
||||||
|
local MenuBack = require "game.modules.gui.menuback"
|
||||||
|
|
||||||
function OptionsMenu:new()
|
function OptionsMenu:new()
|
||||||
OptionsMenu.super.new(self)
|
OptionsMenu.super.new(self)
|
||||||
|
@ -41,11 +42,11 @@ function OptionsMenu:new()
|
||||||
self.borderY = 30
|
self.borderY = 30
|
||||||
self.borders = gui.newBorder(424, 30, 8)
|
self.borders = gui.newBorder(424, 30, 8)
|
||||||
|
|
||||||
self.timer = 0
|
self.back = MenuBack()
|
||||||
end
|
end
|
||||||
|
|
||||||
function OptionsMenu:update(dt)
|
function OptionsMenu:update(dt)
|
||||||
self.timer = (self.timer + (30 * dt)) % 128
|
self.back:update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- MENU FUNCTION
|
-- MENU FUNCTION
|
||||||
|
@ -96,15 +97,17 @@ function OptionsMenu:keypressed( key )
|
||||||
end
|
end
|
||||||
|
|
||||||
function OptionsMenu:draw()
|
function OptionsMenu:draw()
|
||||||
local w, h = core.screen:getDimensions()
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
for i=-1, (w/128) do
|
love.graphics.rectangle("fill", 0, 0, 424, 240)
|
||||||
for j=-1,(h/128) do
|
self.back:draw()
|
||||||
self.assets.images["background"]:draw(i*128 + self.timer, j*128 + self.timer)
|
utils.graphics.resetColor()
|
||||||
end
|
self.assets.images["background"]:draw(0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function OptionsMenu:drawOverTransition()
|
||||||
love.graphics.draw(self.borders, 0, self.borderY, 0, 1, -1)
|
love.graphics.draw(self.borders, 0, self.borderY, 0, 1, -1)
|
||||||
love.graphics.draw(self.borders, 424, 240 - self.borderY, 0, -1, 1)
|
love.graphics.draw(self.borders, 424, 240 - self.borderY, 0, -1, 1)
|
||||||
|
self.assets.fonts["small"]:draw("v" .. game.version, 424 - 44, 240 + 10 - self.borderY)
|
||||||
end
|
end
|
||||||
|
|
||||||
return OptionsMenu
|
return OptionsMenu
|
||||||
|
|
|
@ -15,6 +15,8 @@ widgets.PlayerSubMenu = RadianceListMenu.DualTextWidget:extend()
|
||||||
widgets.Key = RadianceListMenu.DualTextWidget:extend()
|
widgets.Key = RadianceListMenu.DualTextWidget:extend()
|
||||||
widgets.Audio = RadianceListMenu.DualTextWidget:extend()
|
widgets.Audio = RadianceListMenu.DualTextWidget:extend()
|
||||||
|
|
||||||
|
local defTransitions = require "core.modules.transitions"
|
||||||
|
|
||||||
-- BASIC WIDGETS
|
-- BASIC WIDGETS
|
||||||
-- Simple and reusables widgets
|
-- Simple and reusables widgets
|
||||||
|
|
||||||
|
@ -70,6 +72,9 @@ end
|
||||||
function widgets.Exit:action()
|
function widgets.Exit:action()
|
||||||
self.scene.assets:playSFX("mSelect")
|
self.scene.assets:playSFX("mSelect")
|
||||||
core.scenemanager:setStoredScene("mainmenu")
|
core.scenemanager:setStoredScene("mainmenu")
|
||||||
|
core.screen:startTransition(defTransitions.default, defTransitions.default,
|
||||||
|
function() scenes.debug.menu() end,
|
||||||
|
0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- VIDEO WIDGETS
|
-- VIDEO WIDGETS
|
||||||
|
|
|
@ -114,9 +114,12 @@ function TitleScreen:draw()
|
||||||
love.graphics.setColor(1, 1, 1, self.flashOpacity)
|
love.graphics.setColor(1, 1, 1, self.flashOpacity)
|
||||||
love.graphics.rectangle("fill", 0, 0, 424, 240)
|
love.graphics.rectangle("fill", 0, 0, 424, 240)
|
||||||
utils.graphics.resetColor( )
|
utils.graphics.resetColor( )
|
||||||
|
end
|
||||||
|
|
||||||
|
function TitleScreen:drawOverTransition()
|
||||||
love.graphics.draw(self.borders, 0, self.borderY, 0, 1, -1)
|
love.graphics.draw(self.borders, 0, self.borderY, 0, 1, -1)
|
||||||
love.graphics.draw(self.borders, 424, 240 - self.borderY, 0, -1, 1)
|
love.graphics.draw(self.borders, 424, 240 - self.borderY, 0, -1, 1)
|
||||||
|
self.assets.fonts["small"]:draw("v" .. game.version, 424 - 44, 240 + 10 - self.borderY)
|
||||||
end
|
end
|
||||||
|
|
||||||
return TitleScreen
|
return TitleScreen
|
||||||
|
|
|
@ -58,7 +58,8 @@ function OverWorld:new(area, playerx, playery)
|
||||||
|
|
||||||
self.borders = gui.newBorder(424, 30, 8)
|
self.borders = gui.newBorder(424, 30, 8)
|
||||||
self.emblemPosition = 368
|
self.emblemPosition = 368
|
||||||
self.ringBorder = 16
|
self.ringBorder = -16
|
||||||
|
self.tweens:newTween(0, 0.3, {ringBorder=16}, "inOutQuad")
|
||||||
self.timeBorder = -10
|
self.timeBorder = -10
|
||||||
self.message = "Test de message"
|
self.message = "Test de message"
|
||||||
self.messageOpacity = 0
|
self.messageOpacity = 0
|
||||||
|
@ -174,27 +175,7 @@ function OverWorld:getEmblemsPosition()
|
||||||
end
|
end
|
||||||
|
|
||||||
function OverWorld:draw()
|
function OverWorld:draw()
|
||||||
love.graphics.setColor(0, 0, 0, self.backGroundOpacity)
|
self.events:draw()
|
||||||
love.graphics.rectangle("fill", 0, 0, 424, 240)
|
|
||||||
utils.graphics.resetColor()
|
|
||||||
|
|
||||||
if (self.currentScreen ~= nil) then
|
|
||||||
self.currentScreen:drawBackground()
|
|
||||||
end
|
|
||||||
|
|
||||||
love.graphics.draw(self.borders, 0, self.borderPosition, 0, 1, -1)
|
|
||||||
love.graphics.draw(self.borders, 424, 240 - self.borderPosition, 0, -1, 1)
|
|
||||||
|
|
||||||
self.assets.images["guiRing"]:draw(self.ringBorder, self.ringBorder)
|
|
||||||
local ringString = utils.math.numberToString(game.loot.rings, 3)
|
|
||||||
self.assets.fonts["hudnbrs"]:print(ringString, self.ringBorder + 14, self.ringBorder + 1)
|
|
||||||
|
|
||||||
self.assets.fonts["hudnbrs"]:print(game:getTimeString(), 424 - 16, 240 - self.timeBorder, "right")
|
|
||||||
|
|
||||||
|
|
||||||
if (self.currentScreen ~= nil) then
|
|
||||||
self.currentScreen:drawForeground()
|
|
||||||
end
|
|
||||||
|
|
||||||
love.graphics.setColor(0,0,0, 0.5 * self.messageOpacity)
|
love.graphics.setColor(0,0,0, 0.5 * self.messageOpacity)
|
||||||
love.graphics.rectangle("fill", 0, PLAYER_MESSAGE, 424, 16)
|
love.graphics.rectangle("fill", 0, PLAYER_MESSAGE, 424, 16)
|
||||||
|
@ -204,8 +185,34 @@ function OverWorld:draw()
|
||||||
self.assets.fonts["small"]:setColor(1,1,1, 1)
|
self.assets.fonts["small"]:setColor(1,1,1, 1)
|
||||||
end
|
end
|
||||||
utils.graphics.resetColor()
|
utils.graphics.resetColor()
|
||||||
|
self:drawScreenBottomLayer()
|
||||||
|
end
|
||||||
|
|
||||||
|
function OverWorld:drawOverTransition()
|
||||||
|
self:drawScreenTopLayer()
|
||||||
|
end
|
||||||
|
|
||||||
|
function OverWorld:drawScreenBottomLayer()
|
||||||
|
love.graphics.setColor(0, 0, 0, self.backGroundOpacity)
|
||||||
|
love.graphics.rectangle("fill", 0, 0, 424, 240)
|
||||||
|
utils.graphics.resetColor()
|
||||||
|
|
||||||
|
if (self.currentScreen ~= nil) then
|
||||||
|
self.currentScreen:drawBackground()
|
||||||
|
self.currentScreen:drawForeground()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function OverWorld:drawScreenTopLayer()
|
||||||
|
love.graphics.draw(self.borders, 0, self.borderPosition, 0, 1, -1)
|
||||||
|
love.graphics.draw(self.borders, 424, 240 - self.borderPosition, 0, -1, 1)
|
||||||
|
|
||||||
|
self.assets.images["guiRing"]:draw(self.ringBorder, self.ringBorder)
|
||||||
|
local ringString = utils.math.numberToString(game.loot.rings, 3)
|
||||||
|
self.assets.fonts["hudnbrs"]:print(ringString, self.ringBorder + 14, self.ringBorder + 1)
|
||||||
|
|
||||||
|
self.assets.fonts["hudnbrs"]:print(game:getTimeString(), 424 - 16, 240 - self.timeBorder, "right")
|
||||||
|
|
||||||
self.events:draw()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return OverWorld
|
return OverWorld
|
||||||
|
|
|
@ -12,6 +12,9 @@ local TeamWidget = menu.BaseWidget:extend()
|
||||||
local ViewWidget = menu.BaseWidget:extend()
|
local ViewWidget = menu.BaseWidget:extend()
|
||||||
local SaveExitWidget = menu.BaseWidget:extend()
|
local SaveExitWidget = menu.BaseWidget:extend()
|
||||||
|
|
||||||
|
local defTransitions = require "core.modules.transitions"
|
||||||
|
local radTransitions = require "game.modules.transitions"
|
||||||
|
|
||||||
local const = require "scenes.overworld.screens.mainmenu.const"
|
local const = require "scenes.overworld.screens.mainmenu.const"
|
||||||
|
|
||||||
function PauseScreen:new(scene, menu, widget)
|
function PauseScreen:new(scene, menu, widget)
|
||||||
|
@ -28,7 +31,7 @@ function PauseScreen:setMenu()
|
||||||
ViewWidget(self.scene, "Items", "items")
|
ViewWidget(self.scene, "Items", "items")
|
||||||
menu.BaseWidget(self.scene, "main", "Chao", ">")
|
menu.BaseWidget(self.scene, "main", "Chao", ">")
|
||||||
menu.BaseWidget(self.scene, "main", "Encylopedia", ">")
|
menu.BaseWidget(self.scene, "main", "Encylopedia", ">")
|
||||||
menu.BaseWidget(self.scene, "main", "Options", ">")
|
--menu.BaseWidget(self.scene, "main", "Options", ">")
|
||||||
self.scene.menusystem.menus["main"]:addSubMenu("save", "Save / Exit")
|
self.scene.menusystem.menus["main"]:addSubMenu("save", "Save / Exit")
|
||||||
SaveExitWidget(self.scene, "main", "Resume", false, false)
|
SaveExitWidget(self.scene, "main", "Resume", false, false)
|
||||||
|
|
||||||
|
@ -102,7 +105,10 @@ function SaveExitWidget:action()
|
||||||
game:write()
|
game:write()
|
||||||
end
|
end
|
||||||
if (self.exit) then
|
if (self.exit) then
|
||||||
scenes.debug.menu()
|
|
||||||
|
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")
|
||||||
else
|
else
|
||||||
self.scene:unpause()
|
self.scene:unpause()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue