2024-12-08 18:50:52 +01:00
|
|
|
import { SYSTEM_RDD } from "../constants.js";
|
2021-02-11 02:48:27 +01:00
|
|
|
import { Draconique } from "./draconique.js";
|
2023-05-29 08:38:22 +02:00
|
|
|
import { PixiTMR } from "./pixi-tmr.js";
|
2021-02-11 02:48:27 +01:00
|
|
|
|
2024-12-08 18:50:52 +01:00
|
|
|
const IMAGE_CARTE_TMR = 'image-carte-tmr';
|
|
|
|
const TMR_V1 = "systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr-v1.webp";
|
|
|
|
const TMR_V2 = "systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr-v2.webp";
|
|
|
|
const TMR_V3_COULEUR = "systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr-v3-couleur.webp";
|
|
|
|
|
2021-02-11 02:48:27 +01:00
|
|
|
export class CarteTmr extends Draconique {
|
|
|
|
|
2024-12-08 18:50:52 +01:00
|
|
|
static initSettings() {
|
|
|
|
game.settings.register(SYSTEM_RDD, IMAGE_CARTE_TMR,
|
|
|
|
{
|
|
|
|
name: 'Carte des TMR',
|
|
|
|
hint: "Choix de l'image de la carte des TMR",
|
|
|
|
scope: "client",
|
|
|
|
config: true,
|
|
|
|
choices: {
|
|
|
|
[TMR_V3_COULEUR]: "TMR Scriptarium v3 couleur",
|
|
|
|
[TMR_V2]: "TMR Multisim v2",
|
|
|
|
[TMR_V1]: "TMR NEF v1",
|
|
|
|
},
|
|
|
|
default: TMR_V3_COULEUR,
|
|
|
|
type: String
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2021-02-11 02:48:27 +01:00
|
|
|
type() { return '' }
|
|
|
|
match(item) { return false; }
|
|
|
|
manualMessage() { return false }
|
|
|
|
async onActorCreateOwned(actor, item) { }
|
|
|
|
|
|
|
|
code() { return 'tmr' }
|
2024-12-08 18:50:52 +01:00
|
|
|
img() { return game.settings.get(SYSTEM_RDD, IMAGE_CARTE_TMR) }
|
2021-02-11 02:48:27 +01:00
|
|
|
|
2021-02-12 18:31:49 +01:00
|
|
|
createSprite(pixiTMR) {
|
2023-10-20 22:18:37 +02:00
|
|
|
const img = PixiTMR.getImgFromCode(this.code())
|
|
|
|
const sprite = new PIXI.Sprite(PIXI.utils.TextureCache[img]);
|
|
|
|
// Setup the position of the TMR
|
2023-11-15 22:14:00 +01:00
|
|
|
sprite.x = pixiTMR.pixiApp.screen.x;
|
|
|
|
sprite.y = pixiTMR.pixiApp.screen.y;
|
|
|
|
sprite.width = pixiTMR.pixiApp.screen.width;
|
|
|
|
sprite.height = pixiTMR.pixiApp.screen.height;
|
2023-10-20 22:18:37 +02:00
|
|
|
// Rotate around the center
|
|
|
|
sprite.anchor.set(0);
|
|
|
|
sprite.buttonMode = true;
|
|
|
|
sprite.tmrObject = pixiTMR;
|
|
|
|
return sprite;
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2023-10-20 22:18:37 +02:00
|
|
|
|
2023-11-10 03:39:35 +01:00
|
|
|
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|