-
Notifications
You must be signed in to change notification settings - Fork 11
/
ActorRecording.h
348 lines (300 loc) · 17.2 KB
/
ActorRecording.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
#pragma once
#include <vector>
#include "..\..\inc\types.h"
#include "script.h"
#include "scenario.h"
#include "Animation.h"
#include "SyncedAnimation.h"
#include "tinyxml2.h"
#include <string>
#include <memory>
//forward declaration
class Actor;
struct Scenario;
class SyncedAnimation;
class ActorRecordingItem {
protected:
bool m_isDisabled = false;
DWORD m_ticksAfterRecordStart;
int m_actorIndex;
Ped m_actorPed;
Vector3 m_location;
DWORD m_ticksDeltaCheckCompletion;
DWORD m_ticksLength;
DWORD m_ticksDeltaWhenRecorded;
float m_minDistanceBeforeCompleted;
MARKER_TYPE m_markerType;
int m_index;
int m_nrAttemptsBeforeSkipping;
public:
ActorRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actorPed, Vector3 location);
DWORD getTicksAfterRecordStart();
Vector3 getLocation();
virtual void setLocation(Vector3 location);
DWORD getTicksDeltaCheckCompletion();
void setTicksDeltaCheckCompletion(DWORD ticksDeltaCheckCompletion);
void setTicksLength(DWORD ticks);
DWORD getTicksLength();
int getIndex();
void setIndex(int index);
bool isDisabled();
void setIsDisabled(bool isDisabled);
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)=0;
virtual bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem,DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location)=0;
virtual std::string toString();
virtual void executeNativesAfterRecording(Actor actor);
virtual void drawMarkerForRecording(bool isCurrent, bool showDisabled);
virtual void setMarkerType(MARKER_TYPE markerType);
virtual MARKER_TYPE getMarkerType();
virtual std::string toUserFriendlyName();
virtual void setMinDistanceBeforeCompleted(float minDistanceBeforeCompleted);
virtual float getMinDistanceBeforeCompleted();
virtual int getNrAttemptsBeforeSkipping();
virtual void setNrAttemptsBeforeSkipping(int nrAttemptsBeforeSkipping);
virtual void previewRecording(Actor* actor);
virtual void stopPreviewRecording(Actor* actor);
virtual void updatePreviewLocation(Actor* actor, Vector3 location);
virtual tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument* doc);
};
class ActorOnFootMovementRecordingItem : public ActorRecordingItem {
protected:
float m_walkSpeed;
float m_heading;
public:
ActorOnFootMovementRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, float walkSpeed, float headingAtEnd);
float getWalkSpeed();
void setWalkSpeed(float walkSpeed);
float getHeading();
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
virtual bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location);
std::string toString() override;
virtual std::string toUserFriendlyName() override;
};
class ActorSpeakRecordingItem : public ActorOnFootMovementRecordingItem {
protected:
bool m_isMovingWhileSpeaking;
public:
ActorSpeakRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, float walkSpeed, float headingAtEnd, bool isMovingWhileSpeaking);
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
virtual bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location);
std::string toString() override;
virtual void executeNativesAfterRecording(Actor actor) override;
virtual std::string toUserFriendlyName() override;
};
class ActorJumpingRecordingItem : public ActorOnFootMovementRecordingItem {
protected:
bool m_isClimbing;
public:
ActorJumpingRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, float walkSpeed, float headingAtEnd, bool isClimbing);
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
virtual bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location);
std::string toString() override;
virtual std::string toUserFriendlyName() override;
bool isClimbing();
void setIsClimbing(bool isClimbing);
};
class ActorStandingStillRecordingItem : public ActorRecordingItem {
protected:
float m_heading;
public:
ActorStandingStillRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, float heading);
float getHeading();
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem,DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual std::string toUserFriendlyName() override;
};
class ActorAimAtRecordingItem : public ActorRecordingItem {
protected:
Entity m_aimedAtEntity;
public:
ActorAimAtRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Entity aimedAtEntity);
Entity getAimedAtEntity();
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual void executeNativesAfterRecording(Actor actor) override;
virtual std::string toUserFriendlyName() override;
};
class ActorShootAtEntityRecordingItem : public ActorRecordingItem {
protected:
Entity m_shotAtEntity;
public:
ActorShootAtEntityRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Entity shotAtEntity);
Entity getShotAtEntity();
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual void executeNativesAfterRecording(Actor actor) override;
virtual std::string toUserFriendlyName() override;
};
class ActorShootAtByImpactRecordingItem : public ActorRecordingItem {
protected:
Hash m_weapon;
Vector3 m_weaponImpact;
Hash m_firingPattern;
float m_walkSpeed;
float m_heading;
public:
ActorShootAtByImpactRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Hash weapon, Vector3 weaponImpact, Hash firingPattern, float walkSpeed, float heading);
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
void executeNativesAfterRecording(Actor actor) override;
virtual std::string toUserFriendlyName() override;
};
class ActorReloadRecordingItem : public ActorRecordingItem {
protected:
Hash m_weapon;
bool m_doAim;
Vector3 m_weaponImpact;
public:
ActorReloadRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Hash weapon, bool doAim, Vector3 weaponImpact);
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual std::string toUserFriendlyName() override;
};
class ActorScenarioRecordingItem : public ActorRecordingItem {
protected:
Scenario m_scenario;
public:
ActorScenarioRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Scenario scenario);
Scenario getScenario();
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
void executeNativesAfterRecording(Actor actor) override;
virtual std::string toUserFriendlyName() override;
};
class ActorVehicleRecordingItem : public ActorRecordingItem {
protected:
Vehicle m_vehicle;
float m_vehicleHeading;
VEHICLE_TYPE m_vehicleType;
VEHICLE_TYPE _getVehicleTypeFromNatives();
public:
ActorVehicleRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Vehicle veh, float vehHeading);
Vehicle getVehicle();
VEHICLE_TYPE getVehicleType();
float getVehicleHeading();
std::string toString() override;
virtual std::string toUserFriendlyName() override;
};
class ActorVehicleEnterRecordingItem : public ActorVehicleRecordingItem {
protected:
int m_vehicleSeat;
float m_enterVehicleSpeed;
public:
ActorVehicleEnterRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Vehicle veh, float vehHeading, int vehicleSeat,float enterVehicleSpeed);
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual std::string toUserFriendlyName() override;
};
class ActorVehicleExitRecordingItem : public ActorVehicleRecordingItem {
protected:
int m_vehicleSeat;
float m_enterVehicleSpeed;
public:
ActorVehicleExitRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Vehicle veh, float vehHeading);
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual std::string toUserFriendlyName() override;
};
class ActorVehicleMovementRecordingItem : public ActorVehicleRecordingItem {
protected:
float m_speedInVehicle;
public:
ActorVehicleMovementRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Vehicle veh, float vehHeading, float speedInVehicle);
std::string toString() override;
float getSpeedInVehicle();
void setSpeedInVehicle(float speedInVehicle);
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual std::string toUserFriendlyName() override;
};
class ActorVehicleRocketBoostRecordingItem : public ActorVehicleMovementRecordingItem {
protected:
public:
ActorVehicleRocketBoostRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Vehicle veh, float vehHeading);
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual std::string toUserFriendlyName() override;
};
class ActorVehicleParachuteRecordingItem : public ActorVehicleMovementRecordingItem {
protected:
public:
ActorVehicleParachuteRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Vehicle veh, float vehHeading);
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual std::string toUserFriendlyName() override;
};
class ActorAnimationSequenceRecordingItem : public ActorRecordingItem {
protected:
AnimationSequence m_animationSequence;
AnimationFlag m_animationFlag;
float m_heading;
public:
ActorAnimationSequenceRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, float heading, AnimationSequence animationSequence, AnimationFlag animationFlag);
AnimationSequence getAnimationSequence();
void setAnimationSequence(AnimationSequence animationSequence);
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual std::string toUserFriendlyName() override;
void previewRecording(Actor* actor) override;
void stopPreviewRecording(Actor* actor) override;
void updatePreviewLocation(Actor* actor,Vector3 location) override;
float getHeading();
void setHeading(float heading);
};
class ActorSyncedAnimationRecordingItem : public ActorRecordingItem {
protected:
std::vector<Actor*> m_actors;
SyncedAnimation* m_syncedAnimation;
bool m_doLooping = false;
bool m_keepProps = false;
bool m_useActorLocation = false;
bool m_useActorRotation = false;
float m_rotation;
public:
ActorSyncedAnimationRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped pedActor, std::vector<Actor*> actors, Vector3 location, float actorRotation, SyncedAnimation* syncedAnimation);
SyncedAnimation* getSyncedAnimation();
void setSyncedAnimation(SyncedAnimation* syncedAnimation);
std::vector<Actor*> getActors();
void setActors(std::vector<Actor*> actors);
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
void executeNativesAfterRecording(Actor actor) override;
virtual std::string toUserFriendlyName() override;
void setDoLooping(bool doLooping);
bool getDoLooping();
void setLocation(Vector3 location) override;
void setKeepProps(bool keepProps);
bool getKeepProps();
void setUseActorLocation(bool useActorLocation);
bool getUseActorLocation();
void setRotation(float rotation);
float getRotation();
void setUseActorRotation(bool useActorRotation);
void previewRecording(Actor* actor) override;
void stopPreviewRecording(Actor* actor) override;
void updatePreviewLocation(Actor* actor,Vector3 location) override;
};
class ActorCoverAtRecordingItem : public ActorRecordingItem {
protected:
Vector3 m_enterCoverPosition;
Vector3 m_coverPosition;
public:
ActorCoverAtRecordingItem(DWORD ticksStart, DWORD ticksDeltaWhenRecorded, int actorIndex, Ped actor, Vector3 location, Vector3 enterCoverPosition, Vector3 coverPosition);
void setCoverPosition(Vector3 coverPosition);
std::string toString() override;
virtual void executeNativesForRecording(Actor actor, std::shared_ptr<ActorRecordingItem> nextRecordingItem, std::shared_ptr<ActorRecordingItem> previousRecordingItem)override;
bool isRecordingItemCompleted(std::shared_ptr<ActorRecordingItem> nextRecordingItem, DWORD ticksStart, DWORD ticksNow, int nrOfChecksForCompletion, Actor actor, Vector3 location) override;
virtual std::string toUserFriendlyName() override;
};