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/windowing | |
parent | f75d1f0b5a78bfce56bde4fe57b8d1193a340e74 (diff) |
Change pure string format calls to use fmt::to_string
Diffstat (limited to 'source/windowing')
-rw-r--r-- | source/windowing/StarItemGridWidget.cpp | 2 | ||||
-rw-r--r-- | source/windowing/StarItemSlotWidget.cpp | 2 | ||||
-rw-r--r-- | source/windowing/StarListWidget.cpp | 6 | ||||
-rw-r--r-- | source/windowing/StarWidgetLuaBindings.cpp | 2 | ||||
-rw-r--r-- | source/windowing/StarWidgetParsing.cpp | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/source/windowing/StarItemGridWidget.cpp b/source/windowing/StarItemGridWidget.cpp index ad02c32..494d09c 100644 --- a/source/windowing/StarItemGridWidget.cpp +++ b/source/windowing/StarItemGridWidget.cpp @@ -155,7 +155,7 @@ void ItemGridWidget::setItemBag(ItemBagConstPtr bag) { m_slots.clear(); for (size_t i = 0; i < m_bag->size() - m_bagOffset && i < (unsigned)m_dimensions[0] * m_dimensions[1]; ++i) { auto itemSlot = make_shared<ItemSlotWidget>(m_bag->at(i), m_backingImage); - addChild(strf("{}", i), itemSlot); + addChild(toString(i), itemSlot); m_slots.append(itemSlot); itemSlot->setBackingImageAffinity(m_drawBackingImageWhenFull, m_drawBackingImageWhenEmpty); itemSlot->setProgress(m_progress); diff --git a/source/windowing/StarItemSlotWidget.cpp b/source/windowing/StarItemSlotWidget.cpp index cf12a8d..cc9ff50 100644 --- a/source/windowing/StarItemSlotWidget.cpp +++ b/source/windowing/StarItemSlotWidget.cpp @@ -185,7 +185,7 @@ void ItemSlotWidget::renderImpl() { context()->setFontSize(m_fontSize); context()->setFontColor(m_fontColor.toRgba()); context()->setFontMode(m_countFontMode); - context()->renderInterfaceText(strf("{}", m_item->count()), m_countPosition.translated(Vec2F(screenPosition()))); + context()->renderInterfaceText(toString(m_item->count()), m_countPosition.translated(Vec2F(screenPosition()))); } } else if (m_drawBackingImageWhenEmpty && m_backingImage != "") { diff --git a/source/windowing/StarListWidget.cpp b/source/windowing/StarListWidget.cpp index 993fb73..c5ac35b 100644 --- a/source/windowing/StarListWidget.cpp +++ b/source/windowing/StarListWidget.cpp @@ -70,7 +70,7 @@ void ListWidget::setSchema(Json const& schema) { WidgetPtr ListWidget::addItem() { auto newItem = constructWidget(); - addChild(strf("{}", Random::randu64()), newItem); + addChild(toString(Random::randu64()), newItem); updateSizeAndPosition(); return newItem; @@ -78,7 +78,7 @@ WidgetPtr ListWidget::addItem() { WidgetPtr ListWidget::addItem(size_t at) { auto newItem = constructWidget(); - addChildAt(strf("{}", Random::randu64()), newItem, at); + addChildAt(toString(Random::randu64()), newItem, at); updateSizeAndPosition(); if (m_selectedItem != NPos && at <= m_selectedItem) @@ -88,7 +88,7 @@ WidgetPtr ListWidget::addItem(size_t at) { } WidgetPtr ListWidget::addItem(WidgetPtr existingItem) { - addChild(strf("{}", Random::randu64()), existingItem); + addChild(toString(Random::randu64()), existingItem); updateSizeAndPosition(); return existingItem; diff --git a/source/windowing/StarWidgetLuaBindings.cpp b/source/windowing/StarWidgetLuaBindings.cpp index 62d2be6..46f1ac8 100644 --- a/source/windowing/StarWidgetLuaBindings.cpp +++ b/source/windowing/StarWidgetLuaBindings.cpp @@ -186,7 +186,7 @@ LuaCallbacks LuaBindings::makeWidgetCallbacks(Widget* parentWidget, GuiReaderPtr callbacks.registerCallback("addChild", [parentWidget, reader](String const& widgetName, Json const& newChildConfig, Maybe<String> const& newChildName) { if (auto widget = parentWidget->fetchChild<Widget>(widgetName)) { - String name = newChildName.value(strf("{}", Random::randu64())); + String name = newChildName.value(toString(Random::randu64())); WidgetPtr newChild = reader->makeSingle(name, newChildConfig); widget->addChild(name, newChild); } diff --git a/source/windowing/StarWidgetParsing.cpp b/source/windowing/StarWidgetParsing.cpp index 8e27ecd..9afb825 100644 --- a/source/windowing/StarWidgetParsing.cpp +++ b/source/windowing/StarWidgetParsing.cpp @@ -360,7 +360,7 @@ WidgetConstructResult WidgetParser::radioGroupHandler(String const& name, Json c common(button, btnConfig); - buttonGroup->addChild(strf("{}", button->buttonGroupId()), button); + buttonGroup->addChild(toString(button->buttonGroupId()), button); } catch (MapException const& e) { throw WidgetParserException( strf("Malformed gui json, missing a required value in the map. {}", outputException(e, false))); @@ -749,7 +749,7 @@ WidgetConstructResult WidgetParser::stackHandler(String const& name, Json const& auto widget = make_shared<Widget>(); constructImpl(widgetCfg, widget.get()); widget->determineSizeFromChildren(); - stack->addChild(strf("{}", stack->numChildren()), widget); + stack->addChild(toString(stack->numChildren()), widget); } } |