Skip to content

Commit ae5c265

Browse files
committed
Updates
1 parent b0339ed commit ae5c265

2 files changed

Lines changed: 2 additions & 87 deletions

File tree

bundle.js

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -444,29 +444,6 @@
444444
let output = obj;
445445
const scaleRatio = revert ? 64 : 1 / 64;
446446
const physicsRatio = revert ? 1 / (30 / 64) : 30 / 64;
447-
["x", "y", "z", "width", "height", "depth"].forEach((key) => {
448-
output = modifyCertainKey(
449-
output,
450-
key,
451-
{
452-
parentKeys: [],
453-
currentParentKey: "",
454-
targetParentKey: ["position", "size"],
455-
insideParentKeys: ["bodies"],
456-
excludeKeys: ["z-index", "rotate", "mountRotation"],
457-
brotherEntries: [
458-
["dataType", "region"],
459-
["function", "xyCoordinate"]
460-
],
461-
parent: {}
462-
},
463-
(v) => {
464-
if (typeof v[key] === "number" || typeof v[key] === "string") {
465-
v[key] = Number(v[key]) * scaleRatio;
466-
}
467-
}
468-
);
469-
});
470447
["default"].forEach((key) => {
471448
output = modifyCertainKey(
472449
output,
@@ -772,7 +749,8 @@
772749
// Duplicate entry
773750
"upperAngle",
774751
"lowerAngle",
775-
"buffTypes"
752+
"buffTypes",
753+
"body"
776754
].forEach((key) => {
777755
output = removeCertainKey(output, key);
778756
});

index.html

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,11 @@
1717
fix scale (use world unit)
1818
</label>
1919
<br>
20-
<!-- <label>
21-
<input type="checkbox" id="fixScalePixel">
22-
fix scale (use pixel unit)
23-
</label>
24-
<br> -->
2520
<label>
2621
<input type="checkbox" id="useRapier2d" checked>
2722
use rapier2d
2823
</label>
2924
<br>
30-
<!-- <label>
31-
<input type="checkbox" id="fixFixture" checked>
32-
fix fixtures in body settings
33-
</label>
34-
<br>
35-
<label>
36-
<input type="checkbox" id="moveUpHalfDepth" checked>
37-
move collider.offset.z up half depth (in fixture fix)
38-
</label> -->
3925
</div>
4026

4127
<button onclick="handleJson()">Download</button>
@@ -45,49 +31,6 @@
4531
<script>
4632
let jsonObject = null;
4733

48-
// Enforce only one of fixScaleWorld or fixScalePixel can be checked
49-
// function enforceScaleCheckboxes(changedId) {
50-
// const fixScaleWorld = document.getElementById('fixScaleWorld');
51-
// const fixScalePixel = document.getElementById('fixScalePixel');
52-
// if (changedId === 'fixScaleWorld' && fixScaleWorld.checked) {
53-
// fixScalePixel.checked = false;
54-
// } else if (changedId === 'fixScalePixel' && fixScalePixel.checked) {
55-
// fixScaleWorld.checked = false;
56-
// }
57-
// }
58-
59-
// Enforce moveUpHalfDepth can only be checked if fixFixture is checked
60-
// function enforceMoveUpHalfDepth() {
61-
// const fixFixture = document.getElementById('fixFixture');
62-
// const moveUpHalfDepth = document.getElementById('moveUpHalfDepth');
63-
// if (!fixFixture.checked) {
64-
// moveUpHalfDepth.disabled = true;
65-
// } else {
66-
// moveUpHalfDepth.disabled = false;
67-
// }
68-
// }
69-
70-
// Attach event listeners after DOM is loaded
71-
window.addEventListener('DOMContentLoaded', function () {
72-
const fixScaleWorld = document.getElementById('fixScaleWorld');
73-
// const fixScalePixel = document.getElementById('fixScalePixel');
74-
// const fixFixture = document.getElementById('fixFixture');
75-
// const moveUpHalfDepth = document.getElementById('moveUpHalfDepth');
76-
77-
fixScaleWorld.addEventListener('change', function () {
78-
enforceScaleCheckboxes('fixScaleWorld');
79-
});
80-
// fixScalePixel.addEventListener('change', function () {
81-
// enforceScaleCheckboxes('fixScalePixel');
82-
// });
83-
84-
// fixFixture.addEventListener('change', function () {
85-
// enforceMoveUpHalfDepth();
86-
// });
87-
88-
// Initial state for moveUpHalfDepth
89-
// enforceMoveUpHalfDepth();
90-
});
9134

9235
// Function to handle the uploaded JSON file and apply selected fixes
9336
function handleJson() {
@@ -128,12 +71,6 @@
12871
}
12972
}
13073

131-
// Apply fixture fix if checked
132-
// if (fixFixture) {
133-
// obj = fixFixtureFn(obj, moveUpHalfDepth);
134-
// prefixParts.push('fixed_fixture' + (moveUpHalfDepth ? '(moveUpHalfDepth)' : ''));
135-
// }
136-
13774
// Always remove unwanted properties
13875
obj = removeUnwantedProperties(obj);
13976
prefixParts.push('remove_unwanted_properties');

0 commit comments

Comments
 (0)