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 /* 24 * This code is based on the original source code of Lord Avalot d'Argent version 1.3. 25 * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman. 26 */ 27 28 /* SCROLLS The scroll driver. */ 29 30 #ifndef AVALANCHE_DIALOGS_H 31 #define AVALANCHE_DIALOGS_H 32 33 namespace Avalanche { 34 class AvalancheEngine; 35 36 class Dialogs; 37 38 typedef void (Dialogs::*DialogFunctionType)(); 39 40 class Dialogs { 41 public: 42 bool _aboutBox; // Is this the about box? - Used in scrollModeNormal(), not yet fully implemented 43 FontType _fonts[2]; 44 45 Dialogs(AvalancheEngine *vm); 46 47 void init(); 48 void reset(); 49 void setReadyLight(byte state); 50 void displayText(Common::String text); 51 bool displayQuestion(Common::String question); 52 void setTalkPos(int16 x, int16 y); 53 int16 getTalkPosX(); 54 void setBubbleStateNatural(); 55 void displayMusicalScroll(); 56 void displayScrollChain(char block, byte point, bool report = true, bool bubbling = false); 57 void talkTo(byte whom); 58 void sayIt(Common::String str); 59 Common::String personSpeaks(); 60 void sayThanks(byte thing); 61 void sayHello(); 62 void sayOK(); 63 void saySilly(); 64 private: 65 AvalancheEngine *_vm; 66 int16 _talkX, _talkY; 67 68 enum FontStyle { 69 kFontStyleRoman, 70 kFontStyleItalic 71 }; 72 73 typedef int8 TuneType[31]; 74 75 static const TuneType kTune; 76 static const int16 kHalfIconWidth = 19; 77 static const QuasipedType kQuasipeds[16]; 78 79 Common::String _scroll[15]; 80 Common::Point _dodgeCoord; 81 byte _maxLineNum; 82 bool _scReturn; 83 bool _noError; 84 byte _currentFont; 85 byte _param; // For using arguments code 86 byte _useIcon; 87 byte _scrollBells; // no. of times to ring the bell 88 int16 _underScroll; // Y-coord of just under the scroll text. 89 int16 _shadowBoxX, _shadowBoxY; 90 91 void drawBubble(DialogFunctionType modeFunc); 92 void drawScroll(DialogFunctionType modeFunc); 93 void scrollModeNormal(); 94 void scrollModeDialogue(); 95 void scrollModeMusic(); 96 97 // These 2 are used only in musicalScroll(). 98 void store(byte what, TuneType &played); 99 bool theyMatch(TuneType &played); 100 void stripTrailingSpaces(Common::String &str); 101 void solidify(byte n); 102 void dodgem(); 103 void unDodgem(); 104 105 Common::String displayMoney(); 106 void easterEgg(); 107 void say(int16 x, int16 y, Common::String text); 108 void resetScrollDriver(); 109 void ringBell(); 110 void loadFont(); 111 112 void unSkrimble(Common::String &text); 113 void doTheBubble(Common::String &text); 114 void speak(byte who, byte subject); 115 }; 116 117 } // End of namespace Avalanche 118 119 #endif // AVALANCHE_DIALOGS_H 120