|
17 | 17 | fix scale (use world unit) |
18 | 18 | </label> |
19 | 19 | <br> |
20 | | - <!-- <label> |
21 | | - <input type="checkbox" id="fixScalePixel"> |
22 | | - fix scale (use pixel unit) |
23 | | - </label> |
24 | | - <br> --> |
25 | 20 | <label> |
26 | 21 | <input type="checkbox" id="useRapier2d" checked> |
27 | 22 | use rapier2d |
28 | 23 | </label> |
29 | 24 | <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> --> |
39 | 25 | </div> |
40 | 26 |
|
41 | 27 | <button onclick="handleJson()">Download</button> |
|
45 | 31 | <script> |
46 | 32 | let jsonObject = null; |
47 | 33 |
|
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 | | - }); |
91 | 34 |
|
92 | 35 | // Function to handle the uploaded JSON file and apply selected fixes |
93 | 36 | function handleJson() { |
|
128 | 71 | } |
129 | 72 | } |
130 | 73 |
|
131 | | - // Apply fixture fix if checked |
132 | | - // if (fixFixture) { |
133 | | - // obj = fixFixtureFn(obj, moveUpHalfDepth); |
134 | | - // prefixParts.push('fixed_fixture' + (moveUpHalfDepth ? '(moveUpHalfDepth)' : '')); |
135 | | - // } |
136 | | - |
137 | 74 | // Always remove unwanted properties |
138 | 75 | obj = removeUnwantedProperties(obj); |
139 | 76 | prefixParts.push('remove_unwanted_properties'); |
|
0 commit comments