This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from death-save:v1.2.0
v1.2.0
- Loading branch information
Showing
13 changed files
with
528 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# From https://github.com/League-of-Foundry-Developers/FoundryVTT-Module-Template/blob/master/.github/workflows/main.yml | ||
name: Release Creation | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
#Substitute the Manifest and Download URLs in the module.json | ||
- name: Substitute Manifest and Download Links For Versioned Ones | ||
id: sub_manifest_link_version | ||
uses: microsoft/variable-substitution@v1 | ||
with: | ||
files: 'module.json' | ||
env: | ||
version: ${{github.event.release.tag_name}} | ||
manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json | ||
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip | ||
|
||
# create a zip file with all files required by the module to add to the release | ||
- run: zip -r ./module.zip . [email protected]/zip-exclude.lst | ||
|
||
# Create a release for this specific version | ||
- name: Update Release with Files | ||
id: create_version_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true # set this to false if you want to prevent updating existing releases | ||
name: ${{ github.event.release.name }} | ||
draft: false | ||
prerelease: false | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
artifacts: './module.json, ./module.zip' | ||
tag: ${{ github.event.release.tag_name }} | ||
body: ${{ github.event.release.body }} | ||
|
||
# Update the 'latest' release | ||
- name: Create Release | ||
id: create_latest_release | ||
uses: ncipollo/release-action@v1 | ||
if: endsWith(github.ref, 'master') | ||
with: | ||
allowUpdates: true | ||
name: Latest | ||
draft: false | ||
prerelease: false | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
artifacts: './module.json,./module.zip' | ||
tag: latest | ||
body: ${{ github.event.release.body }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
./dist/* | ||
./out/* | ||
./jsdoc/* | ||
./node_modules/* | ||
*.git* | ||
*.vscode* | ||
gulpfile.js | ||
package.json | ||
package-lock.json | ||
jsdoc-conf.json | ||
tsconfig.json | ||
foundry.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,3 +114,6 @@ dist | |
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
# Foundry | ||
foundry.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "chrome", | ||
"request": "launch", | ||
"name": "Launch Chrome", | ||
"url": "http://192.168.1.69:59999", | ||
"pathMapping": { | ||
"/modules/${workspaceFolderBasename}": "${workspaceFolder}" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"I18N.LANGUAGE": "Español", | ||
"I18N.MAINTAINERS": "@Viriato139ac#0342", | ||
|
||
"SETTINGS.AboutAppN": "Acerca de Pin Cushion", | ||
"SETTINGS.AboutAppH": "Muestra información adicional acerca de Pin Cushion", | ||
"SETTINGS.AllowPlayerNotesN": "Permitir notas del jugador", | ||
"SETTINGS.AllowPlayerNotesH": "Permite que los jugadores creen chinchetas en el mapa", | ||
"SETTINGS.ShowJournalPreviewN": "Mostrar vista previa del diario", | ||
"SETTINGS.ShowJournalPreviewH": "Cuando se pasa el ratón por encima de una chincheta en el mapa, se muestra una vista previa del diario", | ||
"SETTINGS.PreviewTypeN": "Tipo de vista previa del diario", | ||
"SETTINGS.PreviewTypeH": "El tipo de vista previa del diario que se mostrará (HTML o texto)", | ||
"SETTINGS.PreviewMaxLengthN": "Longitud máxima de la vista previa", | ||
"SETTINGS.PreviewMaxLengthH": "**SOLO VISTA PREVIA DE TEXTO** ¿Cuantos caracteres de texto se deben mostrar en la vista previa de texto?", | ||
"SETTINGS.PreviewDelayN": "Retraso de la vista previa", | ||
"SETTINGS.PreviewDelayH": "Cuanto tiempo (en milisegundos) ha de pasar hasta que se muestre la vista previa" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
// Copyright © 2021 fvtt-lib-wrapper Rui Pinheiro | ||
|
||
|
||
'use strict'; | ||
|
||
// A shim for the libWrapper library | ||
export let libWrapper = undefined; | ||
|
||
Hooks.once('init', () => { | ||
// Check if the real module is already loaded - if so, use it | ||
if(globalThis.libWrapper && !(globalThis.libWrapper.is_fallback ?? true)) { | ||
libWrapper = globalThis.libWrapper; | ||
return; | ||
} | ||
|
||
// Fallback implementation | ||
libWrapper = class { | ||
static get is_fallback() { return true }; | ||
|
||
static register(module, target, fn, type="MIXED") { | ||
const is_setter = target.endsWith('#set'); | ||
target = !is_setter ? target : target.slice(0, -4); | ||
const split = target.split('.'); | ||
const fn_name = split.pop(); | ||
const root_nm = split.splice(0,1)[0]; | ||
const _eval = eval; // The browser doesn't expose all global variables (e.g. 'Game') inside globalThis, but it does to an eval. We copy it to a variable to have it run in global scope. | ||
const obj = split.reduce((x,y)=>x[y], globalThis[root_nm] ?? _eval(root_nm)); | ||
|
||
let iObj = obj; | ||
let descriptor = null; | ||
while(iObj) { | ||
descriptor = Object.getOwnPropertyDescriptor(iObj, fn_name); | ||
if(descriptor) break; | ||
iObj = Object.getPrototypeOf(iObj); | ||
} | ||
if(!descriptor) throw `libWrapper Shim: '${target}' does not exist or could not be found.`; | ||
|
||
let original = null; | ||
const wrapper = (type == 'OVERRIDE') ? function() { return fn.call(this, ...arguments); } : function() { return fn.call(this, original.bind(this), ...arguments); } | ||
|
||
if(!is_setter) { | ||
if(descriptor.value) { | ||
original = descriptor.value; | ||
descriptor.value = wrapper; | ||
} | ||
else { | ||
original = descriptor.get; | ||
descriptor.get = wrapper; | ||
} | ||
} | ||
else { | ||
if(!descriptor.set) throw `libWrapper Shim: '${target}' does not have a setter`; | ||
original = descriptor.set; | ||
descriptor.set = wrapper; | ||
} | ||
|
||
descriptor.configurable = true; | ||
Object.defineProperty(obj, fn_name, descriptor); | ||
} | ||
} | ||
|
||
//************** USER CUSTOMIZABLE: | ||
// Whether to warn GM that the fallback is being used | ||
const WARN_FALLBACK = true; | ||
|
||
// Set up the ready hook that shows the "libWrapper not installed" warning dialog | ||
if(WARN_FALLBACK) { | ||
//************** USER CUSTOMIZABLE: | ||
// Module ID - by default attempts to auto-detect, but you might want to hardcode your module ID here to avoid potential auto-detect issues | ||
// const MODULE_ID = ((import.meta?.url ?? Error().stack)?.match(/(?<=\/)modules\/.+(?=\/)/i)??[])[0]?.split('/')?.find(n => n && game.modules.has(n)); | ||
const MODULE_ID = "pin-cushion"; | ||
if(!MODULE_ID) { | ||
console.error("libWrapper Shim: Could not auto-detect module ID. The libWrapper fallback warning dialog will be disabled."); | ||
return; | ||
} | ||
|
||
Hooks.once('ready', () => { | ||
// Module title | ||
const MODULE_TITLE = game.modules.get(MODULE_ID).data.title; | ||
|
||
//************** USER CUSTOMIZABLE: | ||
// Title and message for the dialog shown when the real libWrapper is not installed. | ||
const FALLBACK_MESSAGE_TITLE = MODULE_TITLE; | ||
const FALLBACK_MESSAGE = ` | ||
<p><b>'${MODULE_TITLE}' depends on the 'libWrapper' module, which is not present.</b></p> | ||
<p>A fallback implementation will be used, which increases the chance of compatibility issues with other modules.</p> | ||
<small><p>'libWrapper' is a library which provides module developers with a simple way to modify core Foundry VTT code, while reducing the likelihood of conflict with other modules.</p> | ||
<p>You can install it from the "Add-on Modules" tab in the <a href="javascript:game.shutDown()">Foundry VTT Setup</a>, from the <a href="https://foundryvtt.com/packages/lib-wrapper">Foundry VTT package repository</a>, or from <a href="https://github.com/ruipin/fvtt-lib-wrapper/">libWrapper's Github page</a>.</p></small> | ||
`; | ||
|
||
// Settings key used for the "Don't remind me again" setting | ||
const DONT_REMIND_AGAIN_KEY = "libwrapper-dont-remind-again"; | ||
|
||
// Dialog code | ||
console.warn(`${MODULE_TITLE}: libWrapper not present, using fallback implementation.`); | ||
game.settings.register(MODULE_ID, DONT_REMIND_AGAIN_KEY, { name: '', default: false, type: Boolean, scope: 'world', config: false }); | ||
if(game.user.isGM && !game.settings.get(MODULE_ID, DONT_REMIND_AGAIN_KEY)) { | ||
new Dialog({ | ||
title: FALLBACK_MESSAGE_TITLE, | ||
content: FALLBACK_MESSAGE, buttons: { | ||
ok: { icon: '<i class="fas fa-check"></i>', label: 'Understood' }, | ||
dont_remind: { icon: '<i class="fas fa-times"></i>', label: "Don't remind me again", callback: () => game.settings.set(MODULE_ID, DONT_REMIND_AGAIN_KEY, true) } | ||
} | ||
}).render(true); | ||
} | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,62 @@ | ||
{ | ||
"name": "pin-cushion", | ||
"title": "Pin Cushion", | ||
"description": "Adds additional map pin functionality", | ||
"version": "1.1.4", | ||
"description": "Adds additional map pin (Journal Note/Scene Note) functionality", | ||
"version": "1.2.0", | ||
"minimumCoreVersion": "0.7.5", | ||
"compatibleCoreVersion": "0.7.5", | ||
"compatibleCoreVersion": "0.7.9", | ||
"author": "Evan Clarke [errational#2007]", | ||
"authors": [ | ||
{ | ||
"name": "Evan Clarke", | ||
"url": "https://patreon.com/deathsave", | ||
"discord": "errational#2007", | ||
"twitter": "@death_save_dev", | ||
"reddit": "u/etherboy12" | ||
} | ||
], | ||
"url": "https://github.com/death-save/pin-cushion", | ||
"manifest": "https://raw.githubusercontent.com/death-save/pin-cushion/master/module.json", | ||
"download": "https://github.com/death-save/pin-cushion/archive/master.zip", | ||
"scripts": [ | ||
"./pin-cushion.js", | ||
"./about.js" | ||
"manifest": "https://github.com/death-save/pin-cushion/releases/latest/download/module.json", | ||
"download": "https://github.com/death-save/pin-cushion/release/latest/download/module.zip", | ||
"esmodules": [ | ||
"./pin-cushion.js", | ||
"./about.js" | ||
], | ||
"socket": true, | ||
"styles": [ | ||
"./pin-cushion.css" | ||
], | ||
"styles": ["./pin-cushion.css"], | ||
"languages": [ | ||
{ | ||
"lang": "en", | ||
"name": "English", | ||
"path": "./lang/en.json" | ||
}, | ||
{ | ||
"lang": "pt-BR", | ||
"name": "Português (Brasil)", | ||
"path": "./lang/pt-BR.json" | ||
} | ||
] | ||
} | ||
{ | ||
"lang": "en", | ||
"name": "English", | ||
"path": "./lang/en.json" | ||
}, | ||
{ | ||
"lang": "pt-BR", | ||
"name": "Português (Brasil)", | ||
"path": "./lang/pt-BR.json" | ||
}, | ||
{ | ||
"lang": "es", | ||
"name": "Español", | ||
"path": "./lang/es.json" | ||
} | ||
], | ||
"media": [ | ||
{ | ||
"type": "screenshot", | ||
"url": "https://github.com/death-save/media/raw/master/pin-cushion/create_pin.png" | ||
}, | ||
{ | ||
"type": "screenshot", | ||
"url": "https://github.com/death-save/media/raw/master/pin-cushion/note-config.png" | ||
}, | ||
{ | ||
"type": "screenshot", | ||
"url": "https://github.com/death-save/media/raw/master/pin-cushion/journal-preview.png" | ||
} | ||
], | ||
"bugs": "https://github.com/death-save/pin-cushion/issues", | ||
"allowBugReporter": true | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.