Added a real app fo helper/info button (dialog before)
This commit is contained in:
@@ -40,14 +40,14 @@
|
||||
"title": "Need help?",
|
||||
"content": "Follow the guide :",
|
||||
"edge": "Go to the Edge-Studio website",
|
||||
"drive": "Buy a PDF of the game...",
|
||||
"drivethrurpg": "Buy a PDF of the game...",
|
||||
"discord": "FoundryVTT Official Discord",
|
||||
"src": "systems/l5r5e/assets/l5r-logo.webp",
|
||||
"alt": "Online Help",
|
||||
"edge-info": "your browser will open the EDGE STUDIO website",
|
||||
"edge-link": "https://edge-studio.net/",
|
||||
"drive-info": "your browser will open the DriveThruRpg site of Edge Studio",
|
||||
"drive-link": "https://www.drivethrurpg.com/browse/pub/17946/EDGE-Studio",
|
||||
"drivethrurpg-info": "your browser will open the DriveThruRpg site of Edge Studio",
|
||||
"drivethrurpg-link": "https://www.drivethrurpg.com/browse/pub/17946/EDGE-Studio",
|
||||
"discord-info": "Your browser will open on the official Foundry discord",
|
||||
"discord-link": "https://discordapp.com/invite/DDBZUDf"
|
||||
},
|
||||
|
||||
@@ -40,14 +40,14 @@
|
||||
"títle": "¿Necesitas ayuda?",
|
||||
"content": "Sigue la guía :",
|
||||
"edge": "Ir a la página web de Edge-Studio",
|
||||
"drive": "¿Comprar un PDF del juego?",
|
||||
"drivethrurpg": "¿Comprar un PDF del juego?",
|
||||
"discord": "Discordia oficial de FoundryVTT",
|
||||
"src": "systems/l5r5e/assets/l5r-logo.webp",
|
||||
"alt": "Ayuda en línea",
|
||||
"edge-info": "tu navegador abrirá la página web de EDGE STUDIO",
|
||||
"edge-info": "Tu navegador abrirá la página web de EDGE STUDIO",
|
||||
"edge-link": "https://edge-studio.net/",
|
||||
"drive-info": "tu navegador abrirá el sitio DriveThruRpg de Edge Studio",
|
||||
"drive-link": "https://www.drivethrurpg.com/browse/pub/17946/EDGE-Studio",
|
||||
"drivethrurpg-info": "tu navegador abrirá el sitio DriveThruRpg de Edge Studio",
|
||||
"drivethrurpg-link": "https://www.drivethrurpg.com/browse/pub/17946/EDGE-Studio",
|
||||
"discord-info": "Su navegador se abrirá a la discordia oficial de la Fundición",
|
||||
"discord-link": "https://discordapp.com/invite/DDBZUDf"
|
||||
},
|
||||
|
||||
@@ -40,14 +40,14 @@
|
||||
"title": "Besoin d'aide ?",
|
||||
"content": "Suivez le guide :",
|
||||
"edge": "Accéder au site de Edge Studio.",
|
||||
"drive": "Acheter un PDF du jeu ?",
|
||||
"discord": "rejoignez le Discord Francophone",
|
||||
"drivethrurpg": "Acheter un PDF du jeu ?",
|
||||
"discord": "Rejoignez le Discord Francophone",
|
||||
"src": "systems/l5r5e/assets/l5r-logo.webp",
|
||||
"alt": "Aide en Ligne",
|
||||
"edge-info": "Votre navigateur va ouvrir le site de Edge Studio.",
|
||||
"edge-link": "https://edge-studio.net/",
|
||||
"drive-info": "Votre navigateur va ouvrir le site DriveThruRpg de Edge Studio.",
|
||||
"drive-link": "https://www.drivethrurpg.com/browse/pub/17946/EDGE-Studio",
|
||||
"drivethrurpg-info": "Votre navigateur va ouvrir le site DriveThruRpg de Edge Studio.",
|
||||
"drivethrurpg-link": "https://www.drivethrurpg.com/browse/pub/17946/EDGE-Studio",
|
||||
"discord-info": "Votre navigateur va ouvrir le discord francophone de foundry.",
|
||||
"discord-link": "https://discord.gg/pPSDNJk"
|
||||
},
|
||||
|
||||
66
system/scripts/help/help-dialog.js
Normal file
66
system/scripts/help/help-dialog.js
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* L5R Help dialog
|
||||
* @extends {FormApplication}
|
||||
*/
|
||||
export class HelpDialog extends FormApplication {
|
||||
/**
|
||||
* Payload Object
|
||||
*/
|
||||
object = {};
|
||||
|
||||
/**
|
||||
* Assign the default options
|
||||
* @override
|
||||
*/
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
id: "l5r5e-help-dialog",
|
||||
classes: ["l5r5e", "help-dialog"],
|
||||
template: CONFIG.l5r5e.paths.templates + "help/help-dialog.html",
|
||||
title: game.i18n.localize("l5r5e.logo.title"),
|
||||
width: 400,
|
||||
height: 200,
|
||||
closeOnSubmit: false,
|
||||
submitOnClose: false,
|
||||
submitOnChange: false,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct and return the data object used to render the HTML template for this form application.
|
||||
* @param options
|
||||
* @return {Object}
|
||||
*/
|
||||
getData(options = null) {
|
||||
return {
|
||||
...super.getData(options),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen to html elements
|
||||
* @override
|
||||
*/
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
// Buttons
|
||||
["edge", "drivethrurpg", "discord"].forEach((name) => {
|
||||
html.find(`button[name='${name}']`).on("click", (event) => {
|
||||
ui.notifications.info(game.i18n.localize(`l5r5e.logo.${name}-info`));
|
||||
window.open(game.i18n.localize(`l5r5e.logo.${name}-link`), "_blank");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called upon form submission after form data is validated
|
||||
* @param event {Event} The initial triggering submission event
|
||||
* @param formData {Object} The object of validated form data with which to update the object
|
||||
* @returns {Promise} A Promise which resolves once the update operation has completed
|
||||
* @override
|
||||
*/
|
||||
_updateObject(event, formData) {
|
||||
// Nothing, but needed to be override
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import { L5R5E } from "./config.js";
|
||||
import { HelpersL5r5e } from "./helpers.js";
|
||||
import { RegisterSettings } from "./settings.js";
|
||||
import { PreloadTemplates } from "./preloadTemplates.js";
|
||||
import { HelpDialog } from "./help/help-dialog.js";
|
||||
// Actors
|
||||
import { ActorL5r5e } from "./actor.js";
|
||||
import { CharacterSheetL5r5e } from "./actors/character-sheet.js";
|
||||
@@ -63,6 +64,7 @@ Hooks.once("init", async function () {
|
||||
HelpersL5r5e,
|
||||
RollL5r5e,
|
||||
DicePickerDialog,
|
||||
HelpDialog,
|
||||
};
|
||||
|
||||
// Register custom system settings
|
||||
@@ -182,16 +184,16 @@ Hooks.once("init", async function () {
|
||||
// });
|
||||
|
||||
/* ------------------------------------ */
|
||||
/* Actor Dialog */
|
||||
/* ------------------------------------ */
|
||||
|
||||
/* ------------------------------------ */
|
||||
/* When ready */
|
||||
/* Do anything once the system is ready */
|
||||
/* ------------------------------------ */
|
||||
Hooks.once("ready", function () {
|
||||
// Do anything once the system is ready
|
||||
// Add title on button dice icon
|
||||
$(".chat-control-icon")[0].title = game.i18n.localize("l5r5e.chatdices.dicepicker");
|
||||
|
||||
// Open Help dialog on clic on logo
|
||||
$("#logo")
|
||||
.on("click", () => new game.l5r5e.HelpDialog().render(true))
|
||||
.prop("title", game.i18n.localize("l5r5e.logo.alt"));
|
||||
});
|
||||
|
||||
/* ------------------------------------ */
|
||||
@@ -259,53 +261,3 @@ Hooks.once("diceSoNiceReady", (dice3d) => {
|
||||
"d12"
|
||||
);
|
||||
});
|
||||
|
||||
// Logo & Menu options
|
||||
Hooks.once("ready", async function () {
|
||||
// -- Function Open Edge-Studio Website
|
||||
function openEdge() {
|
||||
ui.notifications.info(game.i18n.localize("l5r5e.logo.edge-info"));
|
||||
var windowObjectReference = window.open(game.i18n.localize("l5r5e.logo.edge-link"), "_blank");
|
||||
}
|
||||
// -- Open Function Edge's DriveThruRpg
|
||||
function openDrive() {
|
||||
ui.notifications.info(game.i18n.localize("l5r5e.logo.drive-info"));
|
||||
var windowObjectReference = window.open(game.i18n.localize("l5r5e.logo.drive-link"), "_blank");
|
||||
}
|
||||
// -- Open Function Discord Link
|
||||
function openDiscord() {
|
||||
ui.notifications.info(game.i18n.localize("l5r5e.logo.discord-info"));
|
||||
var windowObjectReference = window.open(game.i18n.localize("l5r5e.logo.discord-link"), "_blank");
|
||||
}
|
||||
|
||||
//-- Logo Menu Link
|
||||
let liensExt = new Dialog({
|
||||
title: game.i18n.localize("l5r5e.logo.title"),
|
||||
content: "<p>" + game.i18n.localize("l5r5e.logo.content") + "</p>",
|
||||
buttons: {
|
||||
one: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: game.i18n.localize("l5r5e.logo.edge"),
|
||||
callback: () => openEdge(),
|
||||
},
|
||||
two: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: game.i18n.localize("l5r5e.logo.drive"),
|
||||
callback: () => openDrive(),
|
||||
},
|
||||
three: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: game.i18n.localize("l5r5e.logo.discord"),
|
||||
callback: () => openDiscord(),
|
||||
},
|
||||
},
|
||||
});
|
||||
//-- Logo
|
||||
var logo = document.getElementById("logo");
|
||||
|
||||
//-- Open menu on Logo click
|
||||
logo.setAttribute("title", game.i18n.localize("l5r5e.logo.alt"));
|
||||
logo.addEventListener("click", function () {
|
||||
liensExt.render(true);
|
||||
});
|
||||
});
|
||||
|
||||
10
system/templates/help/help-dialog.html
Normal file
10
system/templates/help/help-dialog.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<form class="l5r5e help-dialog" autocomplete="off">
|
||||
<p>{{localize 'l5r5e.logo.content'}}</p>
|
||||
|
||||
<button name="edge"><i class="fas fa-check"></i> {{localize 'l5r5e.logo.edge'}}</button>
|
||||
|
||||
<button name="drivethrurpg"><i class="fas fa-check"></i> {{localize 'l5r5e.logo.drivethrurpg'}}</button>
|
||||
|
||||
<button name="discord"><i class="fas fa-check"></i> {{localize 'l5r5e.logo.discord'}}</button>
|
||||
|
||||
</form>
|
||||
Reference in New Issue
Block a user