|
|
|
@ -73,6 +73,7 @@ public: |
|
|
|
|
return itemRef.get(); |
|
|
|
|
} |
|
|
|
|
inline Item&SetItem(Item&newItem){ |
|
|
|
|
UpdateIcon(); |
|
|
|
|
return itemRef=std::reference_wrapper<Item>(newItem); |
|
|
|
|
} |
|
|
|
|
inline void SetShowQuantity(bool show){ |
|
|
|
@ -94,19 +95,20 @@ protected: |
|
|
|
|
virtual inline void OnHover()override{ |
|
|
|
|
UpdateLabel(); |
|
|
|
|
} |
|
|
|
|
void UpdateLabel(){ |
|
|
|
|
if(itemRef.get().IsBlank())return; |
|
|
|
|
inline void UpdateLabel(){ |
|
|
|
|
std::string labelNameText; |
|
|
|
|
std::string labelDescriptionText; |
|
|
|
|
if(valid){ |
|
|
|
|
icon=itemRef.get().Decal(); |
|
|
|
|
labelNameText=itemRef.get().Name(); |
|
|
|
|
labelDescriptionText=itemRef.get().Description(compact); |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
if(itemRef.get().IsBlank()){ |
|
|
|
|
icon=nullptr; |
|
|
|
|
labelNameText=""; |
|
|
|
|
labelDescriptionText=""; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
icon=itemRef.get().Decal(); |
|
|
|
|
labelNameText=itemRef.get().Name(); |
|
|
|
|
labelDescriptionText=itemRef.get().Description(compact); |
|
|
|
|
if(itemNameLabelName!=""){ |
|
|
|
|
Component<MenuLabel>(parentMenu,itemNameLabelName)->label=labelNameText; |
|
|
|
|
Component<MenuLabel>(parentMenu,itemNameLabelName)->Enable(true); |
|
|
|
@ -135,4 +137,12 @@ protected: |
|
|
|
|
window.DrawShadowStringDecal(drawPos,quantityText,WHITE,BLACK,quantityTextScale,quantityTextScale.x); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
private: |
|
|
|
|
inline void UpdateIcon(){ |
|
|
|
|
if(itemRef.get().IsBlank()){ |
|
|
|
|
icon=nullptr; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
icon=itemRef.get().Decal(); |
|
|
|
|
} |
|
|
|
|
}; |