File tree Expand file tree Collapse file tree 2 files changed +46
-1
lines changed
Expand file tree Collapse file tree 2 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,27 @@ interface PredicateModel {
209209 }
210210}
211211
212- let predicateIDMap = { }
212+ function throwPredicateMergingError ( reason : string ) {
213+ throw new CustomError ( 'Predicate Missing Overrides List' , {
214+ intentional : true ,
215+ dialog : {
216+ id : 'animatedJava.predicateMergeFailed' ,
217+ title : tl (
218+ 'animatedJava.dialogs.errors.predicateMergeFailed.title' ,
219+ {
220+ reason,
221+ }
222+ ) ,
223+ lines : [
224+ tl ( 'animatedJava.dialogs.errors.predicateMergeFailed.body' , {
225+ reason,
226+ } ) ,
227+ ] ,
228+ width : 512 + 256 ,
229+ singleButton : true ,
230+ } ,
231+ } )
232+ }
213233
214234async function exportPredicate (
215235 models : aj . ModelObject ,
@@ -245,6 +265,21 @@ async function exportPredicate(
245265 )
246266 console . log ( oldPredicate )
247267 // @ts -ignore
268+ if ( oldPredicate ) {
269+ if ( ! oldPredicate ?. aj ) {
270+ throwPredicateMergingError (
271+ tl (
272+ 'animatedJava.dialogs.errors.predicateMergeFailed.reasons.ajMetaMissing'
273+ )
274+ )
275+ } else if ( ! oldPredicate . overrides ) {
276+ throwPredicateMergingError (
277+ tl (
278+ 'animatedJava.dialogs.errors.predicateMergeFailed.reasons.overridesMissing'
279+ )
280+ )
281+ }
282+ }
248283 const data = oldPredicate ?. aj ?. includedRigs || { }
249284 if ( ! oldPredicate ?. aj ?. includedRigs ) {
250285 data . preExistingIds = {
Original file line number Diff line number Diff line change @@ -181,6 +181,16 @@ animatedJava:
181181 body :
182182 - All cubes must be inside of a group.
183183
184+ predicateMergeFailed :
185+ title : Predicate Failed to Merge
186+ body :
187+ - " %reason"
188+ - Animated Java only supports merging into Animated Java controlled predicate models.
189+ - Please make sure you are attempting to merge your predicate item model with a valid pre-existing Animated Java predicate item model.
190+ reasons :
191+ overridesMissing : Model overrides list missing.
192+ ajMetaMissing : Model file to merge into is not an Animated Java predicate file.
193+
184194 invalidAnimationSnappingValue :
185195 title : Invalid Animation Snapping Value
186196 body :
You can’t perform that action at this time.
0 commit comments