33using System . Linq ;
44using System . Windows . Forms ;
55
6- using BizHawk . Common ;
76using BizHawk . Common . NumberExtensions ;
87
98namespace BizHawk . Client . EmuHawk
@@ -15,7 +14,6 @@ public partial class RCheevosAchievementListForm : Form
1514 {
1615 private RCheevos . Cheevo [ ] _cheevos ;
1716 private RCheevosAchievementForm [ ] _cheevoForms ;
18- private int _updateCooldown ;
1917 private Func < uint , string > _getCheevoProgress ;
2018 private Func < bool > _isHardcodeMode ;
2119
@@ -26,7 +24,6 @@ public RCheevosAchievementListForm()
2624 InitializeComponent ( ) ;
2725 FormClosing += RCheevosAchievementListForm_FormClosing ;
2826 _cheevoForms = Array . Empty < RCheevosAchievementForm > ( ) ;
29- _updateCooldown = 5 ; // only update every 5 frames / 12 fps (as this is rather expensive to update)
3027 using var temp = new RCheevosAchievementForm ( null ) ;
3128 _controlHeight = temp . Height + temp . Margin . Bottom + temp . Margin . Top ;
3229 }
@@ -57,22 +54,16 @@ public void Restart(IEnumerable<RCheevos.Cheevo> cheevos, Func<uint, string> get
5754 UpdateForms ( ) ;
5855 }
5956
60- public void OnFrameAdvance ( bool hardcore , bool forceUpdate = false )
57+ public void OnFrameAdvance ( bool hardcore )
6158 {
62- _updateCooldown -- ;
63- if ( _updateCooldown == 0 || forceUpdate )
64- {
65- _updateCooldown = 5 ;
66-
67- var reorderedCheevos = _cheevos . OrderByDescending ( f => f . OrderByKey ( _getCheevoProgress ) ) . ToArray ( ) ;
68- _cheevos = reorderedCheevos ;
59+ var reorderedCheevos = _cheevos . OrderByDescending ( f => f . OrderByKey ( _getCheevoProgress ) ) . ToArray ( ) ;
60+ _cheevos = reorderedCheevos ;
6961
70- UpdateForms ( ) ;
62+ UpdateForms ( ) ;
7163
72- foreach ( var form in _cheevoForms )
73- {
74- form . OnFrameAdvance ( hardcore ) ;
75- }
64+ foreach ( var form in _cheevoForms )
65+ {
66+ form . OnFrameAdvance ( hardcore ) ;
7667 }
7768 }
7869
0 commit comments