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 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (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, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef TITANIC_PET_REMOTE_GLYPHS_H 24 #define TITANIC_PET_REMOTE_GLYPHS_H 25 26 #include "titanic/pet_control/pet_glyphs.h" 27 #include "titanic/pet_control/pet_gfx_element.h" 28 29 namespace Titanic { 30 31 enum RemoteGlyph { 32 GLYPH_SUMMON_ELEVATOR = 0, GLYPH_SUMMON_PELLERATOR = 1, 33 GLYPH_TELEVISION_CONTROL = 2, GLYPH_ENTERTAINMENT_DEVICE = 3, 34 GLYPH_OPERATE_LIGHTS = 4, GLYPH_DEPLOY_FLORAL = 5, 35 GLYPH_DEPLOY_FULLY_RELAXATION = 6, GLYPH_DEPLOY_COMFORT = 7, 36 GLYPH_DEPLOY_MINOR_STORAGE = 8, GLYPH_DEPLOY_MAJOR_RELAXATION = 9, 37 GLYPH_INFLATE_RELAXATION = 10, GLYPH_DEPLOY_MAINTENANCE = 11, 38 GLYPH_DEPLOY_WORK_SURFACE = 12, GLYPH_DEPLOY_MINOR_RELAXATION = 13, 39 GLYPH_DEPLOY_SINK = 14, GLYPH_DEPLOY_MAJOR_STORAGE = 15, 40 GLYPH_SUCCUBUS_DELIVERY = 16, GLYPH_NAVIGATION_CONTROLLER = 17, 41 GLYPH_SKIP_NAVIGATION = 18, GLYPH_GOTO_BOTTOM_OF_WELL = 19, 42 GLYPH_GOTO_TOP_OF_WELL = 20, GLYPH_GOTO_STATEROOM = 21, 43 GLYPH_GOTO_BAR = 22, GLYPH_GOTO_PROMENADE = 23, GLYPH_GOTO_ARBORETUM = 24, 44 GLYPH_GOTO_MUSIC_ROOM = 25, GLYPH_GOTO_RESTAURANT = 26 45 }; 46 47 enum RemoteMessage { 48 RMSG_LEFT = 0, RMSG_RIGHT = 1, RMSG_UP = 2, RMSG_DOWN = 3, RMSG_ACTIVATE = 4 49 }; 50 51 class CPetRemote; 52 53 class CPetRemoteGlyphs : public CPetGlyphs { 54 public: 55 /** 56 * Returns the owning CPetRemote 57 */ 58 CPetRemote *getOwner() const; 59 60 /** 61 * Generates a PET message 62 */ 63 void generateMessage(RemoteMessage msgNum, const CString &name, int num = -1); 64 }; 65 66 class CPetRemoteGlyph : public CPetGlyph { 67 protected: 68 CPetGfxElement *_callButton; 69 protected: CPetRemoteGlyph()70 CPetRemoteGlyph() : CPetGlyph(), _callButton(nullptr) {} 71 72 /** 73 * Set defaults for the glyph 74 */ 75 void setDefaults(const CString &name, CPetControl *petControl); 76 77 /** 78 * Get the owner 79 */ 80 CPetRemoteGlyphs *getOwner() const; 81 82 /** 83 * Get an element by id from the parent Remote section 84 */ 85 CPetGfxElement *getElement(uint id) const; 86 }; 87 88 class CBasicRemoteGlyph : public CPetRemoteGlyph { 89 private: 90 CString _gfxName, _tooltip, _msgString; 91 public: CBasicRemoteGlyph(const CString & gfxName,const CString & tooltip,const CString & msgString)92 CBasicRemoteGlyph(const CString &gfxName, const CString &tooltip, 93 const CString &msgString) : CPetRemoteGlyph(), 94 _gfxName(gfxName), _tooltip(tooltip), _msgString(msgString) {} 95 96 /** 97 * Setup the glyph 98 */ 99 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 100 101 /** 102 * Handles any secondary drawing of the glyph 103 */ 104 void draw2(CScreenManager *screenManager) override; 105 106 /** 107 * Called for mouse button down messages 108 */ 109 bool MouseButtonDownMsg(const Point &pt) override; 110 111 /** 112 * Handles mouse button up messages 113 */ 114 bool MouseButtonUpMsg(const Point &pt) override; 115 116 /** 117 * Returns the tooltip text for when the glyph is selected 118 */ 119 void getTooltip(CTextControl *text) override; 120 }; 121 122 class CToggleRemoteGlyph : public CPetRemoteGlyph { 123 protected: 124 CPetGfxElement *_toggle; 125 bool _toggleFlag; 126 public: CToggleRemoteGlyph()127 CToggleRemoteGlyph() : CPetRemoteGlyph(), _toggle(nullptr), _toggleFlag(false) {} 128 129 /** 130 * Setup the glyph 131 */ 132 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 133 134 /** 135 * Handles any secondary drawing of the glyph 136 */ 137 void draw2(CScreenManager *screenManager) override; 138 139 /** 140 * Called for mouse button down messages to the default element 141 */ 142 bool elementMouseButtonDownMsg(const Point &pt, int petNum); 143 144 /** 145 * Called for mouse button up messages to the default element 146 */ 147 bool elementMouseButtonUpMsg(const Point &pt, int petNum); 148 }; 149 150 class CRemoteGotoGlyph : public CPetRemoteGlyph { 151 protected: 152 int _roomIndex; 153 CPetGfxElement *_goButton; 154 CString _gfxName, _tooltip; 155 public: CRemoteGotoGlyph()156 CRemoteGotoGlyph() : CPetRemoteGlyph(), _goButton(nullptr), _roomIndex(21) {} CRemoteGotoGlyph(const CString & gfxName,const CString & tooltip,int roomIndex)157 CRemoteGotoGlyph(const CString &gfxName, const CString &tooltip, int roomIndex) : 158 CPetRemoteGlyph(), _gfxName(gfxName), _tooltip(tooltip), _roomIndex(roomIndex), 159 _goButton(nullptr) {} 160 161 /** 162 * Setup the glyph 163 */ 164 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 165 166 /** 167 * Handles any secondary drawing of the glyph 168 */ 169 void draw2(CScreenManager *screenManager) override; 170 171 /** 172 * Called for mouse button down messages 173 */ 174 bool MouseButtonDownMsg(const Point &pt) override; 175 176 /** 177 * Handles mouse button up messages 178 */ 179 bool MouseButtonUpMsg(const Point &pt) override; 180 181 /** 182 * Returns the tooltip text for when the glyph is selected 183 */ 184 void getTooltip(CTextControl *text) override; 185 }; 186 187 class CSummonElevatorGlyph : public CBasicRemoteGlyph { 188 public: 189 CSummonElevatorGlyph(); 190 }; 191 192 class CSummonPelleratorGlyph : public CBasicRemoteGlyph { 193 public: 194 CSummonPelleratorGlyph(); 195 }; 196 197 class CTelevisionControlGlyph : public CPetRemoteGlyph { 198 private: 199 bool _flag; 200 CPetGfxElement *_up, *_down, *_onOff; 201 public: CTelevisionControlGlyph()202 CTelevisionControlGlyph() : CPetRemoteGlyph(), _flag(false), 203 _up(nullptr), _down(nullptr), _onOff(nullptr) {} 204 205 /** 206 * Setup the glyph 207 */ 208 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 209 210 /** 211 * Handles any secondary drawing of the glyph 212 */ 213 void draw2(CScreenManager *screenManager) override; 214 215 /** 216 * Called for mouse button down messages 217 */ 218 bool MouseButtonDownMsg(const Point &pt) override; 219 220 /** 221 * Handles mouse button up messages 222 */ 223 bool MouseButtonUpMsg(const Point &pt) override; 224 225 /** 226 * Returns the tooltip text for when the glyph is selected 227 */ 228 void getTooltip(CTextControl *text) override; 229 }; 230 231 class CEntertainmentDeviceGlyph : public CToggleRemoteGlyph { 232 public: 233 bool _flag2; 234 CPetGfxElement *_up, *_down; 235 public: CEntertainmentDeviceGlyph()236 CEntertainmentDeviceGlyph() : CToggleRemoteGlyph(), 237 _flag2(false), _up(nullptr), _down(nullptr) {} 238 239 /** 240 * Setup the glyph 241 */ 242 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 243 244 /** 245 * Handles any secondary drawing of the glyph 246 */ 247 void draw2(CScreenManager *screenManager) override; 248 249 /** 250 * Called for mouse button down messages 251 */ 252 bool MouseButtonDownMsg(const Point &pt) override; 253 254 /** 255 * Handles mouse button up messages 256 */ 257 bool MouseButtonUpMsg(const Point &pt) override; 258 259 /** 260 * Returns the tooltip text for when the glyph is selected 261 */ 262 void getTooltip(CTextControl *text) override; 263 }; 264 265 266 class COperateLightsGlyph : public CPetRemoteGlyph { 267 public: 268 CPetGfxElement *_left, *_right, *_up, *_down, *_activate; 269 public: COperateLightsGlyph()270 COperateLightsGlyph() : CPetRemoteGlyph(), _left(nullptr), _right(nullptr), 271 _up(nullptr), _down(nullptr), _activate(nullptr) {} 272 273 /** 274 * Setup the glyph 275 */ 276 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 277 278 /** 279 * Handles any secondary drawing of the glyph 280 */ 281 void draw2(CScreenManager *screenManager) override; 282 283 /** 284 * Called for mouse button down messages 285 */ 286 bool MouseButtonDownMsg(const Point &pt) override; 287 288 /** 289 * Handles mouse button up messages 290 */ 291 bool MouseButtonUpMsg(const Point &pt) override; 292 293 /** 294 * Returns the tooltip text for when the glyph is selected 295 */ 296 void getTooltip(CTextControl *text) override; 297 }; 298 299 class CDeployFloralGlyph : public CToggleRemoteGlyph { 300 public: 301 /** 302 * Setup the glyph 303 */ 304 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 305 306 /** 307 * Called for mouse button down messages 308 */ MouseButtonDownMsg(const Point & pt)309 bool MouseButtonDownMsg(const Point &pt) override { 310 return elementMouseButtonDownMsg(pt, 0); 311 } 312 313 /** 314 * Handles mouse button up messages 315 */ MouseButtonUpMsg(const Point & pt)316 bool MouseButtonUpMsg(const Point &pt) override { 317 return elementMouseButtonUpMsg(pt, 0); 318 } 319 320 /** 321 * Returns the tooltip text for when the glyph is selected 322 */ 323 void getTooltip(CTextControl *text) override; 324 }; 325 326 class CDeployFullyRelaxationGlyph : public CToggleRemoteGlyph { 327 public: 328 /** 329 * Setup the glyph 330 */ 331 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 332 333 /** 334 * Called for mouse button down messages 335 */ MouseButtonDownMsg(const Point & pt)336 bool MouseButtonDownMsg(const Point &pt) override { 337 return elementMouseButtonDownMsg(pt, 1); 338 } 339 340 /** 341 * Handles mouse button up messages 342 */ MouseButtonUpMsg(const Point & pt)343 bool MouseButtonUpMsg(const Point &pt) override { 344 return elementMouseButtonUpMsg(pt, 1); 345 } 346 347 /** 348 * Returns the tooltip text for when the glyph is selected 349 */ 350 void getTooltip(CTextControl *text) override; 351 }; 352 353 class CDeployComfortGlyph : public CToggleRemoteGlyph { 354 public: 355 /** 356 * Setup the glyph 357 */ 358 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 359 360 /** 361 * Called for mouse button down messages 362 */ MouseButtonDownMsg(const Point & pt)363 bool MouseButtonDownMsg(const Point &pt) override { 364 return elementMouseButtonDownMsg(pt, 2); 365 } 366 367 /** 368 * Handles mouse button up messages 369 */ MouseButtonUpMsg(const Point & pt)370 bool MouseButtonUpMsg(const Point &pt) override { 371 return elementMouseButtonUpMsg(pt, 2); 372 } 373 374 /** 375 * Returns the tooltip text for when the glyph is selected 376 */ 377 void getTooltip(CTextControl *text) override; 378 }; 379 380 class CDeployMinorStorageGlyph : public CToggleRemoteGlyph { 381 public: 382 /** 383 * Setup the glyph 384 */ 385 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 386 387 /** 388 * Called for mouse button down messages 389 */ MouseButtonDownMsg(const Point & pt)390 bool MouseButtonDownMsg(const Point &pt) override { 391 return elementMouseButtonDownMsg(pt, 3); 392 } 393 394 /** 395 * Handles mouse button up messages 396 */ MouseButtonUpMsg(const Point & pt)397 bool MouseButtonUpMsg(const Point &pt) override { 398 return elementMouseButtonUpMsg(pt, 3); 399 } 400 401 /** 402 * Returns the tooltip text for when the glyph is selected 403 */ 404 void getTooltip(CTextControl *text) override; 405 }; 406 407 class CDeployMajorRelaxationGlyph : public CToggleRemoteGlyph { 408 public: 409 /** 410 * Setup the glyph 411 */ 412 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 413 414 /** 415 * Called for mouse button down messages 416 */ MouseButtonDownMsg(const Point & pt)417 bool MouseButtonDownMsg(const Point &pt) override { 418 return elementMouseButtonDownMsg(pt, 5); 419 } 420 421 /** 422 * Handles mouse button up messages 423 */ MouseButtonUpMsg(const Point & pt)424 bool MouseButtonUpMsg(const Point &pt) override { 425 return elementMouseButtonUpMsg(pt, 5); 426 } 427 428 /** 429 * Returns the tooltip text for when the glyph is selected 430 */ 431 void getTooltip(CTextControl *text) override; 432 }; 433 434 class CInflateRelaxationGlyph : public CToggleRemoteGlyph { 435 public: 436 /** 437 * Setup the glyph 438 */ 439 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 440 441 /** 442 * Called for mouse button down messages 443 */ MouseButtonDownMsg(const Point & pt)444 bool MouseButtonDownMsg(const Point &pt) override { 445 return elementMouseButtonDownMsg(pt, 6); 446 } 447 448 /** 449 * Handles mouse button up messages 450 */ MouseButtonUpMsg(const Point & pt)451 bool MouseButtonUpMsg(const Point &pt) override { 452 return elementMouseButtonUpMsg(pt, 6); 453 } 454 455 /** 456 * Returns the tooltip text for when the glyph is selected 457 */ 458 void getTooltip(CTextControl *text) override; 459 }; 460 461 class CDeployMaintenanceGlyph : public CToggleRemoteGlyph { 462 public: 463 /** 464 * Setup the glyph 465 */ 466 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 467 468 /** 469 * Called for mouse button down messages 470 */ MouseButtonDownMsg(const Point & pt)471 bool MouseButtonDownMsg(const Point &pt) override { 472 return elementMouseButtonDownMsg(pt, 7); 473 } 474 475 /** 476 * Handles mouse button up messages 477 */ MouseButtonUpMsg(const Point & pt)478 bool MouseButtonUpMsg(const Point &pt) override { 479 return elementMouseButtonUpMsg(pt, 7); 480 } 481 482 /** 483 * Returns the tooltip text for when the glyph is selected 484 */ 485 void getTooltip(CTextControl *text) override; 486 }; 487 488 class CDeployWorkSurfaceGlyph : public CToggleRemoteGlyph { 489 public: 490 /** 491 * Setup the glyph 492 */ 493 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 494 495 /** 496 * Called for mouse button down messages 497 */ MouseButtonDownMsg(const Point & pt)498 bool MouseButtonDownMsg(const Point &pt) override { 499 return elementMouseButtonDownMsg(pt, 8); 500 } 501 502 /** 503 * Handles mouse button up messages 504 */ MouseButtonUpMsg(const Point & pt)505 bool MouseButtonUpMsg(const Point &pt) override { 506 return elementMouseButtonUpMsg(pt, 8); 507 } 508 509 /** 510 * Returns the tooltip text for when the glyph is selected 511 */ 512 void getTooltip(CTextControl *text) override; 513 }; 514 515 class CDeployMinorRelaxationGlyph : public CToggleRemoteGlyph { 516 public: 517 /** 518 * Setup the glyph 519 */ 520 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 521 522 /** 523 * Called for mouse button down messages 524 */ MouseButtonDownMsg(const Point & pt)525 bool MouseButtonDownMsg(const Point &pt) override { 526 return elementMouseButtonDownMsg(pt, 9); 527 } 528 529 /** 530 * Handles mouse button up messages 531 */ MouseButtonUpMsg(const Point & pt)532 bool MouseButtonUpMsg(const Point &pt) override { 533 return elementMouseButtonUpMsg(pt, 9); 534 } 535 536 /** 537 * Returns the tooltip text for when the glyph is selected 538 */ 539 void getTooltip(CTextControl *text) override; 540 }; 541 542 class CDeploySinkGlyph : public CToggleRemoteGlyph { 543 public: 544 /** 545 * Setup the glyph 546 */ 547 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 548 549 /** 550 * Called for mouse button down messages 551 */ MouseButtonDownMsg(const Point & pt)552 bool MouseButtonDownMsg(const Point &pt) override { 553 return elementMouseButtonDownMsg(pt, 10); 554 } 555 556 /** 557 * Handles mouse button up messages 558 */ MouseButtonUpMsg(const Point & pt)559 bool MouseButtonUpMsg(const Point &pt) override { 560 return elementMouseButtonUpMsg(pt, 10); 561 } 562 563 /** 564 * Returns the tooltip text for when the glyph is selected 565 */ 566 void getTooltip(CTextControl *text) override; 567 }; 568 569 class CDeployMajorStorageGlyph : public CToggleRemoteGlyph { 570 public: 571 /** 572 * Setup the glyph 573 */ 574 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 575 576 /** 577 * Called for mouse button down messages 578 */ MouseButtonDownMsg(const Point & pt)579 bool MouseButtonDownMsg(const Point &pt) override { 580 return elementMouseButtonDownMsg(pt, 11); 581 } 582 583 /** 584 * Handles mouse button up messages 585 */ MouseButtonUpMsg(const Point & pt)586 bool MouseButtonUpMsg(const Point &pt) override { 587 return elementMouseButtonUpMsg(pt, 11); 588 } 589 590 /** 591 * Returns the tooltip text for when the glyph is selected 592 */ 593 void getTooltip(CTextControl *text) override; 594 }; 595 596 class CSuccubusDeliveryGlyph : public CPetRemoteGlyph { 597 private: 598 CPetGfxElement *_send, *_receive; 599 public: CSuccubusDeliveryGlyph()600 CSuccubusDeliveryGlyph() : CPetRemoteGlyph(), 601 _send(nullptr), _receive(nullptr) {} 602 603 /** 604 * Setup the glyph 605 */ 606 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 607 608 /** 609 * Handles any secondary drawing of the glyph 610 */ 611 void draw2(CScreenManager *screenManager) override; 612 613 /** 614 * Called for mouse button down messages 615 */ 616 bool MouseButtonDownMsg(const Point &pt) override; 617 618 /** 619 * Handles mouse button up messages 620 */ 621 bool MouseButtonUpMsg(const Point &pt) override; 622 623 /** 624 * Returns the tooltip text for when the glyph is selected 625 */ 626 void getTooltip(CTextControl *text) override; 627 }; 628 629 class CNavigationControllerGlyph : public CPetRemoteGlyph { 630 private: 631 bool _flag; 632 CPetGfxElement *_gfxElement; 633 public: CNavigationControllerGlyph()634 CNavigationControllerGlyph() : CPetRemoteGlyph(), 635 _flag(false), _gfxElement(nullptr) {} 636 637 /** 638 * Setup the glyph 639 */ 640 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 641 642 /** 643 * Handles any secondary drawing of the glyph 644 */ 645 void draw2(CScreenManager *screenManager) override; 646 647 /** 648 * Called for mouse button down messages 649 */ 650 bool MouseButtonDownMsg(const Point &pt) override; 651 652 /** 653 * Handles mouse button up messages 654 */ 655 bool MouseButtonUpMsg(const Point &pt) override; 656 657 /** 658 * Returns the tooltip text for when the glyph is selected 659 */ 660 void getTooltip(CTextControl *text) override; 661 }; 662 663 class CGotoBottomOfWellGlyph : public CRemoteGotoGlyph { 664 public: 665 CGotoBottomOfWellGlyph(); 666 }; 667 668 class CGotoTopOfWellGlyph : public CRemoteGotoGlyph { 669 public: 670 CGotoTopOfWellGlyph(); 671 }; 672 673 class CGotoStateroomGlyph : public CRemoteGotoGlyph { 674 public: 675 CGotoStateroomGlyph(); 676 }; 677 678 class CGotoBarGlyph : public CRemoteGotoGlyph { 679 public: 680 CGotoBarGlyph(); 681 }; 682 683 class CGotoPromenadeDeckGlyph : public CRemoteGotoGlyph { 684 public: 685 CGotoPromenadeDeckGlyph(); 686 }; 687 688 class CGotoArboretumGlyph : public CRemoteGotoGlyph { 689 public: 690 CGotoArboretumGlyph(); 691 }; 692 693 class CGotoMusicRoomGlyph : public CRemoteGotoGlyph { 694 public: 695 CGotoMusicRoomGlyph(); 696 }; 697 698 class CGotoRestaurantGlyph : public CRemoteGotoGlyph { 699 public: 700 CGotoRestaurantGlyph(); 701 }; 702 703 class CSkipNavigationGlyph : public CPetRemoteGlyph { 704 protected: 705 CPetGfxElement *_button; 706 public: CSkipNavigationGlyph()707 CSkipNavigationGlyph() : CPetRemoteGlyph(), _button(nullptr) {} 708 709 /** 710 * Setup the glyph 711 */ 712 bool setup(CPetControl *petControl, CPetGlyphs *owner) override; 713 714 /** 715 * Handles any secondary drawing of the glyph 716 */ 717 void draw2(CScreenManager *screenManager) override; 718 719 /** 720 * Called for mouse button down messages 721 */ 722 bool MouseButtonDownMsg(const Point &pt) override; 723 724 /** 725 * Handles mouse button up messages 726 */ 727 bool MouseButtonUpMsg(const Point &pt) override; 728 729 /** 730 * Returns the tooltip text for when the glyph is selected 731 */ 732 void getTooltip(CTextControl *text) override; 733 }; 734 735 } // End of namespace Titanic 736 737 #endif /* TITANIC_PET_REMOTE_GLYPHS_H */ 738