2017-05-24 20:22:43 +00:00
|
|
|
#ifndef OPENMW_DIALOGUEAPI_HPP
|
|
|
|
#define OPENMW_DIALOGUEAPI_HPP
|
|
|
|
|
|
|
|
#define DIALOGUEAPI \
|
2017-07-07 06:25:48 +00:00
|
|
|
{"InitializeTopicChanges", DialogueFunctions::InitializeTopicChanges},\
|
|
|
|
\
|
2017-05-24 20:22:43 +00:00
|
|
|
{"GetTopicChangesSize", DialogueFunctions::GetTopicChangesSize},\
|
|
|
|
\
|
|
|
|
{"AddTopic", DialogueFunctions::AddTopic},\
|
|
|
|
\
|
|
|
|
{"GetTopicId", DialogueFunctions::GetTopicId},\
|
|
|
|
\
|
2017-10-27 06:10:29 +00:00
|
|
|
{"SendTopicChanges", DialogueFunctions::SendTopicChanges},\
|
|
|
|
\
|
|
|
|
{"PlayAnimation", DialogueFunctions::PlayAnimation}
|
2017-05-24 20:22:43 +00:00
|
|
|
|
|
|
|
class DialogueFunctions
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Clear the last recorded topic changes for a player.
|
|
|
|
*
|
|
|
|
* This is used to initialize the sending of new PlayerTopic packets.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose topic changes should be used.
|
|
|
|
* \return void
|
|
|
|
*/
|
2017-07-07 06:25:48 +00:00
|
|
|
static void InitializeTopicChanges(unsigned short pid) noexcept;
|
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Get the number of indexes in a player's latest topic changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose topic changes should be used.
|
|
|
|
* \return The number of indexes.
|
|
|
|
*/
|
2017-05-24 20:22:43 +00:00
|
|
|
static unsigned int GetTopicChangesSize(unsigned short pid) noexcept;
|
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Add a new topic to the topic changes for a player.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose topic changes should be used.
|
|
|
|
* \param topicId The topicId of the topic.
|
|
|
|
* \return void
|
|
|
|
*/
|
2017-05-24 20:22:43 +00:00
|
|
|
static void AddTopic(unsigned short pid, const char* topicId) noexcept;
|
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Get the topicId at a certain index in a player's latest topic changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose topic changes should be used.
|
|
|
|
* \param i The index of the topic.
|
|
|
|
* \return The topicId.
|
|
|
|
*/
|
2017-05-24 20:22:43 +00:00
|
|
|
static const char *GetTopicId(unsigned short pid, unsigned int i) noexcept;
|
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Send a PlayerTopic packet with a player's recorded topic changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose topic changes should be used.
|
|
|
|
* \param toOthers Whether this packet should be sent only to other players or
|
|
|
|
* only to the player it is about.
|
|
|
|
* \return void
|
|
|
|
*/
|
2017-07-07 06:25:48 +00:00
|
|
|
static void SendTopicChanges(unsigned short pid, bool toOthers = false) noexcept;
|
2017-10-27 06:10:29 +00:00
|
|
|
|
|
|
|
static void PlayAnimation(unsigned short pid, const char* groupname, int mode = 0, int count = 1, bool persist = false) noexcept;
|
|
|
|
|
2017-05-24 20:22:43 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //OPENMW_DIALOGUEAPI_HPP
|