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 CRYOMNI3D_VERSAILLES_DIALOGS_MANAGER_H 24 #define CRYOMNI3D_VERSAILLES_DIALOGS_MANAGER_H 25 26 #include "common/hashmap.h" 27 #include "common/hash-str.h" 28 #include "graphics/managed_surface.h" 29 30 #include "cryomni3d/dialogs_manager.h" 31 #include "cryomni3d/font_manager.h" 32 33 namespace CryOmni3D { 34 namespace Versailles { 35 36 class CryOmni3DEngine_Versailles; 37 typedef void (CryOmni3DEngine_Versailles::*ShowCallback)(); 38 39 class Versailles_DialogsManager : public DialogsManager { 40 public: 41 Versailles_DialogsManager(CryOmni3DEngine_Versailles *engine, bool padAudioFileName); 42 43 // This overload will hide the base one and this is what we want 44 bool play(const Common::String &sequence); 45 registerShowCallback(const Common::String & showName,ShowCallback callback)46 void registerShowCallback(const Common::String &showName, ShowCallback callback) { _shows[showName] = callback; } 47 48 protected: 49 void executeShow(const Common::String &show) override; 50 void playDialog(const Common::String &video, const Common::String &sound, 51 const Common::String &text, const SubtitlesSettings &settings) override; 52 void displayMessage(const Common::String &text) override; 53 uint askPlayerQuestions(const Common::String &video, 54 const Common::StringArray &questions) override; 55 56 private: 57 CryOmni3DEngine_Versailles *_engine; 58 Common::HashMap<Common::String, ShowCallback> _shows; 59 bool _padAudioFileName; 60 61 void loadFrame(const Common::String &video); 62 63 Graphics::ManagedSurface _lastImage; 64 }; 65 66 } // End of namespace Versailles 67 } // End of namespace CryOmni3D 68 69 #endif 70