mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 12:49:40 +00:00
parent
1c73a3f2fb
commit
64210e6efa
6 changed files with 8 additions and 47 deletions
|
@ -82,8 +82,6 @@ namespace MWBase
|
||||||
virtual OEngine::Render::Fader* getFader() = 0;
|
virtual OEngine::Render::Fader* getFader() = 0;
|
||||||
///< \ŧodo remove this function. Rendering details should not be exposed.
|
///< \ŧodo remove this function. Rendering details should not be exposed.
|
||||||
|
|
||||||
virtual void newGame() = 0;
|
|
||||||
|
|
||||||
virtual MWWorld::CellStore *getExterior (int x, int y) = 0;
|
virtual MWWorld::CellStore *getExterior (int x, int y) = 0;
|
||||||
|
|
||||||
virtual MWWorld::CellStore *getInterior (const std::string& name) = 0;
|
virtual MWWorld::CellStore *getInterior (const std::string& name) = 0;
|
||||||
|
|
|
@ -6,15 +6,12 @@
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
#include "confirmationdialog.hpp"
|
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
MainMenu::MainMenu(MWBase::WindowManager& parWindowManager, int w, int h)
|
MainMenu::MainMenu(int w, int h)
|
||||||
: OEngine::GUI::Layout("openmw_mainmenu.layout")
|
: OEngine::GUI::Layout("openmw_mainmenu.layout")
|
||||||
, mButtonBox(0)
|
, mButtonBox(0)
|
||||||
, mDialog(parWindowManager)
|
|
||||||
{
|
{
|
||||||
onResChange(w,h);
|
onResChange(w,h);
|
||||||
}
|
}
|
||||||
|
@ -23,7 +20,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
setCoord(0,0,w,h);
|
setCoord(0,0,w,h);
|
||||||
|
|
||||||
int height = 64 * 4;
|
int height = 64 * 3;
|
||||||
|
|
||||||
if (mButtonBox)
|
if (mButtonBox)
|
||||||
MyGUI::Gui::getInstance ().destroyWidget(mButtonBox);
|
MyGUI::Gui::getInstance ().destroyWidget(mButtonBox);
|
||||||
|
@ -36,11 +33,12 @@ namespace MWGui
|
||||||
mReturn->eventMouseButtonClick += MyGUI::newDelegate(this, &MainMenu::returnToGame);
|
mReturn->eventMouseButtonClick += MyGUI::newDelegate(this, &MainMenu::returnToGame);
|
||||||
curH += 64;
|
curH += 64;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
mNewGame = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default);
|
mNewGame = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default);
|
||||||
mNewGame->eventMouseButtonClick += MyGUI::newDelegate(this, &MainMenu::newGame);
|
|
||||||
mNewGame->setImageResource ("Menu_NewGame");
|
mNewGame->setImageResource ("Menu_NewGame");
|
||||||
curH += 64;
|
curH += 64;
|
||||||
/*
|
|
||||||
mLoadGame = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default);
|
mLoadGame = mButtonBox->createWidget<MyGUI::Button> ("ButtonImage", MyGUI::IntCoord(0, curH, 128, 64), MyGUI::Align::Default);
|
||||||
mLoadGame->setImageResource ("Menu_LoadGame");
|
mLoadGame->setImageResource ("Menu_LoadGame");
|
||||||
curH += 64;
|
curH += 64;
|
||||||
|
@ -83,17 +81,4 @@ namespace MWGui
|
||||||
Ogre::Root::getSingleton ().queueEndRendering ();
|
Ogre::Root::getSingleton ().queueEndRendering ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainMenu::newGame(MyGUI::Widget* sender)
|
|
||||||
{
|
|
||||||
mDialog.open ("#{sNotifyMessage54}");
|
|
||||||
mDialog.eventOkClicked.clear();
|
|
||||||
mDialog.eventCancelClicked.clear();
|
|
||||||
mDialog.eventOkClicked += MyGUI::newDelegate(this, &MainMenu::newGameConfirmed);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainMenu::newGameConfirmed()
|
|
||||||
{
|
|
||||||
MWBase::Environment::get().getWindowManager ()->removeGuiMode (GM_MainMenu);
|
|
||||||
MWBase::Environment::get().getWorld ()->newGame();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
#include <openengine/gui/layout.hpp>
|
#include <openengine/gui/layout.hpp>
|
||||||
|
|
||||||
#include "confirmationdialog.hpp"
|
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
class MainMenu : public OEngine::GUI::Layout
|
class MainMenu : public OEngine::GUI::Layout
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MainMenu(MWBase::WindowManager& parWindowManager, int w, int h);
|
MainMenu(int w, int h);
|
||||||
|
|
||||||
void onResChange(int w, int h);
|
void onResChange(int w, int h);
|
||||||
|
|
||||||
|
@ -26,10 +24,6 @@ namespace MWGui
|
||||||
void returnToGame(MyGUI::Widget* sender);
|
void returnToGame(MyGUI::Widget* sender);
|
||||||
void showOptions(MyGUI::Widget* sender);
|
void showOptions(MyGUI::Widget* sender);
|
||||||
void exitGame(MyGUI::Widget* sender);
|
void exitGame(MyGUI::Widget* sender);
|
||||||
void newGame(MyGUI::Widget* sender);
|
|
||||||
void newGameConfirmed();
|
|
||||||
|
|
||||||
ConfirmationDialog mDialog;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ WindowManager::WindowManager(
|
||||||
mDragAndDrop->mDraggedWidget = 0;
|
mDragAndDrop->mDraggedWidget = 0;
|
||||||
mDragAndDrop->mDragAndDropWidget = dragAndDropWidget;
|
mDragAndDrop->mDragAndDropWidget = dragAndDropWidget;
|
||||||
|
|
||||||
mMenu = new MainMenu(*this, w,h);
|
mMenu = new MainMenu(w,h);
|
||||||
mMap = new MapWindow(*this, cacheDir);
|
mMap = new MapWindow(*this, cacheDir);
|
||||||
mStatsWindow = new StatsWindow(*this);
|
mStatsWindow = new StatsWindow(*this);
|
||||||
mConsole = new Console(w,h, consoleOnlyScripts);
|
mConsole = new Console(w,h, consoleOnlyScripts);
|
||||||
|
|
|
@ -170,7 +170,7 @@ namespace MWWorld
|
||||||
const std::string& master, const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir, bool newGame,
|
const std::string& master, const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir, bool newGame,
|
||||||
const std::string& encoding, std::map<std::string,std::string> fallbackMap)
|
const std::string& encoding, std::map<std::string,std::string> fallbackMap)
|
||||||
: mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
|
: mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
|
||||||
mSky (true), mCells (mStore, mEsm), mNewGameStarted(false),
|
mSky (true), mCells (mStore, mEsm),
|
||||||
mNumFacing(0)
|
mNumFacing(0)
|
||||||
{
|
{
|
||||||
mPhysics = new PhysicsSystem(renderer);
|
mPhysics = new PhysicsSystem(renderer);
|
||||||
|
@ -1015,12 +1015,6 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mNewGameStarted)
|
|
||||||
{
|
|
||||||
playVideo ("mw_intro.bik");
|
|
||||||
mNewGameStarted = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool World::isCellExterior() const
|
bool World::isCellExterior() const
|
||||||
|
@ -1302,11 +1296,4 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
mRendering->stopVideo();
|
mRendering->stopVideo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::newGame ()
|
|
||||||
{
|
|
||||||
// set new game mark
|
|
||||||
mGlobalVariables->setInt ("chargenstate", 1);
|
|
||||||
mNewGameStarted = true; // in order to play the intro video at the end of the next frame
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,6 @@ namespace MWWorld
|
||||||
MWWorld::Globals *mGlobalVariables;
|
MWWorld::Globals *mGlobalVariables;
|
||||||
MWWorld::PhysicsSystem *mPhysics;
|
MWWorld::PhysicsSystem *mPhysics;
|
||||||
bool mSky;
|
bool mSky;
|
||||||
bool mNewGameStarted;
|
|
||||||
|
|
||||||
Cells mCells;
|
Cells mCells;
|
||||||
|
|
||||||
|
@ -103,8 +102,6 @@ namespace MWWorld
|
||||||
virtual OEngine::Render::Fader* getFader();
|
virtual OEngine::Render::Fader* getFader();
|
||||||
///< \ŧodo remove this function. Rendering details should not be exposed.
|
///< \ŧodo remove this function. Rendering details should not be exposed.
|
||||||
|
|
||||||
virtual void newGame();
|
|
||||||
|
|
||||||
virtual CellStore *getExterior (int x, int y);
|
virtual CellStore *getExterior (int x, int y);
|
||||||
|
|
||||||
virtual CellStore *getInterior (const std::string& name);
|
virtual CellStore *getInterior (const std::string& name);
|
||||||
|
|
Loading…
Reference in a new issue