Ejemplo n.º 1
0
 def ConstructHeaderButton(self):
     btn = xtriui.ListSurroundingsBtn(parent=self.headerBtnCont, align=uiconst.TOPRIGHT, pos=(0,
      0,
      self.topCont.height,
      self.topCont.height), texturePath=self.default_iconTexturePath, iconSize=16, showIcon=True)
     btn.hint = localization.GetByLabel('UI/Neocom/ListItemsInSystem')
     btn.sr.owner = self
     btn.sr.groupByType = 1
     btn.filterCurrent = 1
     btn.sr.itemID = session.solarsystemid2
     btn.sr.typeID = const.typeSolarSystem
     return btn
Ejemplo n.º 2
0
 def GetSpaceMenu(self):
     if self.sr.spacemenu:
         if self.sr.spacemenu.solarsystemid == eve.session.solarsystemid2:
             return self.sr.spacemenu
         m = self.sr.spacemenu
         self.sr.spacemenu = None
         m.Close()
     solarsystemitems = sm.GetService('map').GetSolarsystemItems(
         session.solarsystemid2)
     listbtn = xtriui.ListSurroundingsBtn(name='gimp',
                                          parent=self,
                                          state=uiconst.UI_HIDDEN,
                                          pos=(0, 0, 0, 0))
     listbtn.sr.mapitems = solarsystemitems
     listbtn.sr.groupByType = 1
     listbtn.filterCurrent = 1
     listbtn.solarsystemid = eve.session.solarsystemid2
     self.sr.spacemenu = listbtn
     return self.sr.spacemenu
Ejemplo n.º 3
0
    def GetMap(self, ids, idlevel, drawlevel, selected = None):
        if getattr(self, 'loadingMap', 0):
            return
        self.loadingMap = 1
        uiutil.FlushList(self.children[idlevel:])
        self.ids[idlevel] = ids
        cfg.evelocations.Prime(ids)
        l, t, absWidth, absHeight = self.GetAbsolute()
        pilmap = xtriui.Map2D(name='map', align=uiconst.TOTOP, state=uiconst.UI_NORMAL, height=absWidth)
        pilmap.OnSelectItem = self.OnMapSelection
        pilmap.GetParentMenu = self.GetMenu
        pilmapList = []
        basesize = self.absoluteRight - self.absoluteLeft
        if drawlevel == DRAWLVLSYS:
            pilmap.width = pilmap.height = basesize
            pilmap.left = pilmap.top = (pilmap.width - basesize) / 2
            pilmap.align = uiconst.RELATIVE
            pilmap.dragAllowed = 1
            mapparent = uiprimitives.Container(name='mapparent', align=uiconst.TOTOP, lockAspect=1, parent=self, clipChildren=1, height=absWidth)
            LineThemeColored(parent=mapparent, align=uiconst.TOBOTTOM)
            pilmapList = mapparent.children
            self.SetLoadExternalPointer(mapparent, self.ids[idlevel][0])
            addstuff = mapparent
        else:
            LineThemeColored(parent=pilmap.overlays, align=uiconst.TOBOTTOM)
            pilmapList = self.children
            self.SetLoadExternalPointer(pilmap, self.ids[idlevel][0])
            addstuff = pilmap.overlays
        pilmap.Draw(ids, idlevel, drawlevel, basesize)
        uicore.animations.FadeIn(pilmap, duration=0.3)
        pilmapList.append(pilmap)
        listicon = xtriui.ListSurroundingsBtn(parent=addstuff, align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL, pos=(0, 3, 16, 16), idx=0, showIcon=True)
        locConsts = {0: {const.typeUniverse: ''},
         1: {const.typeRegion: localization.GetByLabel('UI/Common/LocationTypes/Region')},
         2: {const.typeConstellation: localization.GetByLabel('UI/Common/LocationTypes/Constellation')},
         3: {const.typeSolarSystem: localization.GetByLabel('UI/Common/LocationTypes/SolarSystem')}}
        levelName = locConsts.get(idlevel, '').values()[0]
        levelID = locConsts.get(idlevel, '').keys()[0]
        for id in ids:
            if levelID != const.typeUniverse:
                locName = cfg.evelocations.Get(id).name

        hintStr = ''
        buttonStr = ''
        if levelID == const.typeUniverse:
            buttonStr = localization.GetByLabel('UI/Common/LocationTypes/Universe')
            hintStr = localization.GetByLabel('UI/Map/MapBrowser/ListRegions')
        elif levelID == const.typeRegion:
            buttonStr = localization.GetByLabel('UI/Map/MapBrowser/NameRegion', name=locName)
            hintStr = localization.GetByLabel('UI/Map/MapBrowser/ListConstellations', name=locName)
        elif levelID == const.typeConstellation:
            buttonStr = localization.GetByLabel('UI/Map/MapBrowser/NameConstellation', name=locName)
            hintStr = localization.GetByLabel('UI/Map/MapBrowser/ListSolarSystems', name=locName)
        elif levelID == const.typeSolarSystem:
            buttonStr = localization.GetByLabel('UI/Map/MapBrowser/NameSolarSystem', name=locName)
            hintStr = localization.GetByLabel('UI/Map/MapBrowser/ListCelestials', name=locName)
        listbtn = uicontrols.EveLabelMedium(text=buttonStr, parent=addstuff, left=listicon.left + listicon.width + 4, top=5, color=(1.0, 1.0, 1.0, 0.75), idx=0, state=uiconst.UI_NORMAL)
        listbtn.expandOnLeft = True
        listbtn.GetMenu = listicon.GetMenu
        for id in ids:
            if id != const.typeUniverse:
                listicon.sr.typeID = listbtn.sr.typeID = levelID
                listicon.sr.itemID = listbtn.sr.itemID = id

        listbtn.sr.hint = hintStr
        if self.destroyed:
            return
        if drawlevel == DRAWLVLSYS:
            listbtn.sr.groupByType = listicon.sr.groupByType = 1
            listbtn.sr.mapitems = listicon.sr.mapitems = pilmap.mapitems
        elif drawlevel in (DRAWLVLCON, DRAWLVLSOL):
            listbtn.sr.mapitems = listicon.sr.mapitems = pilmap.mapitems[1:]
        else:
            listbtn.sr.mapitems = listicon.sr.mapitems = pilmap.mapitems
        listbtn.solarsystemid = listicon.solarsystemid = ids[0]
        if selected:
            pilmap.SetSelected([selected])
        self.Refresh()
        self.loadingMap = 0