From e60b1f88d2b69314c3611dcc69c5bd90c9ae3b49 Mon Sep 17 00:00:00 2001 From: Jan Borsodi Date: Sun, 12 Sep 2010 14:28:17 +0200 Subject: [PATCH] Added unique names for skill/power sub-widgets. --- apps/openmw/mwgui/mw_chargen.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwgui/mw_chargen.cpp b/apps/openmw/mwgui/mw_chargen.cpp index 148052934..b0cc4314b 100644 --- a/apps/openmw/mwgui/mw_chargen.cpp +++ b/apps/openmw/mwgui/mw_chargen.cpp @@ -185,9 +185,13 @@ void RaceDialog::updateSkills() for (int i = 0; inputList[i][0]; ++i) { - skillName = skillList->createWidget("SandText", coord1, MyGUI::Align::Default, "SkillName0"); + std::ostringstream name; + name << std::string("SkillName") << i; + skillName = skillList->createWidget("SandText", coord1, MyGUI::Align::Default, name.str()); skillName->setCaption(inputList[i][0]); - skillBonus = skillList->createWidget("SandTextRight", coord2, MyGUI::Align::Default, "SkillBonus0"); + std::ostringstream bonus; + bonus << std::string("SkillBonus") << i; + skillBonus = skillList->createWidget("SandTextRight", coord2, MyGUI::Align::Default, bonus.str()); skillBonus->setCaption(inputList[i][1]); skillItems.push_back(skillName); @@ -219,9 +223,9 @@ void RaceDialog::updateSpellPowers() for (int i = 0; inputList[i]; ++i) { - std::string name = "spellPowerName"; - name += i; - spellPowerName = spellPowerList->createWidget("SandText", coord, MyGUI::Align::Default, name); + std::ostringstream name; + name << std::string("SpellPowerName") << i; + spellPowerName = spellPowerList->createWidget("SandText", coord, MyGUI::Align::Default, name.str()); spellPowerName->setCaption(inputList[i]); spellPowerItems.push_back(spellPowerName);