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
end
function Menu:getWidgetNumber()
return #self.widget.list
end
-- ACTION FUNCTIONS
-- Send actions to the widgets

View file

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