forked from teamnwah/openmw-tes3coop
Merge pull request #1566 from akortunov/guifixes
Set default values for class and birthsign select menus
This commit is contained in:
commit
88ec6179ff
2 changed files with 21 additions and 2 deletions
|
@ -8,7 +8,9 @@
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
|
#include "../mwworld/player.hpp"
|
||||||
|
|
||||||
#include "widgets.hpp"
|
#include "widgets.hpp"
|
||||||
|
|
||||||
|
@ -70,8 +72,14 @@ namespace MWGui
|
||||||
updateBirths();
|
updateBirths();
|
||||||
updateSpells();
|
updateSpells();
|
||||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mBirthList);
|
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mBirthList);
|
||||||
}
|
|
||||||
|
|
||||||
|
// Show the current birthsign by default
|
||||||
|
const std::string &signId =
|
||||||
|
MWBase::Environment::get().getWorld()->getPlayer().getBirthSign();
|
||||||
|
|
||||||
|
if (!signId.empty())
|
||||||
|
setBirthId(signId);
|
||||||
|
}
|
||||||
|
|
||||||
void BirthDialog::setBirthId(const std::string &birthId)
|
void BirthDialog::setBirthId(const std::string &birthId)
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,6 +7,9 @@
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
|
#include "../mwmechanics/actorutil.hpp"
|
||||||
|
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
|
|
||||||
#include "tooltips.hpp"
|
#include "tooltips.hpp"
|
||||||
|
@ -131,8 +134,16 @@ namespace MWGui
|
||||||
updateClasses();
|
updateClasses();
|
||||||
updateStats();
|
updateStats();
|
||||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mClassList);
|
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mClassList);
|
||||||
}
|
|
||||||
|
|
||||||
|
// Show the current class by default
|
||||||
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
||||||
|
|
||||||
|
const std::string &classId =
|
||||||
|
player.get<ESM::NPC>()->mBase->mClass;
|
||||||
|
|
||||||
|
if (!classId.empty())
|
||||||
|
setClassId(classId);
|
||||||
|
}
|
||||||
|
|
||||||
void PickClassDialog::setClassId(const std::string &classId)
|
void PickClassDialog::setClassId(const std::string &classId)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue