Example #1
0
 private void RuleCategoryController_SetData(On.RoR2.UI.RuleCategoryController.orig_SetData orig, RoR2.UI.RuleCategoryController self, RuleCategoryDef categoryDef, RuleChoiceMask availability, RuleBook ruleBook)
 {
     if (categoryDef.displayToken == "RULE_HEADER_DIFFICULTY" && EDrule != null)
     {
         try
         {
             var localUser1 = LocalUserManager.GetFirstLocalUser();
             if (localUser1 != null)
             {
                 bool knowsED = AchievementManager.GetUserAchievementManager(localUser1).userProfile.HasAchievement("COMPLETE_MAINENDING_DILUVIAN");
                 if (knowsED)
                 {
                     Syzygy.Unlocked();
                 }
                 else
                 {
                     Syzygy.Locked();
                 }
                 EDrule.spritePath = assetString + Syzygy.def.IconPath;
                 ReloadLanguage();
             }
         }
         catch (Exception e)
         {
             Logger.LogWarning(e);
         }
     }
     orig(self, categoryDef, availability, ruleBook);
 }
 public override void OnGranted()
 {
     base.OnGranted();
     Syzygy.Unlocked();
 }