22 #ifndef TITANIC_MESSAGES_H 23 #define TITANIC_MESSAGES_H 25 #include "common/keyboard.h" 26 #include "titanic/core/saveable_object.h" 27 #include "titanic/core/tree_item.h" 28 #include "titanic/support/strings.h" 34 MSGFLAG_BREAK_IF_HANDLED = 2,
38 #define MESSAGE0(NAME) \ 39 class NAME: public CMessage { \ 40 public: NAME() : CMessage() {} \ 42 static bool isSupportedBy(const CTreeItem *item) { \ 43 return supports(item, _type); } \ 45 #define MESSAGE1(NAME, F1, N1, V1) \ 46 class NAME: public CMessage { \ 48 NAME() : CMessage(), _##N1(V1) {} \ 49 NAME(F1 N1) : CMessage(), _##N1(N1) {} \ 51 static bool isSupportedBy(const CTreeItem *item) { \ 52 return supports(item, _type); } \ 54 #define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) \ 55 class NAME: public CMessage { \ 56 public: F1 _##N1; F2 _##N2; \ 57 NAME() : CMessage(), _##N1(V1), _##N2(V2) {} \ 58 NAME(F1 N1, F2 N2) : CMessage(), _##N1(N1), _##N2(N2) {} \ 60 static bool isSupportedBy(const CTreeItem *item) { \ 61 return supports(item, _type); } \ 63 #define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) \ 64 class NAME: public CMessage { \ 65 public: F1 _##N1; F2 _##N2; F3 _##N3; \ 66 NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3) {} \ 67 NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3) {} \ 69 static bool isSupportedBy(const CTreeItem *item) { \ 70 return supports(item, _type); } \ 72 #define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) \ 73 class NAME: public CMessage { \ 74 public: F1 _##N1; F2 _##N2; F3 _##N3; F4 _##N4; \ 75 NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3), _##N4(V4) {} \ 76 NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3), _##N4(N4) {} \ 78 static bool isSupportedBy(const CTreeItem *item) { \ 79 return supports(item, _type); } \ 106 int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
113 int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
135 virtual bool isMouseMsg()
const;
136 virtual bool isButtonDownMsg()
const;
137 virtual bool isButtonUpMsg()
const;
138 virtual bool isMouseMoveMsg()
const;
139 virtual bool isDoubleClickMsg()
const;
140 virtual bool isEnterRoomMsg()
const;
141 virtual bool isPreEnterRoomMsg()
const;
142 virtual bool isleaveRoomMsg()
const;
143 virtual bool isEnterNodeMsg()
const;
144 virtual bool isPreEnterNodeMsg()
const;
145 virtual bool isLeaveNodeMsg()
const;
146 virtual bool isEnterViewMsg()
const;
147 virtual bool isPreEnterViewMsg()
const;
148 virtual bool isLeaveViewMsg()
const;
151 enum EditControlAction {
160 EDIT_SHOW_CURSOR = 8,
161 EDIT_HIDE_CURSOR = 9,
171 EditControlAction _mode;
179 CEditControlMsg() : _mode(EDIT_INIT), _param(0), _textR(0), _textG(0), _textB(0) {}
181 static bool isSupportedBy(
const CTreeItem *item) {
196 CTimerMsg(uint ticks, uint timerCtr,
int actionVal,
const CString &action) :
197 CTimeMsg(ticks), _timerCtr(timerCtr), _actionVal(actionVal), _action(action) {}
199 static bool isSupportedBy(
const CTreeItem *item) {
213 static bool isSupportedBy(
const CTreeItem *item) {
218 enum MissiveOMatAction {
219 MESSAGE_NONE = 1, MESSAGE_SHOW = 2, NEXT_MESSAGE = 3, PRIOR_MESSAGE = 4,
220 MESSAGE_5 = 5, MESSAGE_DOWN = 6, MESSAGE_UP = 7, REDRAW_MESSAGE = 8,
225 MOVE_NONE = 0, MOVE_FORWARDS, MOVE_BACKWARDS, TURN_LEFT, TURN_RIGHT
228 enum ChangeMusicAction {
229 MUSIC_NONE = 0, MUSIC_STOP = 1, MUSIC_START = 2
241 _movement(getMovement(key)) {}
243 static bool isSupportedBy(
const CTreeItem *item) {
250 static Movement getMovement(Common::KeyCode keycode);
312 MESSAGE4(
CLightsMsg,
bool, topRight,
false,
bool, topLeft,
false,
bool, bottomLeft,
false,
bool, bottomRight,
false);
337 MESSAGE3(
CPhonographStopMsg,
bool, leavingRoom,
false,
bool, cylinderPresent,
false,
bool, dontStop,
false);
378 MESSAGE4(
CSubAcceptCCarryMsg,
CString, string1,
"",
int, value1, 0,
int, value2, 0,
CCarry *, item,
nullptr);
395 MESSAGE4(
CTrueTalkGetAnimSetMsg,
int, value1, 0, uint, index, 0, uint, startFrame, 0, uint, endFrame, 0);
Definition: messages.h:349
Definition: messages.h:333
Definition: messages.h:404
Definition: messages.h:281
Definition: messages.h:336
Definition: messages.h:302
Definition: messages.h:331
Definition: messages.h:297
Definition: messages.h:279
Definition: move_player_to.h:29
Definition: messages.h:288
Definition: messages.h:328
Definition: messages.h:377
Definition: messages.h:365
Definition: messages.h:317
Definition: messages.h:323
Definition: messages.h:350
Definition: messages.h:388
Definition: messages.h:347
Definition: messages.h:380
static bool supports(const CTreeItem *treeItem, ClassDef *classDef)
Definition: messages.h:257
Definition: messages.h:359
Definition: messages.h:298
Definition: messages.h:369
Definition: messages.h:274
Definition: messages.h:316
Definition: messages.h:299
Definition: messages.h:397
void save(SimpleFile *file, int indent) override
Definition: messages.h:394
Definition: messages.h:294
Definition: messages.h:283
Definition: messages.h:371
Definition: messages.h:326
Definition: messages.h:261
Definition: messages.h:266
Definition: messages.h:385
Definition: messages.h:381
Definition: messages.h:289
Definition: messages.h:332
Definition: messages.h:309
Definition: messages.h:342
Definition: messages.h:340
Definition: messages.h:338
Definition: character.h:29
Definition: messages.h:390
Definition: messages.h:344
Definition: simple_file.h:49
Definition: saveable_object.h:35
Definition: messages.h:290
Definition: messages.h:280
Definition: messages.h:277
Definition: messages.h:363
Definition: messages.h:382
Definition: messages.h:256
Definition: messages.h:374
Definition: messages.h:387
Definition: room_item.h:33
Definition: messages.h:407
Definition: messages.h:321
Definition: messages.h:258
Definition: node_item.h:29
Definition: messages.h:367
Definition: messages.h:311
Definition: messages.h:357
Definition: messages.h:345
Definition: messages.h:399
Definition: messages.h:188
Definition: messages.h:272
Definition: messages.h:330
Definition: messages.h:263
Definition: messages.h:346
Definition: messages.h:327
Definition: messages.h:269
Definition: messages.h:383
Definition: messages.h:255
Definition: messages.h:354
Definition: messages.h:286
Definition: messages.h:401
Definition: messages.h:271
Definition: messages.h:343
Definition: messages.h:293
Definition: messages.h:392
Definition: messages.h:273
Definition: game_object.h:79
Definition: messages.h:319
Definition: messages.h:304
Definition: messages.h:408
Definition: messages.h:398
Definition: messages.h:370
Definition: messages.h:264
Definition: messages.h:282
bool execute(CTreeItem *target, const ClassDef *classDef=nullptr, int flags=MSGFLAG_SCAN|MSGFLAG_BREAK_IF_HANDLED)
Definition: messages.h:276
Definition: message_target.h:34
Definition: messages.h:386
Definition: tree_item.h:37
Definition: messages.h:356
Definition: messages.h:318
Definition: messages.h:285
Definition: messages.h:254
Definition: messages.h:396
Definition: messages.h:360
Definition: messages.h:395
Definition: messages.h:391
Definition: messages.h:334
Definition: messages.h:314
Definition: messages.h:364
Definition: messages.h:376
Definition: messages.h:337
Definition: messages.h:287
Definition: messages.h:324
Definition: messages.h:315
Definition: messages.h:378
void load(SimpleFile *file) override
Definition: messages.h:308
Definition: messages.h:312
Definition: messages.h:204
Definition: messages.h:169
Definition: messages.h:284
Definition: messages.h:339
Definition: messages.h:265
Definition: messages.h:295
Definition: messages.h:402
Definition: messages.h:296
Definition: messages.h:373
Definition: messages.h:409
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
Definition: messages.h:310
Definition: messages.h:351
Definition: messages.h:320
Definition: messages.h:400
Definition: messages.h:379
Definition: messages.h:329
Definition: messages.h:405
Definition: messages.h:306
Definition: messages.h:307
Definition: messages.h:341
Definition: messages.h:292
Definition: messages.h:303
Definition: messages.h:275
Definition: keyboard.h:294
Definition: messages.h:305
Definition: messages.h:267
Definition: messages.h:355
Definition: messages.h:301
Definition: messages.h:372
Definition: messages.h:368
Definition: messages.h:353
Definition: messages.h:384
Definition: saveable_object.h:58
Definition: messages.h:259
Definition: messages.h:393
Definition: messages.h:322
Definition: messages.h:389
Definition: messages.h:268
Definition: messages.h:410
Definition: messages.h:335
Definition: messages.h:291
Definition: messages.h:358
virtual bool perform(CTreeItem *treeItem)
Definition: messages.h:270
Definition: messages.h:352
Definition: messages.h:406
Definition: messages.h:313
Definition: messages.h:375
Definition: messages.h:403
Definition: messages.h:262
Definition: messages.h:91
Definition: messages.h:278
Definition: messages.h:186
Definition: messages.h:260
Definition: music_player.h:30
Definition: messages.h:362
Definition: messages.h:325
Definition: messages.h:232
Definition: messages.h:300
Definition: messages.h:348
Definition: view_item.h:32