Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
caewok committed Dec 21, 2022
2 parents 872889a + 0905b93 commit cc388cb
Showing 21 changed files with 22 additions and 2,533 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'

# get part of the tag after the `v`
- name: Extract tag version number
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,3 +2,4 @@
.DS_Store

sync_to_module.sh
sync_module.sh
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "scripts/geometry"]
path = scripts/geometry
url = https://github.com/caewok/lib-geometry
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.1
Add a shared geometry git submodule.
Fix for prototype token error on save (issue #13). (Appears to be caused by a workaround for a Foundry bug that has since been addressed.)

## 0.6.0
Refactor the configuration settings to use css "display:none," which is simpler than the previous approach for hiding/displaying sub-settings when a specific shape is chosen.

2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"manifestPlusVersion": "1.0.0",
"compatibility": {
"minimum": "10.279",
"verified": "10.290"
"verified": "10.291"
},
"authors": [
{
366 changes: 0 additions & 366 deletions scripts/WeilerAtherton.js

This file was deleted.

12 changes: 6 additions & 6 deletions scripts/boundaryPolygon.js
Original file line number Diff line number Diff line change
@@ -6,12 +6,12 @@ canvas

import { getFlag } from "./util.js";
import { FLAGS } from "./const.js";
import { Ellipse } from "./shapes/Ellipse.js";
import { RegularPolygon } from "./shapes/RegularPolygon.js";
import { RegularStar } from "./shapes/RegularStar.js";
import { EquilateralTriangle } from "./shapes/EquilateralTriangle.js";
import { Square } from "./shapes/Square.js";
import { Hexagon } from "./shapes/Hexagon.js";
import { Ellipse } from "./geometry/Ellipse.js";
import { RegularPolygon } from "./geometry/RegularPolygon/RegularPolygon.js";
import { RegularStar } from "./geometry/RegularPolygon/RegularStar.js";
import { EquilateralTriangle } from "./geometry/RegularPolygon/EquilateralTriangle.js";
import { Square } from "./geometry/RegularPolygon/Square.js";
import { Hexagon } from "./geometry/RegularPolygon/Hexagon.js";

/**
* Method added to the light/sound AmbientLight class to create a custom boundary polygon.
1 change: 1 addition & 0 deletions scripts/geometry
Submodule geometry added at 1903b3
23 changes: 4 additions & 19 deletions scripts/module.js
Original file line number Diff line number Diff line change
@@ -11,9 +11,8 @@ isEmpty
import { MODULE_ID, TEMPLATES, SHAPE, FLAGS } from "./const.js";
import { log, getFlag, noFlag, setFlag } from "./util.js";
import { registerLightMask } from "./patching.js";
import { registerPIXIPolygonMethods } from "./shapes/PIXIPolygon.js";
import { registerPIXIRectangleMethods } from "./shapes/PIXIRectangle.js";
import { registerPIXICircleMethods } from "./shapes/PIXICircle.js";

import { registerGeometry } from "./geometry/registration.js";

import {
injectAmbientLightConfiguration,
@@ -22,34 +21,20 @@ import {

import { lightMaskPreUpdateAmbientLight } from "./preUpdate.js";

// ----- WeilerAtherton ----- //
import { WeilerAthertonClipper } from "./WeilerAtherton.js";

// ----- Shapes ----- //
import { RegularPolygon } from "./shapes/RegularPolygon.js";
import { EquilateralTriangle } from "./shapes/EquilateralTriangle.js";
import { Square } from "./shapes/Square.js";
import { Hexagon } from "./shapes/Hexagon.js";
import { RegularStar } from "./shapes/RegularStar.js";
import { Ellipse } from "./shapes/Ellipse.js";

// ----- ClockwiseSweep ----- //
import { controlledWallIDs, TempWall } from "./customEdges.js";

Hooks.once("init", async function() {
log("Initializing...");

registerLightMask();
registerPIXIPolygonMethods();
registerPIXIRectangleMethods();
registerPIXICircleMethods();

registerGeometry();

Handlebars.registerHelper("max2", function(a, b) { return Math.max(a, b); });

game.modules.get(MODULE_ID).api = {
controlledWallIDs,
WeilerAthertonClipper,
shapes: { RegularPolygon, EquilateralTriangle, Square, Hexagon, RegularStar, Ellipse },
TempWall
};
});
14 changes: 0 additions & 14 deletions scripts/patching.js
Original file line number Diff line number Diff line change
@@ -53,7 +53,6 @@ export function registerLightMask() {

// ------ TokenConfig ----- //
libWrapper.register(MODULE_ID, "TokenConfig.prototype.activateListeners", lightMaskActivateListeners, libWrapper.WRAPPER);
libWrapper.register(MODULE_ID, "TokenConfig.prototype._updateObject", _updateObjectTokenConfig, libWrapper.WRAPPER);

// ------ DefaultTokenConfig ----- //
libWrapper.register(MODULE_ID, "DefaultTokenConfig.prototype.activateListeners", lightMaskActivateListeners, libWrapper.WRAPPER);
@@ -121,16 +120,3 @@ function _getPolygonConfigurationSoundSource(wrapper) {

return cfg;
}

// ----- Token Source ----- //
/**
* Wrap TokenConfig.prototype._updateObject
* If the flags are being updated, force those to be updated in advance so the token shape
* updates correctly.
* See https://ptb.discord.com/channels/170995199584108546/811676497965613117/1043909846526865429
*/
async function _updateObjectTokenConfig(wrapper, event, formData) {
const out = await wrapper(event, formData);
this.token.object.updateLightSource();
return out;
}
225 changes: 0 additions & 225 deletions scripts/shapes/Ellipse.js

This file was deleted.

91 changes: 0 additions & 91 deletions scripts/shapes/EquilateralTriangle.js

This file was deleted.

174 changes: 0 additions & 174 deletions scripts/shapes/Hexagon.js

This file was deleted.

275 changes: 0 additions & 275 deletions scripts/shapes/PIXICircle.js

This file was deleted.

220 changes: 0 additions & 220 deletions scripts/shapes/PIXIPolygon.js

This file was deleted.

339 changes: 0 additions & 339 deletions scripts/shapes/PIXIRectangle.js

This file was deleted.

370 changes: 0 additions & 370 deletions scripts/shapes/RegularPolygon.js

This file was deleted.

177 changes: 0 additions & 177 deletions scripts/shapes/RegularStar.js

This file was deleted.

166 changes: 0 additions & 166 deletions scripts/shapes/Square.js

This file was deleted.

83 changes: 0 additions & 83 deletions scripts/shapes/util.js

This file was deleted.

7 changes: 0 additions & 7 deletions v10_sync_to_module.sh

This file was deleted.

0 comments on commit cc388cb

Please sign in to comment.