Fixed detection of craftable items that aren't enhanceable (failed out of bounds checks). Hide information about craftable items that have yet to be unlocked.

This commit is contained in:
2023-12-29 01:00:42 -06:00
parent 4e3c9877e7
commit c876f8a6ea
15 changed files with 119 additions and 110 deletions
+2 -1
View File
@@ -53,6 +53,7 @@ enum class IconButtonAttr{
class MenuIconButton:public MenuComponent{
protected:
Decal*icon;
Pixel tint=WHITE;
public:
inline MenuIconButton(geom2d::rect<float>rect,Decal*icon,MenuFunc onClick,IconButtonAttr attributes=IconButtonAttr::SELECTABLE)
:MenuIconButton(rect,icon,MenuType::ENUM_END,onClick,attributes){}
@@ -69,7 +70,7 @@ protected:
MenuComponent::DrawDecal(window,focused);
if(icon!=nullptr){
vf2d iconScale=rect.size/24.f;
window.DrawDecal(rect.middle()-icon->sprite->Size()*iconScale/2,icon,iconScale);
window.DrawDecal(rect.middle()-icon->sprite->Size()*iconScale/2,icon,iconScale,tint);
}
}
};