Deux Ex Machina

This commit is contained in:
Bram Verhulst
2024-06-09 23:23:55 +02:00
parent 5f1dcd5788
commit caabb12838
17 changed files with 151 additions and 77 deletions

View File

@@ -12,6 +12,7 @@ SellScreen::SellScreen(const std::string& filePath, Vector2f pos, Vector2f size,
const Vector2f ScreenCenter = Vector2f { utils::GetViewport().x / 2, utils::GetViewport().y / 2 };
const Vector2f sellScreenCenter = ScreenCenter - sellScreenSize / 2;
m_BuySound = new SoundEffect { "sound/buy.wav" };
const Vector2f closeButtonOffset = Vector2f { 460, 396 - 14 };
Vector2f closeButtonPos = sellScreenCenter + closeButtonOffset;
@@ -36,6 +37,7 @@ SellScreen::SellScreen(const std::string& filePath, Vector2f pos, Vector2f size,
sellAllButton->SetOnClick([this]()
{
this->SellAll();
m_BuySound->Play(0);
});
this->AddElement(sellAllButton);
@@ -48,6 +50,7 @@ SellScreen::~SellScreen() {
for (SellSreenRow* row : m_Rows) {
delete row;
}
delete m_BuySound;
}
void SellScreen::Draw() const {
Screen::Draw();