Пример #1
0
 def DoCollision(self, targetId, fx, fy, fz, fake = False):
     if self.collided:
         return
     self.collided = True
     if self.model is None:
         return
     uthread.new(self._DoCollision)
Пример #2
0
 def AutoSelect(self, silently = 0):
     if self.destroyed:
         return
     idx = 0
     if self._settingsID:
         idx = settings.user.tabgroups.Get(self._settingsID, 0)
     uthread.new(self.sr.tabs[min(len(self.sr.tabs) - 1, idx)].Select, silently=silently)
Пример #3
0
    def Start(self, duration):
        if self.gfx is None:
            raise RuntimeError("MicroJumpDriveEngage: no effect defined:" + self.__guid__)
        self.curveSets = self.gfx.curveSets
        self.controllerCurve = None
        length = 0
        for each in self.gfx.curveSets:
            length = max(each.GetMaxCurveDuration() * 1000, length)
            each.Play()
            if each.name == "PLAY_START":
                self.controllerCurve = each.curves[0]

        self.AddToScene(self.gfxModel)
        if self.playerEffect is None:
            self._SetCurveTime(duration * 0.001)
        else:
            self._SetCurveTime(duration * 0.001 - 0.25)
            length = 0
            for each in self.playerEffect.curveSets:
                length = max(each.GetMaxCurveDuration() * 1000, length)
                each.Stop()

            triggerDelayPlayer = duration - length
            uthread.new(self._TriggerPlaybackPlayer, triggerDelayPlayer)
        uthread.new(self._DelayedStop, duration + 2 * SECOND)
Пример #4
0
    def InitUI(self, planetChanged):
        self.LogInfo('Initializing UI')
        self.StartLoadingBar('planet_ui_init', localization.GetByLabel('UI/PI/Common/PlanetMode'), localization.GetByLabel('UI/PI/Common/LoadingPlanetResources'), 5)
        try:
            sm.GetService('planetSvc').GetPlanet(self.planetID)
        except UserError as e:
            self.StopLoadingBar('planet_ui_init')
            raise 
        except Exception:
            eve.Message('PlanetLoadingFailed', {'planet': (LOCID, self.planetID)})
            self.StopLoadingBar('planet_ui_init')
            log.LogException()
            return

        if not sm.GetService('viewState').IsViewActive('planet'):
            self.MinimizeWindows()
        newScene = False
        if self.planetRoot is None or planetChanged:
            self.CreateScene()
            newScene = True
        self.UpdateLoadingBar('planet_ui_init', localization.GetByLabel('UI/PI/Common/PlanetMode'), localization.GetByLabel('UI/PI/Common/LoadingPlanetResources'), 1, 4)
        sm.GetService('sceneManager').SetRegisteredScenes('planet')
        self.UpdateLoadingBar('planet_ui_init', localization.GetByLabel('UI/PI/Common/PlanetMode'), localization.GetByLabel('UI/PI/Common/LoadingPlanetResources'), 2, 4)
        self.SetPlanet()
        self.UpdateLoadingBar('planet_ui_init', localization.GetByLabel('UI/PI/Common/PlanetMode'), localization.GetByLabel('UI/PI/Common/LoadingPlanetResources'), 3, 4)
        self.LoadPI(newScene)
        uthread.new(self.FocusCameraOnCommandCenter, 3.0)
        self.UpdateLoadingBar('planet_ui_init', localization.GetByLabel('UI/PI/Common/PlanetMode'), localization.GetByLabel('UI/PI/Common/LoadingPlanetResources'), 4, 4)
        self.StopLoadingBar('planet_ui_init')
Пример #5
0
 def ApplyAttributes(self, attributes):
     uicls.Transform.ApplyAttributes(self, attributes)
     sprite = uicls.Sprite(parent=self, texturePath='res:/UI/Texture/loadingWheel.dds', pos=(0, 0, 0, 0), align=uiconst.TOALL, state=uiconst.UI_DISABLED)
     loopParams = attributes.get('loopParams', self.default_loopParams)
     if loopParams:
         direction, time = loopParams
         uthread.new(self.StartRotationCycle, direction, time)
 def ApplyAttributes(self, attributes):
     uiprimitives.Transform.ApplyAttributes(self, attributes)
     texturePath = attributes.texturePath
     num = attributes.num
     self.intensity = 1.0
     self.sprite = uiprimitives.Sprite(bgParent=self, texturePath=texturePath)
     uthread.new(self.Animate, num)
Пример #7
0
 def Select(self):
     self.selectBlock.color.SetRGB(*self.SELECT_FILL_COLOR)
     if self.loadingIcon:
         self.loadingIcon.state = uiconst.UI_DISABLED
         self.icon.state = uiconst.UI_HIDDEN
         uthread.new(self.loadingIcon.StartRotationCycle, 1.0, 4000.0)
     self.selected = True
Пример #8
0
    def DoDestinyUpdate(self, state, waitForBubble, dogmaMessages = [], doDump = True):
        self.LogInfo('DoDestinyUpdate call for tick', state[0][0], 'containing', len(state), 'updates.  waitForBubble=', waitForBubble)
        if self.__bp is None:
            raise RuntimeError('No ballpark for update')
        if dogmaMessages:
            self.LogInfo('OnMultiEvent has', len(dogmaMessages), 'messages')
            sm.ScatterEvent('OnMultiEvent', dogmaMessages)
        expandedStates = []
        for action in state:
            if action[1][0] == 'PackagedAction':
                try:
                    unpackagedActions = blue.marshal.Load(action[1][1])
                    expandedStates.extend(unpackagedActions)
                except:
                    log.LogException('Exception whilst expanding a PackagedAction')
                    sys.exc_clear()

            else:
                expandedStates.append(action)

        state = expandedStates
        timestamps = set()
        for action in state:
            timestamps.add(action[0])

        if len(timestamps) > 1:
            self.LogError('Found update batch with', len(state), 'items and', len(timestamps), 'timestamps')
            for action in state:
                self.LogError('Action:', action)

            sm.GetService('clientStatsSvc').OnFatalDesync()
            if not self.__bp.hideDesyncSymptoms:
                uthread.new(eve.Message, 'CustomInfo', {'info': 'Desync mismatched updates problem occurred'})
        self.__bp.FlushState(state, waitForBubble, doDump)
Пример #9
0
    def ProcessEntityVisibility(self, eventList):
        charid = session.charid
        playerEntityCreateIdx = None
        charactersCreated = []
        for i, event in enumerate(eventList):
            if event[0] == 'OnEntityCreate' and event[2] == charid:
                eventList[i] = eventList[0]
                eventList[0] = event
                break

        callsToMake = []
        for t in eventList:
            if t[0] == 'OnEntityCreate':
                eventName, sceneID, entityID, initialState = t
                callsToMake.append((self._CreateEntity, (sceneID, entityID, initialState)))
                if util.IsCharacter(entityID):
                    charactersCreated.append(entityID)
            elif t[0] == 'OnEntityDestroy':
                eventName, entityID = t
                callsToMake.append((self._RemoveEntity, (entityID,)))
            else:
                self.LogError('Aperture Client received a unknown event type %s', str(t[0]))

        if charactersCreated:
            uthread.new(cfg.eveowners.Prime, charactersCreated)
        uthread.parallel(callsToMake)
Пример #10
0
 def UpdateSessionTimer(self):
     if settings.user.ui.Get('showSessionTimer', 0):
         if self.sessionTimer:
             uthread.new(self.sessionTimer.AnimSessionChange)
             self.sessionTimerUpdatePending = False
         else:
             self.sessionTimerUpdatePending = True
Пример #11
0
 def GetDamageStateForDrone(self, droneID):
     if self.IsDroneDamageReady(droneID):
         return self.droneDamageStatesByDroneIDs.get(droneID, None)
     droneIDsMissingDamage = self.FindDronesMissingDamageState([droneID])
     if droneIDsMissingDamage:
         uthread.new(self.FetchInBayDroneDamageToServer, droneIDsMissingDamage)
     return -1
Пример #12
0
    def Run(self, memStream = None):
        self.LogInfo('Starting War')
        self.state = SERVICE_START_PENDING
        self.__warMoniker = None
        self.__warMonikerOwnerID = None
        items = warObject.__dict__.items()
        for objectName in self.__functionalobjects__:
            if objectName == 'base':
                continue
            object = None
            classType = 'warObject.%s' % objectName
            for i in range(0, len(warObject.__dict__)):
                self.LogInfo('Processing', items[i])
                if len(items[i][0]) > 1:
                    if items[i][0][:2] == '__':
                        continue
                if items[i][1].__guid__ == classType:
                    object = CreateInstance(classType, (self,))
                    break

            if object is None:
                raise RuntimeError('FunctionalObject not found %s' % classType)
            setattr(self, objectName, object)

        for objectName in self.__functionalobjects__:
            object = getattr(self, objectName)
            object.DoObjectWeakRefConnections()

        self.state = SERVICE_RUNNING
        uthread.new(self.CheckForStartOrEndOfWar)
Пример #13
0
 def OnFKeyOverload(self, sidx, gidx):
     slot = self.slotsByOrder.get((gidx, sidx), None)
     if slot and slot.sr.module and slot.sr.module.state == uiconst.UI_NORMAL:
         if hasattr(slot.sr.module, 'ToggleOverload'):
             uthread.new(slot.sr.module.ToggleOverload)
     else:
         uthread.new(eve.Message, 'Disabled')
Пример #14
0
    def OnOrbitalStrikeTargets(self, targets):
        self.targets = targets
        for targetID, target in self.targets.iteritems():
            target['targetID'] = targetID

        sm.ScatterEvent('OnDistrictTargets', targets)
        uthread.new(self._LoadTargetBalls)
Пример #15
0
 def OnViewStateChanged(self, oldState, newState):
     if newState == 'charactercreation':
         uthread.new(self.GatherStats, self.lastClientState, session.locationid)
         if oldState in ('station', 'hangar'):
             self.lastClientState = 'charCustomization'
         else:
             self.lastClientState = newState
    def RandomizeCharacter(self, randomizingPart = None, *args):
        info = self.GetInfo()
        doll = self.charSvc.GetSingleCharactersDoll(info.charID)
        if doll.busyUpdating:
            return
        uicore.layer.charactercreation.LockNavigation()
        uicore.layer.charactercreation.ToggleClothes(forcedValue=0)
        uthread.new(self.RandomizeRotation_thread, self.sr.randomButton)
        itemList = []
        if info.genderID == ccConst.GENDERID_FEMALE:
            itemList = ccConst.femaleRandomizeItems.keys()
        else:
            itemList = ccConst.maleRandomizeItems.keys()
        canChangeBaseAppearance = uicore.layer.charactercreation.CanChangeBaseAppearance()
        blacklist = ccConst.randomizerCategoryBlacklist[:]
        if not canChangeBaseAppearance:
            blacklist += ccConst.recustomizationRandomizerBlacklist
        if info.genderID == ccConst.GENDERID_FEMALE:
            blacklist.append(ccConst.scarring)
        categoryList = []
        for item in itemList:
            if item not in blacklist:
                categoryList.append(item)

        self.charSvc.RandomizeCharacterGroups(info.charID, categoryList, doUpdate=False, fullRandomization=True)
        if canChangeBaseAppearance:
            self.charSvc.RandomizeCharacterSculpting(info.charID, doUpdate=False)
        decalModifiers = doll.buildDataManager.GetModifiersByCategory(ccConst.tattoo)
        for modifier in decalModifiers:
            modifier.IsDirty = True

        self.charSvc.UpdateDoll(info.charID, 'RandomizeCharacter')
Пример #17
0
 def Run(self, memStream = None):
     self.LogInfo('Starting Voucher Cache Service')
     self.data = {}
     self.names = {}
     self.ReleaseVoucherSvc()
     self.nameQueue = uthread.Channel('voucherCache._NameFetcher')
     uthread.new(self._NameFetcher, self.nameQueue)
Пример #18
0
    def Damage(self, items, *args):
        btnSetup = {self.sr.selBtn: uiconst.UI_HIDDEN,
         self.sr.pickBtn: uiconst.UI_DISABLED}
        temp = uix.QtyPopup(100, 1, 50, hint=localization.GetByLabel('UI/Station/Repair/ApplyDamage'))
        percentage = temp and temp['qty']
        if percentage == 0 or percentage is None:
            self.sr.pickBtn.state = uiconst.UI_NORMAL
            return
        itemIDAndAmountOfDamageList = []
        try:
            for item in items:
                if self.invCache.IsItemLocked(item.itemID):
                    continue
                if not self.invCache.TryLockItem(item.itemID, 'lockRepairingItem', {}, 1):
                    continue
                amount = int(math.ceil(float(percentage) / 100.0 * float(item.maxHealth - item.damage)))
                itemIDAndAmountOfDamageList.append((item.itemID, amount))

            if len(itemIDAndAmountOfDamageList):
                self.repairSvc.DamageModules(itemIDAndAmountOfDamageList)
        finally:
            for itemID, amount in itemIDAndAmountOfDamageList:
                self.invCache.UnlockItem(itemID)

            uthread.new(self.DisplayRepairQuote, self.GetAll())
            btnSetup[self.sr.pickBtn] = uiconst.UI_NORMAL

        self.DisplayButtons(btnSetup)
Пример #19
0
 def AddExplosion(self, uniqueName, explosionGfxID, spreadOut):
     if uniqueName not in self.districts:
         self.LogError('Could not find district ' + str(uniqueName) + ' for planet with id ' + str(self.itemID))
     graphics = cfg.graphics.GetIfExists(explosionGfxID)
     if graphics is None:
         self.LogError('Explosion graphicsID ' + str(explosionGfxID) + " doesn't exist!")
         return
     fx = trinity.Load(graphics.graphicFile)
     if fx is None:
         self.LogError('Explosion ' + str(graphics.graphicFile) + " doesn't exist!")
         return
     if len(fx.curveSets) == 0:
         self.LogError('Explosion ' + str(graphics.graphicFile) + ' has no curveSets! This is useless...')
         return
     direction = self.districts[uniqueName].centerNormal
     rotMatrix1 = geo2.MatrixRotationAxis((direction[1], direction[2], direction[0]), random.random() * spreadOut * self.districts[uniqueName].pinRadius)
     rotMatrix2 = geo2.MatrixRotationAxis(direction, random.uniform(0, 2.0 * math.pi))
     direction = geo2.Vec3TransformNormal(direction, rotMatrix1)
     direction = geo2.Vec3TransformNormal(direction, rotMatrix2)
     fx.translation = direction
     fx.scaling = (5000.0 / PLANET_SIZE_SCALE, 5000.0 / PLANET_SIZE_SCALE, 5000.0 / PLANET_SIZE_SCALE)
     v1 = geo2.Vec3Cross(geo2.Vec3Normalize(direction), (0.0, 1.0, 0.0))
     alpha = -math.acos(geo2.Vec3Dot(geo2.Vec3Normalize(direction), (0.0, 1.0, 0.0)))
     fx.rotation = geo2.QuaternionRotationAxis(v1, alpha)
     duration = fx.curveSets[0].GetMaxCurveDuration()
     self.districtExplosions.children.append(fx)
     uthread.new(self._RemoveExplosionFromDistrict, fx, duration)
Пример #20
0
 def OnUpdateLocalizationTextCache(self, cacheData):
     messagePerLanguage, metaDataPerLanguage, labelsDict = cacheData
     if messagePerLanguage or metaDataPerLanguage or labelsDict:
         localization.UpdateTextCache(messagePerLanguage, metaDataPerLanguage, labelsDict)
         if not self.broadcasting:
             self.broadcasting = True
             uthread.new(self.DeferredBroadcastMessage)
Пример #21
0
 def SetupContainers(self):
     findFleetsParent = uiprimitives.Container(name='findfleets', parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0))
     myAdvertParent = uiprimitives.Container(name='myadvert', parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0), clipChildren=1)
     self.sr.myAdvertButtons = uiprimitives.Container(name='myAdvertButtons', parent=myAdvertParent, align=uiconst.TOBOTTOM, height=35)
     self.sr.tabs = uicontrols.TabGroup(name='fleetfindertabs', parent=self, idx=0)
     tabs = [[localization.GetByLabel('UI/Fleet/FleetRegistry/FindFleets'),
       findFleetsParent,
       self,
       'findfleets'], [localization.GetByLabel('UI/Fleet/FleetRegistry/MyAdvert'),
       myAdvertParent,
       self,
       'myadvert']]
     self.sr.tabs.Startup(tabs, 'fleetfindertabs', 0)
     uthread.new(self.sr.tabs.ShowPanelByName, localization.GetByLabel('UI/Fleet/FleetRegistry/FindFleets'))
     uiprimitives.Container(name='push', parent=findFleetsParent, width=const.defaultPadding, align=uiconst.TOLEFT)
     uiprimitives.Container(name='push', parent=findFleetsParent, width=const.defaultPadding, align=uiconst.TORIGHT)
     self.sr.filterCont = uiprimitives.Container(name='filterCont', parent=findFleetsParent, align=uiconst.TOTOP, height=35)
     self.sr.infoCont = uiprimitives.Container(name='infoCont', parent=findFleetsParent, align=uiconst.TOBOTTOM, height=155, state=uiconst.UI_HIDDEN)
     uiprimitives.Container(name='push', parent=findFleetsParent, height=const.defaultPadding, align=uiconst.TOBOTTOM)
     self.sr.topInfoCont = uiprimitives.Container(name='topInfoCont', parent=self.sr.infoCont, align=uiconst.TOTOP, height=20)
     self.sr.descrCont = uiprimitives.Container(name='descrCont', parent=self.sr.infoCont, align=uiconst.TOALL, pos=(0, 0, 0, 0))
     self.sr.scrollCont = uiprimitives.Container(name='scrollCont', parent=findFleetsParent, align=uiconst.TOALL, pos=(0, 0, 0, 0))
     uiprimitives.Container(name='push', parent=myAdvertParent, width=const.defaultPadding, align=uiconst.TOLEFT)
     uiprimitives.Container(name='push', parent=myAdvertParent, width=const.defaultPadding, align=uiconst.TORIGHT)
     self.sr.myAdvertCont = uiprimitives.Container(name='myAdvertCont', parent=myAdvertParent, align=uiconst.TOALL, pos=(10, 0, 10, 0))
Пример #22
0
def LogColorModeUsage(useCase = ''):
    colorMode = settings.char.ui.Get('%s_%s' % (VIEWMODE_COLOR_SETTINGS, mapViewConst.MAPVIEW_PRIMARY_ID), mapViewConst.DEFAULT_MAPVIEW_SETTINGS[VIEWMODE_COLOR_SETTINGS])
    if isinstance(colorMode, tuple):
        colorMode, _colorModeArgs = colorMode
    if colorMode in colorModeLogName:
        logValue = '%s (%s)' % (colorModeLogName[colorMode], useCase)
        uthread.new(sm.GetService('experimentClientSvc').LogMapColorModeLoadedCounter, logValue)
Пример #23
0
 def OnFleetLeave_Local(self, memberInfo):
     if self.destroyed:
         return
     myID = util.GetAttrs(self, 'sr', 'node', 'charID')
     charID = memberInfo.charID
     if myID is not None and charID == myID or charID == session.charid:
         uthread.new(self.SetRelationship, self.sr.node)
Пример #24
0
 def StartScale(self, sender, btn, *args):
     if self.align == uiconst.TOALL:
         return
     self.scaleData = (self.left,
      self.top,
      self.width,
      self.height)
     scalerName = sender.name
     if 'Left' in scalerName and self.align != uiconst.TOLEFT:
         modX = -1
     elif 'Right' in scalerName and self.align != uiconst.TORIGHT:
         modX = 1
     else:
         modX = 0
     if 'Top' in scalerName:
         modY = -1
     elif 'Bottom' in scalerName:
         modY = 1
     else:
         modY = 0
     if not (modX or modY):
         return
     self.scaleModifiers = (modX, modY)
     self._scaling = True
     uthread.new(self.OnScale, uicore.uilib.x, uicore.uilib.y)
Пример #25
0
    def _TryExecuteHandler(self, eventID, object, eventArgs = None, param = None):
        functionName = self.EVENTMAP.get(eventID, None)
        if functionName is None:
            raise NotImplementedError
        itemCapturingMouse = self.GetMouseCapture()
        if itemCapturingMouse:
            object = itemCapturingMouse
        retObject = None
        handlerArgs, handler = self.FindEventHandler(object, functionName)
        if handler:
            retObject = object
            if eventArgs:
                args = handlerArgs + eventArgs
            else:
                args = handlerArgs
            if eventID in self.UTHREADEDEVENTS:
                uthread.new(handler, *args)
            else:
                try:
                    handler(*args)
                except:
                    log.LogException()
                    raise

        self.CheckCallbacks(retObject, eventID, param)
        return retObject
Пример #26
0
 def OnFleetJoin_Local(self, memberInfo, state = 'Active'):
     if self.destroyed:
         return
     myID = util.GetAttrs(self, 'sr', 'node', 'charID')
     charID = memberInfo.charID
     if myID is not None and charID == myID:
         uthread.new(self.SetRelationship, self.sr.node)
Пример #27
0
    def SwitchBloodline(self, newBloodlineID, *args):
        uicore.layer.charactercreation.FadeToBlack(why=localization.GetByLabel('UI/Common/Loading'))
        sm.GetService('character').StopEditing()
        self.bloodlineID = newBloodlineID
        self.sr.bloodlineCont.Flush()
        self.RearrangeInfo(self.bloodlineID, 'bloodlineID', self.currentBloodlineInfo)
        self.CreateBloodlineHex()
        self.SelectHex(self.bloodlineConts.get(self.bloodlineID), [])
        info = uicore.layer.charactercreation.GetInfo()
        sm.GetService('character').RemoveCharacter(info.charID)
        uicore.layer.charactercreation.AddCharacter(info.charID, newBloodlineID, info.genderID)
        uicore.layer.charactercreation.SelectBloodline(self.bloodlineID, check=0)
        doll = sm.GetService('character').GetSingleCharactersDoll(info.charID)
        while doll.busyUpdating:
            blue.synchro.Yield()

        step = uicore.layer.charactercreation.sr.step
        if hasattr(step, 'GoToAssetMode'):
            uthread.new(step.GoToAssetMode, 0, 1)
            if step.sr.tattooMenu and not step.sr.tattooMenu.destroyed:
                step.sr.tattooMenu.Close()
        else:
            uicore.layer.charactercreation.StartEditMode(mode='sculpt', resetAll=True)
        if hasattr(step, 'LoadFaceMode'):
            uthread.new(step.LoadFaceMode)
        uicore.layer.charactercreation.FadeFromBlack()
 def Toggle(self, name):
     name = 'market_setting_' + name
     curr = settings.user.ui.Get(name, 1)
     settings.user.ui.Set(name, not curr)
     self.InitOptions()
     if self.typerecord:
         uthread.new(self.Render, self.typerecord)
Пример #29
0
 def ApplyAttributes(self, attributes):
     super(PurchaseView, self).ApplyAttributes(attributes)
     self.controller = attributes.controller
     self.onBuyOffer = attributes.onBuyOffer
     self.onCloseView = attributes.onCloseView
     self.panel = None
     uthread.new(self.Layout)
 def InitializeGateTransition(self, destSolarSystemID, destObjectID = None):
     self.active = True
     self.destObjectID = destObjectID
     self.destSolarSystemID = destSolarSystemID
     self.camera = self._GetInflightCamera()
     self.scene = self._GetSolarSystemScene(destSolarSystemID)
     uthread.new(self._PrioritizeStargateLoads, destObjectID, destSolarSystemID)
Пример #31
0
 def OnComboChange(self, entry, header, value, *args):
     uthread.new(self.ShowJournal)
Пример #32
0
 def SearchMember(self, *args):
     uthread.new(self.ShowJournal)
Пример #33
0
 def DoClickDay(self, day, *args):
     """
         this function overwrites the DoClickDay function of the day
     """
     uthread.new(self.DoClickDay_thread, day)
Пример #34
0
 def OnReturn(self, *args):
     uthread.new(self.ShowJournal)
Пример #35
0
 def _OnClose(self, *args):
     uthread.new(sm.GetService('holoscreen').Restart)
Пример #36
0
 def OnActivated(self, **kwargs):
     BaseSpaceCamera.OnActivated(self, **kwargs)
     sm.StartService('state').SetState(self.ego, states.lookingAt, True)
     settings.char.ui.Set('spaceCameraID', evecamera.CAM_SHIPPOV)
     self.UpdateTrackBall()
     uthread.new(self.ConstructInSceneContainer)
Пример #37
0
 def Load(self, key):
     sm.GetService('corpui').LoadTop(
         'res:/ui/Texture/WindowIcons/assetscorp.png',
         localization.GetByLabel('UI/Corporations/Assets/CorpAssets'),
         localization.GetByLabel('UI/Corporations/Common/UpdateDelay'))
     if not self.sr.Get('inited', 0):
         self.sr.inited = 1
         self.sr.scroll = uicontrols.Scroll(
             parent=self,
             padding=(const.defaultPadding, const.defaultPadding,
                      const.defaultPadding, const.defaultPadding))
         self.sr.scroll.adjustableColumns = 1
         self.sr.scroll.sr.id = 'CorporationAssets'
         self.sr.scroll.sr.minColumnWidth = {
             localization.GetByLabel('UI/Common/Name'): 44
         }
         self.sr.scroll.SetColumnsHiddenByDefault(
             uix.GetInvItemDefaultHiddenHeaders())
         self.sr.tabs = uicontrols.TabGroup(name='tabparent',
                                            parent=self,
                                            idx=0)
         self.sr.tabs.Startup([
             [
                 localization.GetByLabel('UI/Corporations/Common/Offices'),
                 self.sr.scroll, self, 'offices'
             ],
             [
                 localization.GetByLabel(
                     'UI/Corporations/Assets/Impounded'), self.sr.scroll,
                 self, 'impounded'
             ],
             [
                 localization.GetByLabel('UI/Corporations/Assets/InSpace'),
                 self.sr.scroll, self, 'property'
             ],
             [
                 localization.GetByLabel(
                     'UI/Corporations/Assets/Deliveries'), self.sr.scroll,
                 self, 'deliveries'
             ],
             [
                 localization.GetByLabel('UI/Corporations/Assets/Lockdown'),
                 self.sr.scroll, self, 'lockdown'
             ],
             [
                 localization.GetByLabel('UI/Common/Search'),
                 self.sr.scroll, self, 'search'
             ]
         ],
                              'corpassetstab',
                              autoselecttab=0)
     self.sr.scroll.Load(contentList=[],
                         headers=uix.GetInvItemDefaultHeaders())
     self.sr.scroll.OnNewHeaders = self.OnNewHeadersSet
     self.sr.scroll.allowFilterColumns = 0
     if self.sr.Get('search_cont', None):
         self.sr.search_cont.state = uiconst.UI_HIDDEN
     if key == 'accounts':
         key = 'offices'
         self.sr.tabs.AutoSelect()
         return
     if key != 'search':
         if not getattr(self, 'filt_inited', False):
             sortKey = settings.char.ui.Get('corpAssetsSortKey', None)
             self.sr.filt_cont = uiprimitives.Container(align=uiconst.TOTOP,
                                                        height=37,
                                                        parent=self,
                                                        top=2,
                                                        idx=1)
             sortoptions = [
                 (localization.GetByLabel('UI/Common/Name'), 0),
                 (localization.GetByLabel('UI/Common/NumberOfJumps'), 1)
             ]
             self.sr.sortcombo = uicontrols.Combo(
                 label=localization.GetByLabel('UI/Common/SortBy'),
                 parent=self.sr.filt_cont,
                 options=sortoptions,
                 name='sortcombo',
                 select=sortKey,
                 callback=self.Filter,
                 width=100,
                 pos=(5, 16, 0, 0))
             l = self.sr.sortcombo.width + self.sr.sortcombo.left + const.defaultPadding
             self.sr.filtcombo = uicontrols.Combo(
                 label=localization.GetByLabel('UI/Common/View'),
                 parent=self.sr.filt_cont,
                 options=[],
                 name='filtcombo',
                 select=None,
                 callback=self.Filter,
                 width=100,
                 pos=(l, 16, 0, 0))
             self.sr.filt_cont.height = self.sr.filtcombo.top + self.sr.filtcombo.height
             self.filt_inited = 1
         self.sr.filt_cont.state = uiconst.UI_PICKCHILDREN
     elif self.sr.Get('filt_cont', None):
         self.sr.filt_cont.state = uiconst.UI_HIDDEN
     if key in 'lockdown':
         uthread.new(self.ShowLockdown, None, None)
     elif key == 'search':
         self.sr.scroll.OnNewHeaders = self.Search
         uthread.new(self.ShowSearch)
     else:
         uthread.new(self.ShowAssets, key, None, None)
Пример #38
0
 def OnResize(self, *args):
     uthread.new(self.UpdateMoreIndicators)