Touch Interface Designer 2025.2
Create touch interface with a visual editor and manage all mobile inputs like gestures
Loading...
Searching...
No Matches
TouchInterfaceSave.h
Go to the documentation of this file.
1// Copyright Lost in Game Studio, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "GameFramework/SaveGame.h"
8#include "TouchInterfaceSave.generated.h"
9
11
12USTRUCT(BlueprintType)
14{
15 GENERATED_BODY()
16
17 UPROPERTY(Category="GlobalSettings", BlueprintReadOnly)
18 FSoftObjectPath SetupRef;
19
20 //TODO: Allow opacity curve modification (FSoftObjectPath)
21
22 UPROPERTY(Category="GlobalSettings", BlueprintReadOnly)
24
25 UPROPERTY(Category="GlobalSettings", BlueprintReadOnly)
27
28 UPROPERTY(Category="GlobalSettings", BlueprintReadOnly)
30
31 UPROPERTY(Category="GlobalSettings", BlueprintReadOnly)
33
34 UPROPERTY(Category="GlobalSettings", BlueprintReadOnly)
36
37 UPROPERTY(Category="GlobalSettings", BlueprintReadOnly)
39
40 UPROPERTY(Category="GlobalSettings", BlueprintReadOnly)
42
43 UPROPERTY(Category="VirtualControl", BlueprintReadOnly)
45
47 : ActiveOpacity(1.0f)
48 , InactiveOpacity(0.2f)
50 , TimeUntilReset(3.0f)
51 , ActivationDelay(0.0f)
52 , StartupDelay(0.0f)
54 {
55 VirtualControls = {};
56 }
57};
58
59USTRUCT(BlueprintType)
61{
62 GENERATED_BODY()
63
64 //Begin V1
65
66 UPROPERTY(Category="Save Data|Component", BlueprintReadOnly)
67 FVector4f AnchorOffset;
68
69 //UPROPERTY(Category="Save Data|Component", BlueprintReadOnly)
70 //FVector2D Size;
71
72 //UPROPERTY(Category="Save Data|Component", BlueprintReadOnly)
73 //FVector2D Location;
74
75 //End V1
76
77 //TODO: Save input
78
79 //TODO: Save appearance? Save decorator data
80
81 //TODO: Update system between version
82
84 : AnchorOffset(0.0f, 0.0f, 0.0f, 0.0f)
85 /*Size(1.0f)
86 , Location(FVector2D::ZeroVector)*/
87 {
88
89 }
90
91 explicit FComponentSaveData(/*const FVector2D InSize, const FVector2D InOffset*/ const FVector4f InAnchorOffset)
92 : AnchorOffset(InAnchorOffset)
93 /*Size(InSize)
94 , Location(InOffset)*/
95 {
96
97 }
98};
99
100USTRUCT(BlueprintType)
102{
103 GENERATED_BODY()
104
105 //UPROPERTY(Category="Save Data|Layout", BlueprintReadOnly)
106 //FSoftObjectPath LayoutReferencePath;
107
108 //UPROPERTY(Category="Save Data|Layout", BlueprintReadOnly)
109 //TSoftObjectPtr<UTouchInterfaceLayout> LayoutReferenceObject;
110
111 UPROPERTY(Category="Save Data|Layout", BlueprintReadOnly)
113
114 // Begin V1
115
116 UPROPERTY(Category="Save Data|Layout", BlueprintReadOnly)
118
119 UPROPERTY(Category="Save Data|Layout", BlueprintReadOnly)
121
122 UPROPERTY(Category="Save Data|Layout", BlueprintReadOnly)
124
125 UPROPERTY(Category="Save Data|Layout", BlueprintReadOnly)
127
128 UPROPERTY(Category="Save Data|Layout", BlueprintReadOnly)
130
131 UPROPERTY(Category="Save Data|Layout", BlueprintReadOnly)
133
134 //End V1
135
137 : ActiveOpacity(1.0f)
138 , InactiveOpacity(0.2f)
139 , InactiveLerpRate(1.0f)
141 , TimeUntilReset(3.0f)
142 {
143
144 }
145
146 bool GetSavedData(const FName ComponentName, FComponentSaveData& SavedData) const
147 {
148 if (ComponentSaveData.Contains(ComponentName))
149 {
150 SavedData = ComponentSaveData.FindRef(ComponentName);
151 return true;
152 }
153 return false;
154 }
155};
156
158UCLASS()
159class TOUCHINTERFACE_API UTouchInterfaceSave : public USaveGame
160{
161 GENERATED_BODY()
162
163public:
165
166 void GetComponentSavedData(const int32 SnapshotID, const FName CompName, FComponentSaveData& Data) const;
167
168 //TODO: Convert VCS data to Touch Interface Layout data. Make function in touch interface subsystem
169
170 //Check if update is required (because plugin has received update)
171 bool NeedUpdate();
172
173 //Update data in save file to match the new structure
174 void Update();
175
177
178 //Begin V1
179
180 UPROPERTY(Category="SlotData", BlueprintReadWrite, SaveGame)
182
183 UPROPERTY(Category="SlotData", BlueprintReadWrite, SaveGame)
185
186 UPROPERTY(Category="SlotData", BlueprintReadWrite, SaveGame)
188 //End V1
189
190 //Begin 2025.1.8 (45)
191
192 UPROPERTY(Category="SlotData", BlueprintReadWrite, SaveGame)
194
195 //End 2025.1.8 (45)
196};
BlueprintType
Definition ComponentDecorator_Animation.h:40
Definition TouchInterfaceLayout.h:20
BlueprintReadOnly
Definition TouchInterfaceLayout.h:235
bool NeedUpdate()
Definition TouchInterfaceSave.cpp:34
SaveGame FString SaveSlotName
Definition TouchInterfaceSave.h:181
int32 SaveFileVersion
Definition TouchInterfaceSave.h:176
SaveGame TMap< int32, FTouchInterfaceConfiguration > Configurations
Definition TouchInterfaceSave.h:187
BlueprintReadWrite
Definition TouchInterfaceSave.h:180
SaveGame TMap< int32, FLayoutSaveData > Snapshots
Definition TouchInterfaceSave.h:193
void GetComponentSavedData(const int32 SnapshotID, const FName CompName, FComponentSaveData &Data) const
Definition TouchInterfaceSave.cpp:16
UTouchInterfaceSave()
Definition TouchInterfaceSave.cpp:8
Category
Definition TouchInterfaceSave.h:180
SaveGame int32 UserIndex
Definition TouchInterfaceSave.h:184
void Update()
Definition TouchInterfaceSave.cpp:47
Definition TouchInterfaceSave.h:61
BlueprintReadOnly FVector4f AnchorOffset
Definition TouchInterfaceSave.h:67
Category
Definition TouchInterfaceSave.h:66
FComponentSaveData(const FVector4f InAnchorOffset)
Definition TouchInterfaceSave.h:91
FComponentSaveData()
Definition TouchInterfaceSave.h:83
Definition TouchInterfaceSave.h:102
BlueprintReadOnly TMap< FName, FComponentSaveData > ComponentSaveData
Definition TouchInterfaceSave.h:132
BlueprintReadOnly float ActiveOpacity
Definition TouchInterfaceSave.h:117
Category
Definition TouchInterfaceSave.h:111
BlueprintReadOnly float TimeUntilReset
Definition TouchInterfaceSave.h:129
BlueprintReadOnly float TimeUntilDeactivated
Definition TouchInterfaceSave.h:126
BlueprintReadOnly float InactiveLerpRate
Definition TouchInterfaceSave.h:123
BlueprintReadOnly TSoftClassPtr< UTouchInterfaceLayout > LayoutReferenceClass
Definition TouchInterfaceSave.h:112
bool GetSavedData(const FName ComponentName, FComponentSaveData &SavedData) const
Definition TouchInterfaceSave.h:146
BlueprintReadOnly float InactiveOpacity
Definition TouchInterfaceSave.h:120
FLayoutSaveData()
Definition TouchInterfaceSave.h:136
Definition TouchInterfaceSave.h:14
BlueprintReadOnly bool bCalculatePositionAuto
Definition TouchInterfaceSave.h:41
BlueprintReadOnly TArray< FVirtualControl > VirtualControls
Definition TouchInterfaceSave.h:44
FTouchInterfaceConfiguration()
Definition TouchInterfaceSave.h:46
BlueprintReadOnly float StartupDelay
Definition TouchInterfaceSave.h:38
BlueprintReadOnly float TimeUntilReset
Definition TouchInterfaceSave.h:32
BlueprintReadOnly float ActivationDelay
Definition TouchInterfaceSave.h:35
BlueprintReadOnly float InactiveOpacity
Definition TouchInterfaceSave.h:26
BlueprintReadOnly FSoftObjectPath SetupRef
Definition TouchInterfaceSave.h:18
Category
Definition TouchInterfaceSave.h:17
BlueprintReadOnly float TimeUntilDeactivated
Definition TouchInterfaceSave.h:29
BlueprintReadOnly float ActiveOpacity
Definition TouchInterfaceSave.h:23
Definition VirtualControlSetup.h:165