From e32cd098040eaf792ac4363eb0f763313320c653 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 13 Mar 2021 17:28:46 +0100 Subject: [PATCH] feat: handle better not usable items Fixes #69 --- .../scenes/overworld/screens/mainmenu/items.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sonic-radiance.love/scenes/overworld/screens/mainmenu/items.lua b/sonic-radiance.love/scenes/overworld/screens/mainmenu/items.lua index 76ae7b6..d8ad2c6 100644 --- a/sonic-radiance.love/scenes/overworld/screens/mainmenu/items.lua +++ b/sonic-radiance.love/scenes/overworld/screens/mainmenu/items.lua @@ -174,10 +174,15 @@ function UseWidget:new(scene, pocket, item, widgetId) self.pocket = pocket self.widgetId = widgetId UseWidget.super.new(self, scene, "useMenu", "Use", "") + if (not self.itemData.usableOnMap) then + self.color = {0.6, 0.6, 0.6} + end end function UseWidget:action() - self.scene.screens.mainmenu["useItems"](self.scene, self.pocket, self.item, self.widgetId) + if (self.itemData.usableOnMap) then + self.scene.screens.mainmenu["useItems"](self.scene, self.pocket, self.item, self.widgetId) + end end function DropWidget:new(scene, pocket, item, widgetId)