mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
added dialog manager
This commit is contained in:
parent
7611572065
commit
8045320ac9
5 changed files with 67 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
#include "mwclass/classes.hpp"
|
||||
|
||||
#include "mwdialog/dialogmanager.hpp"
|
||||
|
||||
#include "mwmechanics/mechanicsmanager.hpp"
|
||||
|
||||
#include <OgreRoot.h>
|
||||
|
@ -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;
|
||||
|
|
17
apps/openmw/mwdialog/dialogmanager.cpp
Normal file
17
apps/openmw/mwdialog/dialogmanager.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
|
||||
#include "dialogmanager.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
26
apps/openmw/mwdialog/dialogmanager.hpp
Normal file
26
apps/openmw/mwdialog/dialogmanager.hpp
Normal file
|
@ -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
|
|
@ -21,6 +21,11 @@ namespace MWMechanics
|
|||
class MechanicsManager;
|
||||
}
|
||||
|
||||
namespace MWDialog
|
||||
{
|
||||
class DialogManager;
|
||||
}
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
class World;
|
||||
|
@ -31,7 +36,7 @@ namespace MWWorld
|
|||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue