def _resolveLoadCtx(self, ctx=None): nation = ctx['nation'] if ctx is not None and 'nation' in ctx else None if nation is not None and nation in nations.INDICES: nationIdx = nations.INDICES[nation] SelectedNation.select(nationIdx) else: SelectedNation.byDefault()
def _resolveLoadCtx(self, ctx=None): nation = ctx["nation"] if ctx is not None and "nation" in ctx else None if nation is not None and nation in nations.INDICES: nationIdx = nations.INDICES[nation] SelectedNation.select(nationIdx) else: SelectedNation.byDefault()
def getNationTreeData(self, nationName): if nationName not in nations.INDICES: LOG_ERROR('Nation not found', nationName) return {} nationIdx = nations.INDICES[nationName] SelectedNation.select(nationIdx) self._data.load(nationIdx, override=self._getOverride()) return self._data.dump()
def _resolveLoadCtx(self, ctx=None): rootCD = ctx['rootCD'] if ctx is not None and 'rootCD' in ctx else None if rootCD is None: if g_currentVehicle.isPresent(): self._data.setRootCD(g_currentVehicle.item.intCD) else: self._data.setRootCD(rootCD) SelectedNation.select(self._data.getNationID())
def getNationTreeData(self, nationName): if nationName not in nations.INDICES: LOG_ERROR('Nation not found', nationName) return {} nationIdx = nations.INDICES[nationName] SelectedNation.select(nationIdx) self._data.load(nationIdx, override=self._getOverride()) return self._data.dump()
def _resolveLoadCtx(self, ctx = None): rootCD = ctx['rootCD'] if ctx is not None and 'rootCD' in ctx else None if rootCD is None: if g_currentVehicle.isPresent(): self._data.setRootCD(g_currentVehicle.item.intCD) else: self._data.setRootCD(rootCD) SelectedNation.select(self._data.getNationID())
def _resolveLoadCtx(self, ctx=None): nation = ctx[BackButtonContextKeys.NATION] if ctx is not None and BackButtonContextKeys.NATION in ctx else None if nation is not None and nation in nations.INDICES: nationIdx = nations.INDICES[nation] SelectedNation.select(nationIdx) else: SelectedNation.byDefault() return
def getNationTreeData(self, nationName): """ Overridden method of the class _Py_ScriptHandler.getNationTreeData. """ if nationName not in nations.INDICES: LOG_ERROR('Nation not found', nationName) return {} nationIdx = nations.INDICES[nationName] SelectedNation.select(nationIdx) self._data.load(nationIdx, override=self._getOverride()) return self._data.dump()
def getNationTreeData(self, nationName): """ Overridden method of the class _Py_ScriptHandler.getNationTreeData. """ if nationName not in nations.INDICES: LOG_ERROR('Nation not found', nationName) return {} nationIdx = nations.INDICES[nationName] SelectedNation.select(nationIdx) self._data.load(nationIdx, override=self._getOverride()) return self._data.dump()
def _resolveLoadCtx(self, ctx=None): exitEvent = None rootCD = None if ctx: exitEvent = ctx.get(BackButtonContextKeys.EXIT) rootCD = ctx.get(BackButtonContextKeys.ROOT_CD) self._previewAlias = exitEvent.name if exitEvent else VIEW_ALIAS.LOBBY_HANGAR if rootCD or g_currentVehicle.isPresent(): self._data.setRootCD(rootCD or g_currentVehicle.item.intCD) SelectedNation.select(self._data.getNationID()) return
def getNationTreeData(self, nationName): if nationName not in nations.INDICES: _logger.error('Nation with name %s not found', nationName) return {} self.__stopTopOfTheTreeSounds() nationIdx = nations.INDICES[nationName] SelectedNation.select(nationIdx) self.__updateBlueprintBalance() self.__setVehicleCollectorState() self._data.load(nationIdx) self.__playBlueprintPlusSound() return self._data.dump()
def _resolveLoadCtx(self, ctx=None): exitEvent = ctx[ BackButtonContextKeys. EXIT] if ctx is not None and BackButtonContextKeys.EXIT in ctx else None self._previewAlias = exitEvent.name if exitEvent is not None else VIEW_ALIAS.LOBBY_HANGAR rootCD = ctx[ BackButtonContextKeys. ROOT_CD] if ctx is not None and BackButtonContextKeys.ROOT_CD in ctx else None if rootCD is None and g_currentVehicle.isPresent(): self._data.setRootCD(g_currentVehicle.item.intCD) else: self._data.setRootCD(rootCD) SelectedNation.select(self._data.getNationID()) return
def getNationTreeData(self, nationName): if nationName not in nations.INDICES: _logger.error('Nation with name %s not found', nationName) return {} self.__stopTopOfTheTreeSounds() nationIdx = nations.INDICES[nationName] SelectedNation.select(nationIdx) if self.__uiSpamController.shouldBeHidden(TECH_TREE_EVENT): g_techTreeDP.techTreeEventsListener.setNationViewed(nationIdx) self.__updateBlueprintBalance() self.__setVehicleCollectorState() self._data.load(nationIdx) self.__playBlueprintPlusSound() return self._data.dump()
def __redrawPageAfterNationWasChanged(self): targetVehicleCD = iterVehTypeCDsInNationGroup( self._data.getRootCD()).next() self._data.setRootCD(targetVehicleCD) SelectedNation.select(self._data.getNationID()) self.redraw()