@@ -33,8 +33,8 @@ public partial class Form1 : Form
33
33
private readonly Dictionary < Species , int [ ] > _topLevels = new Dictionary < Species , int [ ] > ( ) ;
34
34
35
35
private readonly Dictionary < Species , int [ ] > _lowestLevels = new Dictionary < Species , int [ ] > ( ) ;
36
- private readonly List < StatIO > _statIOs = new List < StatIO > ( ) ;
37
- private readonly List < StatIO > _testingIOs = new List < StatIO > ( ) ;
36
+ private readonly StatIO [ ] _statIOs = new StatIO [ Stats . StatsCount ] ;
37
+ private readonly StatIO [ ] _testingIOs = new StatIO [ Stats . StatsCount ] ;
38
38
private int _activeStatIndex = - 1 ;
39
39
40
40
private readonly bool [ ]
@@ -188,6 +188,46 @@ public Form1()
188
188
openSettingsToolStripMenuItem . ShortcutKeyDisplayString = new KeysConverter ( )
189
189
. ConvertTo ( Keys . Control , typeof ( string ) ) ? . ToString ( ) . Replace ( "None" , "," ) ;
190
190
191
+ for ( int s = 0 ; s < Stats . StatsCount ; s ++ )
192
+ {
193
+ var statIo = new StatIO
194
+ {
195
+ InputType = StatIOInputType . FinalValueInputType ,
196
+ Title = Utils . StatName ( s ) ,
197
+ statIndex = s
198
+ } ;
199
+ var statIoTesting = new StatIO
200
+ {
201
+ InputType = StatIOInputType . LevelsInputType ,
202
+ Title = Utils . StatName ( s ) ,
203
+ statIndex = s
204
+ } ;
205
+
206
+ if ( Utils . Precision ( s ) == 3 )
207
+ {
208
+ statIo . Percent = true ;
209
+ statIoTesting . Percent = true ;
210
+ }
211
+
212
+ statIoTesting . LevelChanged += TestingStatIoValueUpdate ;
213
+ statIo . InputValueChanged += StatIOQuickWildLevelCheck ;
214
+ statIo . Click += StatIO_Click ;
215
+ _considerStatHighlight [ s ] = ( Properties . Settings . Default . consideredStats & ( 1 << s ) ) != 0 ;
216
+
217
+ _statIOs [ s ] = statIo ;
218
+ _testingIOs [ s ] = statIoTesting ;
219
+ }
220
+
221
+ // add controls in the order they are shown in-game
222
+ for ( int s = 0 ; s < Stats . StatsCount ; s ++ )
223
+ {
224
+ var displayIndex = Stats . DisplayOrder [ s ] ;
225
+ flowLayoutPanelStatIOsExtractor . Controls . Add ( _statIOs [ displayIndex ] ) ;
226
+ flowLayoutPanelStatIOsTester . Controls . Add ( _testingIOs [ displayIndex ] ) ;
227
+ checkedListBoxConsiderStatTop . Items . Add ( Utils . StatName ( displayIndex ) ,
228
+ _considerStatHighlight [ displayIndex ] ) ;
229
+ }
230
+
191
231
_timerGlobal . Interval = 1000 ;
192
232
_timerGlobal . Tick += TimerGlobal_Tick ;
193
233
@@ -251,46 +291,6 @@ private void Form1_Load(object sender, EventArgs e)
251
291
tamingControl1 . WeaponDamages = Properties . Settings . Default . weaponDamages ;
252
292
tamingControl1 . WeaponDamagesEnabled = Properties . Settings . Default . weaponDamagesEnabled ;
253
293
254
- for ( int s = 0 ; s < Stats . StatsCount ; s ++ )
255
- {
256
- var statIO = new StatIO
257
- {
258
- InputType = StatIOInputType . FinalValueInputType ,
259
- Title = Utils . StatName ( s ) ,
260
- statIndex = s
261
- } ;
262
- var statIoTesting = new StatIO
263
- {
264
- InputType = StatIOInputType . LevelsInputType ,
265
- Title = Utils . StatName ( s ) ,
266
- statIndex = s
267
- } ;
268
-
269
- if ( Utils . Precision ( s ) == 3 )
270
- {
271
- statIO . Percent = true ;
272
- statIoTesting . Percent = true ;
273
- }
274
-
275
- statIoTesting . LevelChanged += TestingStatIoValueUpdate ;
276
- statIO . InputValueChanged += StatIOQuickWildLevelCheck ;
277
- statIO . Click += StatIO_Click ;
278
- _considerStatHighlight [ s ] = ( Properties . Settings . Default . consideredStats & ( 1 << s ) ) != 0 ;
279
-
280
- _statIOs . Add ( statIO ) ;
281
- _testingIOs . Add ( statIoTesting ) ;
282
- }
283
-
284
- // add controls in the order they are shown in-game
285
- for ( int s = 0 ; s < Stats . StatsCount ; s ++ )
286
- {
287
- var displayIndex = Stats . DisplayOrder [ s ] ;
288
- flowLayoutPanelStatIOsExtractor . Controls . Add ( _statIOs [ displayIndex ] ) ;
289
- flowLayoutPanelStatIOsTester . Controls . Add ( _testingIOs [ displayIndex ] ) ;
290
- checkedListBoxConsiderStatTop . Items . Add ( Utils . StatName ( displayIndex ) ,
291
- _considerStatHighlight [ displayIndex ] ) ;
292
- }
293
-
294
294
// torpor should not show bar, it get's too wide and is not interesting for breeding
295
295
_statIOs [ Stats . Torpidity ] . ShowBarAndLock = false ;
296
296
_testingIOs [ Stats . Torpidity ] . ShowBarAndLock = false ;
0 commit comments