modules/menusystem: add a way to preserve creation order
This commit is contained in:
parent
1061e4822f
commit
05a5f8d877
2 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ end
|
|||
|
||||
function BaseWidget:register()
|
||||
self.menu:addWidget(self)
|
||||
self.creationID = self.menu:getWidgetNumber()
|
||||
end
|
||||
|
||||
function BaseWidget:redrawCanvas()
|
||||
|
|
Loading…
Reference in a new issue