def AuraIntroduction(self):
     if not self.IsEnabled():
         return
     if not settings.char.ui.Get('opportunities_aura_introduced', False):
         nextIncompleteGroup = GetFirstIncompleteAchievementGroup()
         if nextIncompleteGroup:
             from achievements.client.auraAchievementWindow import AchievementAuraWindow
             AchievementAuraWindow.Open()
 def ActivateNextIncompleteOpportunity(self, emphasize, **kwargs):
     nextGroup = GetFirstIncompleteAchievementGroup()
     if nextGroup:
         if True:
             self.Close()
         sm.GetService('achievementSvc').SetActiveAchievementGroupID(
             nextGroup.groupID, emphasize=emphasize)
     else:
         self.UpdateOpportunityState()
 def UpdateOpportunityState(self,
                            activeGroupChanged=False,
                            activeGroupCompleted=False):
     activeGroup = GetActiveAchievementGroup()
     nextGroup = GetFirstIncompleteAchievementGroup()
     if activeGroup:
         if nextGroup:
             if activeGroupCompleted:
                 self.Step_PresentOpportunity()
             return
     elif nextGroup:
         if self.activeStep not in (STEP_INTRO, STEP_INTRO2,
                                    STEP_PRESENT_OPPORTUNITY):
             self.Step_AskStart()
         return
     self.Step_AllDone()
 def Step_PresentOpportunity(self, *args):
     nextGroup = GetFirstIncompleteAchievementGroup()
     if not nextGroup:
         return self.Step_AllDone()
     self.mainContent.Flush()
     self.LoadLargeText(nextGroup.groupName)
     self.LoadDivider()
     self.LoadMediumText(nextGroup.groupDescription)
     self.LoadButtons(
         ((GetByLabel('Achievements/UI/Accept'),
           self.ActivateNextIncompleteOpportunity, (False, )),
          (GetByLabel('Achievements/UI/Dismiss'), self.Close, None)))
     self.LoadTreeLink()
     self.SetCaption(GetByLabel('Achievements/UI/NewOpportunity'))
     self.SetOrder(0)
     self.activeStep = STEP_PRESENT_OPPORTUNITY
 def Step_PresentOpportunity(self, btn=None, groupToPresent=None, *args):
     if groupToPresent:
         nextGroup = groupToPresent
     else:
         nextGroup = GetFirstIncompleteAchievementGroup()
     if not nextGroup:
         return self.Step_AllDone()
     self.FadeOutTransition()
     self.mainContent.Flush()
     self.LoadLargeText(GetByLabel(nextGroup.groupName))
     self.LoadDivider()
     self.LoadMediumText(GetByLabel(nextGroup.groupDescription))
     self.LoadPresentButtons(groupToPresent)
     self.LoadTreeLink()
     self.SetCaption(GetByLabel('Achievements/UI/NewOpportunity'))
     self.SetOrder(0)
     self.activeStep = STEP_PRESENT_OPPORTUNITY
     self.FadeInTransition()
 def ActivateNextIncompleteOpportunity(self,
                                       emphasize,
                                       groupToPresent=None,
                                       **kwargs):
     if groupToPresent:
         nextGroup = groupToPresent
     else:
         nextGroup = GetFirstIncompleteAchievementGroup()
     if nextGroup:
         if True:
             self.FadeOutTransitionAndClose()
         done = settings.char.ui.Get('opportunities_aura_activated', [])
         if nextGroup.groupID not in done:
             done.append(nextGroup.groupID)
         settings.char.ui.Set('opportunities_aura_activated', done)
         sm.GetService('achievementSvc').SetActiveAchievementGroupID(
             nextGroup.groupID, emphasize=emphasize)
     else:
         self.UpdateOpportunityState()