Skip to content

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Feb 25, 2024
1 parent e8af06e commit 1d39760
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ jobs:
scripts/ \
styles/ \
packs/ \
language/ \
lang/
languages/ \
resources/ \
# Don't forget to add a backslash at the end of the line for any
# additional files or directories!
Expand Down
20 changes: 19 additions & 1 deletion languages/en.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
{
"MODULE.hello": "hello"
"I18N.LANGUAGE": "English",
"pf2e-rules-lawyer": {
"module-settings": {
"enabled": {
"name": "Enable Module",
"hint": "Enables functionality of module"
},
"position": {
"name": "Enable Module",
"hint": "Enables functionality of module",
"choices": {
"top-left": "Top Left",
"top-right": "Top Right",
"bot-left": "Bottom Left",
"bot-right": "Bottom Right"
}
}
}
}
}
68 changes: 39 additions & 29 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,51 @@
{
"id": "module",
"title": "New Module",
"description": "",
"id": "pf2e-rules-lawyer",
"title": "PF2e Rules Lawyer",
"description": "A FAN module inspired by the rules Lawyer that shows off his iconic +1s Matter",
"version": "#{VERSION}#",
"library": "false",
"manifestPlusVersion": "1.2.0",
"compatibility": {
"minimum": 10,
"verified": 10,
"maximum": 11
"minimum": "10",
"verified": "11",
"maximum": "11"
},
"authors": [
{
"name": "The League of Extraordinary FVTT Developers",
"url": "https://github.com/League-of-Foundry-Developers",
"discord": "discordID#0001"
"name": "chasarooniZ"
}
],
"relationships": {
"systems": [],
"requires": []
"systems": [
{
"id": "pf2e",
"type": "system",
"compatibility": {
"minimum": "5.2.1",
"verified": "5.3.0"
}
}
],
"requires": [
{
"id": "sequencer",
"type": "module",
"compatibility": {
"minimum": "3.0.0",
"verified": "3.1.2"
}
},
{
"id": "pf2e-modifiers-matter",
"type": "module",
"compatibility": {
"minimum": "1.8.0",
"verified": "1.8.8"
}
}
]
},
"esmodules": [
"scripts/module.js"
],
"scripts": [
"scripts/lib/lib.js"
],
"styles": [
"styles/module.css"
"scripts/module.js",
"scripts/settings.js"
],
"languages": [
{
Expand All @@ -40,12 +57,5 @@
"url": "#{URL}#",
"manifest": "#{MANIFEST}#",
"download": "#{DOWNLOAD}#",
"license": "LICENSE",
"readme": "README.md",
"media": [
{
"type": "icon",
"url": "https://avatars2.githubusercontent.com/u/71292812?s=400&u=ccdb4eeb7abf551ca8f314e5a9bfd0479a4d3d41&v=4"
}
]
}
"readme": "https://github.com/chasarooniZ/pf2e-rules-lawyer/blob/master/README.md"
}
Binary file added resources/every-plus-one-extra.webm
Binary file not shown.
Empty file removed scripts/lib/lib.js
Empty file.
40 changes: 36 additions & 4 deletions scripts/module.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
Hooks.once('init', async function() {

Hooks.once('ready', function () {
Hooks.on('modifiersMatter', (data) => {
//console.log({ modifiers: data })
if (!game.settings.get("pf2e-rules-lawyer", "enabled")) return;
const sigMods = ["ESSENTIAL", "HELPFUL", "HARMFUL", "DETRIMENTAL"];
if (data?.significantModifiers.some(mod => sigMods.includes(mod.significance))) {

This comment has been minimized.

Copy link
@shemetz

shemetz Feb 27, 2024

This code is now unnecessary if you upgrade your modifiers matter dependency to minimum v1.9.1+; I had a bug that made the hook call include "NONE"-significance modifiers in this list, but no longer.

You can just remove this line and the line before it (and the ending })

const chatWidth = chat.offsetWidth;
const position = "bot-right";
const anchor = getAnchor(position);
const file = 'modules/pf2e-rules-lawyer/resources/every-plus-one-extra.webm';
const xOffset = 40;
const yOffset = 0
const duration = 5000;
new Sequence()
.effect()
.file(file)
.screenSpace()
.screenSpaceAnchor(anchor)
.screenSpacePosition({ x: chatWidth + xOffset, y: yOffset })
.duration(duration)
}
})
});

Hooks.once('ready', async function() {

});
function getAnchor(position) {
switch (position) {
case 'bot-left':
return { x: 0, y: 1 }
case 'bot-right':
return { x: 1, y: 1 }
case 'top-left':
return { x: 0, y: 0 }
case 'top-right':
return { x: 1, y: 0 }
default:
return { x: 0.5, y: 1 }
}
}
27 changes: 27 additions & 0 deletions scripts/settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Hooks.on("init", () => {
const debouncedReload = foundry.utils.debounce(() => window.location.reload(), 100);

game.settings.register("pf2e-rules-lawyer", "enabled", {
name: game.i18n.localize("pf2e-rules-lawyer.module-settings.enabled.name"),
hint: game.i18n.localize("pf2e-rules-lawyer.module-settings.enabled.hint"),
scope: "world",
config: true,
default: true,
type: Boolean,
});

// game.settings.register("pf2e-rules-lawyer", "position", {
// name: game.i18n.localize("pf2e-rules-lawyer.module-settings.position.name"),
// hint: game.i18n.localize("pf2e-rules-lawyer.module-settings.position.hint"),
// scope: "world",
// config: true,
// default: "roll",
// type: String,
// choices: {
// ["top-left"]: game.i18n.localize("pf2e-rules-lawyer.module-settings.position.choices.top-left"),
// ["top-right"]: game.i18n.localize("pf2e-rules-lawyer.module-settings.position.choices.top-right"),
// ["bot-left"]: game.i18n.localize("pf2e-rules-lawyer.module-settings.position.choices.bot-left"),
// ["bot-right"]: game.i18n.localize("pf2e-rules-lawyer.module-settings.position.choices.bot-right"),
// }
// });
})
Empty file removed styles/module.css
Empty file.

0 comments on commit 1d39760

Please sign in to comment.