16
16
using OpenLoco . ObjectEditor . Data ;
17
17
using OpenLoco . ObjectEditor ;
18
18
using System . Collections . ObjectModel ;
19
- using ReactiveUI ;
20
- using System . Reflection ;
21
19
22
20
namespace AvaGui . Models
23
21
{
24
- public enum DatFileType
25
- {
26
- Object ,
27
- Scenario ,
28
- SaveGame ,
29
- Tutorial ,
30
- G1 ,
31
- Music ,
32
- SoundEffect , // css*.dat
33
- Language ,
34
- Scores ,
35
- }
36
-
37
22
public class ObjectEditorModel
38
23
{
39
24
public EditorSettings Settings { get ; private set ; }
@@ -48,23 +33,23 @@ public class ObjectEditorModel
48
33
49
34
public G1Dat ? G1 { get ; set ; }
50
35
51
- public Dictionary < string , byte [ ] > Music { get ; set ; } = [ ] ;
36
+ public Dictionary < string , byte [ ] > Music { get ; } = [ ] ;
52
37
53
- public Dictionary < string , byte [ ] > MiscellaneousTracks { get ; set ; } = [ ] ;
38
+ public Dictionary < string , byte [ ] > MiscellaneousTracks { get ; } = [ ] ;
54
39
55
- public Dictionary < string , byte [ ] > SoundEffects { get ; set ; } = [ ] ;
40
+ public Dictionary < string , byte [ ] > SoundEffects { get ; } = [ ] ;
56
41
57
- public Dictionary < string , byte [ ] > Tutorials { get ; set ; } = [ ] ;
42
+ public Dictionary < string , byte [ ] > Tutorials { get ; } = [ ] ;
58
43
59
- public Collection < string > MiscFiles { get ; set ; } = [ ] ;
44
+ public Collection < string > MiscFiles { get ; } = [ ] ;
60
45
61
46
public const string ApplicationName = "OpenLoco Object Editor" ;
62
47
63
48
public static string SettingsPath => Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , ApplicationName ) ;
64
49
65
50
public static string SettingsFile => Path . Combine ( SettingsPath , "settings.json" ) ;
66
51
67
- public ObservableCollection < LogLine > LoggerObservableLogs = new ( ) ;
52
+ public ObservableCollection < LogLine > LoggerObservableLogs = [ ] ;
68
53
69
54
public ObjectEditorModel ( )
70
55
{
@@ -187,20 +172,9 @@ void CreateIndex(string[] allFiles, IProgress<float>? progress)
187
172
sw . Start ( ) ;
188
173
189
174
var fileCount = allFiles . Length ;
190
- var parallelise = true ; // todo: remove this or make a user setting
191
175
192
- if ( parallelise )
193
- {
194
- _ = Parallel . ForEach ( allFiles , new ParallelOptions ( ) { MaxDegreeOfParallelism = 16 } , ( filename )
195
- => count = LoadAndIndexFile ( count , filename ) ) ;
196
- }
197
- else
198
- {
199
- foreach ( var filename in allFiles )
200
- {
201
- count = LoadAndIndexFile ( count , filename ) ;
202
- }
203
- }
176
+ _ = Parallel . ForEach ( allFiles , new ParallelOptions ( ) { MaxDegreeOfParallelism = 16 } , ( filename )
177
+ => count = LoadAndIndexFile ( count , filename ) ) ;
204
178
205
179
HeaderIndex = ccHeaderIndex . OrderBy ( kvp => kvp . Key ) . ToDictionary ( kvp => kvp . Key , kvp => kvp . Value ) ;
206
180
@@ -294,7 +268,7 @@ void LoadKnownData(HashSet<string> allFilesInDir, HashSet<string> knownFilenames
294
268
LoadKnownData ( allDataFiles , [ OriginalDataFiles . SoundEffect ] , SoundEffects ) ;
295
269
LoadKnownData ( allDataFiles , OriginalDataFiles . Tutorials , Tutorials ) ;
296
270
297
- MiscFiles = [ .. allDataFiles ] ;
271
+ // MiscFiles = [.. allDataFiles];
298
272
299
273
// load G1 only for now since we need it for palette
300
274
G1 = SawyerStreamReader . LoadG1 ( Settings . GetDataFullPath ( Settings . G1DatFileName ) ) ;
0 commit comments