|
33 | 33 | from ...bolt import Flags, DataDict, GPath, struct_unpack, struct_pack |
34 | 34 | from ...brec import MelRecord, MelStructs, MelObject, MelGroups, MelStruct, \ |
35 | 35 | FID, MelGroup, MelString, MelSet, MelFid, MelNull, MelOptStruct, MelFids, \ |
36 | | - MreHeaderBase, MelBase, MelUnicode, MelFidList, MelStructA, MreRecord, \ |
37 | | - MreGmstBase, MelStrings, MelFull0, MelTuple, MelMODS, MreHasEffects |
| 36 | + MreHeaderBase, MelBase, MelUnicode, MelFidList, MelStructA, MreGmstBase, \ |
| 37 | + MelStrings, MelFull0, MelTuple, MelMODS, MreHasEffects |
38 | 38 | from ...exception import BoltError, ModError, ModSizeError, StateError |
39 | 39 | # Set MelModel in brec but only if unset |
40 | 40 | if brec.MelModel is None: |
@@ -1252,9 +1252,8 @@ def dumpData(self,record,out): |
1252 | 1252 | __slots__ = melSet.getSlotsUsed() |
1253 | 1253 |
|
1254 | 1254 | #------------------------------------------------------------------------------ |
1255 | | -class MreDial(MelRecord): |
| 1255 | +class MreDial(brec.MreDial): |
1256 | 1256 | """Dialog record.""" |
1257 | | - classType = 'DIAL' |
1258 | 1257 | _flags = Flags(0,Flags.getNames('rumors','toplevel',)) |
1259 | 1258 | class MelDialData(MelStruct): |
1260 | 1259 | """Handle older truncated DATA for DIAL subrecord.""" |
@@ -1284,53 +1283,6 @@ def loadData(self, record, ins, sub_type, size_, readId): |
1284 | 1283 | ) |
1285 | 1284 | __slots__ = melSet.getSlotsUsed() + ['infoStamp', 'infoStamp2', 'infos'] |
1286 | 1285 |
|
1287 | | - def __init__(self, header, ins=None, do_unpack=False): |
1288 | | - """Initialize.""" |
1289 | | - MelRecord.__init__(self, header, ins, do_unpack) |
1290 | | - self.infoStamp = 0 #--Stamp for info GRUP |
1291 | | - self.infoStamp2 = 0 #--Stamp for info GRUP |
1292 | | - self.infos = [] |
1293 | | - |
1294 | | - def loadInfos(self,ins,endPos,infoClass): |
1295 | | - """Load infos from ins. Called from MobDials.""" |
1296 | | - infos = self.infos |
1297 | | - recHead = ins.unpackRecHeader |
1298 | | - infosAppend = infos.append |
1299 | | - while not ins.atEnd(endPos,'INFO Block'): |
1300 | | - #--Get record info and handle it |
1301 | | - header = recHead() |
1302 | | - recType = header[0] |
1303 | | - if recType == 'INFO': |
1304 | | - info = infoClass(header,ins,True) |
1305 | | - infosAppend(info) |
1306 | | - else: |
1307 | | - raise ModError(ins.inName, _('Unexpected %s record in %s group.') |
1308 | | - % (recType,"INFO")) |
1309 | | - |
1310 | | - def dump(self,out): |
1311 | | - """Dumps self., then group header and then records.""" |
1312 | | - MreRecord.dump(self,out) |
1313 | | - if not self.infos: return |
1314 | | - # Magic number '24': size of Fallout 3's record header |
1315 | | - # Magic format '4sIIIII': format for Fallout 3's GRUP record |
1316 | | - dial_size = 24 + sum([24 + info.getSize() for info in self.infos]) |
1317 | | - out.pack('4sIIIII', 'GRUP', dial_size, self.fid, 7, self.infoStamp, |
1318 | | - self.infoStamp2) |
1319 | | - for info in self.infos: info.dump(out) |
1320 | | - |
1321 | | - def updateMasters(self,masters): |
1322 | | - """Updates set of master names according to masters actually used.""" |
1323 | | - MelRecord.updateMasters(self,masters) |
1324 | | - for info in self.infos: |
1325 | | - info.updateMasters(masters) |
1326 | | - |
1327 | | - def convertFids(self,mapper,toLong): |
1328 | | - """Converts fids between formats according to mapper. |
1329 | | - toLong should be True if converting to long format or False if converting to short format.""" |
1330 | | - MelRecord.convertFids(self,mapper,toLong) |
1331 | | - for info in self.infos: |
1332 | | - info.convertFids(mapper,toLong) |
1333 | | - |
1334 | 1286 | #------------------------------------------------------------------------------ |
1335 | 1287 | class MreDobj(MelRecord): |
1336 | 1288 | """Default object manager record.""" |
|
0 commit comments