Ajout des derniers développement #1

Merged
kazhnuz merged 68 commits from chronicles-cbs into master 2020-08-02 11:14:18 +02:00
3 changed files with 14 additions and 14 deletions
Showing only changes of commit 0984ce370e - Show all commits

View file

@ -6,6 +6,7 @@ local Widget = require "core.modules.menusystem.widgets"
menu.DebugMenu = ListBox:extend() menu.DebugMenu = ListBox:extend()
menu.DebugWidget = Widget.Text:extend() menu.DebugWidget = Widget.Text:extend()
menu.SubMenuWidget = menu.DebugWidget:extend() menu.SubMenuWidget = menu.DebugWidget:extend()
menu.SceneWidget = menu.DebugWidget:extend()
local CONST = {} local CONST = {}
CONST.MENU = {} CONST.MENU = {}
@ -56,5 +57,15 @@ function menu.SubMenuWidget:action()
self.scene.menusystem:switchMenu(self.newmenu) self.scene.menusystem:switchMenu(self.newmenu)
end end
-- SceneWidget
function menu.SceneWidget:new(scene, menuName, newScene, newSceneName)
menu.SceneWidget.super.new(self, scene, menuName, newSceneName)
self.newScene = newScene
end
function menu.SceneWidget:action()
self.newScene()
end
return menu return menu

View file

@ -7,7 +7,7 @@ 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.DebugMenu(self, "BaseMenu") menu.commons.DebugMenu(self, "BaseMenu")
menu.SceneWidget(self, "BaseMenu", scenes.title, "Launch Game") menu.commons.SceneWidget(self, "BaseMenu", scenes.title, "Launch Game")
self:buildBattleMenu() self:buildBattleMenu()
self:buildOverworldMenu() self:buildOverworldMenu()
self:buildSaveMenu() self:buildSaveMenu()
@ -35,7 +35,7 @@ end
function DebugMenu:buildBattleMenu() function DebugMenu:buildBattleMenu()
self:addSubMenu("combat", "BaseMenu", "Battle System") self:addSubMenu("combat", "BaseMenu", "Battle System")
menu.SceneWidget(self, "combat", scenes.cbs, "Launch Battle") menu.commons.SceneWidget(self, "combat", scenes.cbs, "Launch Battle")
menu.commons.SubMenuWidget(self, "combat", "BaseMenu", "Back") menu.commons.SubMenuWidget(self, "combat", "BaseMenu", "Back")
end end
@ -47,7 +47,7 @@ end
function DebugMenu:buildOtherMenu() function DebugMenu:buildOtherMenu()
self:addSubMenu("other", "BaseMenu", "Other gameplay") self:addSubMenu("other", "BaseMenu", "Other gameplay")
menu.SceneWidget(self, "other", scenes.test, "Minigame Engine") menu.commons.SceneWidget(self, "other", scenes.test, "Minigame Engine")
menu.commons.SubMenuWidget(self, "other", "BaseMenu", "Back") menu.commons.SubMenuWidget(self, "other", "BaseMenu", "Back")
end end

View file

@ -3,7 +3,6 @@ local menu = {}
menu.commons = commons menu.commons = commons
menu.ExitWidget = commons.DebugWidget:extend() menu.ExitWidget = commons.DebugWidget:extend()
menu.ShowBackgroundWidget = commons.DebugWidget:extend() menu.ShowBackgroundWidget = commons.DebugWidget:extend()
menu.SceneWidget = commons.DebugWidget:extend()
-- ExitWidget -- ExitWidget
function menu.ExitWidget:new(scene, menuName) function menu.ExitWidget:new(scene, menuName)
@ -23,14 +22,4 @@ function menu.ShowBackgroundWidget:action()
self.scene.menusystem:deactivate() self.scene.menusystem:deactivate()
end end
-- SceneWidget
function menu.SceneWidget:new(scene, menuName, newScene, newSceneName)
menu.SceneWidget.super.new(self, scene, menuName, newSceneName)
self.newScene = newScene
end
function menu.SceneWidget:action()
self.newScene()
end
return menu return menu