Skip to content

Commit

Permalink
add method to check if group trait is required
Browse files Browse the repository at this point in the history
  • Loading branch information
memelotsqui committed Dec 10, 2023
1 parent 72684e2 commit 3823be1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/library/characterManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ export class CharacterManager {
}

// returns wether or not the trait group can be removed
isTraitGroupRemovable(groupTraitID){
isTraitGroupRequired(groupTraitID){
const groupTrait = this.manifestData.getModelTraits(groupTraitID)
if (groupTrait?.isRequired){
return true;
}
return false;
}

Expand Down Expand Up @@ -75,7 +79,7 @@ export class CharacterManager {
}

removeTrait(groupTraitID, forceRemove = false){
if (!this.isTraitGroupRemovable(groupTraitID) && !forceRemove){
if (this.isTraitGroupRequired(groupTraitID) && !forceRemove){
console.warn(`No trait with name: ${ groupTraitID } is not removable.`)
return;
}
Expand Down

0 comments on commit 3823be1

Please sign in to comment.