2017-12-25 23:49:48 +00:00
# ifndef CHAT_HPP_INCLUDED
# define CHAT_HPP_INCLUDED
# include "../../Core/Classes/MessageNode.hpp"
# include <cstdint>
# include <string>
# include <vector>
2018-12-27 18:17:09 +00:00
namespace Chat
2017-12-25 23:49:48 +00:00
{
2018-12-27 18:17:09 +00:00
typedef enum DIALOGUE_STATE
{
IDLE ,
CLICK_CONTINUE ,
SELECT_OPTION ,
PLEASE_WAIT ,
ENTER_AMOUNT ,
2019-06-17 16:44:48 +00:00
LEVEL_UP ,
SPRITE_SELECT_OPTION
2018-12-27 18:17:09 +00:00
} DIALOGUE_STATE ;
2017-12-25 23:49:48 +00:00
2018-12-27 18:17:09 +00:00
typedef enum CHAT_TYPE
{
2019-05-31 20:06:57 +00:00
/** Game message */
GAME_MESSAGE = 0 ,
/** Public chat message from a moderator */
MOD = 1 ,
/** Public chat message */
2018-12-27 18:17:09 +00:00
PUBLIC = 2 ,
2019-05-31 20:06:57 +00:00
/** Private message from another player */
PRIVATE = 3 ,
ENGINE = 4 ,
/** Received when a friend logs in or out */
LOGIN_LOGOUT_NOTIFICATION = 5 ,
/** Private message sent to another player */
PRIVATE_OUT = 6 ,
/** Private message received from a moderator */
MOD_PRIVATE = 7 ,
/** Clan chat message */
FRIENDS = 9 ,
/** Message with information about the current clan chat */
FRIENDS_NOTIFICATION = 11 ,
/** Trade request being sent */
2018-12-27 18:17:09 +00:00
TRADE_SENT = 12 ,
2019-05-31 20:06:57 +00:00
/** Game broadcast */
BROADCAST = 14 ,
/** Abuse report submitted */
SNAPSHOT_FEEDBACK = 26 ,
/** Examine item message */
2018-12-27 18:17:09 +00:00
EXAMINE_ITEM = 27 ,
2019-05-31 20:06:57 +00:00
/** Examine NPC message */
2018-12-27 18:17:09 +00:00
EXAMINE_NPC = 28 ,
2019-05-31 20:06:57 +00:00
/** Examine object message */
EXAMINE_OBJ = 29 ,
/** Message sent when adding a player to friends list */
FRIEND_NOTIFICATION = 30 ,
/** Message sent when adding a player to ignore list */
IGNORE_NOTIFICATION = 31 ,
/** Autotyper message from a player */
AUTOTYPER = 90 ,
/** Autotyper message from a moderator */
MOD_AUTOTYPER = 91 ,
/** Message sent typically when a setting changes */
CONSOLE = 99 ,
/** Message recieved when another sends a trade offer to the local player */
TRADE_REQUEST = 101 ,
/** Message recieved when completing a trade or duel */
TRADE = 102 ,
/** Message received when somebody sends a duel offer */
CHALREQ_TRADE = 103 ,
/** Message received when another player sends a clan challenge offer */
CHALREQ_FRIENDS = 104 ,
/** Filtered message */
SPAM = 105 ,
PLAYER_RELATED = 106 ,
TENSEC_TIMEOUT = 107 ,
2018-12-27 18:17:09 +00:00
UNKNOWN = - 1
} CHAT_TYPE ;
2017-12-25 23:49:48 +00:00
2019-05-31 20:06:57 +00:00
std : : vector < Internal : : MessageNode > GetMessages ( bool Sort = true ) ;
2018-12-27 18:17:09 +00:00
std : : vector < Internal : : MessageNode > GetMessages ( CHAT_TYPE Type , bool Sort = true ) ;
std : : vector < Internal : : MessageNode > GetMessages ( const std : : vector < CHAT_TYPE > & Type , bool Sort = true ) ;
2019-05-31 20:06:57 +00:00
Internal : : MessageNode GetLastMessage ( ) ;
2018-12-27 18:17:09 +00:00
Internal : : MessageNode GetLastMessage ( CHAT_TYPE Type ) ;
2017-12-25 23:49:48 +00:00
2018-12-27 18:17:09 +00:00
DIALOGUE_STATE GetDialogueState ( ) ;
std : : vector < std : : string > GetDialogueOptions ( ) ;
std : : string GetDialogueTitle ( ) ;
std : : string GetDialogueContent ( ) ;
2017-12-25 23:49:48 +00:00
2018-12-27 18:17:09 +00:00
std : : int32_t GetDialogueOptionIndexOf ( const std : : string & Option ) ;
std : : int32_t GetDialogueOptionIndexOf ( const std : : vector < std : : string > & Options ) ;
2017-12-25 23:49:48 +00:00
2018-12-27 18:17:09 +00:00
bool ClickContinue ( bool UseKeyboard = false ) ;
bool EnterAmount ( std : : int32_t Amount ) ;
2018-05-17 01:18:17 +00:00
2018-12-27 18:17:09 +00:00
bool SelectDialogueOption ( std : : int32_t Index , bool UseKeyboard = false ) ; // Index starts at 0
bool SelectDialogueOption ( const std : : string & Option , bool UseKeyboard = false ) ;
bool SelectDialogueOption ( const std : : vector < std : : string > & Options , bool UseKeyboard = false ) ;
2018-05-17 01:18:17 +00:00
2018-12-27 18:17:09 +00:00
bool WaitDialogueState ( std : : uint32_t Duration , std : : uint32_t Step , Chat : : DIALOGUE_STATE State , bool Result = true ) ; // Waits until the current chat state equals State
2018-12-31 21:52:58 +00:00
}
2017-12-25 23:49:48 +00:00
# endif // CHAT_HPP_INCLUDED