feat: handle better not usable items

Fixes #69
This commit is contained in:
Kazhnuz 2021-03-13 17:28:46 +01:00
parent 17b3e4e172
commit e32cd09804

View file

@ -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)