Traveling Merchant Purchase Window and systems implemented.
This commit is contained in:
@@ -44,6 +44,7 @@ All rights reserved.
|
||||
#include "MenuItemButton.h"
|
||||
#include "MenuItemItemButton.h"
|
||||
#include "RowItemDisplay.h"
|
||||
#include "PlayerMoneyLabel.h"
|
||||
|
||||
INCLUDE_game
|
||||
INCLUDE_ITEM_CATEGORIES
|
||||
@@ -123,9 +124,13 @@ void Menu::InitializeInventoryWindow(){
|
||||
inventoryWindow->ADD("Item Description Label",MenuLabel)({{226,94},{inventoryDescriptionWidth-6,inventoryWindow->size.y-44-66}},"",0.5f,LEFT_ALIGN|SHADOW)END;
|
||||
#pragma endregion
|
||||
|
||||
vf2d moneyIconPos={224+inventoryDescriptionWidth-24,28+inventoryWindow->size.y-44+8};
|
||||
auto moneyIcon=inventoryWindow->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;
|
||||
inventoryWindow->ADD("Money Label",MenuLabel)({moneyIconPos-vf2d{2+moneyTextSize.x,0},moneyTextSize},moneyText,2,SHADOW|LEFT_ALIGN)END;
|
||||
#pragma region Money Display
|
||||
vf2d moneyIconPos={224+inventoryDescriptionWidth-24,28+inventoryWindow->size.y-44+8};
|
||||
auto moneyIcon=inventoryWindow->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=inventoryWindow->ADD("Money Label",PlayerMoneyLabel)({moneyIconPos-vf2d{2+moneyTextSize.x,0},moneyTextSize},2,SHADOW|LEFT_ALIGN)END;
|
||||
moneyDisplay->SetRightAlignment(true);
|
||||
Player::AddMoneyListener(moneyDisplay);
|
||||
#pragma endregion
|
||||
}
|
||||
Reference in New Issue
Block a user