def packVehiclesBlock(uniqueListID, header, vehs=None, showFilters=True, showInHangarCB=False, showNotInHangarCB=False, isShowInHangarCBChecked=False, disableChecker=None): props = caches.addVehiclesData(uniqueListID, vehs, disableChecker=disableChecker, checkbox=isShowInHangarCBChecked) if props.checkbox is not None: isShowInHangarCBChecked = props.checkbox return UiElement({ 'linkage': 'VehiclesSortingBlock_UI', 'hasHeader': showFilters, 'showNotInHangarCB': showNotInHangarCB, 'showInHangarCB': showInHangarCB, 'cbSelected': isShowInHangarCBChecked, 'vehicles': packVehiclesList(vehs or [], disableChecker), 'tableHeader': header, 'nationFilterData': packNationsFilter(), 'tankFilterData': packIntVehicleTypesFilter(), 'levelFilterData': packVehicleLevelsFilter(), 'selectedNation': props.nationIdx, 'selectedVehType': props.vehTypeIdx, 'selectedLvl': props.levelIdx, 'selectedBtnID': props.selectedBtn, 'sortDirection': props.sortDirect, 'tableID': uniqueListID })
def _initFilter(self, nation, vehicleType, isMain, level, compatibleOnly): filtersData = {'vehicleTypesDP': packVehicleTypesFilter(defaultVehType='none'), 'levelsDP': packVehicleLevelsFilter(self._levelsRange), 'nation': nation, 'vehicleType': vehicleType, 'isMain': isMain, 'level': level, 'compatibleOnly': compatibleOnly} return filtersData
def _initFilter(self, nation, vehicleType, isMain, level, compatibleOnly): filtersData = {'vehicleTypesDP': packVehicleTypesFilter(defaultVehType='none'), 'levelsDP': packVehicleLevelsFilter(self._levelsRange), 'nation': nation, 'vehicleType': vehicleType, 'isMain': isMain, 'level': level, 'compatibleOnly': compatibleOnly} return filtersData
def _initFilter(self, nation=-1, vehicleType='none', isMain=False, level=-1, compatibleOnly=False): filtersData = {'vehicleTypesDP': packVehicleTypesFilter(defaultVehType='none'), 'levelsDP': packVehicleLevelsFilter(self._levelsRange), 'nation': nation, 'nationDP': packNationsFilter(), 'vehicleType': vehicleType, 'isMain': isMain, 'level': level, 'compatibleOnly': compatibleOnly, 'compatibleOnlyLabel': VEH_COMPARE.ADDVEHPOPOVER_SHOWONLYMYVAHICLES} return filtersData
def _initFilter(self, nation=-1, vehicleType='none', isMain=False, level=-1, compatibleOnly=False): levelsDP = packVehicleLevelsFilter(self._levelsRange) if len(levelsDP) <= 2: self._filterVisibility ^= VEHICLE_SELECTOR_CONSTANTS.VISIBLE_LEVEL filtersData = {'vehicleTypesDP': packVehicleTypesFilter(defaultVehType='none'), 'levelsDP': levelsDP, 'nation': nation, 'nationDP': packNationsFilter(), 'vehicleType': vehicleType, 'isMain': isMain, 'level': level, 'compatibleOnly': compatibleOnly, 'visibility': self._filterVisibility, 'compatibleOnlyLabel': self._compatibleOnlyLabel} return filtersData
def setOpener(self, view): self.__opener = view eventData = self.__opener.eventData if eventData.getType() == EVENT_TYPE.VEHICLE: filtersVO = self.__filters.copy() filtersVO['vehicleTypesDP'] = packVehicleTypesFilter( defaultVehType='none') filtersVO['levelsDP'] = packVehicleLevelsFilter(LEVELS_RANGE) self.as_setFiltersS(filtersVO) self.applyFilters(**self.__filters) else: leaderboards = eventData.getLeaderboards() leaderboardID = leaderboards[0][0] header = { 'filters': makeFiltersVO(eventData.getType(), leaderboards, leaderboardID, category='vehicles') } self.as_setHeaderS(header) self.changeFilter(leaderboardID)