From baa5a24ce6af431cde2c68b4f9cb49a0f4e22a5f Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 30 Jan 2021 09:18:07 +0100 Subject: [PATCH] fix: initial ports of the basic scenes --- examples/scenes/basic/test_menus/init.lua | 64 +++++++++++------------ 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/examples/scenes/basic/test_menus/init.lua b/examples/scenes/basic/test_menus/init.lua index f5af5da..7a22f76 100644 --- a/examples/scenes/basic/test_menus/init.lua +++ b/examples/scenes/basic/test_menus/init.lua @@ -37,39 +37,39 @@ function TestScene:new() MenuType(self.menusystem, "testMenu1", 32, 32, 100, 24*8, 4) MenuWidget(self, "testMenu1", "text_menu1") - Widget.Base(self.menusystem.menus["testMenu1"]) - Widget.Base(self.menusystem.menus["testMenu1"]) - Widget.Base(self.menusystem.menus["testMenu1"]) - Widget.Base(self.menusystem.menus["testMenu1"]) - Widget.Base(self.menusystem.menus["testMenu1"]) + Widget.Base("testMenu1") + Widget.Base("testMenu1") + Widget.Base("testMenu1") + Widget.Base("testMenu1") + Widget.Base("testMenu1") MenuType2(self.menusystem, "testMenu2", 164, 32, 24*8, 24*2, 8, 2) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) - Widget.Base(self.menusystem.menus["testMenu2"]) + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") + Widget.Base("testMenu2") MenuType3(self.menusystem, "testMenu3", 164, 32 + 72, 24*8, 24*5, 8, 5) - Widget.Base(self.menusystem.menus["testMenu3"]) - Widget.Base(self.menusystem.menus["testMenu3"]) - Widget.Base(self.menusystem.menus["testMenu3"]) - Widget.Base(self.menusystem.menus["testMenu3"]) + Widget.Base("testMenu3") + Widget.Base("testMenu3") + Widget.Base("testMenu3") + Widget.Base("testMenu3") self.menusystem.menus["testMenu3"]:addSlot(1, 0, 0, 4, 3) self.menusystem.menus["testMenu3"]:addSlot(2, 0, 3, 5, 2) self.menusystem.menus["testMenu3"]:addSlot(3, 5, 0, 3, 1) @@ -120,7 +120,7 @@ end function TestScene:addTextWidget(menu, number) for i=1, number do - Widget.Text(self.menusystem.menus[menu], self.assets.fonts["medium"], "lorem ipsum " .. i) + Widget.Text(menu, "medium", "lorem ipsum " .. i) end end @@ -131,10 +131,8 @@ end function MenuWidget:new(scene, menu, newmenu) self.scene = scene - local widgetmenu = self.scene.menusystem.menus[menu] - local font = self.scene.assets.fonts["medium"] self.newmenu = newmenu - MenuWidget.super.new(self, widgetmenu, font, newmenu) + MenuWidget.super.new(self, menu, "menu", newmenu) end function MenuWidget:action()