ScummVM API documentation
wolfcommands.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
22#ifndef NANCY_ACTION_WOLFCOMMANDS_H
23#define NANCY_ACTION_WOLFCOMMANDS_H
24
25#include "engines/nancy/commontypes.h"
26#include "engines/nancy/action/actionrecord.h"
27#include "engines/nancy/ui/ndui/manager.h"
28
29namespace Nancy {
30namespace Action {
31
32// Nancy16 commands for Isis the wolf (AR 198). The record fills a UI dialog with a
33// button for each command; the player queues up a few, and "Go" has Nancy call them
34// out. The queued commands then get left as a playlist under the wolf's name, for the
35// wolf's movie or the wolf maze to act out, and an event flag gets set.
37public:
38 WolfCommands() {}
39 virtual ~WolfCommands();
40
41 void readData(Common::SeekableReadStream &stream) override;
42 void execute() override;
43
44 void onEngineAction(const UI::NDUI::Action &action) override;
45
46protected:
47 Common::String getRecordTypeName() const override { return "WolfCommands"; }
48
49 struct Command {
50 Common::String buttonName; // also the movie the wolf acts the command out with
51 Common::String label;
52 RandomSoundBlock clickSound;
53 RandomSoundBlock callSound; // Nancy calls the command out
54 };
55
56 const Command *findCommand(const Common::String &buttonName) const;
57 void addCommand(const Common::String &buttonName);
58 void clearCommands();
59 void callNextCommand();
60
61 // -- File data --
62 Common::String _playlistName;
63 Common::String _dialogName;
64 Common::String _buttonTemplate;
65 Common::String _displayName; // shows the queued commands
66 uint32 _maxCommands = 0;
67 Common::String _separator;
68 FlagDescription _doneFlag;
69 Common::Array<Command> _commands;
70 RandomSoundBlock _nameSound; // Nancy calls the wolf by her name
71 RandomSoundBlock _goSound;
72 RandomSoundBlock _fullSound;
73
74 // -- Runtime state --
76 bool _isRegistered = false;
77 bool _isCalling = false; // Nancy is calling out the queued commands
78 int _callIndex = -1; // -1 while calling the wolf by her name
79 SoundDescription _callSound;
80 bool _clearOnNextCommand = false; // the commands of the last run are still shown
81};
82
83} // End of namespace Action
84} // End of namespace Nancy
85
86#endif // NANCY_ACTION_WOLFCOMMANDS_H
Definition: stream.h:745
Definition: str.h:59
Definition: actionrecord.h:107
Definition: wolfcommands.h:36
Definition: manager.h:51
Definition: actionmanager.h:32
Definition: wolfcommands.h:49
Definition: commontypes.h:201
Definition: commontypes.h:324
Definition: commontypes.h:306
Definition: common.h:126