2424function Module :OnDisable ()
2525 self :UnhookAll ();
2626 if IsAddOnLoaded (' Blizzard_ChallengesUI' ) then
27- ChallengesFrame_Update (ChallengesFrame );
27+ self . updateFunc (ChallengesFrame );
2828 for i = 1 , # ChallengesFrame .DungeonIcons do
2929 if ChallengesFrame .DungeonIcons [i ].CurrentLevel then
3030 ChallengesFrame .DungeonIcons [i ].CurrentLevel :Hide ();
@@ -68,7 +68,7 @@ function Module:GetOptions(defaultOptionsTable, db)
6868 db .dash = value ;
6969 self .font :CopyFontObject (SystemFont_Huge1_Outline );
7070 if ChallengesFrame and ChallengesFrame .IsShown and ChallengesFrame :IsShown () then
71- ChallengesFrame_Update (ChallengesFrame );
71+ self . updateFunc (ChallengesFrame );
7272 end
7373 end ,
7474 order = 11 ,
@@ -85,11 +85,18 @@ function Module:ADDON_LOADED(event, addon)
8585end
8686
8787function Module :SetupHook ()
88- self :SecureHook (' ChallengesFrame_Update' , function (frame )
89- Module :AddScoresToAllIcons (frame );
90- end );
88+ self .updateFunc = ChallengesFrame_Update or ChallengesFrame .Update ;
89+ if ChallengesFrame_Update then
90+ self :SecureHook (' ChallengesFrame_Update' , function (frame )
91+ Module :AddScoresToAllIcons (frame );
92+ end );
93+ else
94+ self :SecureHook (ChallengesFrame , ' Update' , function (frame )
95+ Module :AddScoresToAllIcons (frame );
96+ end );
97+ end
9198 if ChallengesFrame :IsShown () then
92- ChallengesFrame_Update (ChallengesFrame );
99+ self . updateFunc (ChallengesFrame );
93100 end
94101end
95102
0 commit comments