feat(welcome): message de bienvenue simple, sans bouton ni tour
Retire le bouton « J'y vais mais j'ai peur » (qui ne lançait aucun tour fonctionnel) et toute la machinerie du tour d'initiation (WelcomeTour, CreateActorDialog) devenus inutiles. tour.mjs ne garde que postWelcomeMessage() ; les clés i18n TOURS.Welcome.* sont supprimées.
This commit is contained in:
+1
-17
@@ -65,23 +65,7 @@
|
||||
"roll_dice": "Roll the dice"
|
||||
},
|
||||
"TOURS": {
|
||||
"ChatMessage": "<h3>Welcome to Vermine 2047!</h3><p>If you're using this system for the first time, our shaman will guide you to your initiation rite</p> <button id=\"vermine-tour-chat-button\"> <i class=\"fas fa-person-hiking\"></i> I'm going but I'm scared </button><hr><p class=\"vermine-credits\"><strong>Vermine 2047</strong> — a game by Julien Blondel<br>© 2023 Studio Agate — TOTEM System — © 2023 Julien Blondel — All rights reserved.<br>Foundry VTT system developed by <a href=\"https://www.uberwald.me\">LeRatierBretonnier</a>, based on an original work by RWanoux.</p>",
|
||||
"Welcome": {
|
||||
"Title": "Welcome to Vermine",
|
||||
"Description": "Overview of the Vermine system",
|
||||
"WelcomeTitle": "Welcome",
|
||||
"WelcomeContent": "<p>Welcome to Vermine, survivor! Take a tour of our action zone to find your bearings, even if it's your first day among us.</p><p>At the top of the right column, you have everything you're allowed to do here: talk, see other tronches of your commu, manage your matos and that of your potes, study the maps, read the journals of the clamsés, go get us some food with your surin. Let's get into the thick of it.</p>",
|
||||
"ActorTabTitle": "Populate your universe",
|
||||
"ActorTabContent": "<p>Well installed, survivor? Let's not turn around the pot, if you want to stay with us, you'll have to tell us who you are, where you come from, and who you trust. Once you're ready for that, click on the \"Create an actor\" button</p>",
|
||||
"CharacterCreateTitle": "Create a group",
|
||||
"CharacterCreateContent": "<p>This button creates a group file, because that's where we start, in this trou! Your tronche will come later, when you create your character file. As you progress, you might want to add some info on what you see around the camp.</p>",
|
||||
"CompendiumTitle": "Maps",
|
||||
"CompendiumContent": "<p>You will probably need a map of the Iron Lands or a sector of the Forge. You can create your own scene for that, or you can use one of ours. Open one of these compendiums and drag a map into your scene tab (the tab that looks like a folded map).</p>",
|
||||
"OracleToolTitle": "Totem",
|
||||
"OracleToolContent": "<p>No game of Vermine or Starforged would be complete without oracles. This button will open a window with all the oracles of the chosen game. The oracles are also available from the character sheet.</p>",
|
||||
"ToursTitle": "Next steps",
|
||||
"ToursContent": "<p>You're not doing too badly! I'll leave you there, but if you have any questions, you can come find me. If it's about the mechanics, sign up for our group of speech, over there <a href=\"https://discord.gg/FqGHYvXg\">Totem Foundry Discord</a>. Otherwise, you can join the central place over here <a href=\"https://discord.gg/qejqmSxr\">Vermine Discord</a></p><p>Enjoy!</p>"
|
||||
}
|
||||
"ChatMessage": "<h3>Welcome to Vermine 2047!</h3><p>If you're using this system for the first time, our shaman will guide you to your initiation rite</p><hr><p class=\"vermine-credits\"><strong>Vermine 2047</strong> — a game by Julien Blondel<br>© 2023 Studio Agate — TOTEM System — © 2023 Julien Blondel — All rights reserved.<br>Foundry VTT system developed by <a href=\"https://www.uberwald.me\">LeRatierBretonnier</a>, based on an original work by RWanoux.</p>"
|
||||
},
|
||||
"DIFFICULTY_LEVELS": {
|
||||
"obvious": "Obvious",
|
||||
|
||||
+1
-17
@@ -65,23 +65,7 @@
|
||||
"roll_dice": "Jeter les dés"
|
||||
},
|
||||
"TOURS": {
|
||||
"ChatMessage": "<h3>Bienvenue dans Vermine 2047 !</h3><p>Si vous utilisez ce système pour la première fois, notre shaman va vous guider vers votre rite d'initiation</p> <button id=\"vermine-tour-chat-button\"> <i class=\"fas fa-person-hiking\"></i> J'y vais mais j'ai peur </button><hr><p class=\"vermine-credits\"><strong>Vermine 2047</strong> — un jeu de Julien Blondel<br>© 2023 Studio Agate — TOTEM System — © 2023 Julien Blondel — Tous droits réservés.<br>Système Foundry VTT développé par <a href=\"https://www.uberwald.me\">LeRatierBretonnier</a>, sur un travail original de RWanoux.</p>",
|
||||
"Welcome": {
|
||||
"Title": "Bienvenue dans Vermine",
|
||||
"Description": "Aperçu du système Vermine",
|
||||
"WelcomeTitle": "Bienvenue",
|
||||
"WelcomeContent": "<p>Bienvenue dans Vermine, survivantE ! Faire le tour de notre zone d'action te permettre de retrouver tes marques, même si c'est ton premier jour parmi nous.</p><p>En haut de la colonne de droite, tu as tout ce que tu as le droit de faire chez nous : parler, voir les autres tronches de ta commu, gérer ton matos et celui de tes potes, étudier les cartes, lire les journaux des clamsés, aller nous chercher de la bouffe à coups de surin. Entrons dans le vif du sujet.</p>",
|
||||
"ActorTabTitle": "Peupler son univers",
|
||||
"ActorTabContent": "<p>Bien installéE, survivantE ? Tournons pas au tour du pot, si tu veux rester avec nous, va falloir nous dire qui tu es, d'où tu viens, et à qui tu fais confiance. Une fois que t'es prêtE pour ca, clique donc sur le bouton \"Créer un acteur\"</p>",
|
||||
"CharacterCreateTitle": "Créer un groupe",
|
||||
"CharacterCreateContent": "<p>Ce bouton crée une fiche de groupe, parce que c'est par là qu'on commence, dans ce trou ! Ta tronche viendra ensuite, quand tu créeras ta fiche de personnage. Au fur et à mesure que tu progresses, tu voudras peut-être rajouter des infos sur ce que tu vois trainer autour du camp.</p>",
|
||||
"CompendiumTitle": "Cartes",
|
||||
"CompendiumContent": "<p>Vous aurez probablement besoin d'une carte des Terres de Fer ou d'un secteur de la Forge. Vous pouvez créer votre propre scène pour cela, ou vous pouvez utiliser l'une des nôtres. Ouvrez l'un de ces compendiums et faites glisser une carte dans votre zone de scènes (l'onglet qui ressemble à une carte pliée).</p>",
|
||||
"OracleToolTitle": "Totem",
|
||||
"OracleToolContent": "<p>Aucune partie d'Vermine ou Starforged ne serait complète sans oracles. Ce bouton fera apparaître une fenêtre avec tous les oracles du jeu choisi. Les oracles sont également disponibles depuis la fiche de personnage.</p>",
|
||||
"ToursTitle": "Prochaines étapes",
|
||||
"ToursContent": "<p>Tu t'en sors pas si mal ! Moi je vais te laisser là, mais si tu as d'autres questions, tu peux venir me trouver. Si ca concerne la mécanique, inscris-toi dans notre groupe de parole, par là <a href=\"https://discord.gg/FqGHYvXg\">Totem Foundry Discord</a>. Sinon, tu peux rejoindre la place centrale par ici <a href=\"https://discord.gg/qejqmSxr\">Vermine Discord</a></p><p>Enjoy!</p>"
|
||||
}
|
||||
"ChatMessage": "<h3>Bienvenue dans Vermine 2047 !</h3><p>Si vous utilisez ce système pour la première fois, notre shaman va vous guider vers votre rite d'initiation</p><hr><p class=\"vermine-credits\"><strong>Vermine 2047</strong> — un jeu de Julien Blondel<br>© 2023 Studio Agate — TOTEM System — © 2023 Julien Blondel — Tous droits réservés.<br>Système Foundry VTT développé par <a href=\"https://www.uberwald.me\">LeRatierBretonnier</a>, sur un travail original de RWanoux.</p>"
|
||||
},
|
||||
"DIFFICULTY_LEVELS": {
|
||||
"obvious": "Evidente",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import RollDialog from "./dialogs/rollDialog.mjs";
|
||||
import { initUserDice } from "./dice3d.mjs";
|
||||
import { VermineUtils } from "./roll.mjs";
|
||||
import { registerTours } from "./tour.mjs";
|
||||
import { postWelcomeMessage } from "./tour.mjs";
|
||||
|
||||
export const registerHooks = function () {
|
||||
/**
|
||||
@@ -70,8 +70,8 @@ export const registerHooks = function () {
|
||||
// Relays player rerolls to the GM client (Foundry v14 ChatMessage
|
||||
// updates are GM-only).
|
||||
VermineUtils.registerRerollSocket();
|
||||
// Message de bienvenue + tour d'initiation (premier lancement).
|
||||
await registerTours();
|
||||
// Message de bienvenue (crédits), affiché à chaque chargement.
|
||||
await postWelcomeMessage();
|
||||
});
|
||||
|
||||
// changement de la pause
|
||||
|
||||
+8
-151
@@ -1,157 +1,14 @@
|
||||
function compact(array) {
|
||||
var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
||||
while (++index2 < length) {
|
||||
var value2 = array[index2];
|
||||
if (value2) {
|
||||
result[resIndex++] = value2;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
class CreateActorDialog extends FormApplication {
|
||||
constructor() {
|
||||
super({});
|
||||
}
|
||||
async _updateObject() {
|
||||
}
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
title: game.i18n.format("DOCUMENT.Create", {
|
||||
type: game.i18n.localize("DOCUMENT.Actor")
|
||||
}),
|
||||
template: "systems/vermine2047/templates/actor/create.hbs",
|
||||
id: "new-actor-dialog",
|
||||
resizable: false,
|
||||
classes: ["vermine2047", "sheet", "new-actor"],
|
||||
width: 650,
|
||||
height: 200
|
||||
});
|
||||
}
|
||||
getData(_options) {
|
||||
return {
|
||||
// sfenabled: IronswornSettings.starforgedToolsEnabled
|
||||
};
|
||||
}
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
html.find(".vermine__character__create").on("click", async (ev) => {
|
||||
await this._characterCreate.call(this, ev);
|
||||
});
|
||||
html.find(".vermine__shared__create").on("click", async (ev) => {
|
||||
await this._sharedCreate.call(this, ev);
|
||||
});
|
||||
html.find(".vermine__site__create").on("click", async (ev) => {
|
||||
await this._siteCreate.call(this, ev);
|
||||
});
|
||||
html.find(".vermine__foe__create").on("click", async (ev) => {
|
||||
await this._foeCreate.call(this, ev);
|
||||
});
|
||||
}
|
||||
}
|
||||
class VermineTour extends foundry.nue.Tour {
|
||||
/** @override */
|
||||
async _preStep() {
|
||||
var _a2, _b, _c, _d, _e;
|
||||
await super._preStep();
|
||||
if ((_a2 = this.currentStep) == null ? void 0 : _a2.sidebarTab) {
|
||||
await ((_b = ui.sidebar) == null ? void 0 : _b.activateTab(this.currentStep.sidebarTab));
|
||||
}
|
||||
if ((_c = this.currentStep) == null ? void 0 : _c.layer) {
|
||||
const layer = canvas == null ? void 0 : canvas[this.currentStep.layer];
|
||||
if (layer.active && this.currentStep.tool)
|
||||
(_d = ui.controls) == null ? void 0 : _d.initialize({ tool: this.currentStep.tool });
|
||||
else
|
||||
layer.activate({ tool: this.currentStep.tool });
|
||||
}
|
||||
if (((_e = this.currentStep) == null ? void 0 : _e.hook) != null) {
|
||||
await this.currentStep.hook();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class WelcomeTour extends VermineTour {
|
||||
constructor() {
|
||||
super({
|
||||
title: "TOURS.Welcome.Title",
|
||||
description: "TOURS.Welcome.Description",
|
||||
canBeResumed: false,
|
||||
display: true,
|
||||
steps: []
|
||||
});
|
||||
}
|
||||
get steps() {
|
||||
var _a2;
|
||||
return compact([
|
||||
{
|
||||
id: "welcome",
|
||||
title: "TOURS.Welcome.WelcomeTitle",
|
||||
content: "TOURS.Welcome.WelcomeContent"
|
||||
},
|
||||
{
|
||||
id: "character-tab",
|
||||
title: "TOURS.Welcome.ActorTabTitle",
|
||||
content: "TOURS.Welcome.ActorTabContent",
|
||||
sidebarTab: "actors",
|
||||
selector: "#actors .create-document"
|
||||
},
|
||||
{
|
||||
id: "character-create",
|
||||
title: "TOURS.Welcome.CharacterCreateTitle",
|
||||
content: "TOURS.Welcome.CharacterCreateContent",
|
||||
hook: async () => {
|
||||
this.createActorDialog = new CreateActorDialog();
|
||||
await this.createActorDialog.render(true);
|
||||
await new Promise((r) => setTimeout(r, 100));
|
||||
},
|
||||
selector: "#new-actor-dialog #new-group"
|
||||
},
|
||||
/*{
|
||||
id: "compendia",
|
||||
title: "TOURS.Welcome.CompendiumTitle",
|
||||
content: "TOURS.Welcome.CompendiumContent",
|
||||
hook: async () => {
|
||||
var _a3;
|
||||
return await ((_a3 = this.createActorDialog) == null ? void 0 : _a3.close());
|
||||
},
|
||||
sidebarTab: "compendium",
|
||||
selector: 'li[data-pack="vermine2047.verminescenes"]'
|
||||
},*/
|
||||
/*((_a2 = game.user) == null ? void 0 : _a2.viewedScene) && {
|
||||
id: "oracletool",
|
||||
title: "TOURS.Welcome.OracleToolTitle",
|
||||
content: "TOURS.Welcome.OracleToolContent",
|
||||
layer: "tokens",
|
||||
selector: '[data-tool="Oracles"]'
|
||||
},*/
|
||||
{
|
||||
id: "tours",
|
||||
title: "TOURS.Welcome.ToursTitle",
|
||||
content: "TOURS.Welcome.ToursContent",
|
||||
hook: async () => {
|
||||
var _a3;
|
||||
return await ((_a3 = this.createActorDialog) == null ? void 0 : _a3.close());
|
||||
},
|
||||
sidebarTab: "settings",
|
||||
selector: 'button[data-action="tours"]'
|
||||
}
|
||||
]);
|
||||
}
|
||||
}
|
||||
export async function registerTours() {
|
||||
game.tours.register("vermine2047", "welcome", new WelcomeTour());
|
||||
document.addEventListener("click", (el) => {
|
||||
if (el.target.closest("#chat-log #vermine-tour-chat-button")) {
|
||||
const tour = game.tours.get("vermine2047.welcome");
|
||||
tour?.start();
|
||||
}
|
||||
});
|
||||
// Message de bienvenue (crédits) posté à chaque chargement du monde.
|
||||
// Un seul exemplaire par refresh : il est posté par le MJ actif uniquement.
|
||||
/**
|
||||
* Message de bienvenue (crédits du système et du jeu) posté dans le chat
|
||||
* à chaque chargement du monde. Un seul exemplaire par refresh : il est
|
||||
* posté par le MJ actif uniquement.
|
||||
*/
|
||||
export async function postWelcomeMessage() {
|
||||
if (!game.user?.isActiveGM) return;
|
||||
const gms = ChatMessage.getWhisperRecipients("GM");
|
||||
ChatMessage.create({
|
||||
await ChatMessage.create({
|
||||
whisper: gms,
|
||||
speaker: { alias: game.i18n.localize("VERMINE.name") },
|
||||
content: game.i18n.localize("TOURS.ChatMessage")
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user