Refonte pour utiliser le systeme de GUI #112

Merged
kazhnuz merged 102 commits from feat/gui into master 2022-01-06 19:15:16 +01:00
2 changed files with 14 additions and 7 deletions
Showing only changes of commit 88a68d2f98 - Show all commits

View file

@ -142,9 +142,9 @@ end
-- CANCEL FUNCTIONS
-- Add a widget as a "cancel" function
function MenuModel:setCancelWidget()
function MenuModel:setCancelWidget(id)
local page = self:getCurrentPage()
page:setCancelWidget()
page:setCancelWidget(id)
end
function MenuModel:getCancelWidget()

View file

@ -66,8 +66,8 @@ end
-- All the actions callback used by the widgets
function Page:cancelAction()
if (self.cancel ~= 0) then
self:action(self.cancel, "key")
if (self:getCancelWidget() ~= 0) then
self:action(self:getCancelWidget(), "key")
end
end
@ -134,11 +134,18 @@ end
-- Add a widget as a "cancel" function
function Page:setCancelWidget(id)
self.cancel = #self.widgets
if (id == nil) then
id = #self.widgets
end
self.cancel = id
end
function Page:getCancelWidget(id)
return self.cancel
function Page:getCancelWidget()
if (self.cancel == "last") then
return #self.widgets
else
return self.cancel
end
end
-- CURSOR FUNCTIONS