@@ -43,12 +43,12 @@ public RiftTimer(
4343
4444 // recycle rifts list if coming back from settings
4545 if ( riftsList != null )
46- this . riftsList = riftsList ;
46+ this . riftsList = riftsList ;
4747
48- this . isSessionLogged = isSessionLogged ;
48+ this . isSessionLogged = isSessionLogged ;
4949
5050 if ( logFileName != null )
51- this . logFileName = logFileName ;
51+ this . logFileName = logFileName ;
5252 }
5353
5454 // Handle global hotkey press
@@ -100,7 +100,7 @@ protected override void WndProc(ref Message m)
100100 "Crusader" ,
101101 "Demon Hunter" ,
102102 "Monk" ,
103- "Necromancer" ,
103+ "Necromancer" ,
104104 "Witch Doctor" ,
105105 "Wizard"
106106 } ;
@@ -126,57 +126,60 @@ protected override void WndProc(ref Message m)
126126 "Torment XIII" ,
127127 "Torment XIV" ,
128128 "Torment XV" ,
129- "Torment XVI" ,
129+ "Torment XVI" ,
130130 } ;
131131
132132 private int playerClass = Properties . Settings . Default . playerClass ;
133- private bool isNormalRifts = Properties . Settings . Default . isNormalRifts ;
133+ private bool isNormalRifts = Properties . Settings . Default . isNormalRifts ;
134134 private int difficulty = Properties . Settings . Default . difficulty ;
135- private int grDifficulty = Properties . Settings . Default . grDifficulty ;
135+ private int grDifficulty = Properties . Settings . Default . grDifficulty ;
136136
137137 private int posX = Properties . Settings . Default . posX ;
138138 private int posY = Properties . Settings . Default . posY ;
139139
140140 private bool isTopMost = Properties . Settings . Default . userTopMost ;
141141
142- private bool isCollapsed = false ;
142+ private bool isCollapsed = false ;
143143
144144 private void RiftTimer_Load ( object sender , EventArgs e )
145- {
146- Point startPos = new Point ( posX , posY ) ;
147- this . Location = startPos ;
145+ {
146+ Point startPos = new Point ( posX , posY ) ;
147+ this . Location = startPos ;
148+
149+ this . TopMost = isTopMost ;
148150
149- this . TopMost = isTopMost ;
151+ CheckTime ( ) ;
150152
151- CheckTime ( ) ;
153+ pauseIndicator . Text = "paused" ;
154+ pauseIndicator . Hide ( ) ;
155+ finishIndicator . Text = "finished" ;
156+ finishIndicator . Hide ( ) ;
152157
153- pauseIndicator . Text = "paused" ;
154- pauseIndicator . Hide ( ) ;
155- finishIndicator . Text = "finished" ;
156- finishIndicator . Hide ( ) ;
158+ pauseButton . Enabled = false ;
159+ finishButton . Enabled = false ;
160+ resetButton . Enabled = false ;
157161
158- pauseButton . Enabled = false ;
159- finishButton . Enabled = false ;
160- resetButton . Enabled = false ;
162+ logBox . DataSource = riftsList ;
163+ logBox . DrawMode = DrawMode . OwnerDrawFixed ;
161164
162- logBox . DataSource = riftsList ;
163- logBox . DrawMode = DrawMode . OwnerDrawFixed ;
165+ classesDropDown . DataSource = classesList ;
166+ classesDropDown . SelectedIndex = playerClass ;
167+ difficultyDropDown . DataSource = difficultyList ;
168+ difficultyDropDown . SelectedIndex = difficulty ;
164169
165- classesDropDown . DataSource = classesList ;
166- classesDropDown . SelectedIndex = playerClass ;
167- difficultyDropDown . DataSource = difficultyList ;
168- difficultyDropDown . SelectedIndex = difficulty ;
169- grUpDown . Value = grDifficulty ;
170+ grUpDown . Minimum = 1 ;
171+ grUpDown . Maximum = 200 ;
172+ grUpDown . Value = grDifficulty ;
170173
171- UpdateRiftSelectors ( ) ;
174+ UpdateRiftSelectors ( ) ;
172175
173- internalClock . Interval = 50 ;
174- internalClock . Start ( ) ;
176+ internalClock . Interval = 50 ;
177+ internalClock . Start ( ) ;
175178
176- //debugConsole.Show();
177- }
179+ //debugConsole.Show();
180+ }
178181
179- private void RiftTimer_Shown ( object sender , EventArgs e )
182+ private void RiftTimer_Shown ( object sender , EventArgs e )
180183 {
181184 logBox . ClearSelected ( ) ;
182185 }
@@ -236,9 +239,9 @@ private void Finish_Click(object sender, EventArgs e)
236239 "Rift #" , ( riftsList . Count + 1 ) . ToString ( "D3" ) , "|" ,
237240 time . Elapsed . ToString ( "mm\\ :ss\\ :ff" ) , "|" ,
238241 classesList [ classesDropDown . SelectedIndex ] , "|" ,
239- isNormalRifts
240- ? difficultyList [ difficultyDropDown . SelectedIndex ]
241- : $ "Greater Rift { grDifficulty } "
242+ isNormalRifts
243+ ? difficultyList [ difficultyDropDown . SelectedIndex ]
244+ : $ "Greater Rift { grDifficulty } "
242245 ) ;
243246
244247 riftsList . Add ( entryStr ) ;
@@ -312,12 +315,21 @@ private void InternalClock_Tick(object sender, EventArgs e)
312315 {
313316 classesDropDown . Enabled = false ;
314317 difficultyDropDown . Enabled = false ;
318+ toggleRiftType . Enabled = false ;
319+
320+ grUpDown . Enabled = false ;
321+ grUpDown . Minimum = grUpDown . Value ;
322+ grUpDown . Maximum = grUpDown . Value ;
315323 }
316324 else
317325 {
318326 classesDropDown . Enabled = true ;
319327 difficultyDropDown . Enabled = true ;
320- //pauseButton.Enabled = false;
328+ toggleRiftType . Enabled = true ;
329+
330+ grUpDown . Enabled = true ;
331+ grUpDown . Minimum = 1 ;
332+ grUpDown . Maximum = 200 ;
321333 }
322334
323335 if ( isPaused )
@@ -378,10 +390,10 @@ private void logBox_DrawItem(object sender, DrawItemEventArgs e)
378390 if ( e . Index > - 1 )
379391 {
380392 Color color = isSelected
381- ? SystemColors . Highlight
382- : e . Index % 2 != 0
383- ? Color . SkyBlue
384- : Color . White ;
393+ ? SystemColors . Highlight
394+ : e . Index % 2 != 0
395+ ? Color . SkyBlue
396+ : Color . White ;
385397
386398 SolidBrush bgBrush = new SolidBrush ( color ) ;
387399 SolidBrush txtBrush = new SolidBrush ( e . ForeColor ) ;
@@ -415,16 +427,16 @@ private void MenuItem_Settings_Click(object sender, EventArgs e)
415427 // Toggle panel height collapse mode via context menu item
416428 private void MenuItem_ToggleCollapse_Click ( object sender , EventArgs e )
417429 {
418- if ( ! isCollapsed )
419- {
420- isCollapsed = true ;
421- this . Size = new Size ( 490 , 117 ) ;
422- }
423- else
424- {
425- isCollapsed = false ;
426- this . Size = new Size ( 490 , 321 ) ;
427- }
430+ if ( ! isCollapsed )
431+ {
432+ isCollapsed = true ;
433+ this . Size = new Size ( 490 , 117 ) ;
434+ }
435+ else
436+ {
437+ isCollapsed = false ;
438+ this . Size = new Size ( 490 , 321 ) ;
439+ }
428440 }
429441
430442 // Open file import log
@@ -444,7 +456,7 @@ private void MenuItem_ImportLog_Click(object sender, EventArgs e)
444456 private void MenuItem_SaveLog_Click ( object sender , EventArgs e )
445457 {
446458 if ( isSessionLogged )
447- File . Delete ( logFileName ) ;
459+ File . Delete ( logFileName ) ;
448460
449461 LogToFile ( riftsList ) ;
450462 }
@@ -499,36 +511,38 @@ private void RiftTimer_FormClosed(object sender, FormClosedEventArgs e)
499511 DialogResult = DialogResult . Cancel ;
500512 }
501513
502- // Show the appropriate rift selector
503- private void UpdateRiftSelectors ( )
504- {
505- if ( isNormalRifts )
506- {
507- difficultyDropDown . Visible = true ;
508- grLevelLabel . Visible = false ;
509- grUpDown . Visible = false ;
510- }
511- else
512- {
513- grLevelLabel . Visible = true ;
514- grUpDown . Visible = true ;
515- difficultyDropDown . Visible = false ;
516- }
517- }
518-
519- private void toggleRiftType_Click ( object sender , EventArgs e )
520- {
521- isNormalRifts = ! isNormalRifts ;
522- Properties . Settings . Default . isNormalRifts = isNormalRifts ;
523- UpdateRiftSelectors ( ) ;
524- }
525-
526- private void grUpDown_ValueChanged ( object sender , EventArgs e )
527- {
528- grDifficulty = ( int ) grUpDown . Value ;
529- Properties . Settings . Default . grDifficulty = grDifficulty ;
530-
531- grUpDown . Text = $ "Greater Rift { grDifficulty } ";
532- }
533- }
514+ // Show the appropriate rift selector
515+ private void UpdateRiftSelectors ( )
516+ {
517+ if ( isNormalRifts )
518+ {
519+ difficultyDropDown . Visible = true ;
520+ grLevelLabel . Visible = false ;
521+ grUpDown . Visible = false ;
522+ }
523+ else
524+ {
525+ grLevelLabel . Visible = true ;
526+ grUpDown . Visible = true ;
527+ difficultyDropDown . Visible = false ;
528+ }
529+ }
530+
531+ private void toggleRiftType_Click ( object sender , EventArgs e )
532+ {
533+ isNormalRifts = ! isNormalRifts ;
534+ Properties . Settings . Default . isNormalRifts = isNormalRifts ;
535+ Properties . Settings . Default . Save ( ) ;
536+ UpdateRiftSelectors ( ) ;
537+ }
538+
539+ private void grUpDown_ValueChanged ( object sender , EventArgs e )
540+ {
541+ grDifficulty = ( int ) grUpDown . Value ;
542+ Properties . Settings . Default . grDifficulty = grDifficulty ;
543+ Properties . Settings . Default . Save ( ) ;
544+
545+ grUpDown . Text = $ "Greater Rift { grDifficulty } ";
546+ }
547+ }
534548}
0 commit comments