1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 06:23:52 +00:00

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

This commit is contained in:
Marc Zinnschlag 2014-01-21 14:50:58 +01:00
parent 0f60898517
commit 9ebe66e693
5 changed files with 28 additions and 5 deletions

View file

@ -8,6 +8,7 @@
#include "../mwbase/statemanager.hpp" #include "../mwbase/statemanager.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwstate/character.hpp" #include "../mwstate/character.hpp"
@ -123,6 +124,12 @@ namespace MWGui
} }
setVisible(false); 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) void SaveGameDialog::onCharacterSelected(MyGUI::ComboBox *sender, size_t pos)

View file

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

View file

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

View file

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

View file

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