diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-06 19:26:28 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-06 19:26:28 +1000 |
commit | fe4cc1961888db364bbc70cfe0e7a15ec27a5c5b (patch) | |
tree | db5357973b2e2ef368b6c1f81a701b8ea75b9a9b /source/frontend | |
parent | f75d1f0b5a78bfce56bde4fe57b8d1193a340e74 (diff) |
Change pure string format calls to use fmt::to_string
Diffstat (limited to 'source/frontend')
-rw-r--r-- | source/frontend/StarCinematic.cpp | 2 | ||||
-rw-r--r-- | source/frontend/StarClientCommandProcessor.cpp | 2 | ||||
-rw-r--r-- | source/frontend/StarContainerInterface.cpp | 2 | ||||
-rw-r--r-- | source/frontend/StarCraftingInterface.cpp | 4 | ||||
-rw-r--r-- | source/frontend/StarInventory.cpp | 10 | ||||
-rw-r--r-- | source/frontend/StarItemTooltip.cpp | 6 | ||||
-rw-r--r-- | source/frontend/StarMainInterface.cpp | 2 | ||||
-rw-r--r-- | source/frontend/StarMerchantInterface.cpp | 6 | ||||
-rw-r--r-- | source/frontend/StarQuestInterface.cpp | 2 | ||||
-rw-r--r-- | source/frontend/StarTeamBar.cpp | 4 |
10 files changed, 20 insertions, 20 deletions
diff --git a/source/frontend/StarCinematic.cpp b/source/frontend/StarCinematic.cpp index 7470410..bf39bd0 100644 --- a/source/frontend/StarCinematic.cpp +++ b/source/frontend/StarCinematic.cpp @@ -189,7 +189,7 @@ void Cinematic::render() { m_completable = true; if (!values.alpha) continue; - auto frame = strf("{}", ((int)values.frame) % panel->animationFrames); + auto frame = toString(((int)values.frame) % panel->animationFrames); auto alphaColor = Color::rgbaf(1.0f, 1.0f, 1.0f, values.alpha); for (auto const& d : panel->drawables) { Drawable drawable = Drawable(d.set("image", d.getString("image").replaceTags(StringMap<String>{{"species", playerSpecies}, {"frame", frame}}))); diff --git a/source/frontend/StarClientCommandProcessor.cpp b/source/frontend/StarClientCommandProcessor.cpp index 0f78ea0..7b6e234 100644 --- a/source/frontend/StarClientCommandProcessor.cpp +++ b/source/frontend/StarClientCommandProcessor.cpp @@ -127,7 +127,7 @@ String ClientCommandProcessor::gravity() { if (!adminCommandAllowed()) return "You must be an admin to use this command."; - return strf("{}", m_universeClient->worldClient()->gravity(m_universeClient->mainPlayer()->position())); + return toString(m_universeClient->worldClient()->gravity(m_universeClient->mainPlayer()->position())); } String ClientCommandProcessor::debug(StringList const& arguments) { diff --git a/source/frontend/StarContainerInterface.cpp b/source/frontend/StarContainerInterface.cpp index 10da82f..5a69fda 100644 --- a/source/frontend/StarContainerInterface.cpp +++ b/source/frontend/StarContainerInterface.cpp @@ -129,7 +129,7 @@ ContainerPane::ContainerPane(WorldClientPtr worldClient, PlayerPtr player, Conta m_reader.construct(guiConfig.get("gui"), this); if (auto countWidget = fetchChild<LabelWidget>("count")) - countWidget->setText(countWidget->text().replace("<slots>", strf("{}", container->containerSize()))); + countWidget->setText(countWidget->text().replace("<slots>", toString(container->containerSize()))); m_itemBag = make_shared<ItemBag>(container->containerSize()); auto items = container->containerItems(); diff --git a/source/frontend/StarCraftingInterface.cpp b/source/frontend/StarCraftingInterface.cpp index f3cedf5..df0100a 100644 --- a/source/frontend/StarCraftingInterface.cpp +++ b/source/frontend/StarCraftingInterface.cpp @@ -294,7 +294,7 @@ void CraftingPane::update() { updateCraftButtons(); } - setLabel("lblPlayerMoney", strf("{}", (int)m_player->currency("money"))); + setLabel("lblPlayerMoney", toString((int)m_player->currency("money"))); Pane::update(); } @@ -421,7 +421,7 @@ void CraftingPane::setupWidget(WidgetPtr const& widget, ItemRecipe const& recipe } if (price > 0) { - widget->setLabel("priceLabel", strf("{}", price)); + widget->setLabel("priceLabel", toString(price)); if (auto icon = widget->fetchChild<ImageWidget>("moneyIcon")) icon->setVisibility(true); } else { diff --git a/source/frontend/StarInventory.cpp b/source/frontend/StarInventory.cpp index a5a17e1..850eedf 100644 --- a/source/frontend/StarInventory.cpp +++ b/source/frontend/StarInventory.cpp @@ -317,25 +317,25 @@ void InventoryPane::update() { techOverlay->setVisibility(m_player->techOverridden()); auto healthLabel = fetchChild<LabelWidget>("healthtext"); - healthLabel->setText(strf("{}", m_player->maxHealth())); + healthLabel->setText(toString(m_player->maxHealth())); auto energyLabel = fetchChild<LabelWidget>("energytext"); - energyLabel->setText(strf("{}", m_player->maxEnergy())); + energyLabel->setText(toString(m_player->maxEnergy())); auto weaponLabel = fetchChild<LabelWidget>("weapontext"); weaponLabel->setText(strf("{}%", ceil(m_player->powerMultiplier() * 100))); auto defenseLabel = fetchChild<LabelWidget>("defensetext"); if (m_player->protection() == 0) defenseLabel->setText("--"); else - defenseLabel->setText(strf("{}", ceil(m_player->protection()))); + defenseLabel->setText(toString(ceil(m_player->protection()))); auto moneyLabel = fetchChild<LabelWidget>("lblMoney"); - moneyLabel->setText(strf("{}", m_player->currency("money"))); + moneyLabel->setText(toString(m_player->currency("money"))); if (m_player->currency("essence") > 0) { fetchChild<ImageWidget>("imgEssenceIcon")->show(); auto essenceLabel = fetchChild<LabelWidget>("lblEssence"); essenceLabel->show(); - essenceLabel->setText(strf("{}", m_player->currency("essence"))); + essenceLabel->setText(toString(m_player->currency("essence"))); } else { fetchChild<ImageWidget>("imgEssenceIcon")->hide(); fetchChild<LabelWidget>("lblEssence")->hide(); diff --git a/source/frontend/StarItemTooltip.cpp b/source/frontend/StarItemTooltip.cpp index 46a2d85..8d7ee29 100644 --- a/source/frontend/StarItemTooltip.cpp +++ b/source/frontend/StarItemTooltip.cpp @@ -81,7 +81,7 @@ void ItemTooltipBuilder::buildItemDescriptionInner( container->fetchChild<ItemSlotWidget>("icon")->setItem(item); container->setLabel("nameLabel", item->name()); - container->setLabel("countLabel", strf("{}", item->count())); + container->setLabel("countLabel", toString(item->count())); container->setLabel("rarityLabel", RarityNames.getRight(item->rarity()).titleCase()); @@ -90,8 +90,8 @@ void ItemTooltipBuilder::buildItemDescriptionInner( else container->setLabel("handednessLabel", "1-Handed"); - container->setLabel("countLabel", strf("{}", item->instanceValue("fuelAmount", 0).toUInt() * item->count())); - container->setLabel("priceLabel", strf("{}", (int)item->price())); + container->setLabel("countLabel", toString(item->instanceValue("fuelAmount", 0).toUInt() * item->count())); + container->setLabel("priceLabel", toString((int)item->price())); if (auto objectItem = as<ObjectItem>(item)) { try { diff --git a/source/frontend/StarMainInterface.cpp b/source/frontend/StarMainInterface.cpp index 9a47835..9f335b6 100644 --- a/source/frontend/StarMainInterface.cpp +++ b/source/frontend/StarMainInterface.cpp @@ -682,7 +682,7 @@ void MainInterface::update() { } m_messageOverflow++; - m_overflowMessage->message = m_config->overflowMessageText.replace("<count>", strf("{}", m_messageOverflow)); + m_overflowMessage->message = m_config->overflowMessageText.replace("<count>", toString(m_messageOverflow)); m_overflowMessage->cooldown = m_config->messageTime; if (auto oldest = m_messages.sorted([](GuiMessagePtr a, GuiMessagePtr b) { return a->cooldown < b->cooldown; }).maybeFirst()) m_overflowMessage->cooldown = oldest.value()->cooldown; diff --git a/source/frontend/StarMerchantInterface.cpp b/source/frontend/StarMerchantInterface.cpp index 4db2771..c4b1047 100644 --- a/source/frontend/StarMerchantInterface.cpp +++ b/source/frontend/StarMerchantInterface.cpp @@ -242,7 +242,7 @@ void MerchantPane::setupWidget(WidgetPtr const& widget, Json const& itemConfig) itemName->setText(name); unsigned price = ceil(itemConfig.getInt("price", item->price()) * m_buyFactor); - widget->setLabel("priceLabel", strf("{}", price)); + widget->setLabel("priceLabel", toString(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("{}", m_buyTotal)); + m_buyTotalLabel->setText(toString(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("{}", m_sellTotal)); + m_sellTotalLabel->setText(toString(m_sellTotal)); if (m_sellTotal > 0) m_sellButton->enable(); else diff --git a/source/frontend/StarQuestInterface.cpp b/source/frontend/StarQuestInterface.cpp index fa42b4d..324cbd8 100644 --- a/source/frontend/StarQuestInterface.cpp +++ b/source/frontend/StarQuestInterface.cpp @@ -422,7 +422,7 @@ QuestCompleteInterface::QuestCompleteInterface(QuestPtr const& quest, PlayerPtr commonSetup(config, m_quest->completionText(), "QuestComplete"); if (auto moneyLabel = fetchChild<LabelWidget>("lblMoneyAmount")) - moneyLabel->setText(strf("{}", m_quest->money())); + moneyLabel->setText(toString(m_quest->money())); disableScissoring(); } diff --git a/source/frontend/StarTeamBar.cpp b/source/frontend/StarTeamBar.cpp index 8bdd3b3..06b3ee7 100644 --- a/source/frontend/StarTeamBar.cpp +++ b/source/frontend/StarTeamBar.cpp @@ -162,7 +162,7 @@ void TeamBar::buildTeamBar() { continue; } - String cellName = strf("{}", controlIndex); + String cellName = toString(controlIndex); WidgetPtr cell = list->fetchChild(cellName); if (!cell) { @@ -234,7 +234,7 @@ void TeamBar::buildTeamBar() { noInviteImage->setVisibility(!couldInvite); while (true) { - String cellName = strf("{}", controlIndex); + String cellName = toString(controlIndex); WidgetPtr cell = list->fetchChild(cellName); if (!cell) break; |