22 #ifndef NANCY_SCRIPT_RECORDS_H 23 #define NANCY_SCRIPT_RECORDS_H 25 #include "common/array.h" 26 #include "common/rect.h" 28 #include "engines/nancy/commontypes.h" 29 #include "engines/nancy/movieplayer.h" 30 #include "engines/nancy/renderobject.h" 32 #include "engines/nancy/script/record.h" 34 #include "engines/nancy/ui/ndui/element.h" 53 kRecordVideoConvo = 5,
54 kRecordSoundConvo = 6,
58 kRecordAnimOverlay = 10,
64 const char *getRecordKindName(RecordKind kind);
65 const char *getRecordTypeName(RecordKind kind);
68 Record *makeRecord(RecordKind kind, SceneContext &context);
81 void setScriptZ(
double z, int32 streamZOffset);
84 bool isViewportRelative()
const override {
return true; }
97 const Common::String &getEnvironment()
const {
return _environment; }
98 const Common::String &getBackgroundName()
const {
return _backgroundName; }
104 void readTable(
int tableIndex)
override;
105 void runOnce()
override;
106 void run(
double sceneTime,
double elapsedTime)
override;
107 bool hasTransform()
const override {
return true; }
110 void onMouseMove(
const ScriptPoint &point,
bool inViewport)
override;
111 bool getCursor(
const ScriptPoint &point,
bool inViewport, uint &cursorType,
bool &isHot)
override;
112 bool onMouseEvent(RecordEvent event,
const ScriptPoint &point,
bool inViewport)
override;
115 enum Turn { kNoTurn, kTurnLeft, kTurnRight, kTurnAround };
118 Turn getTurnAt(
const ScriptPoint &point,
bool inViewport)
const;
119 void setFrame(uint frame);
121 void updateTheme(
double sceneTime);
126 bool _loopsTheme =
false;
127 double _themePause = 0.0;
128 double _themeEndTime = 0.0;
129 double _lastThemeCheck = 0.0;
135 Turn _turn = kNoTurn;
136 bool _isTurningFast =
false;
137 double _lastTurnTime = 0.0;
138 double _sceneTime = 0.0;
147 void readTable(
int tableIndex)
override;
148 void run(
double sceneTime,
double elapsedTime)
override;
149 bool prepareReset()
override {
return true; }
150 bool hasTransform()
const override {
return true; }
154 void onMouseMove(
const ScriptPoint &point,
bool inViewport)
override;
155 bool getCursor(
const ScriptPoint &point,
bool inViewport, uint &cursorType,
bool &isHot)
override;
156 bool onMouseEvent(RecordEvent event,
const ScriptPoint &point,
bool inViewport)
override;
164 void readScene(
int valueIndex);
165 void readCursor(
int valueIndex);
166 void readRef(
int valueIndex);
175 bool _hasCursor =
false;
176 uint _cursorType = 0;
177 bool _cursorIsHot =
false;
184 bool _hasRefColor =
false;
185 uint32 _refColor = 0;
188 bool _isRightClick =
false;
189 bool _isMouseOver =
false;
201 void updateGraphics()
override;
202 void onSave()
override { callFunction(
"OnSave"); }
203 void onDie()
override { callFunction(
"OnDie"); }
207 void readTable(
int tableIndex)
override;
208 bool prepareReset()
override {
return true; }
209 bool isScripted()
const override {
return true; }
210 void onActivation()
override { callFunction(
"OnActivation"); }
211 void onDeactivation()
override { callFunction(
"OnDeactivation"); }
212 void onZChanged()
override;
226 void updateGraphics()
override;
229 void readTable(
int tableIndex)
override;
230 void onZChanged()
override;
231 bool hasTransform()
const override {
return true; }
232 void onTransformChanged()
override { applyRects(); }
233 void renderNow()
override;
243 uint32 _modColor = 0xFFFFFFFF;
244 bool _hasPicture =
false;
249 bool _hasAttachment =
false;
250 bool _isAttachmentDrawn =
false;
258 void updateGraphics()
override;
260 void setPaused(
bool isPaused) { _isPaused = isPaused; }
263 void readTable(
int tableIndex)
override;
264 void runOnce()
override;
265 void run(
double sceneTime,
double elapsedTime)
override;
266 void onZChanged()
override;
267 bool prepareReset()
override;
268 bool hasTransform()
const override {
return true; }
269 void onTransformChanged()
override { applyFrame(); }
275 int getFirstFrame()
const {
return _firstFrame > 0 ? _firstFrame : 1; }
276 int getLastFrame()
const {
return _lastFrame > 0 ? _lastFrame : (int)_sources.size(); }
277 void setFrame(
int frame);
284 uint32 _modColor = 0xFFFFFFFF;
285 bool _hasPicture =
false;
288 int _firstFrame = -1;
291 double _framesPerSecond = 15.0;
292 double _progress = 0.0;
293 double _endTime = 0.0;
296 int _numLoopsDone = 0;
297 bool _pausesOnLastFrame =
false;
298 bool _isPaused =
false;
299 bool _isVisible =
true;
307 void onSkip()
override;
310 void readTable(
int tableIndex)
override;
311 void runOnce()
override;
312 void run(
double sceneTime,
double elapsedTime)
override;
313 bool prepareReset()
override;
318 uint16 _channel = 14;
319 double _volume = 1.0;
320 bool _isLooping =
false;
321 bool _usesCaption =
true;
325 bool _isPlaying =
false;
326 bool _wasPreempted =
false;
327 double _endTime = 0.0;
338 void updateGraphics()
override;
345 void readTable(
int tableIndex)
override;
346 void run(
double sceneTime,
double elapsedTime)
override;
347 void onZChanged()
override;
348 bool prepareReset()
override;
358 bool _isDirty =
true;
361 double _yOffset = 0.0;
362 double _yVelocity = 0.0;
366 double _initialYOffset = 0.0;
367 double _initialYVelocity = 0.0;
369 bool _usesAutotext =
true;
370 bool _revealsAll =
true;
373 uint _numRevealed = 0;
382 void updateGraphics()
override;
383 bool isSkippable()
const override;
385 void setPaused(
bool isPaused) { _isPaused = isPaused; }
388 void readTable(
int tableIndex)
override;
389 void runOnce()
override;
390 void run(
double sceneTime,
double elapsedTime)
override;
391 void onZChanged()
override;
392 bool prepareReset()
override;
393 bool hasTransform()
const override {
return true; }
394 void onTransformChanged()
override { applyPosition(); }
400 void applyPosition();
409 bool _pausesOnLastFrame =
false;
410 bool _hasCalledOnPause =
false;
411 bool _isPaused =
false;
412 bool _isVisible =
true;
413 double _endTime = 0.0;
419 #endif // NANCY_SCRIPT_RECORDS_H Definition: managed_surface.h:51
Definition: viewport.h:42
Definition: records.h:378
Definition: movieplayer.h:56
Definition: records.h:222
Definition: scenecontext.h:52
Definition: soundequalizerpuzzle.h:27
Definition: renderobject.h:36
Definition: records.h:334
Definition: commontypes.h:306
Definition: records.h:142
Definition: records.h:254
Definition: records.h:303
Definition: records.h:196
Definition: actionmanager.h:32