feat(core/menusystem): make work the selectAction
This commit is contained in:
parent
42837c6fbd
commit
76eb9b1482
5 changed files with 14 additions and 0 deletions
|
@ -55,6 +55,7 @@ end
|
|||
|
||||
function FlowBox:update(dt)
|
||||
self:updateView()
|
||||
self:updateSelectedWidget(dt)
|
||||
end
|
||||
|
||||
function FlowBox:updateView()
|
||||
|
|
|
@ -140,6 +140,7 @@ end
|
|||
|
||||
function GridBox:update(dt)
|
||||
self.view.firstSlot = 1
|
||||
self:updateSelectedWidget(dt)
|
||||
end
|
||||
|
||||
-- KEYS FUNCTIONS
|
||||
|
|
|
@ -50,6 +50,7 @@ end
|
|||
|
||||
function HListBox:update(dt)
|
||||
self:updateView()
|
||||
self:updateSelectedWidget(dt)
|
||||
end
|
||||
|
||||
function HListBox:updateView()
|
||||
|
|
|
@ -50,6 +50,7 @@ end
|
|||
|
||||
function ListBox:update(dt)
|
||||
self:updateView()
|
||||
self:updateSelectedWidget(dt)
|
||||
end
|
||||
|
||||
function ListBox:updateView()
|
||||
|
|
|
@ -158,6 +158,16 @@ end
|
|||
|
||||
function Menu:update(dt)
|
||||
-- Cette fonction ne contient rien par défaut
|
||||
self:updateSelectedWidget(dt)
|
||||
end
|
||||
|
||||
function Menu:updateSelectedWidget(dt)
|
||||
if (self.widget.selected ~= self.widget.previous) and (self.isActive) then
|
||||
if (self.widget.list[self.widget.selected] ~= nil) then
|
||||
self.widget.list[self.widget.selected]:selectAction()
|
||||
self.widget.previous = self.widget.selected
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- DRAW FUNCTIONS
|
||||
|
|
Loading…
Reference in a new issue