1
0
Fork 0
mirror of https://github.com/em-squared/5e-drs.git synced 2025-10-30 13:14:20 +00:00

outils de création de sorts/monstres/objets

This commit is contained in:
Maxime Moraine 2020-04-22 11:17:05 +02:00
parent 6237f0e6a2
commit a6986c42c6
48 changed files with 2743 additions and 259 deletions

View file

@ -73,3 +73,19 @@ export function setBooleanMutation (param, store, mutation) {
store.commit(mutation, value)
}
}
export function sortByString (a, b, direction = 'ASC') {
const titleA = a.toUpperCase()
const titleB = b.toUpperCase()
let comparison = 0
if (titleA > titleB) {
comparison = 1
} else if (titleA < titleB) {
comparison = -1
}
if (direction == 'ASC') {
return comparison
} else {
return comparison * -1
}
}

View file

@ -57,7 +57,11 @@ export function displayMonsterTypeSizeAlignment (monster, hideAlignment = false,
result += ' de taille ' + monster.size
}
if (!hideAlignment) {
result += ', ' + monster.alignment
if (monster.alignment) {
result += ', ' + monster.alignment
} else {
result += ', non alignée'
}
}
if (showChallenge) {
result += ', Dangerosité : ' + displayChallenge(monster.challenge)