Merge branch 'master' into dialogue

Conflicts:
	apps/openmw/CMakeLists.txt
	apps/openmw/mwclass/creature.cpp
	apps/openmw/mwclass/creature.hpp
	apps/openmw/mwclass/npc.cpp
	apps/openmw/mwclass/npc.hpp
pull/7/head
Marc Zinnschlag 15 years ago
commit d42747e85b

@ -89,6 +89,7 @@ set(GAMEWORLD
mwworld/globals.cpp
mwworld/class.cpp
mwworld/actionteleport.cpp
mwworld/actiontalk.cpp
)
set(GAMEWORLD_HEADER
mwworld/refdata.hpp
@ -101,6 +102,7 @@ set(GAMEWORLD_HEADER
mwworld/nullaction.hpp
mwworld/actionteleport.hpp
mwworld/containerstore.hpp
mwworld/actiontalk.hpp
)
source_group(apps\\openmw\\mwworld FILES ${GAMEWORLD} ${GAMEWORLD_HEADER})

@ -6,6 +6,7 @@
#include "../mwmechanics/creaturestats.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontalk.hpp"
namespace MWClass
{
@ -58,6 +59,12 @@ namespace MWClass
}
return *ptr.getRefData().getContainerStore();
}
boost::shared_ptr<MWWorld::Action> Creature::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const
{
return boost::shared_ptr<MWWorld::Action> (new MWWorld::ActionTalk (ptr));
}
std::string Creature::getScript (const MWWorld::Ptr& ptr) const

@ -20,6 +20,10 @@ namespace MWClass
const MWWorld::Ptr& ptr) const;
///< Return container store
virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
///< Generate action for activation
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
///< Return name of the script attached to ptr

@ -6,6 +6,7 @@
#include "../mwmechanics/creaturestats.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontalk.hpp"
namespace MWClass
{
@ -58,6 +59,12 @@ namespace MWClass
}
return *ptr.getRefData().getContainerStore();
}
boost::shared_ptr<MWWorld::Action> Npc::activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const
{
return boost::shared_ptr<MWWorld::Action> (new MWWorld::ActionTalk (ptr));
}
std::string Npc::getScript (const MWWorld::Ptr& ptr) const

@ -20,6 +20,10 @@ namespace MWClass
const MWWorld::Ptr& ptr) const;
///< Return container store
virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const;
///< Generate action for activation
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
///< Return name of the script attached to ptr

@ -0,0 +1,16 @@
#include "actiontalk.hpp"
#include "environment.hpp"
#include "../mwgui/window_manager.hpp"
namespace MWWorld
{
ActionTalk::ActionTalk (const Ptr& actor) : mActor (actor) {}
void ActionTalk::execute (Environment& environment)
{
environment.mWindowManager->setMode (MWGui::GM_Dialogue);
}
}

@ -0,0 +1,21 @@
#ifndef GAME_MWWORLD_ACTIONTALK_H
#define GAME_MWWORLD_ACTIONTALK_H
#include "ptr.hpp"
#include "action.hpp"
namespace MWWorld
{
class ActionTalk : public Action
{
Ptr mActor;
public:
ActionTalk (const Ptr& actor);
virtual void execute (Environment& environment);
};
}
#endif
Loading…
Cancel
Save