Astrologie !

This commit is contained in:
2022-12-25 18:00:42 +01:00
parent bcb377db7a
commit 1bbefd3499
18 changed files with 336 additions and 68 deletions

View File

@@ -32,7 +32,7 @@ export class BoLUtility {
name: "character-summary-data",
scope: "world",
config: false,
default: { npcList : [], x: 200, y: 200},
default: { npcList: [], x: 200, y: 200 },
type: Object
})
game.settings.register("bol", "logoActorSheet", {
@@ -84,8 +84,8 @@ export class BoLUtility {
return this.logoTopLeft
}
/* -------------------------------------------- */
static getActorFromRollData(rollData) {
let actor = game.actors.get( rollData.actorId)
static getActorFromRollData(rollData) {
let actor = game.actors.get(rollData.actorId)
if (rollData.tokenId) {
let token = canvas.tokens.placeables.find(t => t.id == rollData.tokenId)
if (token) {
@@ -185,7 +185,7 @@ export class BoLUtility {
static getOtherWhisperRecipients(name) {
let users = []
for (let user of game.users) {
if ( !user.isGM && user.name != name) {
if (!user.isGM && user.name != name) {
users.push(user.id)
}
}
@@ -585,5 +585,29 @@ export class BoLUtility {
return item
}
/* -------------------------------------------- */
static updateSheets() {
// Then force opened actor refresh if needed
for (let actor of game.actors) {
if (actor.sheet.rendered) {
actor.sheet.render()
}
}
game.bol.charSummary.updatePCSummary() // Refresh if needed
}
/* -------------------------------------------- */
static removeGroupHoroscope(rollData) {
let horo = rollData.horoscopeGroupList[rollData.selectedGroupHoroscopeIndex]
let horoscopes = duplicate(game.settings.get("bol", "horoscope-group"))
let toChange = duplicate(horoscopes[horo.id])
toChange.availableDice -= horo.nbDice // Remove the dice
if (toChange.availableDice <= 0) {
horoscopes[horo.id] = undefined
} else {
horoscopes[horo.id] = toChange
}
game.settings.set("bol", "horoscope-group", horoscopes)
this.updateSheets()
}
}