예제 #1
0
 def _updateRallyData(self):
     entity = self.prbEntity
     data = vo_converters.makeSortieVO(entity,
                                       unitIdx=entity.getUnitIdx(),
                                       app=self.app)
     self.__updateLabels()
     self.as_updateRallyS(data)
 def _updateRallyData(self):
     functional = self.unitFunctional
     data = vo_converters.makeSortieVO(functional,
                                       unitIdx=functional.getUnitIdx(),
                                       app=self.app)
     self.__updateLabels()
     self.as_updateRallyS(data)
예제 #3
0
    def onSlotsHighlihgtingNeed(self, databaseID):
        availableSlots = list(self.unitFunctional.getPlayerInfo(databaseID).getAvailableSlots(True))
        functional = self.unitFunctional
        pInfo = functional.getPlayerInfo(dbID=databaseID)
        data = vo_converters.makeSortieVO(functional, unitIdx=functional.getUnitIdx(), app=self.app)
        if pInfo.isInSlot:
            self.as_highlightSlotsS(availableSlots)
            return availableSlots
        else:
            isLegionariesDrag = pInfo.isLegionary()
            slotIndexies = []
            if isLegionariesDrag:
                slots = data['slots']
                slotCount = 0
                for slot in slots:
                    player = slot['player']
                    if not player:
                        slotCount += 1
                        continue
                    isLeg = player['isLegionaries']
                    if isLeg and len(slotIndexies) <= g_fortCache.maxLegionariesCount:
                        slotIndexies.append(slotCount)
                    slotCount += 1

                if len(slotIndexies) < g_fortCache.maxLegionariesCount:
                    self.as_highlightSlotsS(availableSlots)
                    return availableSlots
                self.as_highlightSlotsS(slotIndexies)
                return slotIndexies
            self.as_highlightSlotsS(availableSlots)
            return availableSlots
예제 #4
0
    def _updateRallyData(self):
        entity = self.prbEntity
        unitPermissions = entity.getPermissions()
        havePermissions = unitPermissions.canChangeUnitState()
        canInvite = unitPermissions.canSendInvite()
        unitFreezed = entity.isStrongholdUnitFreezed(
        ) or entity.isStrongholdUnitWaitingForData()
        if entity.isStrongholdSettingsValid():
            maxPlayerCount = entity.getStrongholdSettings().getHeader(
            ).getMaxPlayersCount()
        else:
            maxPlayerCount = MAX_PLAYER_COUNT_ALL
        data = vo_converters.makeSortieVO(entity,
                                          havePermissions,
                                          unitMgrID=entity.getID(),
                                          app=self.app,
                                          canInvite=canInvite,
                                          maxPlayerCount=maxPlayerCount)
        if self.__changeModeBrowserId and not havePermissions:
            self.__destroyChangeModeWindow()
        if self.__minimapGrid:
            self.__minimapGrid.as_clickEnabledS(havePermissions
                                                and not unitFreezed)
        try:
            for slot in data['slots']:
                if slot['selectedVehicle'] and not slot[
                        'isFreezed'] and not slot['isCommanderState']:
                    slot['selectedVehicle']['isReadyToFight'] = True

        except:
            LOG_CURRENT_EXCEPTION()

        self.as_updateRallyS(data)
 def onUnitSettingChanged(self, opCode, value):
     if opCode == UNIT_OP.SET_COMMENT:
         self.as_setCommentS(self.unitFunctional.getCensoredComment())
     elif opCode in (UNIT_OP.CLOSE_SLOT, UNIT_OP.OPEN_SLOT):
         self._setActionButtonState()
     elif opCode == UNIT_OP.CHANGE_DIVISION:
         functional = self.unitFunctional
         data = vo_converters.makeSortieVO(functional, unitIdx=functional.getUnitIdx(), app=self.app)
         self.as_updateRallyS(data)
예제 #6
0
 def onUnitSettingChanged(self, opCode, value):
     if opCode == UNIT_OP.SET_COMMENT:
         self.as_setCommentS(self.unitFunctional.getCensoredComment())
     elif opCode in (UNIT_OP.CLOSE_SLOT, UNIT_OP.OPEN_SLOT):
         self._setActionButtonState()
     elif opCode == UNIT_OP.CHANGE_DIVISION:
         functional = self.unitFunctional
         data = vo_converters.makeSortieVO(functional, unitIdx=functional.getUnitIdx(), app=self.app)
         self.as_updateRallyS(data)
 def _updateRallyData(self):
     functional = self.unitFunctional
     data = vo_converters.makeSortieVO(functional, unitIdx=functional.getUnitIdx(), app=self.app)
     self.__updateLabels()
     self.as_updateRallyS(data)