示例#1
0
 def cascade_categories_out(self):
     for super_cat in self.super_categories:
         animations.FadeOut(super_cat.category_group_hex, duration=0.5, curveType=uiconst.ANIM_OVERSHOT2)
         animations.FadeOut(super_cat.label, duration=0.5, curveType=uiconst.ANIM_OVERSHOT2)
         for sub_cat in super_cat.sub_categories:
             animations.FadeOut(sub_cat, duration=0.5, curveType=uiconst.ANIM_OVERSHOT2)
             blue.synchro.Sleep(15)
示例#2
0
 def submit_training_solution(self):
     if self.isSubmitting:
         return
     if not self.selection:
         self.open_error_dialogue()
         return
     self.isSubmitting = True
     self.finishedTaskCount += 1
     sm.GetService('audio').SendUIEvent(const.Sounds.MainImageLoopStop)
     classification = list(
         set([cat['id'] for cat in self.selection if not cat['excluded']]))
     self.result = {
         'playerSelection': classification,
         'task': {
             'solution': self.task['solution']
         }
     }
     SetTooltipHeaderAndDescription(targetObject=self.explanation_icon,
                                    headerText='',
                                    descriptionText=self.explanation)
     self.result_window.assign_result(self.result)
     self.training_category_selector.cascade_categories_out()
     self.training_category_selector.state = uiconst.UI_DISABLED
     animations.FadeOut(self.main_button_container)
     animations.FadeOut(self.training_task_image.colorFilterContainer)
     animations.FadeOut(self.task_label)
     animations.FadeOut(self.refresh_task_button)
     self.training_task_image.start_transmission_animation()
     self.left_main_container.state = uiconst.UI_DISABLED
     self.category_container.state = uiconst.UI_DISABLED
     self.main_button_container.state = uiconst.UI_DISABLED
示例#3
0
 def _animate_out(self):
     animations.FadeOut(self.main_button_container)
     animations.FadeOut(self.task_image.colorFilterContainer)
     animations.FadeOut(self.task_label)
     animations.FadeOut(self.checkbox_container)
     animations.FadeOut(self.new_task_button)
     self.new_task_button.SetState(uiconst.UI_DISABLED)
     uthread.new(self.category_selector.cascade_categories_out)
     self.category_selector.state = uiconst.UI_DISABLED
     self.task_image.start_transmission_animation()
示例#4
0
 def _AnimHideIconGlow(self):
     animations.FadeOut(self.iconGlow, duration=0.3)
     animations.MorphScalar(self.iconShadow,
                            'left',
                            startVal=self.iconShadow.left,
                            endVal=28,
                            duration=0.2)
示例#5
0
    def Update(self, animate=True):
        for i, bar in enumerate(self.bars):
            if i < self.skill.level:
                if animate:
                    animations.SpColorMorphTo(bar,
                                              endColor=(1.0, 1.0, 1.0, 0.5),
                                              duration=0.3)
                else:
                    bar.opacity = self.SKILL_BAR_OPACITY
            elif i < self.skill.unmodifiedLevel:
                if animate:
                    animations.SpColorMorphTo(bar,
                                              endColor=COLOR_MODIFIED,
                                              duration=0.3)
                else:
                    bar.SetRGB(*COLOR_MODIFIED)
            elif animate:
                animations.FadeOut(bar, duration=0.3)
            else:
                bar.opacity = 0.0

        self.progress.SetValueInstantly(0, self.skill.progress)
        if self.skill.unmodifiedProgress == self.skill.progress:
            self.progress.SetValueInstantly(1, 0.0)
        elif self.skill.unmodifiedProgress < self.skill.progress:
            self.progress.SetValueInstantly(1, 1.0)
        else:
            self.progress.SetValueInstantly(1, self.skill.unmodifiedProgress)
示例#6
0
 def AnimAvailable(self):
     self.check.SetTexturePath(RES_AVAILABLE)
     animations.BlinkIn(self.check)
     animations.FadeTo(self.completedFill,
                       startVal=self.completedFill.opacity,
                       endVal=0.0)
     animations.FadeOut(self.timer, duration=0.3)
示例#7
0
    def UpdateHint(self):
        """
        This is the hint automatic fade out logic
        """
        startTime = blue.os.GetSimTime() + self.minDisplayTime
        outsideBoundsEndTime = None
        doUpdates = True
        try:
            while doUpdates:
                timeNow = blue.os.GetSimTime()
                if not self or self.destroyed:
                    return
                if timeNow > startTime:
                    if not (uicore.uilib.mouseOver in (self, self.anchor) or IsUnder(uicore.uilib.mouseOver, self) or IsUnder(uicore.uilib.mouseOver, self.anchor)):
                        if outsideBoundsEndTime is None:
                            outsideBoundsEndTime = timeNow + self.outsideBoundsTime
                        elif timeNow > outsideBoundsEndTime:
                            doUpdates = False
                    else:
                        outsideBoundsEndTime = None
                if self.sensorSuite.activeBracketHint is not self:
                    doUpdates = False
                if doUpdates:
                    try:
                        self.OnUpdateHint()
                        self.UpdateWarpButton()
                        blue.pyos.synchro.SleepWallclock(self.updateLoopTimeMSec)
                    except InvalidClientStateError:
                        doUpdates = False

        finally:
            if self and not self.destroyed:
                animations.FadeOut(self, sleep=True)
                uthread.new(self.Close)
示例#8
0
 def AnimCollapse(self):
     animations.MorphScalar(self,
                            'width',
                            startVal=self.width,
                            endVal=ENTRY_DEFAULT_WIDTH,
                            duration=0.1)
     animations.FadeOut(self.selectionGradient, duration=0.1)
     self._AnimHideIconGlow()
示例#9
0
 def UpdateLockedStatus(self):
     opacity = 0.6 if self.data.isLocked else 1.0
     animations.FadeTo(self, startVal=self.opacity, endVal=opacity)
     if self.data.isLocked:
         self.CheckConstructLockIcon()
         animations.FadeIn(self.lockedIcon, duration=0.3)
     elif self.lockedIcon is not None:
         animations.FadeOut(self.lockedIcon, duration=0.3)
示例#10
0
 def OnClick(self, *args):
     if self.exclude_texture.state is not uiconst.UI_HIDDEN or self.unclickable is True:
         return
     sm.GetService('audio').SendUIEvent(const.Sounds.CategorySelectPlay)
     self.category['selected'] = not self.category['selected']
     if self.category['selected']:
         animations.FadeIn(self.selected_texture, **self.GLOW_ANIMATION)
     else:
         animations.FadeOut(self.selected_texture, **self.GLOW_ANIMATION)
     sm.ScatterEvent(const.Events.CategoryChanged, self)
示例#11
0
 def HideDetails(self):
     if not self.details or self.details.destroyed:
         return
     details = self.details
     self.details = None
     details.DisableAutoSize()
     animations.FadeOut(details, duration=0.15)
     animations.MorphScalar(details,
                            'height',
                            startVal=details.height,
                            endVal=0,
                            duration=0.15,
                            callback=details.Close)
示例#12
0
 def EnterCompactMode(self):
     if self.compactMode:
         return
     self.compactMode = True
     animations.FadeOut(self.characters, duration=0.2)
     animations.MorphScalar(self.characters,
                            'left',
                            startVal=self.characters.left,
                            endVal=self.CHARACTERS_LEFT - 60,
                            duration=0.3)
     animations.MorphScalar(self.content,
                            'left',
                            startVal=self.content.left,
                            endVal=0,
                            duration=0.3)
示例#13
0
 def close(self):
     if not self.result:
         sm.ScatterEvent(const.Events.ContinueFromReward)
     elif self.isTrainingPhase:
         sm.ScatterEvent(const.Events.ContinueFromTrainingResult)
         self.audio_service.SendUIEvent(const.Sounds.RewardsWindowLoopStop)
         self.audio_service.SendUIEvent(const.Sounds.RewardsWindowClosePlay)
         self.audio_service.SendUIEvent(const.Sounds.MainImageLoopPlay)
     else:
         sm.ScatterEvent(const.Events.CloseResult, self.result)
         sm.ScatterEvent(const.Events.ContinueFromResult)
     animations.FadeOut(self, duration=0.4)
     self.categories_selected.cascade_categories_out()
     self.categories_selected.reset_categories()
     self.legend_container.SetOpacity(0)
     self.disable_ui()
示例#14
0
    def AnimHide(self):
        for child in self.children:
            animations.FadeOut(child, duration=0.3)

        self.DisableAutoSize()
        animations.MorphScalar(self,
                               'height',
                               startVal=self.height,
                               endVal=0,
                               timeOffset=0.1,
                               duration=0.3)
        animations.MorphScalar(self,
                               'padTop',
                               startVal=self.padTop,
                               endVal=0,
                               timeOffset=0.1,
                               duration=0.3)
        animations.MorphScalar(self,
                               'padBottom',
                               startVal=self.padBottom,
                               endVal=0,
                               timeOffset=0.1,
                               duration=0.3)
示例#15
0
 def fade_out_tooltip_image(self, path):
     animations.FadeOut(self.imageSprite, duration=0.15, callback=lambda : self.set_image_path(path))
示例#16
0
 def AnimStatePending(self):
     animations.FadeOut(self.appliedIcon, duration=0.15)
     animations.FadeOut(self.previewedIcon, duration=0.15)
     animations.FadeIn(self.pendingIcon, duration=0.15)
示例#17
0
 def AnimStatePreviewed(self):
     animations.FadeOut(self.appliedIcon, duration=0.15)
     animations.FadeOut(self.pendingIcon, duration=0.15)
     self._AnimShowStateIcon(self.previewedIcon)
示例#18
0
 def _AnimHideProcessing(self):
     animations.FadeIn(self.label)
     animations.FadeOut(self.spinner)
示例#19
0
 def AnimStateIdle(self):
     for icon in (self.pendingIcon, self.previewedIcon, self.pendingIcon):
         animations.FadeOut(icon, duration=0.15)
示例#20
0
 def fade_out(self):
     animations.FadeOut(self, duration=0.5, callback=self.reset_processing_screen)
示例#21
0
 def set_unselected(self):
     self.category['selected'] = False
     animations.FadeOut(self.selected_texture, **self.GLOW_ANIMATION)
示例#22
0
def HideContainerContent(container):
    for child in container.children:
        animations.FadeOut(child, duration=0.3)

    blue.synchro.SleepWallclock(300)
示例#23
0
 def reset_task_image(self):
     self.submitting = False
     self.task_image.state = uiconst.UI_DISABLED
     animations.FadeOut(self, duration=0.4, callback=self.task_image.reset_image)
示例#24
0
 def animate_result_background_in(self):
     animations.FadeOut(self.gridBackground, duration=0.5)
     animations.FadeIn(self.result_background,
                       duration=1,
                       curveType=uiconst.ANIM_OVERSHOT5,
                       endVal=1.5)
示例#25
0
 def animate_normal_background(self):
     animations.FadeOut(self.result_background, duration=0.5)
     animations.FadeIn(self.gridBackground,
                       duration=1,
                       curveType=uiconst.ANIM_OVERSHOT5)
示例#26
0
 def AnimExit(self):
     animations.FadeOut(self, duration=self.TRANSITION_TIME)
示例#27
0
 def fade_out(self):
     self.main_button_container.SetState(uiconst.UI_HIDDEN)
     sm.ScatterEvent(const.Events.RewardViewFadeOut)
     animations.FadeOut(self, duration=0.5, callback=self.continue_from_reward)
示例#28
0
 def fade_badge_out(self):
     animations.FadeOut(self.rank_icon, duration=0.5, callback=self.fade_badge_in)
     animations.FadeOut(self.rank_label, duration=0.5)
示例#29
0
 def fade_out_annotation(self):
     animations.FadeOut(self.imageOverlaySprite, duration=0.15)
示例#30
0
 def AnimHide(self):
     animations.FadeOut(self, duration=0.4)