forked from raduprv/Eternal-Lands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialogues.h
113 lines (95 loc) · 2.68 KB
/
dialogues.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*!
* \file
* \ingroup network_text
* \brief handles displaying of different dialogues.
*/
#ifndef __DIALOGUES_H__
#define __DIALOGUES_H__
#include <SDL_types.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
* \name Response count
*/
#define MAX_RESPONSES 40 /*!< max. number of response entries in \see dialogue_responces */
extern unsigned char dialogue_string[2048]; /*!< buffer for strings in a dialogue */
extern unsigned char npc_name[20]; /*!< buffer for the NPCs name */
extern int cur_portrait; /*!< pointer to the portrait used by a particular NPC */
extern char npc_mark_str[20]; /*!< npc location in map mark - the template (print format) string used */
/*!
* \name portrait textures
*/
/*! @{ */
#define MAX_PORTRAITS_TEXTURES 16
extern int portraits_tex[MAX_PORTRAITS_TEXTURES];
extern int use_keypress_dialogue_boxes, use_full_dialogue_window;
/*! @} */
/*!
* response structure used in dialogues with NPCs. It contains the data of a response from some NPC.
*/
typedef struct{
char text[200]; /*!< text of the response */
/*! \name response coordinates @{ */
int x_start;
int y_start;
int x_len;
int y_len;
// orig_* is the unadulterated information from the server to save repeatedly recalculating
int orig_x_start;
int orig_y_start;
int orig_x_len;
int orig_y_len;
/*! @} */
int to_actor; /*!< id of the actor to which this response is directed */
int response_id; /*!< unique id of the response */
int in_use; /*!< flag whether this response is in use or not */
int mouse_over; /*!< flag whether the mouse is over this response */
}response;
extern response dialogue_responces[MAX_RESPONSES];
/*! \name windows handlers
* @{ */
extern int dialogue_win; /*!< dialogue windows handler */
/*! @} */
extern int dialogue_menu_x;
extern int dialogue_menu_y;
extern int dialogue_menu_x_len;
extern int dialogue_menu_y_len;
//extern int dialogue_menu_dragged;
extern int no_bounding_box;
extern int autoclose_storage_dialogue;
extern int auto_select_storage_option;
extern int dialogue_copy_excludes_responses;
extern int dialogue_copy_excludes_newlines;
/*!
* \ingroup other
* \brief builds the response entries for the given \a data.
*
* Builds the response entries for the given \a data.
*
* \param data
* \param total_length
*/
void build_response_entries (const Uint8 *data,int total_length);
/*!
* \ingroup network_text
* \brief displays the current dialogue
*
* Displays the current dialogue.
*
* \callgraph
*/
void display_dialogue();
/*!
* \ingroup network_text
* \brief closes the current dialogue
*
* Closes the current dialogue.
*
* \sa close_window
*/
void close_dialogue();
#ifdef __cplusplus
} // extern "C"
#endif
#endif