Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Dec 3, 2023
1 parent 4d322a6 commit 955c1fd
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 95 deletions.
46 changes: 46 additions & 0 deletions create_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import os
import json
import zipfile

# Define selected folders
selected_folders = ['scripts', 'styles', 'assets', 'templates', 'languages', 'packs', 'storage']

def read_module_json():
with open(file, 'r', encoding='utf-8') as file:
data = json.load(file)
module_id = data['id']
module_version = data['version']
return module_id, module_version

def create_dist_folder():
if not os.path.exists('dist'):
os.makedirs('dist')

def add_folder_to_zip(zip_file, folder):
if os.path.exists(folder):
for root, dirs, files in os.walk(folder):
for file in files:
file_path = os.path.join(root, file)
relative_path = os.path.relpath(file_path, folder)
zip_file.write(file_path, os.path.join(folder, relative_path))
else:
print(f"Warning: {folder} is missing. Skipping.")

def create_zip(module_id, module_version, folders):
zip_filename = f'dist/{module_id}-{module_version}.zip'
with zipfile.ZipFile(zip_filename, 'w', zipfile.ZIP_DEFLATED) as zip_file:
zip_file.write('module.json')

for folder in folders:
add_folder_to_zip(zip_file, folder)

print(f"Zip file '{zip_filename}' created successfully.")

def main():
module_id, module_version = read_module_json()
create_dist_folder()

create_zip(module_id, module_version, selected_folders)

if __name__ == "__main__":
main()
142 changes: 71 additions & 71 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
{
"title": "Wall Height",
"id": "wall-height",
"description": "Adds the ability to set wall height for walls so that tokens can look and move over them.",
"version": "4.1.2",
"authors": [
{
"name": "theripper93",
"email": "[email protected]",
"url": "https://theripper93.com/"
},
{
"name": "Ian Murphy",
"discord": "Erithtotl#5139"
},
{
"name": "Cole Schultz",
"discord": "cole#9640"
}
],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
},
{
"lang": "es",
"name": "Español",
"path": "lang/es.json"
}
],
"esmodules": [
"scripts/wall-height.js"
],
"packs": [
{
"name": "wall-height-macros",
"label": "Wall Height Macros",
"path": "packs/macros.db",
"type": "Macro",
"private": false
}
],
"styles": [
"styles/wall-height.css"
],
"url": "https://github.com/theripper93/wall-height",
"manifest": "https://github.com/theripper93/wall-height/releases/latest/download/module.json",
"download": "https://github.com/theripper93/wall-height/releases/download/4.1.1/module.zip",
"relationships": {
"requires": [
{
"id": "lib-wrapper",
"type": "module",
"compatibility": {}
}
],
"recommends": [
{
"id": "theripper-premium-hub",
"type": "module",
"reason": "TheRipper93's Module Hub will alert you of critical updates and give you easy access to documentation in the configure settings screen",
"compatibility": {}
}
]
},
"compatibility": {
"minimum": "11",
"verified": "11"
}
{
"title": "Wall Height",
"id": "wall-height",
"description": "Adds the ability to set wall height for walls so that tokens can look and move over them.",
"version": "4.1.2",
"authors": [
{
"name": "theripper93",
"email": "[email protected]",
"url": "https://theripper93.com/"
},
{
"name": "Ian Murphy",
"discord": "Erithtotl#5139"
},
{
"name": "Cole Schultz",
"discord": "cole#9640"
}
],
"languages": [
{
"lang": "en",
"name": "English",
"path": "lang/en.json"
},
{
"lang": "es",
"name": "Español",
"path": "lang/es.json"
}
],
"esmodules": [
"scripts/wall-height.js"
],
"packs": [
{
"name": "wall-height-macros",
"label": "Wall Height Macros",
"path": "packs/macros.db",
"type": "Macro",
"private": false
}
],
"styles": [
"styles/wall-height.css"
],
"url": "https://github.com/theripper93/wall-height",
"manifest": "https://github.com/theripper93/wall-height/releases/latest/download/module.json",
"download": "https://github.com/theripper93/wall-height/releases/download/4.1.1/module.zip",
"relationships": {
"requires": [
{
"id": "lib-wrapper",
"type": "module",
"compatibility": {}
}
],
"recommends": [
{
"id": "theripper-premium-hub",
"type": "module",
"reason": "TheRipper93's Module Hub will alert you of critical updates and give you easy access to documentation in the configure settings screen",
"compatibility": {}
}
]
},
"compatibility": {
"minimum": "11",
"verified": "11"
}
}
Binary file added packs/macros/000003.log
Binary file not shown.
Empty file removed packs/macros/001273.log
Empty file.
2 changes: 1 addition & 1 deletion packs/macros/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-001272
MANIFEST-000002
4 changes: 1 addition & 3 deletions packs/macros/LOG
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
2023/11/28-12:34:53.636 7094 Recovering log #1271
2023/11/28-12:34:53.639 7094 Delete type=0 #1271
2023/11/28-12:34:53.639 7094 Delete type=3 #1270
2023/12/03-12:44:47.360 13cc0 Delete type=3 #1
3 changes: 0 additions & 3 deletions packs/macros/LOG.old

This file was deleted.

Binary file added packs/macros/MANIFEST-000002
Binary file not shown.
Binary file removed packs/macros/MANIFEST-001272
Binary file not shown.
25 changes: 8 additions & 17 deletions scripts/patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,25 +246,16 @@ export function registerWrappers() {
const { advancedVision } = getSceneSettings(token.scene);
const losHeight = token.losHeight;
const sourceId = token.sourceId;
if (!advancedVision) {
if (canvas.effects.visionSources.has(sourceId)) {
token.vision.los.origin.b = token.vision.los.origin.t = losHeight;
}
if (canvas.effects.lightSources.has(sourceId)) {
token.light.los.origin.b = token.light.los.origin.t = losHeight;
}
} else if (canvas.effects.visionSources.has(sourceId) && (token.vision.los.origin.b !== losHeight || token.vision.los.origin.t !== losHeight)
if (canvas.effects.visionSources.has(sourceId)) {
token.vision.los.origin.b = token.vision.los.origin.t = losHeight;
}
if (canvas.effects.lightSources.has(sourceId)) {
token.light.los.origin.b = token.light.los.origin.t = losHeight;
}
if (canvas.effects.visionSources.has(sourceId) && (token.vision.los.origin.b !== losHeight || token.vision.los.origin.t !== losHeight)
|| canvas.effects.lightSources.has(sourceId) && (token.light.los.origin.b !== losHeight || token.light.los.origin.t !== losHeight)) {
token.updateSource({ defer: true });
canvas.perception.update({
initializeLighting: true,
initializeSounds: true,
initializeVision: true,
refreshLighting: true,
refreshSounds: true,
refreshTiles: true,
refreshVision: true,
}, true);
WallHeight.schedulePerceptionUpdate();
}
}

Expand Down

0 comments on commit 955c1fd

Please sign in to comment.