2020-08-03 11:50:39 +02:00
|
|
|
local Scene = require "core.modules.scenes"
|
|
|
|
local menu = require "scenes.debug.viewers.choregraphy.menu"
|
|
|
|
|
|
|
|
local ChoregraphyViewer = Scene:extend()
|
|
|
|
|
|
|
|
local World = require "scenes.battlesystem.world"
|
2020-08-03 17:59:44 +02:00
|
|
|
local Fighter = require "scenes.debug.viewers.choregraphy.mocks.fighter"
|
2020-08-03 11:50:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
function ChoregraphyViewer:new()
|
|
|
|
ChoregraphyViewer.super.new(self)
|
|
|
|
self.assets:batchImport("scenes.battlesystem.assets")
|
|
|
|
self.world = World(self)
|
|
|
|
|
|
|
|
self:buildMenu()
|
2020-08-03 17:59:44 +02:00
|
|
|
self:buildMocks()
|
2020-08-03 11:50:39 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- MENU FUNCTIONS
|
|
|
|
function ChoregraphyViewer:buildMenu()
|
|
|
|
menu.commons.DebugMenu(self, "MainMenu")
|
|
|
|
|
|
|
|
self:buildCharacterMenu()
|
|
|
|
|
|
|
|
self.menusystem:activate()
|
|
|
|
self.menusystem:switchMenu("MainMenu")
|
|
|
|
menu.commons.SceneWidget(self, "MainMenu", scenes.debug.menu, "Back")
|
|
|
|
end
|
|
|
|
|
|
|
|
function ChoregraphyViewer:buildCharacterMenu()
|
2020-08-04 12:27:33 +02:00
|
|
|
self:addSubMenu("characters", "MainMenu", "Rivals")
|
2020-08-03 11:50:39 +02:00
|
|
|
for k, character in pairs(game.characters.list) do
|
|
|
|
self:addSubMenu(k, "characters", character.fullname)
|
|
|
|
menu.HeroChoregraphyWidget(self, k, game.skills:getSkillData("attack"))
|
|
|
|
self:buildSkillMenu(k)
|
|
|
|
menu.commons.SubMenuWidget(self, k, "characters", "Back")
|
|
|
|
end
|
|
|
|
menu.commons.SubMenuWidget(self, "characters", "MainMenu", "Back")
|
|
|
|
end
|
|
|
|
|
|
|
|
function ChoregraphyViewer:buildSkillMenu(charName)
|
|
|
|
local skillList = require("datas.gamedata.characters." .. charName .. ".skills")
|
|
|
|
local skillTreated = {}
|
|
|
|
for i,skill in ipairs(skillList) do
|
|
|
|
local skillName = skill[1]
|
|
|
|
if (skillTreated[skillName] ~= true) then
|
|
|
|
skillTreated[skillName] = true
|
|
|
|
if (game.skills:skillDataExists(skillName)) then
|
|
|
|
menu.HeroChoregraphyWidget(self, charName, game.skills:getSkillData(skillName))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function ChoregraphyViewer:addSubMenu(submenu, parent, name)
|
|
|
|
local parent = parent or "MainMenu"
|
|
|
|
menu.commons.DebugMenu(self, submenu)
|
|
|
|
menu.commons.SubMenuWidget(self, parent, submenu, name .. " >")
|
|
|
|
end
|
|
|
|
|
|
|
|
-- MOCKS FUNCTIONS
|
2020-08-03 17:59:44 +02:00
|
|
|
function ChoregraphyViewer:buildMocks()
|
|
|
|
self.fighter = Fighter(self)
|
2020-08-03 11:50:39 +02:00
|
|
|
end
|
|
|
|
|
2020-08-03 17:59:44 +02:00
|
|
|
function ChoregraphyViewer:playHeroChoregraphy(character, data)
|
|
|
|
self.fighter:playHeroChoregraphy(character, data)
|
|
|
|
end
|
2020-08-03 11:50:39 +02:00
|
|
|
|
2020-08-03 17:59:44 +02:00
|
|
|
-- OTHER
|
|
|
|
function ChoregraphyViewer:update(dt)
|
|
|
|
self.fighter:update(dt)
|
|
|
|
self.world:update(dt)
|
2020-08-03 11:50:39 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function ChoregraphyViewer:draw()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return ChoregraphyViewer
|