battlesystem: stop using a list to generate the main menu

This commit is contained in:
Kazhnuz 2019-03-31 17:11:32 +02:00
parent 6b57d4ccce
commit a23e38fe31

View file

@ -7,8 +7,6 @@ local CharacterMenu = ListBox:extend()
local CharMenuWidget = Widget.Text:extend() local CharMenuWidget = Widget.Text:extend()
local SubMenuWidget = CharMenuWidget:extend() local SubMenuWidget = CharMenuWidget:extend()
local BaseMenu = {"attack", "techs", "object", "defend", "flee", "back"}
local MENUPOS_X1, MENUPOS_X2, MENUPOS_Y = 32, 32, 110 local MENUPOS_X1, MENUPOS_X2, MENUPOS_Y = 32, 32, 110
local MENU_WIDTH, MENU_ITEM_HEIGHT = 112, 17 local MENU_WIDTH, MENU_ITEM_HEIGHT = 112, 17
local MENU_ITEM_NUMBER = 6 local MENU_ITEM_NUMBER = 6
@ -31,9 +29,12 @@ end
function MenuConstructor:buildBaseMenu(character) function MenuConstructor:buildBaseMenu(character)
CharacterMenu(self.controller, "BaseMenu", MENUPOS_X1 - 16, MENUPOS_Y) CharacterMenu(self.controller, "BaseMenu", MENUPOS_X1 - 16, MENUPOS_Y)
for i,v in ipairs(BaseMenu) do CharMenuWidget(self.controller, "BaseMenu", "Attaquer", "", character)
CharMenuWidget(self.controller, "BaseMenu", v, "", character) CharMenuWidget(self.controller, "BaseMenu", "Techniques", "", character)
end CharMenuWidget(self.controller, "BaseMenu", "Objets", "", character)
CharMenuWidget(self.controller, "BaseMenu", "Défendre", "", character)
CharMenuWidget(self.controller, "BaseMenu", "Fuite", "", character)
CharMenuWidget(self.controller, "BaseMenu", "Retour", "", character)
self.controller.menusystem.menus["BaseMenu"]:setCancelWidget() self.controller.menusystem.menus["BaseMenu"]:setCancelWidget()
end end