@@ -90,10 +90,18 @@ ngapp.service('idCacheService', function(patcherService) {
9090 return cache [ fileName ] ;
9191 } ;
9292
93+ let updateNextFormId = function ( patchFile , idCache ) {
94+ let formIds = Object . values ( idCache ) ,
95+ maxFormId = formIds . reduce ( ( a , b ) => Math . max ( a , b ) , 0x7FF ) ;
96+ xelib . SetNextObjectID ( patchFile , maxFormId + 1 ) ;
97+ } ;
98+
9399 this . cacheRecord = function ( patchFile ) {
94100 let idCache = prepareIdCache ( patchFile ) ,
95101 usedIds = { } ;
96102
103+ updateNextFormId ( patchFile , idCache ) ;
104+
97105 return function ( rec , id ) {
98106 if ( ! xelib . IsMaster ( rec ) ) return ;
99107 if ( usedIds . hasOwnProperty ( id ) )
@@ -241,9 +249,10 @@ ngapp.service('patchBuilder', function($rootScope, $timeout, patcherService, pat
241249 } ;
242250
243251 let progressDone = function ( patchPlugins , success ) {
244- let builtStr = `${ patchPlugins . length } patch plugins built` ,
245- successStr = `${ success ? 'un' : '' } successfully` ;
246- progressService . progressTitle ( `${ builtStr } ${ successStr } ` ) ;
252+ let pluginsStr = `${ patchPlugins . length } patch plugins` ;
253+ progressService . progressTitle ( success ?
254+ `${ pluginsStr } built successfully` :
255+ `${ pluginsStr } failed to build` ) ;
247256 progressService . progressMessage ( success ? 'All Done!' : 'Error' ) ;
248257 progressService . allowClose ( ) ;
249258 } ;
@@ -773,6 +782,6 @@ ngapp.run(function(patcherService) {
773782 info : module . info ,
774783 patcherUrl : fh . pathToFileUrl ( module . path ) ,
775784 patcherPath : module . path
776- } , module . code ) ;
785+ } , module . code , module . info . id ) ;
777786 } ) ;
778787} ) ;
0 commit comments