From 0dafd30dfc16132eb7d78037d761e9634d072770 Mon Sep 17 00:00:00 2001 From: Jan Borsodi Date: Wed, 15 Sep 2010 12:56:44 +0200 Subject: [PATCH] The race dialog now fetches strings from GMST. --- apps/openmw/mwgui/race.cpp | 11 +++++++++-- apps/openmw/mwgui/window_manager.hpp | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/race.cpp b/apps/openmw/mwgui/race.cpp index a9549bc244..37217ee9c8 100644 --- a/apps/openmw/mwgui/race.cpp +++ b/apps/openmw/mwgui/race.cpp @@ -1,6 +1,7 @@ #include "race.hpp" #include "../mwworld/environment.hpp" #include "../mwworld/world.hpp" +#include "window_manager.hpp" #include "components/esm_store/store.hpp" #include @@ -26,7 +27,8 @@ RaceDialog::RaceDialog(MWWorld::Environment& environment, bool showNext) // These are just demo values, you should replace these with // real calls from outside the class later. - setText("AppearanceT", "Appearance"); + WindowManager *wm = environment.mWindowManager; + setText("AppearanceT", wm->getGameSettingString("sRaceMenu1", "Appearance")); getWidget(appearanceBox, "AppearanceBox"); getWidget(headRotate, "HeadRotate"); @@ -38,29 +40,34 @@ RaceDialog::RaceDialog(MWWorld::Environment& environment, bool showNext) // Set up next/previous buttons MyGUI::ButtonPtr prevButton, nextButton; + setText("GenderChoiceT", wm->getGameSettingString("sRaceMenu2", "Change Sex")); getWidget(prevButton, "PrevGenderButton"); getWidget(nextButton, "NextGenderButton"); prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender); nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextGender); + setText("FaceChoiceT", wm->getGameSettingString("sRaceMenu3", "Change Face")); getWidget(prevButton, "PrevFaceButton"); getWidget(nextButton, "NextFaceButton"); prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace); nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextFace); + setText("HairChoiceT", wm->getGameSettingString("sRaceMenu3", "Change Hair")); getWidget(prevButton, "PrevHairButton"); getWidget(nextButton, "NextHairButton"); prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair); nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextHair); - setText("RaceT", "Race"); + setText("RaceT", wm->getGameSettingString("sRaceMenu4", "Race")); getWidget(raceList, "RaceList"); raceList->setScrollVisible(true); raceList->eventListSelectAccept = MyGUI::newDelegate(this, &RaceDialog::onSelectRace); raceList->eventListMouseItemActivate = MyGUI::newDelegate(this, &RaceDialog::onSelectRace); raceList->eventListChangePosition = MyGUI::newDelegate(this, &RaceDialog::onSelectRace); + setText("SkillsT", wm->getGameSettingString("sBonusSkillTitle", "Skill Bonus")); getWidget(skillList, "SkillList"); + setText("SpellPowerT", wm->getGameSettingString("sRaceMenu7", "Specials")); getWidget(spellPowerList, "SpellPowerList"); // TODO: These buttons should be managed by a Dialog class diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index bca7fb8396..7be3bf991b 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -166,7 +166,6 @@ namespace MWGui void messageBox (const std::string& message, const std::vector& buttons); - private: /** * Fetches a GMST string from the store, if there is no setting with the given * ID or it is not a string the default string is returned. @@ -176,6 +175,7 @@ namespace MWGui */ const std::string &getGameSettingString(const std::string &id, const std::string &default); + private: void updateCharacterGeneration(); void checkCharacterGeneration(GuiMode mode);