battlesystem: create builder for skill menu
This commit is contained in:
parent
d77dc0057c
commit
5ab143e5f4
1 changed files with 18 additions and 6 deletions
|
@ -32,22 +32,23 @@ function MenuConstructor:buildBaseMenu(character)
|
|||
for i,v in ipairs(BaseMenu) do
|
||||
CharMenuWidget(self.controller, "BaseMenu", v, "", character)
|
||||
end
|
||||
|
||||
self.controller.menusystem.menus["BaseMenu"]:setCancelWidget()
|
||||
end
|
||||
|
||||
function MenuConstructor:set(currentCharacter)
|
||||
self:reconstruct(currentCharacter)
|
||||
end
|
||||
|
||||
function MenuConstructor:getSkillList()
|
||||
function MenuConstructor:buildSkillMenu()
|
||||
CharacterMenu(self.controller, "SkillMenu", MENUPOS_X1 - 16, MENUPOS_Y)
|
||||
local list = game.characters:getSkillList(self.character.charid)
|
||||
local skillmenu = {}
|
||||
for k,v in pairs(list) do
|
||||
table.insert(skillmenu, k)
|
||||
CharMenuWidget(self.controller, "SkillMenu", k, "", character)
|
||||
end
|
||||
CharMenuWidget(self.controller, "Back", v, "", character)
|
||||
|
||||
table.insert(skillmenu, "back")
|
||||
|
||||
return skillmenu
|
||||
self.controller.menusystem.menus["SkillMenu"]:setCancelWidget()
|
||||
end
|
||||
|
||||
function MenuConstructor:unset( )
|
||||
|
@ -135,4 +136,15 @@ function CharMenuWidget:action()
|
|||
self.scene.menusystem:reset()
|
||||
end
|
||||
|
||||
-- Submenu Widget
|
||||
|
||||
function SubMenuWidget:new(scene, menu_name, label, newmenu, character)
|
||||
SubMenuWidget.super.new(self, scene, menu_name, label, "", character)
|
||||
self.newmenu = newmenu or "BaseMenu"
|
||||
end
|
||||
|
||||
function SubMenuWidget:action()
|
||||
self.scene.menusystem:switchMenu(newmenu)
|
||||
end
|
||||
|
||||
return MenuConstructor
|
||||
|
|
Loading…
Reference in a new issue