diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
commit | 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch) | |
tree | fd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/frontend/StarMerchantInterface.cpp | |
parent | 14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff) |
The Formatting String Catastrophe
Diffstat (limited to 'source/frontend/StarMerchantInterface.cpp')
-rw-r--r-- | source/frontend/StarMerchantInterface.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/frontend/StarMerchantInterface.cpp b/source/frontend/StarMerchantInterface.cpp index 7059cb8..4db2771 100644 --- a/source/frontend/StarMerchantInterface.cpp +++ b/source/frontend/StarMerchantInterface.cpp @@ -236,13 +236,13 @@ void MerchantPane::setupWidget(WidgetPtr const& widget, Json const& itemConfig) String name = item->friendlyName(); if (item->count() > 1) - name = strf("%s (x%s)", name, item->count()); + name = strf("{} (x{})", name, item->count()); auto itemName = widget->fetchChild<LabelWidget>("itemName"); itemName->setText(name); unsigned price = ceil(itemConfig.getInt("price", item->price()) * m_buyFactor); - widget->setLabel("priceLabel", strf("%s", price)); + widget->setLabel("priceLabel", strf("{}", price)); widget->setData(price); bool unavailable = price > m_player->currency("money"); @@ -287,7 +287,7 @@ void MerchantPane::updateBuyTotal() { else m_buyTotal = 0; - m_buyTotalLabel->setText(strf("%s", m_buyTotal)); + m_buyTotalLabel->setText(strf("{}", m_buyTotal)); if (m_selectedIndex != NPos && m_buyCount > 0) m_buyButton->enable(); @@ -332,7 +332,7 @@ void MerchantPane::updateSellTotal() { if (item) m_sellTotal += round(item->price() * m_sellFactor); } - m_sellTotalLabel->setText(strf("%s", m_sellTotal)); + m_sellTotalLabel->setText(strf("{}", m_sellTotal)); if (m_sellTotal > 0) m_sellButton->enable(); else @@ -366,7 +366,7 @@ int MerchantPane::maxBuyCount() { } void MerchantPane::countChanged() { - m_countTextBox->setText(strf("x%s", m_buyCount)); + m_countTextBox->setText(strf("x{}", m_buyCount)); updateBuyTotal(); } |