|
|
|
@ -123,7 +123,7 @@ void Menu::InitializeConsumableCraftingWindow(){ |
|
|
|
|
auto moneyIcon=consumableCraftingWindow->ADD("Money Icon",MenuIconButton)({moneyIconPos,{24,24}},GFX["money.png"].Decal(),DO_NOTHING,IconButtonAttr::NOT_SELECTABLE|IconButtonAttr::NO_OUTLINE|IconButtonAttr::NO_BACKGROUND)END; |
|
|
|
|
std::string moneyText=std::to_string(game->GetPlayer()->GetMoney()); |
|
|
|
|
vf2d moneyTextSize=game->GetTextSizeProp(moneyText)*2; |
|
|
|
|
auto moneyDisplay=consumableCraftingWindow->ADD("Money Label",PlayerMoneyLabel)({moneyIconPos-vf2d{2+moneyTextSize.x,-2},moneyTextSize},2,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END; |
|
|
|
|
auto moneyDisplay=consumableCraftingWindow->ADD("Money Label",PlayerMoneyLabel)({moneyIconPos-vf2d{2+moneyTextSize.x,-2},moneyTextSize},2,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; |
|
|
|
|
moneyDisplay->SetRightAlignment(true); |
|
|
|
|
Player::AddMoneyListener(moneyDisplay); |
|
|
|
|
#pragma endregion |
|
|
|
|