modules/menusystem: add a way to preserve creation order

This commit is contained in:
Kazhnuz 2019-04-11 17:31:01 +02:00
parent 1061e4822f
commit 05a5f8d877
2 changed files with 5 additions and 0 deletions

View file

@ -112,6 +112,10 @@ function Menu:getWidgetSize(id)
return self.widget.w, self.widget.h return self.widget.w, self.widget.h
end end
function Menu:getWidgetNumber()
return #self.widget.list
end
-- ACTION FUNCTIONS -- ACTION FUNCTIONS
-- Send actions to the widgets -- Send actions to the widgets

View file

@ -46,6 +46,7 @@ end
function BaseWidget:register() function BaseWidget:register()
self.menu:addWidget(self) self.menu:addWidget(self)
self.creationID = self.menu:getWidgetNumber()
end end
function BaseWidget:redrawCanvas() function BaseWidget:redrawCanvas()