From c7c7e3d0a8a20d3de0d4ff4b97d3a36df3a98d58 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 10 Feb 2019 14:44:04 +0100 Subject: [PATCH] core/menusystem: improve wording for clearing functions --- sonic-boost.love/core/modules/menusystem/init.lua | 4 ++-- sonic-boost.love/core/modules/menusystem/parent.lua | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sonic-boost.love/core/modules/menusystem/init.lua b/sonic-boost.love/core/modules/menusystem/init.lua index 46c76fe..499e659 100644 --- a/sonic-boost.love/core/modules/menusystem/init.lua +++ b/sonic-boost.love/core/modules/menusystem/init.lua @@ -28,7 +28,7 @@ function MenuSystem:addMenu(menu) end function MenuSystem:update(dt) - self:clear() + self:removeDestroyedMenus() for i,v in ipairs(self.menus) do v.id = i v:update(dt) @@ -43,7 +43,7 @@ function MenuSystem:update(dt) end end -function MenuSystem:clear() +function MenuSystem:removeDestroyedMenus() -- On retire les entitées marquées comme supprimées for i,v in ipairs(self.menus) do if (v.isDestroyed == true) then diff --git a/sonic-boost.love/core/modules/menusystem/parent.lua b/sonic-boost.love/core/modules/menusystem/parent.lua index 46381a5..2a86ad9 100644 --- a/sonic-boost.love/core/modules/menusystem/parent.lua +++ b/sonic-boost.love/core/modules/menusystem/parent.lua @@ -46,7 +46,7 @@ function Menu:update(dt) -- Cette fonction ne contient rien par défaut end -function Menu:empty() +function Menu:clear() self.widget.list = {} self.widget.cancel = 0 end @@ -97,14 +97,14 @@ function Menu:addWidget(newwidget) end function Menu:updateWidgets(dt) - self:clearWidgets() + self:removeDestroyedWidgets() for i,v in ipairs(self.widget.list) do v.id = i v:update(dt) end end -function Menu:clearWidgets() -- On retire les widgets marquées comme supprimées +function Menu:removeDestroyedWidgets() -- On retire les widgets marquées comme supprimées for i,v in ipairs(self.widget.list) do if (v.destroyed == true) then table.remove(self.widget.list, i)