Skip to content

Commit

Permalink
add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjythebee committed Nov 12, 2024
1 parent a4c7c24 commit 208000d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/library/CharacterManifestData.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,22 @@ export class CharacterManifestData{
createModelTraits(modelTraits, replaceExisting = false){
if (replaceExisting) this.modelTraits = [];

let hasTraitWithDecals = false
getAsArray(modelTraits).forEach(traitObject => {
this.modelTraits.push(new TraitModelsGroup(this, traitObject))

/**
* We only support one group with decals at the moment; if there are multiple groups with decals, we will log a warning
*/
if(hasTraitWithDecals && traitObject.decals?.length){
console.warn("Detected multiple traits with decals; only one trait with decals is supported at the moment")
}else if (!traitObject.decals?.length){
traitObject.decals = traitObject
hasTraitWithDecals = true
}
});


this.modelTraitsMap = new Map(this.modelTraits.map(item => [item.trait, item]));

// Updates all restricted traits for each group models
Expand Down

0 comments on commit 208000d

Please sign in to comment.