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
|
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
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue