|
|
|
@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
|
|
|
|
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
|
|
|
SUCH DAMAGE. |
|
|
|
|
|
|
|
|
|
Portions of this software are copyright © 2023 The FreeType |
|
|
|
|
Portions of this software are copyright © 2024 The FreeType |
|
|
|
|
Project (www.freetype.org). Please see LICENSE_FT.txt for more information. |
|
|
|
|
All rights reserved. |
|
|
|
|
*/ |
|
|
|
@ -48,6 +48,8 @@ namespace PriceLabel{ |
|
|
|
|
NONE, |
|
|
|
|
BUY_LABEL, |
|
|
|
|
SELL_LABEL, |
|
|
|
|
CRAFTABLE, |
|
|
|
|
UPGRADEABLE, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -114,24 +116,30 @@ public: |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(priceLabel!=PriceLabel::NONE){ |
|
|
|
|
if(priceLabel==PriceLabel::SELL_LABEL){ |
|
|
|
|
std::string priceText=std::to_string(itemRef.lock()->SellValue()); |
|
|
|
|
if(itemRef.lock()->SellValue()==0)priceText="Cannot Sell"; |
|
|
|
|
vf2d priceTextSize=vf2d(game->GetTextSize(priceText)); |
|
|
|
|
switch(priceLabel){ |
|
|
|
|
case PriceLabel::CRAFTABLE:{ |
|
|
|
|
//An item can be crafted if we do not have it and we are on the correct chapter.
|
|
|
|
|
}break; |
|
|
|
|
case PriceLabel::SELL_LABEL:{ |
|
|
|
|
std::string priceText=std::to_string(itemRef.lock()->SellValue()); |
|
|
|
|
if(itemRef.lock()->SellValue()==0)priceText="Cannot Sell"; |
|
|
|
|
vf2d priceTextSize=vf2d(game->GetTextSize(priceText)); |
|
|
|
|
|
|
|
|
|
if(itemRef.lock()->SellValue()!=0){ |
|
|
|
|
window.DrawShadowStringDecal(rect.pos+vf2d{rect.size.x-priceTextSize.x-15,3},priceText); |
|
|
|
|
window.DrawDecal(rect.pos+vf2d{rect.size.x-14,1},GFX["currency_coin.png"].Decal(),{0.5f,0.5f}); |
|
|
|
|
}else{ |
|
|
|
|
vf2d priceTextSize=vf2d(game->GetTextSizeProp(priceText))*vf2d{0.5f,0.85f}; |
|
|
|
|
window.DrawShadowStringPropDecal(rect.pos+vf2d{rect.size.x-priceTextSize.x-1,3},priceText,WHITE,BLACK,{0.5f,0.85f}); |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case PriceLabel::BUY_LABEL:{ |
|
|
|
|
std::string priceText=std::to_string(itemRef.lock()->BuyValue()); |
|
|
|
|
vf2d priceTextSize=vf2d(game->GetTextSize(priceText)); |
|
|
|
|
|
|
|
|
|
if(itemRef.lock()->SellValue()!=0){ |
|
|
|
|
window.DrawShadowStringDecal(rect.pos+vf2d{rect.size.x-priceTextSize.x-15,3},priceText); |
|
|
|
|
window.DrawDecal(rect.pos+vf2d{rect.size.x-14,1},GFX["currency_coin.png"].Decal(),{0.5f,0.5f}); |
|
|
|
|
}else{ |
|
|
|
|
vf2d priceTextSize=vf2d(game->GetTextSizeProp(priceText))*vf2d{0.5f,0.85f}; |
|
|
|
|
window.DrawShadowStringPropDecal(rect.pos+vf2d{rect.size.x-priceTextSize.x-1,3},priceText,WHITE,BLACK,{0.5f,0.85f}); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
std::string priceText=std::to_string(itemRef.lock()->BuyValue()); |
|
|
|
|
vf2d priceTextSize=vf2d(game->GetTextSize(priceText)); |
|
|
|
|
|
|
|
|
|
window.DrawShadowStringDecal(rect.pos+vf2d{rect.size.x-priceTextSize.x-15,3},priceText); |
|
|
|
|
window.DrawDecal(rect.pos+vf2d{rect.size.x-14,1},GFX["currency_coin.png"].Decal(),{0.5f,0.5f}); |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|