def FindByName(self, searchstr, ignorecommas=1): searchGroupList = [ const.searchResultConstellation, const.searchResultSolarSystem, const.searchResultRegion ] results = searchUtil.QuickSearch(searchstr, searchGroupList) return map(self.GetItem, results)
def Search(self, edit): searchString = edit.GetValue() if not searchString or searchString == '': return None groupIDList = [ const.searchResultCharacter, const.searchResultCorporation, const.searchResultAlliance ] searchResult = searchUtil.QuickSearch(searchString.strip(), groupIDList, hideNPC=False) if not len(searchResult): edit.SetValue('') edit.SetHintText( localization.GetByLabel('UI/Station/BountyOffice/NoOneFound')) else: if len(searchResult) == 1: ownerID = searchResult[0] return ownerID dlg = form.BountyPicker.Open(resultList=searchResult) dlg.ShowModal() if dlg.ownerID: return dlg.ownerID edit.SetValue('') return None
def DoSearch(self, key, val): self.itemID = None self.typeID = None id = None name = '' val = '%s*' % val if key == 'type': itemTypes = [] results = searchUtil.QuickSearch(val, [const.searchResultInventoryType]) if results is not None: for typeID in results: typeRec = cfg.invtypes.Get(typeID) itemTypes.append((typeRec.name, None, typeID)) if not itemTypes: eve.Message('NoItemTypesFound') return id = uix.ListWnd( itemTypes, 'item', localization.GetByLabel('UI/Common/SelectItemType'), None, 1) else: group = None hideNPC = 0 if key == 'solarsystem': group = const.groupSolarSystem elif key == 'station': group = const.groupStation elif key == 'char': group = const.groupCharacter elif key == 'corp': group = const.groupCorporation id = uix.Search(val, group, hideNPC=hideNPC, listType='Generic') name = '' if id: self.itemID = id self.typeID = 0 if key in ('char', 'corp'): o = cfg.eveowners.Get(id) self.typeID = o.typeID name = o.name elif key == 'solarsystem': self.typeID = const.typeSolarSystem l = cfg.evelocations.Get(id) name = l.name elif key == 'station': self.typeID = sm.GetService('ui').GetStation(id).stationTypeID l = cfg.evelocations.Get(id) name = l.name elif key == 'type': self.typeID = id[2] self.itemID = None name = id[0] return name
def FindByName(self, searchstr, ignorecommas=1): match = [] cache = self.GetMapCache() searchGroupList = [ const.searchResultConstellation, const.searchResultSolarSystem, const.searchResultRegion ] results = searchUtil.QuickSearch(searchstr, searchGroupList) for itemID in results: match.append(cache['items'][itemID].item) return match