-
Notifications
You must be signed in to change notification settings - Fork 12
/
PlayerSystem.reds
49 lines (39 loc) · 1.54 KB
/
PlayerSystem.reds
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
@addField(PlayerSystem)
private let m_customizationPuppet: wref<gamePuppet>;
@addField(PlayerSystem)
private let m_inventoryPuppet: wref<gamePuppet>;
@addField(PlayerSystem)
private let m_photoPuppet: wref<gamePuppet>;
@addMethod(PlayerSystem)
public func GetPlayer() -> ref<PlayerPuppet> {
return this.GetLocalPlayerControlledGameObject() as PlayerPuppet;
}
@addMethod(PlayerSystem)
public func GetCustomizationPuppet() -> wref<gamePuppet> {
return this.m_customizationPuppet;
}
@addMethod(PlayerSystem)
public func GetInventoryPuppet() -> wref<gamePuppet> {
return this.m_inventoryPuppet;
}
@addMethod(PlayerSystem)
public func GetPhotoPuppet() -> wref<gamePuppet> {
return this.m_photoPuppet;
}
@wrapMethod(inkPuppetPreviewGameController)
protected cb func OnPreviewInitialized() -> Bool {
wrappedMethod();
switch this.GetClassName() {
case n"gameuiInventoryPuppetPreviewGameController":
GameInstance.GetPlayerSystem(this.GetPlayerControlledObject().GetGame()).m_inventoryPuppet = this.GetGamePuppet();
break;
case n"gameuiCharacterCreationPuppetPreviewGameController":
GameInstance.GetPlayerSystem(this.GetPlayerControlledObject().GetGame()).m_customizationPuppet = this.GetGamePuppet();
break;
}
}
@wrapMethod(PhotoModePlayerEntityComponent)
private final func SetupInventory(isCurrentPlayerObjectCustomizable: Bool) {
wrappedMethod(isCurrentPlayerObjectCustomizable);
GameInstance.GetPlayerSystem(this.GetOwner().GetGame()).m_photoPuppet = this.fakePuppet;
}