@@ -110,50 +110,59 @@ public bool ReloadData()
110
110
}
111
111
112
112
//Stats parsing
113
- if ( activeSaveFile . GetItemStatData ( activeItem ) == null )
114
- {
115
- detailsTabControl . TabPages . Remove ( statsTab ) ;
116
- }
117
- else
113
+ if ( Form1 . statsSystemEnabled )
118
114
{
119
- detailsTabControl . TabPages . Remove ( statsPlaceholderTab ) ;
120
- statsListView . Items . Clear ( ) ;
121
- var listRows = new List < ListViewItem > ( ) ;
122
- var statsData = activeSaveFile . GetItemStatData ( activeItem ) ;
123
- if ( statsData . StatModifiers != null )
115
+ if ( activeSaveFile . GetItemStatData ( activeItem ) == null )
124
116
{
125
- foreach ( Handle < GameStatModifierData > modifier in statsData . StatModifiers )
117
+ detailsTabControl . TabPages . Remove ( statsTab ) ;
118
+ }
119
+ else
120
+ {
121
+ detailsTabControl . TabPages . Remove ( statsPlaceholderTab ) ;
122
+ statsListView . Items . Clear ( ) ;
123
+ var listRows = new List < ListViewItem > ( ) ;
124
+ var statsData = activeSaveFile . GetItemStatData ( activeItem ) ;
125
+ if ( statsData . StatModifiers != null )
126
126
{
127
- var row = new string [ ] { "Constant" , modifier . Value . ModifierType . ToString ( ) , modifier . Value . StatType . ToString ( ) , "" } ;
128
-
129
- if ( modifier . Value is GameCombinedStatModifierData combinedData )
130
- {
131
- row [ 0 ] = "Combined" ;
132
- row [ 3 ] = combinedData . Value . ToString ( ) ;
133
- }
134
- else if ( modifier . Value is GameConstantStatModifierData constantData )
127
+ foreach ( Handle < GameStatModifierData > modifier in statsData . StatModifiers )
135
128
{
136
- row [ 3 ] = constantData . Value . ToString ( ) ;
137
- }
138
- else
139
- {
140
- row [ 0 ] = "Curve" ;
129
+ var row = new string [ ] { "Constant" , modifier . Value . ModifierType . ToString ( ) , modifier . Value . StatType . ToString ( ) , "" } ;
130
+
131
+ if ( modifier . Value is GameCombinedStatModifierData combinedData )
132
+ {
133
+ row [ 0 ] = "Combined" ;
134
+ row [ 3 ] = combinedData . Value . ToString ( ) ;
135
+ }
136
+ else if ( modifier . Value is GameConstantStatModifierData constantData )
137
+ {
138
+ row [ 3 ] = constantData . Value . ToString ( ) ;
139
+ }
140
+ else
141
+ {
142
+ row [ 0 ] = "Curve" ;
143
+ }
144
+
145
+ var newItem = new ListViewItem ( row ) ;
146
+ newItem . Tag = modifier ;
147
+ listRows . Add ( newItem ) ;
141
148
}
142
149
143
- var newItem = new ListViewItem ( row ) ;
144
- newItem . Tag = modifier ;
145
- listRows . Add ( newItem ) ;
150
+ statsListView . BeginUpdate ( ) ;
151
+ statsListView . Items . AddRange ( listRows . ToArray ( ) ) ;
152
+ statsListView . EndUpdate ( ) ;
153
+ }
154
+ else
155
+ {
156
+ statsData . StatModifiers = new Handle < GameStatModifierData > [ 0 ] ;
146
157
}
147
-
148
- statsListView . BeginUpdate ( ) ;
149
- statsListView . Items . AddRange ( listRows . ToArray ( ) ) ;
150
- statsListView . EndUpdate ( ) ;
151
- }
152
- else
153
- {
154
- statsData . StatModifiers = new Handle < GameStatModifierData > [ 0 ] ;
155
158
}
156
159
}
160
+ else
161
+ {
162
+ detailsTabControl . TabPages . Remove ( statsTab ) ;
163
+ detailsTabControl . TabPages . Remove ( statsPlaceholderTab ) ;
164
+ }
165
+
157
166
158
167
if ( ! statsOnly )
159
168
{
@@ -176,6 +185,12 @@ public void LoadItem(ItemData item, object _saveFile, Func<bool> callback1, Rand
176
185
177
186
public void LoadStatsOnly ( uint seed , object _saveFile , string name )
178
187
{
188
+ if ( ! Form1 . statsSystemEnabled )
189
+ {
190
+ MessageBox . Show ( "Stats system disabled." ) ;
191
+ this . Close ( ) ;
192
+ }
193
+
179
194
callbackFunc1 = delegate { return true ; } ;
180
195
var dummyItem = new ItemData ( ) ;
181
196
dummyItem . Header . Seed = seed ;
0 commit comments