2021-02-26 17:41:41 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
2021-12-26 17:47:58 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2021-02-26 17:41:41 +00:00
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 17:47:58 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2021-02-26 17:41:41 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NANCY_ACTION_TELEPHONE_H
|
|
|
|
#define NANCY_ACTION_TELEPHONE_H
|
|
|
|
|
2021-04-01 18:04:38 +00:00
|
|
|
#include "engines/nancy/commontypes.h"
|
2021-02-26 17:41:41 +00:00
|
|
|
#include "engines/nancy/renderobject.h"
|
|
|
|
|
2021-04-01 18:04:38 +00:00
|
|
|
#include "engines/nancy/action/actionrecord.h"
|
2021-02-26 17:41:41 +00:00
|
|
|
|
|
|
|
namespace Nancy {
|
|
|
|
namespace Action {
|
|
|
|
|
|
|
|
class Telephone : public ActionRecord, public RenderObject {
|
|
|
|
public:
|
2021-03-19 16:37:20 +00:00
|
|
|
struct PhoneCall {
|
|
|
|
Common::Array<byte> phoneNumber; // 0x0, 11 bytes
|
|
|
|
Common::String soundName; // 0xB
|
|
|
|
Common::String text; // 0x15, 0xC8 bytes
|
2021-03-20 19:16:57 +00:00
|
|
|
SceneChangeDescription sceneChange; // 0xDD
|
2021-03-19 16:37:20 +00:00
|
|
|
// shouldStopRendering
|
|
|
|
EventFlagDescription flag; // 0xE7
|
|
|
|
};
|
|
|
|
|
|
|
|
enum CallState { kWaiting, kButtonPress, kRinging, kBadNumber, kCall, kHangUp };
|
|
|
|
|
|
|
|
Telephone(RenderObject &redrawFrom) :
|
2021-04-14 20:12:53 +00:00
|
|
|
RenderObject(redrawFrom, 7),
|
2021-03-19 16:37:20 +00:00
|
|
|
_callState(kWaiting),
|
|
|
|
_selected(0) {}
|
|
|
|
virtual ~Telephone() {}
|
|
|
|
|
2021-11-13 21:20:07 +00:00
|
|
|
void init() override;
|
2021-03-19 16:37:20 +00:00
|
|
|
|
2021-11-13 21:20:07 +00:00
|
|
|
void readData(Common::SeekableReadStream &stream) override;
|
|
|
|
void execute() override;
|
|
|
|
void handleInput(NancyInput &input) override;
|
2021-03-19 16:37:20 +00:00
|
|
|
|
|
|
|
Common::String _imageName; // 0x00
|
|
|
|
Common::Array<Common::Rect> _srcRects; // 0xA, 12
|
|
|
|
Common::Array<Common::Rect> _destRects; // 0xCA, 12
|
|
|
|
SoundDescription _genericDialogueSound; // 0x18A
|
|
|
|
SoundDescription _genericButtonSound; // 0x1AC
|
|
|
|
SoundDescription _ringSound; // 0x1CE
|
|
|
|
SoundDescription _dialToneSound; // 0x1F0
|
|
|
|
SoundDescription _dialAgainSound; // 0x212
|
|
|
|
SoundDescription _hangUpSound; // 0x234
|
|
|
|
Common::Array<Common::String> _buttonSoundNames; // 0x256, 12 * 0xA
|
|
|
|
Common::String _addressBookString; // 0x2CE, 0xC8 long
|
|
|
|
Common::String _dialAgainString; // 0x396
|
|
|
|
SceneChangeDescription _reloadScene; // 0x45E
|
|
|
|
EventFlagDescription _flagOnReload; // 0x468 ??
|
|
|
|
SceneChangeDescription _exitScene; // 0x46C
|
|
|
|
EventFlagDescription _flagOnExit; // 0x476
|
|
|
|
Common::Rect _exitHotspot; // 0x47A
|
|
|
|
// 0x48A numConvos
|
|
|
|
Common::Array<PhoneCall> _calls; // 0x48C
|
|
|
|
|
|
|
|
Common::Array<byte> _calledNumber;
|
|
|
|
Graphics::ManagedSurface _image;
|
|
|
|
CallState _callState;
|
|
|
|
uint _selected;
|
2021-02-26 17:41:41 +00:00
|
|
|
|
|
|
|
protected:
|
2021-11-13 21:20:07 +00:00
|
|
|
Common::String getRecordTypeName() const override { return "Telephone"; }
|
|
|
|
bool isViewportRelative() const override { return true; }
|
2021-02-26 17:41:41 +00:00
|
|
|
|
2021-03-19 16:37:20 +00:00
|
|
|
void drawButton(uint id);
|
|
|
|
void undrawButton(uint id);
|
2021-02-26 17:41:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Action
|
|
|
|
} // End of namespace Nancy
|
|
|
|
|
2021-03-19 16:37:20 +00:00
|
|
|
#endif // NANCY_ACTION_TELEPHONE_H
|