ScummVM API documentation
uidialog.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  *
21  * Based on the original sources
22  * Faery Tale II -- The Halls of the Dead
23  * (c) 1993-1996 The Wyrmkeep Entertainment Co.
24  */
25 
26 #ifndef SAGA2_UIDIALOG_H
27 #define SAGA2_UIDIALOG_H
28 
29 namespace Saga2 {
30 
31 struct SaveFileHeader;
32 
33 // constants
34 const uint32 kDialogGroupID = MKTAG('D', 'I', 'A', 'L');
35 
36 // this should eventually point to the script that contains the credits
37 const uint16 kCreditsScriptNum = 0; // this has a scripts now
38 // >>> need to make resource for defining
39 // script numbers
40 
41 // enumerations
42 enum placardTypes {
43  WOOD_TYPE,
44  STONE_TYPE,
45  BRASS_TYPE
46 };
47 
48 
49 
50 /* ===================================================================== *
51  protoypes
52  * ===================================================================== */
53 
54 // dialog funcs
55 int16 OptionsDialog(bool disableSaveResume = false);
56 
57 // helper funcs
58 void initFileFields(char **fieldStrings);
59 char **destroyFileFields();
60 bool getSaveName(int8 saveNo, SaveFileHeader &header);
61 int16 userDialog(const char *title, const char *msg, const char *btnMsg1,
62  const char *btnMsg2,
63  const char *btnMsg3);
64 
65 void placardWindow(int8 type, char *text);
66 
67 void updateAutoAggressionButton(bool setting);
68 void updateAutoWeaponButton(bool setting);
69 
70 
71 /* ===================================================================== *
72  PlacardWindow class
73  * ===================================================================== */
74 
75 
76 class CPlacardWindow : public ModalWindow {
77 private:
78 
79  enum {
80  kMaxLines = 16,
81  kMaxText = 512
82  };
83 
84  int16 _titleCount;
85  Point16 _titlePos[kMaxLines];
86  char *_titleStrings[kMaxLines];
87  char _titleBuf[kMaxText];
88 
89  textPallete _textPal;
90  gFont *_textFont;
91 
92  void positionText(
93  char *windowText,
94  const Rect16 &textArea);
95 
96  int16 SplitString(
97  char *text,
98  char *textStart[],
99  int16 maxStrings,
100  char delimiter);
101 
102 protected:
103  bool pointerHit(gPanelMessage &msg);
104 
105 public:
106  CPlacardWindow(const Rect16 &r,
107  uint16 ident,
108  AppFunc *cmd,
109  char *windowText,
110  textPallete &pal,
111  gFont *font);
112 
113  void drawClipped(
114  gPort &port,
115  const Point16 &offset,
116  const Rect16 &r);
117 };
118 
119 class CPlacardPanel : public CPlaqText {
120  enum {
121  kMaxLines = 16,
122  kMaxText = 512
123  };
124 
125  int16 _titleCount;
126  Point16 _titlePos[kMaxLines];
127  char *_titleStrings[kMaxLines];
128  char _titleBuf[kMaxText];
129 
130  void positionText(const char *windowText, const Rect16 &textArea);
131 
132  int16 SplitString(
133  char *text,
134  char *textStart[],
135  int16 maxStrings,
136  char delimiter);
137 public:
138  CPlacardPanel(gPanelList &, const Rect16 &, const char *, gFont *,
139  int16, textPallete &, int16, AppFunc *cmd = NULL);
140 
141  void drawClipped(gPort &,
142  const Point16 &,
143  const Rect16 &);
144 
145 };
146 
147 } // end of namespace Saga2
148 
149 #endif
Definition: button.h:54
Definition: uidialog.h:119
Definition: actor.h:32
Definition: gdraw.h:178
Definition: rect.h:42
Definition: panel.h:255
#define MKTAG(a0, a1, a2, a3)
Definition: endian.h:188
Definition: panel.h:218
Definition: gdraw.h:111
Definition: intrface.h:182
Definition: modal.h:45
Definition: uidialog.h:76
Definition: rect.h:290