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,11 +174,16 @@ function UseWidget:new(scene, pocket, item, widgetId)
self.pocket = pocket self.pocket = pocket
self.widgetId = widgetId self.widgetId = widgetId
UseWidget.super.new(self, scene, "useMenu", "Use", "") UseWidget.super.new(self, scene, "useMenu", "Use", "")
if (not self.itemData.usableOnMap) then
self.color = {0.6, 0.6, 0.6}
end
end end
function UseWidget:action() function UseWidget:action()
if (self.itemData.usableOnMap) then
self.scene.screens.mainmenu["useItems"](self.scene, self.pocket, self.item, self.widgetId) self.scene.screens.mainmenu["useItems"](self.scene, self.pocket, self.item, self.widgetId)
end end
end
function DropWidget:new(scene, pocket, item, widgetId) function DropWidget:new(scene, pocket, item, widgetId)
self.item = item self.item = item