battlesystem: rename menu constructor

This commit is contained in:
Kazhnuz 2019-03-31 12:05:17 +02:00
parent 8a09110ac8
commit eb033c319f

View file

@ -1,9 +1,9 @@
local MenuSystem = Object:extend() local MenuConstructor = Object:extend()
local BaseMenu = {"attack", "techs", "object", "defend", "flee", "back"} 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
function MenuSystem:new( controller ) function MenuConstructor:new( controller )
self.controller = controller self.controller = controller
self.isActive = false self.isActive = false
self.techList = {} self.techList = {}
@ -19,7 +19,7 @@ function MenuSystem:new( controller )
self.view = 1 self.view = 1
end end
function MenuSystem:set(currentCharacter) function MenuConstructor:set(currentCharacter)
self.isActive = true self.isActive = true
self.cursor = 1 self.cursor = 1
self.cursorTransition = 0 self.cursorTransition = 0
@ -32,7 +32,7 @@ function MenuSystem:set(currentCharacter)
end end
function MenuSystem:getSkillList() function MenuConstructor:getSkillList()
local list = game.characters:getSkillList(self.character.charid) local list = game.characters:getSkillList(self.character.charid)
local skillmenu = {} local skillmenu = {}
for k,v in pairs(list) do for k,v in pairs(list) do
@ -44,11 +44,11 @@ function MenuSystem:getSkillList()
return skillmenu return skillmenu
end end
function MenuSystem:unset( ) function MenuConstructor:unset( )
self.isActive = false self.isActive = false
end end
function MenuSystem:update(dt) function MenuConstructor:update(dt)
if (self.isActive) then if (self.isActive) then
local keys = self.controller.keys local keys = self.controller.keys
@ -117,7 +117,7 @@ function MenuSystem:update(dt)
end end
end end
function MenuSystem:sendSignal(menu, id) function MenuConstructor:sendSignal(menu, id)
--print(self.menu[menu][id]) --print(self.menu[menu][id])
self.isActive = false self.isActive = false
if (menu == 1) then if (menu == 1) then
@ -127,7 +127,7 @@ function MenuSystem:sendSignal(menu, id)
end end
end end
function MenuSystem:draw() function MenuConstructor:draw()
if (self.isActive) then if (self.isActive) then
local x, y, addition local x, y, addition
x = 32 x = 32
@ -157,4 +157,4 @@ function MenuSystem:draw()
end end
end end
return MenuSystem return MenuConstructor