@@ -40,15 +40,16 @@ internal class ModifiedLevel
40
40
public bool LowPass { get ; set ; }
41
41
42
42
// these are presumably unused
43
- //public int FarAwayPlaceFadeOutStart { get; set; }
44
- //public int FarAwayPlaceFadeOutLength { get; set; }
43
+ // FAP stands for Far Away Place
44
+ public int FAPFadeOutStart { get ; set ; }
45
+ public int FAPFadeOutLength { get ; set ; }
45
46
46
47
public string TrileSetName { get ; set ; }
47
48
public List < ModifiedTrile > Triles { get ; set ; }
48
49
public Dictionary < int , ModifiedTrileGroup > Groups { get ; set ; }
49
- public Dictionary < int , ModifiedVolume > Volumes { get ; set ; }
50
+ public Dictionary < int , Volume > Volumes { get ; set ; }
50
51
public Dictionary < int , Script > Scripts { get ; set ; }
51
- public Dictionary < int , ModifiedArtObjectInstance > ArtObjects { get ; set ; }
52
+ public Dictionary < int , ArtObjectInstance > ArtObjects { get ; set ; }
52
53
public Dictionary < int , BackgroundPlane > BackgroundPlanes { get ; set ; }
53
54
public Dictionary < int , MovementPath > Paths { get ; set ; }
54
55
public Dictionary < int , NpcInstance > NonPlayerCharacters { get ; set ; }
@@ -96,8 +97,8 @@ public ModifiedLevel(Level level)
96
97
WaterHeight = level . WaterHeight ;
97
98
WaterType = level . WaterType ;
98
99
SongName = level . SongName ;
99
- //FarAwayPlaceFadeOutStart = level.FarAwayPlaceFadeOutStart ;
100
- //FarAwayPlaceFadeOutLength = level.FarAwayPlaceFadeOutLength ;
100
+ FAPFadeOutStart = level . FAPFadeOutStart ;
101
+ FAPFadeOutLength = level . FAPFadeOutLength ;
101
102
MutedLoops = level . MutedLoops ;
102
103
AmbienceTracks = level . AmbienceTracks ;
103
104
SequenceSamplesPath = level . SequenceSamplesPath ;
@@ -107,6 +108,8 @@ public ModifiedLevel(Level level)
107
108
BackgroundPlanes = level . BackgroundPlanes ;
108
109
Paths = level . Paths ;
109
110
NonPlayerCharacters = level . NonPlayerCharacters ;
111
+ Volumes = level . Volumes ;
112
+ ArtObjects = level . ArtObjects ;
110
113
111
114
// sort tiles into modified structures
112
115
Triles = new ( ) ;
@@ -123,12 +126,6 @@ public ModifiedLevel(Level level)
123
126
124
127
// create groups of modified paths
125
128
Groups = level . Groups . ToDictionary ( pair=> pair . Key , pair=> new ModifiedTrileGroup ( pair . Value ) ) ;
126
-
127
- // convert volumes
128
- Volumes = level . Volumes . ToDictionary ( pair => pair . Key , pair => new ModifiedVolume ( pair . Value ) ) ;
129
-
130
- // convert art objects
131
- ArtObjects = level . ArtObjects . ToDictionary ( pair => pair . Key , pair => new ModifiedArtObjectInstance ( pair . Value ) ) ;
132
129
}
133
130
134
131
public Level ToOriginal ( )
@@ -155,8 +152,8 @@ public Level ToOriginal()
155
152
level . WaterHeight = WaterHeight ;
156
153
level . WaterType = WaterType ;
157
154
level . SongName = SongName ;
158
- // level.FarAwayPlaceFadeOutStart = FarAwayPlaceFadeOutStart ;
159
- // level.FarAwayPlaceFadeOutLength = FarAwayPlaceFadeOutLength ;
155
+ level . FAPFadeOutStart = FAPFadeOutStart ;
156
+ level . FAPFadeOutLength = FAPFadeOutLength ;
160
157
level . MutedLoops = MutedLoops ;
161
158
level . AmbienceTracks = AmbienceTracks ;
162
159
level . SequenceSamplesPath = SequenceSamplesPath ;
@@ -166,30 +163,26 @@ public Level ToOriginal()
166
163
level . BackgroundPlanes = BackgroundPlanes ;
167
164
level . Paths = Paths ;
168
165
level . NonPlayerCharacters = NonPlayerCharacters ;
166
+ level . Volumes = Volumes ;
167
+ level . ArtObjects = ArtObjects ;
169
168
170
169
// parse triles back into their original structure
171
- foreach ( var modTrile in Triles )
170
+ foreach ( var modTrile in Triles )
172
171
{
173
172
var trile = modTrile . ToOriginal ( ) ;
174
- if ( ! level . Triles . ContainsKey ( modTrile . Position ) )
173
+ if ( ! level . Triles . ContainsKey ( modTrile . Emplacement ) )
175
174
{
176
- level . Triles [ modTrile . Position ] = trile ;
175
+ level . Triles [ modTrile . Emplacement ] = trile ;
177
176
}
178
177
else
179
178
{
180
- level . Triles [ modTrile . Position ] . OverlappedTriples . Add ( trile ) ;
179
+ level . Triles [ modTrile . Emplacement ] . OverlappedTriples . Add ( trile ) ;
181
180
}
182
181
}
183
182
184
183
// put trile instances back into groups
185
184
level . Groups = Groups . ToDictionary ( pair => pair . Key , pair => pair . Value . ToOriginal ( level ) ) ;
186
185
187
- // convert volumes back
188
- level . Volumes = Volumes . ToDictionary ( pair => pair . Key , pair => pair . Value . ToOriginal ( ) ) ;
189
-
190
- // convert art objects back
191
- level . ArtObjects = ArtObjects . ToDictionary ( pair => pair . Key , pair => pair . Value . ToOriginal ( ) ) ;
192
-
193
186
return level ;
194
187
}
195
188
}
0 commit comments