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/StarCharCreation.cpp | |
parent | 14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff) |
The Formatting String Catastrophe
Diffstat (limited to 'source/frontend/StarCharCreation.cpp')
-rw-r--r-- | source/frontend/StarCharCreation.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/frontend/StarCharCreation.cpp b/source/frontend/StarCharCreation.cpp index fd617df..c1e0f1d 100644 --- a/source/frontend/StarCharCreation.cpp +++ b/source/frontend/StarCharCreation.cpp @@ -165,7 +165,7 @@ void CharCreationPane::createPlayer() { throw CharCreationException("The charPreview portrait has the wrong type."); } } catch (CharCreationException const& e) { - Logger::error("Character Preview portrait was not found in the json specification. %s", outputException(e, false)); + Logger::error("Character Preview portrait was not found in the json specification. {}", outputException(e, false)); } } @@ -269,15 +269,15 @@ void CharCreationPane::changed() { fetchChild<LabelWidget>("labelPortrait")->setText(labels[8]); fetchChild<LabelWidget>("labelPersonality")->setText(labels[9]); - fetchChild<ButtonWidget>(strf("species.%s", m_speciesChoice))->check(); - fetchChild<ButtonWidget>(strf("gender.%s", genderIdx))->check(); - auto modeButton = fetchChild<ButtonWidget>(strf("mode.%s", m_modeChoice)); + fetchChild<ButtonWidget>(strf("species.{}", m_speciesChoice))->check(); + fetchChild<ButtonWidget>(strf("gender.{}", genderIdx))->check(); + auto modeButton = fetchChild<ButtonWidget>(strf("mode.{}", m_modeChoice)); modeButton->check(); setLabel("labelMode", modeButton->data().getString("description", "fail")); // Update the gender images for the new species for (size_t i = 0; i < species.genderOptions.size(); i++) - fetchChild<ButtonWidget>(strf("gender.%s", i))->setOverlayImage(species.genderOptions[i].image); + fetchChild<ButtonWidget>(strf("gender.{}", i))->setOverlayImage(species.genderOptions[i].image); for (auto const& nameDefPair : root.speciesDatabase()->allSpecies()) { String name; @@ -286,7 +286,7 @@ void CharCreationPane::changed() { // NOTE: Probably not hot enough to matter, but this contains and indexOf makes this loop // O(n^2). This is less than ideal. if (m_speciesList.contains(name)) { - auto bw = fetchChild<ButtonWidget>(strf("species.%s", m_speciesList.indexOf(name))); + auto bw = fetchChild<ButtonWidget>(strf("species.{}", m_speciesList.indexOf(name))); if (bw) bw->setOverlayImage(def->options().genderOptions[genderIdx].characterImage); } |