Exemplo n.º 1
0
    def __init__(self, data=None):
        self.states = {}
        if IS_AIRPLANE_EDITOR:
            self.__data = data
        if data != None:
            params = (('id', 0), ('componentType', ''),
                      ('componentTypeQuota', 1.0), ('componentXml', ''),
                      ('repairDestructedAfter', -1.0), ('health', '20.0'),
                      ('fireMountPoint', ''), ('componentPosition', 'Front'))
            if IS_AIRPLANE_EDITOR:
                self.__params = params
            readValues(self, data, params)
            if data.has_key('gunPartName'):
                readValue(self, data, 'gunPartName', '')
            if self.health.find('%') == -1:
                self.healthValue = float(self.health)
                self.healthPrc = 0.0
            else:
                self.healthPrc = float(self.health[:-1]) / 100.0
                self.healthValue = 0.0
            self.componentXml = self.componentXml.lower()
            self.bboxes = BBoxes(findSection(data, 'bBoxes'))
            statesSection = findSection(data, 'states')
            if statesSection:
                for stateData in statesSection.values():
                    state = PartTypeStateSettings(stateData)
                    self.states[int(state.id)] = state

            fireSection = findSection(data, 'fire')
            if fireSection:
                self.fire = FireStateSettings(fireSection)
            if not hasattr(self, 'fire'):
                self.fire = None
        return
Exemplo n.º 2
0
    def __init__(self, data):
        self.onStart = []
        self.state = []
        self.triggered = []
        effectOnStart = findSection(data, 'effectOnStart')
        if effectOnStart:
            for effect in effectOnStart.values():
                parsedEffect = EffectSettings(effect)
                self.onStart.append(parsedEffect)

        effectState = findSection(data, 'effectState')
        if effectState:
            for effect in effectState.values():
                parsedEffect = EffectSettings(effect)
                self.state.append(parsedEffect)

        effectsTriggered = findSection(data, 'effectsTriggered')
        if effectsTriggered:
            for effect in effectsTriggered.values():
                parsedEffect = EffectSettings(effect, True)
                self.triggered.append(parsedEffect)

        if IS_AIRPLANE_EDITOR:
            self.__data = data
            self.__effectSection = {}
            self.__effectSection['effectOnStart'] = effectOnStart
            self.__effectSection['effectState'] = effectState
            self.__effectSection['effectsTriggered'] = effectsTriggered
            self.__effects = {}
            self.__effects['effectOnStart'] = self.onStart
            self.__effects['effectState'] = self.state
            self.__effects['effectsTriggered'] = self.triggered
Exemplo n.º 3
0
    def __init__(self, data):
        self.subItems = []
        self.effectSettings = None
        self.affectedParts = []
        self.customSettings = {}
        if IS_AIRPLANE_EDITOR:
            self.__data = data
        if data != None:
            params = (('id', 0), ('usage', ''), ('model', ''),
                      ('animationController', ''), ('stateHelthCfc', 0.0),
                      ('stateFireChance', 0.2), ('stateAction',
                                                 STATE_ACTION_NONE),
                      ('fallingOutModel', ''), ('stateAnimation', ''))
            if IS_AIRPLANE_EDITOR:
                self.__params = params
            readValues(self, data, params)
            if self.id == 0:
                DBLOG_ERROR('state id missed for part')
            if self.stateHelthCfc < 0 and self.stateHelthCfc != ANIMATION_STATE_HEALTH_K:
                DBLOG_ERROR('invalid stateHelthCfc')
            bBoxesData = findSection(data, 'bBoxes')
            self.bboxes = bBoxesData and BBoxes(bBoxesData) or None
            affectedPartsData = findSection(data, 'affectedParts')
            if affectedPartsData:
                for partData in affectedPartsData.values():
                    partID = partData.readInt('partID', -1)
                    if partID != -1:
                        minimalPartState = partData.readInt(
                            'minimalPartState', 1)
                        self.affectedParts.append((partID, minimalPartState))

            usagestr = self.usage.lower()
            self.stateFlag = 0
            if usagestr.find(PART_STATE_HANGAR) != -1:
                self.stateFlag = self.stateFlag | PART_STATE_IDHANGAR
            if usagestr.find(PART_STATE_CRASH) != -1:
                self.stateFlag = self.stateFlag | PART_STATE_IDCRASH
            if usagestr.find(PART_STATE_FALL) != -1:
                self.stateFlag = self.stateFlag | PART_STATE_IDFALL
            subItemsSection = findSection(data, 'subItems')
            if subItemsSection != None:
                for subItemData in subItemsSection.values():
                    subItem = PartTypeStateSubItemSettings(subItemData)
                    self.subItems.append(subItem)

            self.effectSettings = EffectsSettings(data)
            decalSection = findSection(data, 'groundDecal')
            if decalSection:
                self.groundDecal = GroundDecal(decalSection)
            settings = CustomSettingsFactory.readSettings(data)
            if settings:
                self.customSettings[settings.name()] = settings
        return
Exemplo n.º 4
0
 def __init__(self, data=None):
     if data is not None:
         readValue(self, data, 'duration', 0.0)
         distanceCurvePoints = self.readPoints(
             findSection(data, 'distanceCurve'))
         self.distanceCurvePoints = distanceCurvePoints['points']
         self.minDeltaPosition = distanceCurvePoints['minValue']
         self.maxDeltaPosition = distanceCurvePoints['maxValue']
         heightCurvePoints = self.readPoints(
             findSection(data, 'heightCurve'))
         self.heightCurvePoints = heightCurvePoints['points']
         self.minHeight = heightCurvePoints['minValue']
         self.maxHeight = heightCurvePoints['maxValue']
     return
Exemplo n.º 5
0
 def newSubitem(self):
     if IS_AIRPLANE_EDITOR:
         subItemsSection = findSection(self.__data, 'subItems')
         data = subItemsSection.createSection('item')
         subitem = PartTypeStateSubItemSettings(data)
         subitem.save()
         self.subItems.append(subitem)
Exemplo n.º 6
0
 def __init__(self, groupData):
     _PartData.__init__(self, groupData)
     self.dependency = []
     dependency = findSection(groupData, 'dependency')
     if dependency is not None:
         self.dependency = dependency.readStrings('part')
     return
Exemplo n.º 7
0
    def _readGroupsData(self, data):
        groups = findSection(data, 'groups')
        if groups is not None:
            for groupData in groups.values():
                name = groupData.readString('name')
                self.__groups[name] = _GroupData(groupData)

        return
Exemplo n.º 8
0
    def readData(self, data):
        if data != None:
            readValue(self, data, 'scenario', '')
            excludeEvents = findSection(data, 'excludeEvents')
            if excludeEvents:
                for event in excludeEvents.values():
                    self.excludeEvents.append(event.asString)

        return
Exemplo n.º 9
0
 def readData(self, data):
     if data != None:
         readValue(self, data, 'detailTexture', '')
         decalSettingsData = findSection(data, 'decalsSettings')
         if self.decalsSettings:
             self.decalsSettings.readData(decalSettingsData)
         else:
             self.decalsSettings = DecalsSettings(decalSettingsData)
     return
Exemplo n.º 10
0
 def readData(self, data):
     updateValue(self, data, 'cameraEffectID', '')
     updateValue(self, data, 'relativeAccelerationLimits', Math.Vector2(0, 0))
     if data:
         outputSettingsSection = findSection(data, 'cameraEffectOutputSettings')
         if outputSettingsSection:
             for outputSettingsData in outputSettingsSection.values():
                 outputSettings = CameraEffectOutputSettings(outputSettingsData)
                 self.outputSettings[outputSettings.id] = outputSettings
Exemplo n.º 11
0
    def readData(self, data = None):
        if data != None:
            pivotsData = findSection(data, 'Pivots')
            if pivotsData != None:
                for sName, sData in pivotsData.items():
                    if sName == 'pivot':
                        pivot = PivotData(sData)
                        self.mountPoints[pivot.name] = pivot

        return
Exemplo n.º 12
0
 def newState(self):
     if IS_AIRPLANE_EDITOR:
         stateId = 1
         if len(self.states.keys()) > 0:
             stateId = max(self.states.keys()) + 1
         statesSection = findSection(self.__data, 'states')
         data = statesSection.createSection('state')
         data.writeInt('id', stateId)
         state = PartTypeStateSettings(data)
         state.save()
         self.states[stateId] = state
Exemplo n.º 13
0
    def readData(self, data = None):
        if data != None:
            readValue(self, data, 'name', 'unknown')
            self.decals = {}
            decalsSection = findSection(data, 'decals')
            if decalsSection:
                for decalData in decalsSection.values():
                    decal = DecalSettings(decalData)
                    self.decals[decal.id] = decal

        return
Exemplo n.º 14
0
    def readData(self, data):
        if data:
            readValue(self, data, 'name', '')
            readValue(self, data, 'turretName', '')
            readValue(self, data, 'maxHealth', 200.0)
            readValue(self, data, 'stealthFactor', 1.0)
            readValue(self, data, 'alignToGround', False)
            readValue(self, data, 'superiorityPoints', 0)
            for groupID in range(SUPERIORITY_POINTS_GROUPS_MAX):
                readValue(self, data, 'superiorityPointsGroup%d' % groupID, 0)

            readValue(self, data, 'mass', 100000.0)
            readValue(self, data, 'type', '')
            readValue(self, data, 'modelScaling', AIRCRAFT_MODEL_SCALING)
            self.type = TYPE_TEAM_OBJECT_STR_MAP.get(self.type,
                                                     TYPE_TEAM_OBJECT.INVALID)
            if self.type == TYPE_TEAM_OBJECT.INVALID:
                LOG_ERROR('invalid object type for', self.typeID,
                          self.typeName, self.name)
            visibilityData = findSection(data, 'visibility')
            self.visibility = visibilityData and VisibilityTunes(
                visibilityData) or None
            self.bboxes = BBoxes(findSection(data, 'bBoxes'),
                                 self.modelScaling)
            self.magnetPoints = ()
            self.partsSettings = PartsTunes(findSection(data, 'parts'))
            self.checkPartsTunes()
            battleLevelsSettingsSection = findSection(data,
                                                      'battleLevelsSettings')
            if battleLevelsSettingsSection:
                self.battleLevelsSettings = BattleLevelsSettings(
                    battleLevelsSettingsSection)
            elif not hasattr(self, 'battleLevelsSettings'):
                self.battleLevelsSettings = None
            damageEffectsSection = findSection(data, 'damageEffects')
            if damageEffectsSection:
                self.damageEffects = DamageEffects(damageEffectsSection)
            elif not hasattr(self, 'damageEffects'):
                self.damageEffects = None
            self.__calculateSuperiorityPoints()
        return
Exemplo n.º 15
0
 def updateMassPivot(self, pivot):
     if IS_EDITOR:
         if self.__data != None:
             self.hpmass = None
             sectionName = 'HPmass'
             massData = findSection(self.__data, sectionName)
             if massData:
                 self.__data.deleteSection(massData)
             massData = self.__data.createSection(sectionName)
             massData.writeVector3('position', pivot[0])
             massData.writeVector3('direction', Math.Vector3(pivot[1][0], pivot[1][1], pivot[1][2]))
             self.hpmass = MassTunes(self.__data)
     return
Exemplo n.º 16
0
 def saveMassPivotToXML(self):
     if IS_EDITOR:
         if self.__data != None and self.hpmass != None:
             sectionName = 'HPmass'
             massData = findSection(self.__data, sectionName)
             if massData:
                 self.__data.deleteSection(massData)
             massData = self.__data.createSection(sectionName)
             pos = deepcopy(self.hpmass.mass.position)
             pos /= AIRCRAFT_MODEL_SCALING
             massData.writeVector3('position', pos)
             massData.writeVector3('direction', self.hpmass.mass.direction)
     return
Exemplo n.º 17
0
 def removeBbox(self, bboxId):
     if IS_AIRPLANE_EDITOR:
         bboxSection = findSection(self.__data, 'bBoxes')
         if bboxSection is None:
             DBLOG_ERROR("Error: removeBbox, XML hasn't section bBoxes")
             return
         if bboxId - 1 < len(bboxSection.values()):
             data = bboxSection.values()[bboxId - 1]
             bboxSection.deleteSection(data)
         else:
             DBLOG_ERROR('Error: removeBbox, bbox xml section is not exist')
         self.bboxes.deleteBox(bboxId - 1)
     return
Exemplo n.º 18
0
 def __init__(self, groupID, data):
     self.groupID = groupID
     readValue(self, data, 'initialSpawnDelay', -1.0)
     readValue(self, data, 'bomberIndex', -1)
     readValue(self, data, 'bomberDelay', 0.0)
     readValue(self, data, 'objectsAreaIndex', -1)
     readValue(self, data, 'allTeamSpawn', False)
     readValue(self, data, 'customSpawn', False)
     self.destroyToSpawn = set()
     initOnSection = findSection(data, 'initOnDestruction')
     if initOnSection:
         self.destroyToSpawn = set(
             (sectionData.asString
              for sectionData in initOnSection.values()))
Exemplo n.º 19
0
    def saveMagnetPointsToXML(self):
        if IS_EDITOR:
            if self.__data != None and self.airplane.magnetPoints != None:
                sectionName = 'magnetPoints'
                magnetPointsData = findSection(self.__data, sectionName)
                if magnetPointsData:
                    self.__data.deleteSection(magnetPointsData)
                if len(self.airplane.magnetPoints) != 0:
                    magnetPointsData = self.__data.createSection(sectionName)
                    for item in self.airplane.magnetPoints:
                        pointDataSect = magnetPointsData.createSection('magnetPoint')
                        pointDataSect.writeVector3('position', item['position'] / WORLD_SCALING)
                        pointDataSect.writeFloat('staticMass', item['weight'])

        return
Exemplo n.º 20
0
 def newBbox(self):
     if IS_AIRPLANE_EDITOR:
         bboxesSection = findSection(self.__data, 'bBoxes')
         if bboxesSection is None:
             bboxesSection = self.__data.createSection('bBoxes')
         boxSection = bboxesSection.createSection('bbox')
         boxSection.writeVector3('position', Math.Vector3(0, 0, 0))
         boxSection.writeVector3('size', Math.Vector3(1, 1, 1))
         boxSection.writeFloat('absorption', 1.0)
         box = BBox(boxSection)
         box.save()
         self.bboxes.addBox(box)
         return len(self.bboxes.getList())
     else:
         return
Exemplo n.º 21
0
    def updatePivots(self, pivotsList):
        if IS_EDITOR:
            if self.__data != None:
                self.pivots = None
                sectionName = 'Pivots'
                pivotsData = findSection(self.__data, sectionName)
                if pivotsData:
                    self.__data.deleteSection(pivotsData)
                pivotsData = self.__data.createSection(sectionName)
                for flamename, position, direction in pivotsList:
                    pivotData = pivotsData.createSection('pivot')
                    pivotData.writeString('name', flamename)
                    pivotData.writeVector3('position', position)
                    pivotData.writeVector3('direction', Math.Vector3(direction[0], direction[1], direction[2]))

                self.pivots = PivotsTunes(self.__data)
        return
Exemplo n.º 22
0
    def save(self):
        if IS_AIRPLANE_EDITOR:
            if self.ed_data:
                for value in self.__params:
                    if value[0] == 'name':
                        nameValue = getattr(self, *value)
                        if nameValue != '':
                            writeValue(self, self.ed_data, *value)
                        else:
                            nameSection = findSection(self.ed_data, 'name')
                            if nameSection is not None:
                                self.ed_data.deleteSection(nameSection)
                    else:
                        writeValue(self, self.ed_data, *value)

            if self.delay:
                writeValue(self, self.ed_data, 'delay')
        return
Exemplo n.º 23
0
 def __init__(self, data):
     if IS_AIRPLANE_EDITOR:
         self.__data = data
     if data:
         params = (('extinguish_time', 5.0), ('fire_damage', '2.0'),
                   ('tickLength', 2.0), ('effectFire', ''), ('fire_chance',
                                                             0.0))
         if IS_AIRPLANE_EDITOR:
             self.__params = params
         readValues(self, data, params)
         if self.fire_damage.find('%') == -1:
             self.fire_damage = float(self.fire_damage)
             self.fire_damagePrc = 0.0
         else:
             self.fire_damagePrc = float(self.fire_damage[:-1]) / 100.0
             self.fire_damage = 0.0
         self.extinguish_chance = FireExtinguishChance(
             findSection(data, 'extinguish_chance'))
Exemplo n.º 24
0
    def removeState(self, stateId):
        if IS_AIRPLANE_EDITOR:
            statesSection = findSection(self.__data, 'states')
            if statesSection is None:
                DBLOG_ERROR("Error: removeState, XML hasn't section states")
                return
            data = None
            for stateData in statesSection.values():
                if stateData.readInt('id') == stateId:
                    data = stateData
                    break

            if data is not None:
                statesSection.deleteSection(data)
                del self.states[stateId]
            else:
                DBLOG_ERROR('Error: removeState, state is not exist')
        return
Exemplo n.º 25
0
    def removeSubitem(self, subitemId):
        if IS_AIRPLANE_EDITOR:
            subItemsSection = findSection(self.__data, 'subItems')
            if subItemsSection is None:
                DBLOG_ERROR(
                    "Error: removeSubitem, XML hasn't section subItems")
                return
            data = None
            i = 0
            for subitemData in subItemsSection.values():
                if i == subitemId:
                    data = subitemData
                    break
                i += 1

            if data is not None:
                subItemsSection.deleteSection(data)
                del self.subItems[subitemId]
            else:
                DBLOG_ERROR('Error: removeState, state is not exist')
        return
Exemplo n.º 26
0
    def updateCamouflages(self, decals):
        if IS_EDITOR:
            if self.__data != None:
                self.decalsSettings = None
                sectionName = 'decalsSettings'
                decalSettingsData = findSection(self.__data, sectionName)
                self.__data.deleteSection(decalSettingsData)
                decalSettingsData = self.__data.createSection(sectionName)
                for name, decalList in decals.items():
                    dacalGroupSection = decalSettingsData.createSection('decalGroup')
                    dacalGroupSection.writeString('name', name)
                    decalsSection = dacalGroupSection.createSection('decals')
                    for id, decal in decalList.items():
                        decalSection = decalsSection.createSection('decal')
                        decalSection.writeInt('id', id)
                        decalSection.writeString('texture', decal['texture'])
                        if decal['icoPath'] != '':
                            decalSection.writeString('icoPath', decal['icoPath'])
                        if 'bottomColor' in decal:
                            decalSection.writeVector4('bottomColor', decal['bottomColor'])
                        if 'reflectionColor' in decal and decal['reflectionColor'] != Math.Vector4(0.0, 0.0, 0.0, 0.0) and decal['reflectionColor'] != Math.Vector4(1.0, 1.0, 1.0, 1.0):
                            decalSection.writeVector4('reflectionColor', decal['reflectionColor'])
                        if 'glossinessOffset' in decal:
                            decalSection.writeFloat('glossinessOffset', decal['glossinessOffset'])
                        if 'camouflageMask' in decal and len(decal['camouflageMask']):
                            decalSection.writeString('camouflageMask', decal['camouflageMask'])
                        if 'camouflageStub' in decal and decal['camouflageStub'] != Math.Vector4(0.0, 0.0, 0.0, 0.0):
                            decalSection.writeString('camouflageStub', '{0:.0f} {1:.0f} {2:.0f} {3:.0f}'.format(decal['camouflageStub'].x, decal['camouflageStub'].y, decal['camouflageStub'].z, 1.0))
                        if 'camouflageNeutral' in decal and decal['camouflageNeutral'] != Math.Vector4(0.0, 0.0, 0.0, 1.0):
                            decalSection.writeString('camouflageNeutral', '{0:.0f} {1:.0f} {2:.0f} {3:.0f}'.format(decal['camouflageNeutral'].x, decal['camouflageNeutral'].y, decal['camouflageNeutral'].z, 1.0))
                        if 'camouflageAllied' in decal and decal['camouflageAllied'] != Math.Vector4(0.0, 0.0, 0.0, 1.0):
                            decalSection.writeString('camouflageAllied', '{0:.0f} {1:.0f} {2:.0f} {3:.0f}'.format(decal['camouflageAllied'].x, decal['camouflageAllied'].y, decal['camouflageAllied'].z, 1.0))
                        if 'camouflageHostile' in decal and decal['camouflageHostile'] != Math.Vector4(0.0, 0.0, 0.0, 1.0):
                            decalSection.writeString('camouflageHostile', '{0:.0f} {1:.0f} {2:.0f} {3:.0f}'.format(decal['camouflageHostile'].x, decal['camouflageHostile'].y, decal['camouflageHostile'].z, 1.0))

                self.decalsSettings = DecalsSettings(decalSettingsData)
        return
Exemplo n.º 27
0
    def readData(self, data):
        if not data:
            return
        else:
            for propName in ['exclusiveGameMods', 'excludeArenaType']:
                propData = findSection(data, propName)
                if propData:
                    setattr(
                        self, propName,
                        set([
                            ARENA_TYPE.getValueByName(k)
                            for k in propData.keys()
                        ]))
                else:
                    setattr(self, propName, set())

            spawnGroupData = findSection(data, 'spawnGroup')
            if spawnGroupData:
                self.__spawnGroupDescription = DBSpawnGroup(spawnGroupData)
            readValue(self, data, 'gameType', 'SaD')
            gameModeEnum = GAME_MODE.NAME_TO_MODE.get(self.gameType,
                                                      GAME_MODE.AREA_CONQUEST)
            self._readGameModeSettings(data)
            sectorData = findSection(data, 'sectors')
            if sectorData:
                self.sectors.fillSectorData(
                    sectorData,
                    GAME_MODE_PATH_NAMES.MODE_TO_PATH[gameModeEnum])
                self.sectors.convertPoints(self.arenaObjects.getPointPosition)
            if IS_CLIENT:
                self._readHudSectorsSettings(data)
            readValue(self, data, 'camouflageArenaType', '')
            readValue(self, data, 'hudIcoPath', '')
            self.__parseBounds(self.geometry)
            self.__parseSpaceScripts(self.settings)
            readValue(self, data, 'minPlayersInTeam', 0)
            self.trainingRoomIcoPathSelected = data.readString(
                'trainingRoomIcoPath/selected', '')
            self.trainingRoomIcoPathUnselected = data.readString(
                'trainingRoomIcoPath/unselected', '')
            self.trainingRoomIcoPathPreview = data.readString(
                'trainingRoomIcoPath/preview', '')
            self.trainingRoomIcoPathPreviewBig = data.readString(
                'trainingRoomIcoPath/previewBig', '')
            readValue(self, data, 'trainingRoomDescription', '')
            if self.minPlayersInTeam < 0:
                self.__raiseWrongXml("wrong 'minPlayersInTeam' value")
            readValue(self, data, 'maxPlayersInTeam', 0)
            if self.maxPlayersInTeam < 0:
                self.__raiseWrongXml("wrong 'maxPlayersInTeam' value")
            if self.maxPlayersInTeam < self.minPlayersInTeam:
                self.__raiseWrongXml(
                    "'maxPlayersInTeam' value < 'minPlayersInTeam' value")
            readValue(self, data, 'roundLength', 0)
            if self.roundLength < 0:
                self.__raiseWrongXml("wrong 'roundLength' value")
            bottomLeft = data.readVector2('boundingBox/bottomLeft')
            upperRight = data.readVector2('boundingBox/upperRight')
            if bottomLeft[0] >= upperRight[0] or bottomLeft[1] >= upperRight[1]:
                LOG_UNEXPECTED("wrong 'boundingBox' values", self.typeName)
            self.boundingBox = (bottomLeft, upperRight)
            readValue(self, data, 'isPvEReady', True)
            readValue(self, data, 'visibleEnable', 1)
            readValue(self, data, 'minPlayerCount', 0)
            readValue(self, data, 'selectionPriority', 0)
            readValue(self, data, 'minAircraftLevel', 1)
            readValue(self, data, 'maxAircraftLevel', 10)
            readValue(self, data, 'sunAngle', 70.0)
            readValue(self, data, 'daytime', 8.31)
            readValue(self, data, 'sunStealthFactor', Curve())
            readValue(self, data, 'cloudStealthFactorDistance', 120.0)
            readValue(self, data, 'seaLevelForFlightMdel', 0.0)
            readValue(self, data, 'altitudeMap', 0.0)
            readValue(self, data, 'anyTeamObjectsCount', 5)
            readValue(self, data, 'randomObjectsCount', 5)
            visualScripts = findSection(data, 'visualScripts')
            if visualScripts:
                self.arenaScripts = visualScripts.readStrings('scripts')
            else:
                self.arenaScripts = ()
            if IS_CLIENT:
                readValue(self, data, 'name', '')
                readValue(self, data, 'secondName', ' @ NEED LOCALE ')
                readValue(self, data, 'trainingRoomName', '')
                readValue(self, data, 'trainingRoomSecondName', '')
                readValue(self, data, 'description', '')
                readValue(self, data, 'outroScenario', '')
                readValue(self, data, 'outroTimeline', '')
                readValue(self, data, 'music', '')
                readValue(self, data, 'musicPrefix', '')
                readValue(self, data, 'ambientSound', '')
                readValue(self, data, 'umbraEnabled', 0)
                readValue(self, data, 'batchingEnabled', 0)
                stingersSection = findSection(data, 'stingers')
                self.stingers = SoundsStingers(
                    stingersSection) if stingersSection else None
                self.waterTexScale = data.readFloat('water/texScale', 0.5)
                self.waterFreqX = data.readFloat('water/freqX', 1.0)
                self.waterFreqZ = data.readFloat('water/freqZ', 1.0)
            if IS_BASEAPP:
                readValue(self, data, 'kickAfterFinishWaitTime', 0)
                readValue(self, data, 'battleEntryPoint', '', True)
                if self.kickAfterFinishWaitTime < 0:
                    self.__raiseWrongXml(
                        "wrong 'kickAfterFinishWaitTime' value")
                readValue(self, data, 'arenaStartDelay', 0)
                if self.arenaStartDelay <= 0:
                    self.__raiseWrongXml("wrong 'arenaStartDelay' value")
                groups = findSection(data, 'objectGroups')
                if groups:
                    for groupID, groupData in groups.items():
                        self.objectGroups.addGroup(groupID, groupData)

                selectGroups = findSection(data, 'selectGroups')
                if selectGroups:
                    self.objectGroups.readSpawnSequence(selectGroups)
            if IS_CLIENT:
                weatherPath = self.settings + '/weatherSettings/'
                weatherData = ResMgr.openSection(weatherPath)
                if weatherData:
                    self.weatherWindSpeed = weatherData.readVector2(
                        'windSpeed')
                    self.weatherWindGustiness = weatherData.readFloat(
                        'windGustiness', 0.0)
                    ResMgr.purge(weatherPath)
                else:
                    self.weatherWindSpeed = (0.0, 0.0)
                    self.weatherWindGustiness = 0.0
                groups = findSection(data, 'objectGroups')
                if groups:
                    for groupID, groupData in groups.items():
                        self.offlineObjectGroups.addGroup(groupID, groupData)

                selectGroups = findSection(data, 'selectGroups')
                if selectGroups:
                    self.offlineObjectGroups.readSpawnSequence(selectGroups)
            return
Exemplo n.º 28
0
 def _readGameModeSettings(self, data):
     self._gameModeSettings = ArenaGameModeSettingsModel()
     section = findSection(data, 'gameModeSettings')
     if section:
         self._gameModeSettings.read(section)
Exemplo n.º 29
0
 def _readPartsData(self, data):
     for partData in findSection(data, 'parts').values():
         name = partData.readString('name')
         self.__parts[name] = _PartData(partData)
Exemplo n.º 30
0
 def _readSubItemList(storage, data, sectionsName, subItemName):
     dataList = findSection(data, sectionsName).readStrings(subItemName)
     setattr(storage, sectionsName, list(dataList))