Skip to content

Commit

Permalink
version 2.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
p4535992 committed Jun 8, 2024
1 parent 35f4c71 commit 2ccaa4a
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 107 deletions.
95 changes: 13 additions & 82 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,35 @@
name: Release Creation
name: Create Module Files For GitHub Release

on:
release:
types: [ published ]
types: [published]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v3

# Substitute the Manifest and Download URLs in the module.json
- name: Extract Version From Tag
id: get_version
uses: battila7/get-version-action@v2

- name: Substitute Manifest and Download Links For Versioned Ones
id: sub_release_manifest_version
- name: Modify Module Manifest With Release-Specific Values
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'src/module.json'
env:
version: ${{github.event.release.tag_name}}
version: ${{steps.get_version.outputs.version-without-v}}
url: https://github.com/${{github.repository}}
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

# for a FULL RELEASE
# - name: Substitute Manifest and Download Links For Versioned Ones
# if: "!github.event.release.prerelease"
# id: sub_release_manifest_version
# uses: microsoft/variable-substitution@v1
# with:
# files: 'module.json'
# env:
# version: ${{github.event.release.tag_name}}
# url: https://github.com/${{github.repository}}
# 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

# Substitute the Manifest and Download URLs in the module.json
# for a PRE RELEASE. Manifest pointing to live module.json on branch,
# which is updated after tag.
# - name: Substitute Manifest and Download Links For Versioned Ones
# if: "github.event.release.prerelease"
# id: sub_prerelease_manifest_version
# uses: microsoft/variable-substitution@v1
# with:
# files: 'module.json'
# env:
# version: ${{github.event.release.tag_name}}
# url: https://github.com/${{github.repository}}
# manifest: https://raw.githubusercontent.com/${{github.repository}}/next/module.json
# download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip

# Install packages.
- run: npm install

Expand All @@ -79,55 +56,9 @@ jobs:
with:
allowUpdates: true # Set this to false if you want to prevent updating existing releases
name: ${{ github.event.release.name }}
draft: false
prerelease: false
draft: ${{ github.event.release.unpublished }}
prerelease: ${{ github.event.release.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './src/module.json, ./module.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}

# Create a release for this specific version
# - name: Update Release with Files
# if: "!github.event.release.prerelease"
# 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 }}

# OR create a pre-release for this specific version
# - name: Update Release with Files
# if: "github.event.release.prerelease"
# id: create_version_prerelease
# 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: true
# token: ${{ secrets.GITHUB_TOKEN }}
# artifacts: './module.json, ./module.zip'
# tag: ${{ github.event.release.tag_name }}
# body: ${{ github.event.release.body }}

#update next branch
# - name: Prepare repository
# if: "github.event.release.prerelease"
# run: |
# git config --global user.name '${{github.actor}}'
# git config --global user.email '${{github.actor}}@users.noreply.github.com'
# git add module.json
# git stash
# git clean -f
# git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY"
# git fetch origin "next"
# git switch -c "next" "origin/next"
# git checkout stash module.json
# git commit -m "${{github.event.release.tag_name}} manifest"
# git push -f
21 changes: 1 addition & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,6 @@ To interact with a door, journal, ecc., the player need to have a token selected

![](/wiki/images/flag_stairway.png)

### Reset Doors and Fog feature Feature (deprecated and removed on v11)

~~Adds a button to the Walls Menu to Shut all doors in the current scene. Also adds a menu to the context dropdown for the Scene Navigation and Scene Directory menus to shut all doors and delete fog in the selected scene to prepare it for a fresh visit from characters. I find it useful after QAing a new map for holes in walls/doors and checking lighting, etc.~~

~~Changes the functionality from closing ALL doors to closing ONLY opened doors. Doors that are currently locked remain locked, and are not closed.~~

~~### [Experimental] Integration of [Combat Range Overlay](https://github.com/Nazrax/fvtt-combat-range-overlay)~~

~~[Here the documentation](./wiki/docs/combat-range-overlay.md)~~

# Build

## Install all packages
Expand Down Expand Up @@ -382,13 +372,4 @@ Thanks to anyone who helps me with this code! I appreciate the user community's
- [Rideable](https://github.com/Saibot393/Rideable) TY TO [Saibot393](https://github.com/Saibot393/)

A very big thanks to [manuelVo](https://github.com/manuelVo), because i was to stupid to understand thing like measurement of Foundry by myself.
A very big thanks to [Saibot393](https://github.com/Saibot393/), and his GeometricUtils class for token distance calculation.


## Acknowledgements

Bootstrapped with League of Extraordinary FoundryVTT Developers [foundry-vtt-types](https://github.com/League-of-Foundry-Developers/foundry-vtt-types).

Mad props to the 'League of Extraordinary FoundryVTT Developers' community which helped me figure out a lot.


A very big thanks to [Saibot393](https://github.com/Saibot393/), and his GeometricUtils class for token distance calculation.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# CHANGELOG
### 2.4.2

- Add v12 manifest compatibility

### 2.4.1

Expand Down
3 changes: 3 additions & 0 deletions src/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@
"arms-reach.settingNameMaximumTemplateMeasurementInteraction": "Maximum template interaction distance measurement (ft, mt, ...),",
"arms-reach.settingHintMaximumTemplateMeasurementInteraction": "Is the distance calculation used only for the template",

"arms-reach.settingNameEnableAdditionalReachSettingOnPlaceableConfigSheet": "Enable additional reach setting on placeable config sheet",
"arms-reach.settingHintEnableAdditionalReachSettingOnPlaceableConfigSheet": "If enable it will let you set a specific value for the specific placeable object",

"arms-reach.setting.reset.name": "Reset settings to default",
"arms-reach.setting.reset.label": "Reset Settings To Default",
"arms-reach.setting.reset.hint": "This will reset all of the settings of back to the active game system's default.",
Expand Down
9 changes: 4 additions & 5 deletions src/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "arms-reach",
"title": "Arms Reach",
"description": "Allows the GM to limit the distance that a player can interacted with a placeable object like door, journal, stairway, token, ecc..",
"version": "2.4.1",
"version": "2.4.2",
"authors": [
{
"name": "Psyny"
Expand Down Expand Up @@ -87,15 +87,14 @@
"compatibility": {
"minimum": 11,
"verified": 11,
"maximum": 11
"maximum": 12
},
"url": "https://github.com/p4535992/foundryvtt-arms-reach",
"manifest": "https://github.com/p4535992/foundryvtt-arms-reach/releases/download/2.4.1/module.json",
"download": "https://github.com/p4535992/foundryvtt-arms-reach/releases/download/2.4.1/module.zip",
"manifest": "https://github.com/p4535992/foundryvtt-arms-reach/releases/download/2.4.2/module.json",
"download": "https://github.com/p4535992/foundryvtt-arms-reach/releases/download/2.4.2/module.zip",
"readme": "https://github.com/p4535992/foundryvtt-arms-reach/blob/main/README.md",
"changelog": "https://github.com/p4535992/foundryvtt-arms-reach/blob/main/changelog.md",
"bugs": "https://github.com/p4535992/foundryvtt-arms-reach/issues",
"allowBugReporter": true,
"relationships": {
"systems": [],
"requires": [
Expand Down
29 changes: 29 additions & 0 deletions src/scripts/lib/ArmsReachFormConfig.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import CONSTANTS from "../constants";
import Logger from "./Logger";

export class ArmsReachFormConfig {
static configHandlers = {
Expand All @@ -15,6 +16,10 @@ export class ArmsReachFormConfig {
};

static _handleRenderFormApplication(app, html) {
if (!game.settings.get(CONSTANTS.MODULE_ID, "enableAdditionalReachSettingOnPlaceableConfigSheet")) {
Logger.debug("Setting 'enableAdditionalReachSettingOnPlaceableConfigSheet' is disabled");
return;
}
let method = ArmsReachFormConfig.configHandlers[app.constructor.name];
if (!method) {
const key = Object.keys(ArmsReachFormConfig.configHandlers).find((name) =>
Expand All @@ -27,33 +32,57 @@ export class ArmsReachFormConfig {
}

static _handleTokenConfig(app, html) {
if (!game.settings.get(CONSTANTS.MODULE_ID, "enableAdditionalReachSettingOnPlaceableConfigSheet")) {
Logger.debug("Setting 'enableAdditionalReachSettingOnPlaceableConfigSheet' is disabled");
return;
}
const elem = html.find(`div[data-tab="character"]`);
this._applyHtml(app, elem);
}

static _handleTileConfig(app, html) {
if (!game.settings.get(CONSTANTS.MODULE_ID, "enableAdditionalReachSettingOnPlaceableConfigSheet")) {
Logger.debug("Setting 'enableAdditionalReachSettingOnPlaceableConfigSheet' is disabled");
return;
}
const elem = html.find(`div[data-tab="basic"]`);
this._applyHtml(app, elem);
}

static _handleDrawingConfig(app, html) {
if (!game.settings.get(CONSTANTS.MODULE_ID, "enableAdditionalReachSettingOnPlaceableConfigSheet")) {
Logger.debug("Setting 'enableAdditionalReachSettingOnPlaceableConfigSheet' is disabled");
return;
}
const elem = html.find(`div[data-tab="position"]`);
this._applyHtml(app, elem);
}

static _handleAmbientLightConfig(app, html) {
if (!game.settings.get(CONSTANTS.MODULE_ID, "enableAdditionalReachSettingOnPlaceableConfigSheet")) {
Logger.debug("Setting 'enableAdditionalReachSettingOnPlaceableConfigSheet' is disabled");
return;
}
let button = html.find(`button[name="submit"]`);
let elem = (button.length ? button : html.find(`button[type="submit"]`)).parent();
this._applyHtml(app, elem, true);
}

static _handleGenericConfig(app, html) {
if (!game.settings.get(CONSTANTS.MODULE_ID, "enableAdditionalReachSettingOnPlaceableConfigSheet")) {
Logger.debug("Setting 'enableAdditionalReachSettingOnPlaceableConfigSheet' is disabled");
return;
}
let button = html.find(`button[name="submit"]`);
let elem = button.length ? button : html.find(`button[type="submit"]`);
this._applyHtml(app, elem, true);
}

static _handleStairwayConfig(app, html) {
if (!game.settings.get(CONSTANTS.MODULE_ID, "enableAdditionalReachSettingOnPlaceableConfigSheet")) {
Logger.debug("Setting 'enableAdditionalReachSettingOnPlaceableConfigSheet' is disabled");
return;
}
const elem = html.find(`div[data-tab="label"]`);
this._applyHtml(app, elem, true);
}
Expand Down
9 changes: 9 additions & 0 deletions src/scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ export const registerSettings = function () {
type: Boolean,
});

game.settings.register(CONSTANTS.MODULE_ID, "enableAdditionalReachSettingOnPlaceableConfigSheet", {
name: `${CONSTANTS.MODULE_ID}.settingNameEnableAdditionalReachSettingOnPlaceableConfigSheet`,
hint: `${CONSTANTS.MODULE_ID}.settingHintEnableAdditionalReachSettingOnPlaceableConfigSheet`,
scope: "world",
config: true,
default: true,
type: Boolean,
});

// ========================================================
// DOOR SUPPORT
// ========================================================
Expand Down
7 changes: 7 additions & 0 deletions utils/packs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ function cleanPackEntry(data, { clearSourceId=true, ownership=0 }={}) {
if ( data.system?.save?.dc === 0 ) data.system.save.dc = null;
if ( data.system?.capacity?.value === 0 ) data.system.capacity.value = null;
if ( data.system?.strength === 0 ) data.system.strength = null;
// BREAKING CHANGES Dnd5e 3.2.X
if ((data.system?.weight || data.system?.weight === 0) && !data.system?.weight?.units) {
data.system.weight = {
value: typeof data.system.weight === 'number' ? data.system.weight : 0,
units: "lb"
};
}

// Remove mystery-man.svg from Actors
if ( ["character", "npc"].includes(data.type) && data.img === "icons/svg/mystery-man.svg" ) {
Expand Down

0 comments on commit 2ccaa4a

Please sign in to comment.