core/menusystem: don't use the variable "controller" for menus

This commit is contained in:
Kazhnuz 2019-02-11 19:53:34 +01:00
parent dbfe4747f9
commit db74b15d78
5 changed files with 11 additions and 11 deletions

View file

@ -3,8 +3,8 @@ local Menu = require(cwd .. "parent")
FlowBox = Menu:extend()
function FlowBox:new(controller, name, x, y, w, h, slots_hor, slots_vert)
ListBox.super.new(self, controller, name, x, y, w, h)
function FlowBox:new(menusystem, name, x, y, w, h, slots_hor, slots_vert)
ListBox.super.new(self, menusystem, name, x, y, w, h)
self.slots = slots_hor * slots_vert
self.slots_hor = slots_hor
self.slots_vert = slots_vert

View file

@ -4,8 +4,8 @@ local Menu = require(cwd .. "parent")
GridBox = Menu:extend()
function GridBox:new(controller, name, x, y, w, h, slots_hor, slots_vert)
ListBox.super.new(self, controller, name, x, y, w, h)
function GridBox:new(menusystem, name, x, y, w, h, slots_hor, slots_vert)
ListBox.super.new(self, menusystem, name, x, y, w, h)
self.slots = slots_hor * slots_vert
self.slots_hor = slots_hor
self.slots_vert = slots_vert

View file

@ -3,8 +3,8 @@ local Menu = require(cwd .. "parent")
ListBox = Menu:extend()
function ListBox:new(controller, name, x, y, w, h, slots)
ListBox.super.new(self, controller, name, x, y, w, h)
function ListBox:new(menusystem, name, x, y, w, h, slots)
ListBox.super.new(self, menusystem, name, x, y, w, h)
self.slots = slots
self.begin = 1
self.h = slots * self.widget.h -- On fait en sorte que la hauteur

View file

@ -1,7 +1,7 @@
local Menu = Object:extend()
function Menu:new(controller, name, x, y, w, h)
self.controller = controller
function Menu:new(menusystem, name, x, y, w, h)
self.menusystem = menusystem
self.name = name
self.x = x
@ -33,7 +33,7 @@ function Menu:new(controller, name, x, y, w, h)
end
function Menu:register()
self.controller:addMenu(self.name, self)
self.menusystem:addMenu(self.name, self)
end
function Menu:setCancelWidget(id)

View file

@ -3,8 +3,8 @@ local Menu = require(cwd .. "parent")
local TextMenu = Menu:extend()
function TextMenu:new(controller, name, x, y, font, slots)
TextMenu.super.new(self, controller, name, x, y, 0, 0)
function TextMenu:new(menusystem, name, x, y, font, slots)
TextMenu.super.new(self, menusystem, name, x, y, 0, 0)
self.ox = x
self.oy = y
self.font = font