diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index c9112b0ee..f07143be5 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -41,6 +41,14 @@ set(GAMEGUI ) source_group(apps\\openmw\\mwgui FILES ${GAMEGUI_HEADER} ${GAMEGUI}) +set(GAMEDIALOG_HEADER + mwdialog/dialogmanager.hpp +) +set(GAMEDIALOG + mwdialog/dialogmanager.cpp +) +source_group(apps\\openmw\\mwdialog FILES ${GAMEDIALOG_HEADER} ${GAMEDIALOG}) + set(GAMESCRIPT mwscript/scriptmanager.cpp mwscript/compilercontext.cpp @@ -154,11 +162,11 @@ set(GAMEMECHANICS_HEADER source_group(apps\\openmw\\mwmechanics FILES ${GAMEMECHANICS} ${GAMEMECHANICS_HEADER}) set(OPENMW_CPP ${GAME} ${GAMEREND} ${GAMEINPUT} ${GAMESCRIPT} ${GAMESOUND} ${GAMEGUI} ${GAMEWORLD} - ${GAMECLASS} ${GAMEMECHANICS} + ${GAMECLASS} ${GAMEMECHANICS} ${GAMEDIALOG} ) set(OPENMW_HEADER ${GAME_HEADER} ${GAMEREND_HEADER} ${GAMEINPUT_HEADER} ${GAMESCRIPT_HEADER} ${GAMESOUND_HEADER} ${GAMEGUI_HEADER} ${GAMEWORLD_HEADER} ${GAMECLASS_HEADER} - ${GAMEMECHANICS_HEADER} + ${GAMEMECHANICS_HEADER} ${GAMEDIALOG_HEADER} ) # Main executable diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index b67bcd0ac..2cd738623 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -28,6 +28,8 @@ #include "mwclass/classes.hpp" +#include "mwdialog/dialogmanager.hpp" + #include "mwmechanics/mechanicsmanager.hpp" #include @@ -117,6 +119,7 @@ OMW::Engine::~Engine() delete mEnvironment.mSoundManager; delete mEnvironment.mGlobalScripts; delete mEnvironment.mMechanicsManager; + delete mEnvironment.mDialogManager; delete mScriptManager; delete mScriptContext; } @@ -250,6 +253,9 @@ void OMW::Engine::go() mEnvironment.mMechanicsManager = new MWMechanics::MechanicsManager ( mEnvironment.mWorld->getStore(), *mEnvironment.mWindowManager); + // Create dialog system + mEnvironment.mDialogManager = new MWDialog::DialogManager (mEnvironment); + // load cell ESM::Position pos; pos.pos[0] = pos.pos[1] = pos.pos[2] = 0; diff --git a/apps/openmw/mwdialog/dialogmanager.cpp b/apps/openmw/mwdialog/dialogmanager.cpp new file mode 100644 index 000000000..2dfaebb76 --- /dev/null +++ b/apps/openmw/mwdialog/dialogmanager.cpp @@ -0,0 +1,17 @@ + +#include "dialogmanager.hpp" + +#include "../mwworld/class.hpp" + +#include + +namespace MWDialog +{ + DialogManager::DialogManager (MWWorld::Environment& environment) : mEnvironment (environment) {} + + void DialogManager::startDialog (const MWWorld::Ptr& actor) + { + std::cout << "talking with " << MWWorld::Class::get (actor).getName (actor) << std::endl; + } + +} diff --git a/apps/openmw/mwdialog/dialogmanager.hpp b/apps/openmw/mwdialog/dialogmanager.hpp new file mode 100644 index 000000000..8f4067c9a --- /dev/null +++ b/apps/openmw/mwdialog/dialogmanager.hpp @@ -0,0 +1,26 @@ +#ifndef GAME_MMDIALOG_DIALOGMANAGER_H +#define GAME_MWDIALOG_DIALOGMANAGER_H + +#include "../mwworld/ptr.hpp" + +namespace MWWorld +{ + class Environment; +} + +namespace MWDialog +{ + class DialogManager + { + MWWorld::Environment& mEnvironment; + + public: + + DialogManager (MWWorld::Environment& environment); + + void startDialog (const MWWorld::Ptr& actor); + + }; +} + +#endif diff --git a/apps/openmw/mwworld/environment.hpp b/apps/openmw/mwworld/environment.hpp index 0c6476d52..1887e619f 100644 --- a/apps/openmw/mwworld/environment.hpp +++ b/apps/openmw/mwworld/environment.hpp @@ -21,17 +21,22 @@ namespace MWMechanics class MechanicsManager; } +namespace MWDialog +{ + class DialogManager; +} + namespace MWWorld { class World; ///< Collection of script-accessable sub-systems class Environment - { + { public: Environment() : mWorld (0), mSoundManager (0), mGlobalScripts (0), mWindowManager (0), - mMechanicsManager (0), mFrameDuration (0) + mMechanicsManager (0), mDialogManager (0), mFrameDuration (0) {} World *mWorld; @@ -39,9 +44,9 @@ namespace MWWorld MWScript::GlobalScripts *mGlobalScripts; MWGui::WindowManager *mWindowManager; MWMechanics::MechanicsManager *mMechanicsManager; + MWDialog::DialogManager *mDialogManager; float mFrameDuration; }; } #endif -