@@ -57,9 +57,11 @@ function SaveLoadHandler:SerializeTable(val, name, skipnewlines, depth)
57
57
tmp = tmp .. (val and " true" or " false" )
58
58
elseif val .Magnitude then -- ghetto vector check
59
59
tmp = tmp .. string.format (" %q" , " Vector(" .. val .X .. " ," .. val .Y .. " )" )
60
- elseif val .PresetName and IsMOSRotating (val ) then
60
+ elseif val .PresetName and IsMOSRotating (val ) then -- IsMOSRotating freaks out if we give it something that isn't a preset at all... ghetto here too
61
61
val :SetNumberValue (" saveLoadHandlerUniqueID" , val .UniqueID );
62
62
tmp = tmp .. string.format (" %q" , " SAVELOADHANDLERUNIQUEID_" .. tostring (val .UniqueID ))
63
+ elseif val .FirstBox then -- ghetto area check
64
+ tmp = tmp .. string.format (" %q" , " SAVELOADHANDLERAREA_" .. tostring (val .Name ))
63
65
else
64
66
tmp = tmp .. ' "[inserializeable datatype:' .. type (val ) .. ' ]"'
65
67
end
@@ -70,18 +72,6 @@ function SaveLoadHandler:SerializeTable(val, name, skipnewlines, depth)
70
72
return tmp
71
73
end
72
74
73
- function SaveLoadHandler :ParseTableForVectors (tab )
74
- for k , v in pairs (tab ) do
75
- if type (v ) == " string" and string.find (v , " Vector%(" ) then
76
- local vector = loadstring (" return " .. v )();
77
- tab [k ] = vector ;
78
- elseif type (v ) == " table" then
79
- self :ParseTableForVectors (v );
80
- end
81
- end
82
-
83
- end
84
-
85
75
function SaveLoadHandler :ParseTableForMOs (tab )
86
76
87
77
for k , v in pairs (tab ) do
@@ -169,6 +159,31 @@ function SaveLoadHandler:ParseTableForMOs(tab)
169
159
end
170
160
end
171
161
162
+ function SaveLoadHandler :ParseTableForVectors (tab )
163
+ for k , v in pairs (tab ) do
164
+ if type (v ) == " string" and string.find (v , " Vector%(" ) then
165
+ local vector = loadstring (" return " .. v )();
166
+ tab [k ] = vector ;
167
+ elseif type (v ) == " table" then
168
+ self :ParseTableForVectors (v );
169
+ end
170
+ end
171
+
172
+ end
173
+
174
+ function SaveLoadHandler :ParseTableForAreas (tab )
175
+ for k , v in pairs (tab ) do
176
+ if type (v ) == " string" and string.find (v , " SAVELOADHANDLERAREA_" ) then
177
+ local areaName = string.sub (v , 21 , - 1 );
178
+ local area = SceneMan .Scene :GetOptionalArea (areaName );
179
+ tab [k ] = area ;
180
+ elseif type (v ) == " table" then
181
+ self :ParseTableForAreas (v );
182
+ end
183
+ end
184
+
185
+ end
186
+
172
187
function SaveLoadHandler :ReadSavedStringAsTable (name )
173
188
print (ActivityMan :GetActivity ())
174
189
print (ActivityMan :GetActivity ():LoadString (name ))
@@ -183,6 +198,7 @@ function SaveLoadHandler:ReadSavedStringAsTable(name)
183
198
print (" Parsing table for MOs: " .. name );
184
199
self :ParseTableForMOs (tab );
185
200
self :ParseTableForVectors (tab );
201
+ self :ParseTableForAreas (tab );
186
202
187
203
return tab ;
188
204
0 commit comments