Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CharacterCameraHandlerComponentSerializer.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
4 override static typename GetTargetType()
5 {
6 return SCR_CharacterCameraHandlerComponent;
7 }
8
9 //------------------------------------------------------------------------------------------------
10 override protected ESerializeResult Serialize(notnull IEntity owner, notnull GenericComponent component, notnull SaveContext context)
11 {
12 const SCR_CharacterCameraHandlerComponent cameraHandler = SCR_CharacterCameraHandlerComponent.Cast(component);
13 const bool isSingleplayer = RplSession.Mode() == RplMode.None;
14 if (isSingleplayer && cameraHandler.Is3rdPersonView())
15 {
16 context.WriteValue("version", 1);
17 context.WriteValue("is3rdPerson", true);
18 return ESerializeResult.OK;
19 }
20
21 return ESerializeResult.DEFAULT;
22 }
23
24 //------------------------------------------------------------------------------------------------
25 override protected bool Deserialize(notnull IEntity owner, notnull GenericComponent component, notnull LoadContext context)
26 {
27 auto cameraHandler = SCR_CharacterCameraHandlerComponent.Cast(component);
28
29 int version;
30 context.Read(version);
31
32 bool is3rdPerson = false;
33 context.ReadValue("is3rdPerson", is3rdPerson);
34 if (is3rdPerson)
35 cameraHandler.SetThirdPerson(true);
36
37 return true;
38 }
39}
class SCR_PersistentThreatSector GetTargetType()
RplMode
Mode of replication.
Definition RplMode.c:9
bool Deserialize(notnull IEntity owner, notnull GenericComponent component, notnull LoadContext context)
ESerializeResult Serialize(notnull IEntity owner, notnull GenericComponent component, notnull SaveContext context)
ESerializeResult