mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 11:23:51 +00:00
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
This commit is contained in:
commit
d42747e85b
7 changed files with 61 additions and 0 deletions
|
@ -89,6 +89,7 @@ set(GAMEWORLD
|
||||||
mwworld/globals.cpp
|
mwworld/globals.cpp
|
||||||
mwworld/class.cpp
|
mwworld/class.cpp
|
||||||
mwworld/actionteleport.cpp
|
mwworld/actionteleport.cpp
|
||||||
|
mwworld/actiontalk.cpp
|
||||||
)
|
)
|
||||||
set(GAMEWORLD_HEADER
|
set(GAMEWORLD_HEADER
|
||||||
mwworld/refdata.hpp
|
mwworld/refdata.hpp
|
||||||
|
@ -101,6 +102,7 @@ set(GAMEWORLD_HEADER
|
||||||
mwworld/nullaction.hpp
|
mwworld/nullaction.hpp
|
||||||
mwworld/actionteleport.hpp
|
mwworld/actionteleport.hpp
|
||||||
mwworld/containerstore.hpp
|
mwworld/containerstore.hpp
|
||||||
|
mwworld/actiontalk.hpp
|
||||||
)
|
)
|
||||||
source_group(apps\\openmw\\mwworld FILES ${GAMEWORLD} ${GAMEWORLD_HEADER})
|
source_group(apps\\openmw\\mwworld FILES ${GAMEWORLD} ${GAMEWORLD_HEADER})
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "../mwmechanics/creaturestats.hpp"
|
#include "../mwmechanics/creaturestats.hpp"
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
|
#include "../mwworld/actiontalk.hpp"
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
|
@ -60,6 +61,12 @@ namespace MWClass
|
||||||
return *ptr.getRefData().getContainerStore();
|
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
|
std::string Creature::getScript (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -20,6 +20,10 @@ namespace MWClass
|
||||||
const MWWorld::Ptr& ptr) const;
|
const MWWorld::Ptr& ptr) const;
|
||||||
///< Return container store
|
///< 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;
|
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||||
///< Return name of the script attached to ptr
|
///< Return name of the script attached to ptr
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "../mwmechanics/creaturestats.hpp"
|
#include "../mwmechanics/creaturestats.hpp"
|
||||||
|
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
|
#include "../mwworld/actiontalk.hpp"
|
||||||
|
|
||||||
namespace MWClass
|
namespace MWClass
|
||||||
{
|
{
|
||||||
|
@ -60,6 +61,12 @@ namespace MWClass
|
||||||
return *ptr.getRefData().getContainerStore();
|
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
|
std::string Npc::getScript (const MWWorld::Ptr& ptr) const
|
||||||
{
|
{
|
||||||
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
ESMS::LiveCellRef<ESM::NPC, MWWorld::RefData> *ref =
|
||||||
|
|
|
@ -20,6 +20,10 @@ namespace MWClass
|
||||||
const MWWorld::Ptr& ptr) const;
|
const MWWorld::Ptr& ptr) const;
|
||||||
///< Return container store
|
///< 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;
|
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||||
///< Return name of the script attached to ptr
|
///< Return name of the script attached to ptr
|
||||||
|
|
||||||
|
|
16
apps/openmw/mwworld/actiontalk.cpp
Normal file
16
apps/openmw/mwworld/actiontalk.cpp
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
21
apps/openmw/mwworld/actiontalk.hpp
Normal file
21
apps/openmw/mwworld/actiontalk.hpp
Normal file
|
@ -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…
Reference in a new issue