diff --git a/sonic-radiance.love/main.lua b/sonic-radiance.love/main.lua index 3b334a3..74204c2 100644 --- a/sonic-radiance.love/main.lua +++ b/sonic-radiance.love/main.lua @@ -27,10 +27,13 @@ local Game = require "game" scenes = require "scenes" function love.load() - core = Core(true) + core = Core(false) game = Game() - - scenes.debug.menu() + if (core.debug.active) then + scenes.debug.menu() + else + scenes.title() + end end function love.update(dt) diff --git a/sonic-radiance.love/scenes/debug/menu/builders/debugmenu.lua b/sonic-radiance.love/scenes/debug/menu/builders/debugmenu.lua new file mode 100644 index 0000000..e69de29 diff --git a/sonic-radiance.love/scenes/debug/menu/builders/mainmenu.lua b/sonic-radiance.love/scenes/debug/menu/builders/mainmenu.lua new file mode 100644 index 0000000..e69de29 diff --git a/sonic-radiance.love/scenes/debug/menu/builders/parent.lua b/sonic-radiance.love/scenes/debug/menu/builders/parent.lua new file mode 100644 index 0000000..e69de29 diff --git a/sonic-radiance.love/scenes/debug/menu/infopanel/parent.lua b/sonic-radiance.love/scenes/debug/menu/infopanel/parent.lua index 5fb56a4..cce8114 100644 --- a/sonic-radiance.love/scenes/debug/menu/infopanel/parent.lua +++ b/sonic-radiance.love/scenes/debug/menu/infopanel/parent.lua @@ -6,8 +6,10 @@ function ParentPanel:new() end function ParentPanel:draw(x, y, w, h) - love.graphics.draw(self.panelBackground, x, y) - self:drawContent(x+8, y+8) + if (core.debug.active) then + love.graphics.draw(self.panelBackground, x, y) + self:drawContent(x+8, y+8) + end end function ParentPanel:drawContent(x, y) diff --git a/sonic-radiance.love/scenes/debug/menu/init.lua b/sonic-radiance.love/scenes/debug/menu/init.lua index f3b3163..421ebe9 100644 --- a/sonic-radiance.love/scenes/debug/menu/init.lua +++ b/sonic-radiance.love/scenes/debug/menu/init.lua @@ -6,16 +6,16 @@ local panels = require "scenes.debug.menu.infopanel" local battleutils = require "game.utils.battle" local itemutils = require "game.utils.items" +local gui = require "game.modules.gui" + function DebugMenu:new() DebugMenu.super.new(self) self.assets:batchImport("scenes.debug.commons.assets") menu.commons.DebugMenu(self, "BaseMenu") - menu.commons.SceneWidget(self, "BaseMenu", scenes.title, "Launch Game") - self:buildBattleMenu() - self:buildOverworldMenu() - self:buildSaveMenu() - self:buildOtherMenu() + menu.commons.SceneWidget(self, "BaseMenu", scenes.overworld, "Start playing") menu.commons.SceneWidget(self, "BaseMenu", scenes.options, "Options") + self:buildDebugMenu() + menu.commons.SceneWidget(self, "BaseMenu", scenes.title, "Return to title") menu.ExitWidget(self, "BaseMenu") self.menusystem.menus["BaseMenu"]:finalize() @@ -25,13 +25,23 @@ function DebugMenu:new() self.panel = panels.Gamedata() end +function DebugMenu:buildDebugMenu() + if (core.debug.active) then + self:addSubMenu("debug", "BaseMenu", "Debug Menu") + self:buildBattleMenu() + --self:buildOverworldMenu() + self:buildSaveMenu() + self:buildOtherMenu() + end +end + function DebugMenu:buildOverworldMenu() - self:addSubMenu("overworld", "BaseMenu", "Overworld") + self:addSubMenu("overworld", "debug", "Overworld") menu.commons.SceneWidget(self, "overworld", scenes.overworld, "Launch Overworld") end function DebugMenu:buildBattleMenu() - self:addSubMenu("combat", "BaseMenu", "Battle System") + self:addSubMenu("combat", "debug", "Battle System") self:addSubMenu("launchBattle", "combat", "Launch Battle") local listCat = battleutils.listCategories() @@ -54,7 +64,7 @@ function DebugMenu:addBattles(battleCat) end function DebugMenu:buildSaveMenu() - self:addSubMenu("save", "BaseMenu", "Save System", panels.Gamedata, nil) + self:addSubMenu("save", "debug", "Save System", panels.Gamedata, nil) self:addSubMenu("characters", "save", "Characters", panels.Gamedata, nil) self:addSubMenu("team", "save", "Team Formation", panels.Team, nil) menu.ChangeLeaderWidget(self, "team") @@ -88,7 +98,7 @@ function DebugMenu:addInventory() end function DebugMenu:buildOtherMenu() - self:addSubMenu("other", "BaseMenu", "Other gameplay") + self:addSubMenu("other", "debug", "Other gameplay") self:addSubMenu("battle", "other", "Sonic Battle Maps") local mapList = require "datas.gamedata.maps.battle" for i, name in ipairs(mapList) do @@ -117,8 +127,8 @@ end function DebugMenu:draw() if (self.menusystem.isActive) then - self.assets.fonts["small"]:print("## SONIC RADIANCE - DEBUG MENU ##", 424/2, 8, "center") - self.assets.fonts["small"]:print("v" .. game.version, 424 - 8, 240 - 22, "right") + self.assets.fonts["small"]:print("## SONIC RADIANCE - MAIN MENU ##", 424/2, 8, "center") + self.assets.fonts["small"]:print("v" .. game.version, 424 - 8, 240 - 20, "right") self.panel:draw(240, 48) end