22 #ifndef CRYOMNI3D_DIALOGS_MANAGER_H 23 #define CRYOMNI3D_DIALOGS_MANAGER_H 25 #include "common/array.h" 26 #include "common/hash-str.h" 27 #include "common/hashmap.h" 28 #include "common/path.h" 29 #include "common/rect.h" 30 #include "common/str.h" 31 #include "common/str-array.h" 39 SubtitlesSettings(int16 textLeft, int16 textTop, int16 textRight, int16 textBottom,
40 int16 drawLeft, int16 drawTop, int16 drawRight, int16 drawBottom) :
41 textRect(textLeft, textTop, textRight, textBottom), drawRect(drawLeft, drawTop, drawRight,
48 _ignoreNoEndOfConversation(
false) { }
51 void init(uint arraySize,
const Common::String &endOfConversationText) { _dialogsVariables.resize(arraySize); _endOfConversationText = endOfConversationText; }
54 void setupVariable(uint
id,
const Common::String &variable) { _dialogsVariables[id] = DialogVariable(variable,
'N'); }
55 void reinitVariables();
56 uint size()
const {
return _dialogsVariables.size(); }
57 byte &operator[](uint idx) {
return _dialogsVariables[idx].value; }
58 const byte &operator[](uint idx)
const {
return _dialogsVariables[idx].value; }
59 byte &operator[](
const Common::String &name) {
return find(name).value; }
60 const byte &operator[](
const Common::String &name)
const {
return find(name).value; }
64 void setIgnoreNoEndOfConversation(
bool ignore) { _ignoreNoEndOfConversation = ignore; }
77 Goto() : label(), text(
nullptr) {
79 Goto(
const Common::String &label_,
const char *text_) : label(label_), text(text_) {
86 struct DialogVariable {
87 DialogVariable() : name(), value(0) {
89 DialogVariable(
const Common::String &name_, byte value_) : name(name_), value(value_) {
100 void populateLabels();
101 const char *findLabel(
const char *label,
const char **realLabel =
nullptr)
const;
104 const char *findSequence(
const char *sequence)
const;
111 void executeLet(
const char *letLine);
112 void executeShow(
const char *showLine);
114 const char *executePlayerQuestion(
const char *text,
bool dryRun,
const char **realLabel =
nullptr);
115 const char *parseIf(
const char *ifLine);
117 const char *nextLine(
const char *currentPtr)
const;
118 const char *nextChar(
const char *currentPtr)
const;
119 const char *previousMatch(
const char *currentPtr,
const char *str)
const;
126 bool _ignoreNoEndOfConversation;
Definition: cryomni3d.h:62
Definition: dialogs_manager.h:37
Definition: dialogs_manager.h:35