Ejemplo n.º 1
0
    def UpdateHint(self):
        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)
Ejemplo n.º 2
0
 def IsMouseOverHint(self):
     isMouseOverHint = False
     if uicore.uilib.mouseOver is self or IsUnder(uicore.uilib.mouseOver, self):
         isMouseOverHint = True
     elif self.sensorSuite.HasActiveOverlapContainerInstance():
         overlapContainer = self.sensorSuite.GetOverlapContainerInstance()
         if uicore.uilib.mouseOver is overlapContainer or IsUnder(uicore.uilib.mouseOver, overlapContainer):
             isMouseOverHint = True
     return isMouseOverHint
    def UpdateTimer(self):
        startTime = self.GetTime()
        while self.doUpdates:
            timeNow = self.GetTime()
            if self.parentTimer.expiryTime is not None:
                timeLeft = max(0, self.parentTimer.expiryTime - timeNow)
                if timeLeft == 0:
                    self.doUpdates = False
                if self.activeBlink is not None:
                    self.activeBlink.Stop()
                    self.time.opacity = 1.0
                    self.activeBlink = None
            else:
                timeLeft = self.timerData.maxTimeout
                if self.activeBlink is None:
                    self.activeBlink = uicore.animations.BlinkOut(
                        self.time, duration=1.0, loops=uiconst.ANIM_REPEAT)
            if startTime + const.SEC < timeNow:
                if not (uicore.uilib.mouseOver is self
                        or IsUnder(uicore.uilib.mouseOver, self.parentTimer)):
                    self.doUpdates = False
            self.OnUpdate(timeLeft)
            if self.doUpdates:
                blue.pyos.synchro.SleepWallclock(200)

        uicore.animations.FadeOut(self, sleep=True)
        self.Close()
Ejemplo n.º 4
0
    def OnGlobalMouseDown(self, *args):
        if self.destroyed:
            return False
        for layer in (uicore.layer.utilmenu, uicore.layer.modal, uicore.layer.menu):
            if IsUnder(uicore.uilib.mouseOver, layer):
                return True

        self.Close()
        return False
Ejemplo n.º 5
0
    def HideUtilButtons(self, force=0):
        mo = uicore.uilib.mouseOver
        if not force and (mo in self.utilButtons or mo == self
                          or IsUnder(mo, self)):
            return
        for button in self.utilButtons:
            button.Hide()

        self.utilButtonsTimer = None
Ejemplo n.º 6
0
    def IsMouseInSpaceView(self):
        if self.viewState.IsViewActive('inflight'):
            mouseOver = uicore.uilib.mouseOver
            for uiContainer in (uicore.layer.inflight,
                                uicore.layer.sensorsuite,
                                uicore.layer.bracket):
                if mouseOver is uiContainer or IsUnder(mouseOver, uiContainer):
                    return True

        return False
Ejemplo n.º 7
0
    def UpdateTimer(self):
        startTime = self.GetTime()
        count = 0
        while self.doUpdates:
            timeNow = self.GetTime()
            self._UpdateTimers()
            if startTime + const.SEC < timeNow:
                if not (uicore.uilib.mouseOver is self
                        or IsUnder(uicore.uilib.mouseOver, self)
                        or IsUnder(uicore.uilib.mouseOver, self.parentTimer)):
                    if count > 2:
                        self.doUpdates = False
                    else:
                        count += 1
                else:
                    count = 0
            if self.doUpdates:
                blue.pyos.synchro.SleepWallclock(200)

        uicore.animations.FadeOut(self, sleep=True)
        self.Close()
Ejemplo n.º 8
0
    def OnGlobalMouseDown(self, *args):
        if self.destroyed:
            return False
        self.blockSelection = False
        searchResultMenu = self.searchResultMenu
        if searchResultMenu and searchResultMenu():
            for layer in (uicore.layer.utilmenu, uicore.layer.menu):
                if IsUnder(uicore.uilib.mouseOver, layer):
                    if uicore.uilib.rightbtn:
                        self.blockSelection = True
                    return True

            self.CloseResultMenu()
        return True
Ejemplo n.º 9
0
 def OnGlobalMouseUp_BestRepair(self, fromwhere, *etc):
     if self.bestRepairPickerPanel:
         if uicore.uilib.mouseOver == self.bestRepairPickerPanel or IsUnder(
                 fromwhere, self.bestRepairPickerPanel
         ) or fromwhere == self.activeBestRepairParent:
             import log
             log.LogInfo(
                 'Combo.OnGlobalClick Ignoring all clicks from comboDropDown'
             )
             return 1
     if self.bestRepairPickerPanel and not self.bestRepairPickerPanel.destroyed:
         self.bestRepairPickerPanel.Close()
     self.bestRepairPickerPanel = None
     if self.sr.bestRepairPickerCookie:
         uicore.event.UnregisterForTriuiEvents(
             self.sr.bestRepairPickerCookie)
     self.sr.bestRepairPickerCookie = None
     return 0
Ejemplo n.º 10
0
 def _CheckIfStillHilited(self):
     if IsUnder(uicore.uilib.mouseOver, self) or uicore.uilib.mouseOver is self:
         return
     self.ShowNotHilited()
Ejemplo n.º 11
0
 def OnMouseExit(self, *args):
     if not (IsUnder(uicore.uilib.mouseOver, self) or uicore.uilib.mouseOver is self):
         self.ShowNotHilited()
Ejemplo n.º 12
0
 def OnMouseExit(self, *args):
     if not IsUnder(uicore.uilib.mouseOver, self):
         self.highlight.display = False
Ejemplo n.º 13
0
 def IsMouseOverMenu(self):
     overMegaMenu = IsUnder(uicore.uilib.mouseOver, self)
     overNavigationButton = IsUnder(uicore.uilib.mouseOver, self)
     return overMegaMenu or overNavigationButton