improved cleanup; failed loads will now drop back into the main menu instead of crashing

actorid
Marc Zinnschlag 11 years ago
parent 0f60898517
commit 9ebe66e693

@ -8,6 +8,7 @@
#include "../mwbase/statemanager.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwstate/character.hpp"
@ -123,6 +124,12 @@ namespace MWGui
}
setVisible(false);
if (MWBase::Environment::get().getStateManager()->getState()==
MWBase::StateManager::State_NoGame)
{
MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu);
}
}
void SaveGameDialog::onCharacterSelected(MyGUI::ComboBox *sender, size_t pos)

@ -14,6 +14,7 @@
#include <extern/sdl4ogre/sdlcursormanager.hpp>
#include "../mwbase/inputmanager.hpp"
#include "../mwbase/statemanager.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/player.hpp"
@ -709,6 +710,10 @@ namespace MWGui
mToolTips->onFrame(frameDuration);
if (MWBase::Environment::get().getStateManager()->getState()==
MWBase::StateManager::State_NoGame)
return;
if (mDragAndDrop->mIsOnDragAndDrop)
{
assert(mDragAndDrop->mDraggedWidget);

@ -30,6 +30,7 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/inputmanager.hpp" // FIXME
#include "../mwbase/windowmanager.hpp" // FIXME
#include "../mwbase/statemanager.hpp"
#include "../mwmechanics/creaturestats.hpp"
@ -329,6 +330,12 @@ void RenderingManager::rebuildPtr(const MWWorld::Ptr &ptr)
void RenderingManager::update (float duration, bool paused)
{
mVideoPlayer->update ();
if (MWBase::Environment::get().getStateManager()->getState()==
MWBase::StateManager::State_NoGame)
return;
MWBase::World *world = MWBase::Environment::get().getWorld();
MWWorld::Ptr player = world->getPlayer().getPlayer();
@ -365,8 +372,6 @@ void RenderingManager::update (float duration, bool paused)
mOcclusionQuery->update(duration);
mVideoPlayer->update ();
mRendering.update(duration);
Ogre::ControllerManager::getSingleton().setTimeFactor(paused ? 0.f : 1.f);

@ -6,6 +6,7 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/statemanager.hpp"
#include "../mwworld/esmstore.hpp"
#include "../mwworld/player.hpp"
@ -607,8 +608,13 @@ namespace MWSound
{
if(!mOutput->isInitialized())
return;
updateSounds(duration);
updateRegionSound(duration);
if (MWBase::Environment::get().getStateManager()->getState()!=
MWBase::StateManager::State_NoGame)
{
updateSounds(duration);
updateRegionSound(duration);
}
}

@ -1335,7 +1335,7 @@ namespace MWWorld
updateWindowManager ();
if (mPlayer->getPlayer().getCell()->isExterior())
if (!paused && mPlayer->getPlayer().getCell()->isExterior())
{
ESM::Position pos = mPlayer->getPlayer().getRefData().getPosition();
mPlayer->setLastKnownExteriorPosition(Ogre::Vector3(pos.pos));

Loading…
Cancel
Save