def ToggleVisibility(self, *args): sel = self.sr.node.scroll.GetSelectedNodes(self.sr.node) visible = not self.sr.node.visible wantedGroups = maputils.GetVisibleSolarsystemBrackets()[:] for node in sel: node.visible = visible if node.groupID not in wantedGroups and visible: wantedGroups.append(node.groupID) elif node.groupID in wantedGroups and not visible: wantedGroups.remove(node.groupID) if node.panel: node.panel.Load(node) settings.user.ui.Set('groupsInSolarsystemMap', wantedGroups) sm.ScatterEvent('OnSolarsystemMapSettingsChange', 'brackets')
def GetSolarSystemOptions(self): validGroups = maputils.GetValidSolarsystemGroups() wantedGroups = maputils.GetVisibleSolarsystemBrackets() wantedHints = maputils.GetHintsOnSolarsystemBrackets() scrolllist = [] for groupID in validGroups: data = util.KeyVal() data.visible = groupID in wantedGroups data.showhint = groupID in wantedHints data.groupID = groupID if type(groupID) in types.StringTypes: cerbString = {'bookmark': 'UI/Map/MapPallet/cbSolarSystem_bookmark', 'scanresult': 'UI/Map/MapPallet/cbSolarSystem_scanresult'}[groupID] data.label = localization.GetByLabel(cerbString) else: data.label = cfg.invgroups.Get(groupID).name scrolllist.append((data.label, listentry.Get('BracketSelectorEntry', data=data))) if scrolllist: scrolllist = uiutil.SortListOfTuples(scrolllist) return scrolllist