@reldens/cms 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,341 +0,0 @@
1
- <h2>Maps Wizard</h2>
2
- <div class="sub-content maps-wizard">
3
- <div class="sub-content-box">
4
- <form class="sub-content-form maps-wizard-form confirmation-required"
5
- name="maps-wizard-form"
6
- id="maps-wizard-form"
7
- action="{{&actionPath}}"
8
- method="post"
9
- enctype="multipart/form-data">
10
- <input type="hidden" name="mainAction" id="mainAction" value="generate"/>
11
- <div class="main-action-container">
12
- <p>What would you like to do?</p>
13
- <ul class="wizard-options-container">
14
- <li class="wizard-option-container active">
15
- <div class="checkbox-container">
16
- <input class="map-wizard-option with-state" type="radio" name="mapsWizardAction" id="mapsWizardAction-1" value="elements-object-loader" checked="checked"/>
17
- <label class="main-option" for="mapsWizardAction-1">
18
- Generate a SINGLE random map with Layer Elements Object Loader (LayerElementsObjectLoader)
19
- </label>
20
- </div>
21
- <div class="maps-wizard-option-content mapsWizardAction-1-data">
22
- <p>
23
- Generator Data example:<br/>
24
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-object/map-data.json" target="_blank">
25
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-object/map-data.json
26
- </a>
27
- </p>
28
- <button type="button" class="button button-primary set-sample-data" data-option-value="elements-object-loader">
29
- Set Sample Data in "Generator Data"
30
- </button>
31
- <p>
32
- Expected JSON files examples:<br/>
33
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-object/house-001.json" target="_blank">
34
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-object/house-001.json
35
- </a><br/>
36
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-object/house-002.json" target="_blank">
37
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-object/house-002.json
38
- </a><br/>
39
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-object/tree.json" target="_blank">
40
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-object/tree.json
41
- </a>
42
- </p>
43
- <p>
44
- Expected Images files examples:<br/>
45
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-object/tilesheet.png" target="_blank">
46
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-object/tilesheet.png
47
- </a>
48
- </p>
49
- <p>
50
- Note:<br/>
51
- In the examples above, all the tileset JSON files use the same tileset image (this is because we used the already optimized version of the tileset).<br/>
52
- Case disclaimer:
53
- In theory, it should also work if each element has its own image, but this still needs to be tested.<br/>
54
- For now, you can use the composite option to use multiple tileset images and those will be merged by the generator which use the Tile Map Optimizer.
55
- </p>
56
- </div>
57
- </li>
58
- <li class="wizard-option-container">
59
- <div class="checkbox-container">
60
- <input class="map-wizard-option with-state" type="radio" name="mapsWizardAction" id="mapsWizardAction-2" value="elements-composite-loader"/>
61
- <label class="main-option" for="mapsWizardAction-2">
62
- Generate a SINGLE random map with Layer Elements Composite Loader (LayerElementsCompositeLoader)
63
- </label>
64
- </div>
65
- <div class="maps-wizard-option-content mapsWizardAction-2-data">
66
- <p>
67
- Generator Data example:<br/>
68
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/map-composite-data.json" target="_blank">
69
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/map-composite-data.json
70
- </a>
71
- </p>
72
- <button type="button" class="button button-primary set-sample-data" data-option-value="elements-composite-loader">
73
- Set Sample Data in "Generator Data"
74
- </button>
75
- <p>
76
- Expected JSON files examples:<br/>
77
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/reldens-town-composite.json" target="_blank">
78
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/reldens-town-composite.json
79
- </a>
80
- </p>
81
- <p>
82
- Expected Images files examples:<br/>
83
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/outside.png" target="_blank">
84
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/outside.png
85
- </a><br/>
86
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/terrain.png" target="_blank">
87
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/terrain.png
88
- </a><br/>
89
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/house.png" target="_blank">
90
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/house.png
91
- </a><br/>
92
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/doors.png" target="_blank">
93
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/doors.png
94
- </a><br/>
95
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/water.png" target="_blank">
96
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/water.png
97
- </a><br/>
98
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/inside.png" target="_blank">
99
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/inside.png
100
- </a><br/>
101
- </p>
102
- <p>
103
- Note:<br/>
104
- In this case as you can see we have a single tile map JSON file which contains several tilesets with different images.<br/>
105
- All the original contents are 16x16 pixels, so you can see we set "factor: 2" in the sample params to run the optimizer and get 32x32 pixels tiles in the result.
106
- </p>
107
- </div>
108
- </li>
109
- <li class="wizard-option-container">
110
- <div class="checkbox-container">
111
- <input class="map-wizard-option with-state" type="radio" name="mapsWizardAction" id="mapsWizardAction-3" value="multiple-by-loader"/>
112
- <label class="main-option" for="mapsWizardAction-3">
113
- Generate MULTIPLE random maps by Multiple Loader (MultipleByLoaderGenerator)
114
- </label>
115
- </div>
116
- <div class="maps-wizard-option-content mapsWizardAction-3-data">
117
- <p>
118
- Generator Data example:<br/>
119
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/map-composite-data.json" target="_blank">
120
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/map-composite-data-with-names.json
121
- </a>
122
- </p>
123
- <button type="button" class="button button-primary set-sample-data" data-option-value="multiple-by-loader">
124
- Set Sample Data in "Generator Data"
125
- </button>
126
- <p>
127
- Expected JSON files examples:<br/>
128
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/reldens-town-composite.json" target="_blank">
129
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/reldens-town-composite.json
130
- </a>
131
- </p>
132
- <p>
133
- Expected Images files examples:<br/>
134
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/outside.png" target="_blank">
135
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/outside.png
136
- </a><br/>
137
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/terrain.png" target="_blank">
138
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/terrain.png
139
- </a><br/>
140
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/house.png" target="_blank">
141
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/house.png
142
- </a><br/>
143
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/doors.png" target="_blank">
144
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/doors.png
145
- </a><br/>
146
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/water.png" target="_blank">
147
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/water.png
148
- </a><br/>
149
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/inside.png" target="_blank">
150
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/inside.png
151
- </a><br/>
152
- </p>
153
- <p>
154
- Note:<br/>
155
- In this case we have the same structure as in the SINGLE import, but we include multiple map names in the provided data and use a different loader to create multiple maps at once.
156
- </p>
157
- </div>
158
- </li>
159
- <li class="wizard-option-container">
160
- <div class="checkbox-container">
161
- <input class="map-wizard-option with-state" type="radio" name="mapsWizardAction" id="mapsWizardAction-4" value="multiple-with-association-by-loader"/>
162
- <label class="main-option" for="mapsWizardAction-4">
163
- Generate MULTIPLE random maps with Layer Elements Composite Loader (MultipleWithAssociationsByLoaderGenerator)
164
- </label>
165
- </div>
166
- <div class="maps-wizard-option-content mapsWizardAction-4-data">
167
- <p>
168
- Generator Data example:<br/>
169
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/map-composite-data.json" target="_blank">
170
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/map-composite-data-with-associations.json
171
- </a>
172
- </p>
173
- <button type="button" class="button button-primary set-sample-data" data-option-value="multiple-with-association-by-loader">
174
- Set Sample Data in "Generator Data"
175
- </button>
176
- <p>
177
- Expected JSON files examples:<br/>
178
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/reldens-town-composite-with-associations.json" target="_blank">
179
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/reldens-town-composite-with-associations.json
180
- </a><br/>
181
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/house-composite.json" target="_blank">
182
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/house-composite.json
183
- </a>
184
- </p>
185
- <p>
186
- Expected Images files examples:<br/>
187
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/outside.png" target="_blank">
188
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/outside.png
189
- </a><br/>
190
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/terrain.png" target="_blank">
191
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/terrain.png
192
- </a><br/>
193
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/house.png" target="_blank">
194
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/house.png
195
- </a><br/>
196
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/doors.png" target="_blank">
197
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/doors.png
198
- </a><br/>
199
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/water.png" target="_blank">
200
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/water.png
201
- </a><br/>
202
- <a href="https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/inside.png" target="_blank">
203
- https://github.com/damian-pastorini/tile-map-generator/blob/master/examples/layer-elements-composite/inside.png
204
- </a><br/>
205
- </p>
206
- <p>
207
- Note:<br/>
208
- In this case we have the same structure as in the SINGLE import, but we include multiple maps information and the association options in the provided data, but use a different loader to create multiple associated maps at once.
209
- </p>
210
- </div>
211
- </li>
212
- </ul>
213
- <hr/>
214
- <p>NOTE: if you already uploaded all your files and never manually removed them from the "generate-data" folder, you don't need to upload the same files again.</p>
215
- <div class="input-box">
216
- <label for="generatorImages">Images</label>
217
- <input type="file" name="generatorImages" id="generatorImages" multiple="multiple"/>
218
- </div>
219
- <div class="input-box">
220
- <label for="generatorJsonFiles">JSON Files</label>
221
- <input type="file" name="generatorJsonFiles" id="generatorJsonFiles" multiple="multiple"/>
222
- </div>
223
- <hr/>
224
- <label for="generatorData">Generator data:</label>
225
- <textarea name="generatorData" id="generatorData" class="generatorData" cols="30" rows="10" placeholder="JSON data for map generation process" required="required"></textarea>
226
- </div>
227
- <div class="submit-container">
228
- <input type="submit" class="button button-primary button-maps-wizard" value="Generate"/>
229
- <img class="hidden loading" src="/assets/web/loading.gif"/>
230
- </div>
231
- </form>
232
- </div>
233
- </div>
234
- <script type="text/javascript">
235
- let data = {
236
- 'elements-object-loader': JSON.stringify({
237
- tileSize: 32,
238
- tileSheetPath: 'tilesheet.png',
239
- tileSheetName: 'tilesheet.png',
240
- imageHeight: 578,
241
- imageWidth: 612,
242
- tileCount: 306,
243
- columns: 18,
244
- margin: 1,
245
- spacing: 2,
246
- elementsQuantity: {
247
- house1: 3,
248
- house2: 2,
249
- tree: 6
250
- },
251
- groundTile: 116,
252
- mainPathSize: 3,
253
- blockMapBorder: true,
254
- freeSpaceTilesQuantity: 2,
255
- variableTilesPercentage: 15.0,
256
- pathTile: 121,
257
- collisionLayersForPaths: ['change-points', 'collisions', 'tree-base'],
258
- randomGroundTiles: [26, 27, 28, 29, 30, 36, 37, 38, 39, 50, 51, 52, 53],
259
- surroundingTiles: {
260
- '-1,-1': 127,
261
- '-1,0': 124,
262
- '-1,1': 130,
263
- '0,-1': 126,
264
- '0,1': 129,
265
- '1,-1': 132,
266
- '1,0': 131,
267
- '1,1': 133
268
- },
269
- corners: {
270
- '-1,-1': 285,
271
- '-1,1': 284,
272
- '1,-1': 283,
273
- '1,1': 282
274
- },
275
- layerElementsFiles: {
276
- house1: 'house-001.json',
277
- house2: 'house-002.json',
278
- tree: 'tree.json'
279
- }
280
- }),
281
- 'elements-composite-loader': JSON.stringify({
282
- factor: 2,
283
- mainPathSize: 3,
284
- blockMapBorder: true,
285
- freeSpaceTilesQuantity: 2,
286
- variableTilesPercentage: 15,
287
- collisionLayersForPaths: ['change-points', 'collisions', 'tree-base'],
288
- compositeElementsFile: 'reldens-town-composite.json',
289
- automaticallyExtrudeMaps: '1'
290
- }),
291
- 'multiple-by-loader': JSON.stringify({
292
- factor: 2,
293
- mainPathSize: 3,
294
- blockMapBorder: true,
295
- freeSpaceTilesQuantity: 2,
296
- variableTilesPercentage: 15,
297
- collisionLayersForPaths: ['change-points', 'collisions', 'tree-base'],
298
- mapNames: ['map-001', 'map-002', 'map-003'],
299
- compositeElementsFile: 'reldens-town-composite.json',
300
- automaticallyExtrudeMaps: '1'
301
- }),
302
- 'multiple-with-association-by-loader': JSON.stringify({
303
- factor: 2,
304
- mainPathSize: 3,
305
- blockMapBorder: true,
306
- freeSpaceTilesQuantity: 2,
307
- variableTilesPercentage: 15,
308
- collisionLayersForPaths: ['change-points', 'collisions', 'tree-base'],
309
- mapsInformation: [
310
- {mapName: 'town-001', mapTitle: 'Town 1'},
311
- {mapName: 'town-002', mapTitle: 'Town 2'},
312
- {mapName: 'town-003', mapTitle: 'Town 3'},
313
- {mapName: 'town-004', mapTitle: 'Town 4'}
314
- ],
315
- associationsProperties: {
316
- generateElementsPath: false,
317
- blockMapBorder: true,
318
- freeSpaceTilesQuantity: 0,
319
- variableTilesPercentage: 0,
320
- placeElementsOrder: 'inOrder',
321
- orderElementsBySize: false,
322
- randomizeQuantities: true,
323
- applySurroundingPathTiles: false,
324
- automaticallyExtrudeMaps: true
325
- },
326
- compositeElementsFile: 'reldens-town-composite-with-associations.json',
327
- automaticallyExtrudeMaps: '1'
328
- })
329
- };
330
-
331
- let options = document.querySelectorAll('.set-sample-data');
332
- let generatorDataElement = document.querySelector('.generatorData');
333
- if(generatorDataElement){
334
- for(let option of options){
335
- option.addEventListener('click', () => {
336
- generatorDataElement.value = data[option.dataset.optionValue] || '';
337
- });
338
- }
339
- }
340
-
341
- </script>
@@ -1,143 +0,0 @@
1
- <h2>Objects Import</h2>
2
- <div class="sub-content objects-import">
3
- <div class="sub-content-box">
4
- <form class="sub-content-form objects-import-form confirmation-required"
5
- name="objects-import-form"
6
- id="objects-import-form"
7
- action="{{&actionPath}}"
8
- method="post"
9
- enctype="multipart/form-data">
10
- <div class="main-action-container">
11
- <p>What would you like to do?</p>
12
- <hr/>
13
- <button type="button" class="button button-primary set-sample-data">
14
- Set Sample Data in "Generator Data"
15
- </button>
16
- <p>NOTE: if you already uploaded all your files and never manually removed them from the "generate-data" folder, you don't need to upload the same files again.</p>
17
- <div class="input-box">
18
- <label for="generatorJsonFiles">JSON Files</label>
19
- <input type="file" name="generatorJsonFiles" id="generatorJsonFiles" multiple="multiple"/>
20
- </div>
21
- <hr/>
22
- <label for="generatorData">Generator data (if not empty this data field will be used instead of the files):</label>
23
- <textarea name="generatorData" id="generatorData" class="generatorData" cols="30" rows="10" placeholder="JSON data for objects import process"></textarea>
24
- </div>
25
- <div class="submit-container">
26
- <input type="submit" class="button button-primary button-objects-import" value="Import"/>
27
- <img class="hidden loading" src="/assets/web/loading.gif"/>
28
- </div>
29
- </form>
30
- </div>
31
- </div>
32
- <script type="text/javascript">
33
- let sampleDataElement = document.querySelector('.set-sample-data');
34
- let generatorDataElement = document.querySelector('.generatorData');
35
- if(sampleDataElement && generatorDataElement){
36
- sampleDataElement.addEventListener('click', () => {
37
- generatorDataElement.value = JSON.stringify({
38
- "objects": [
39
- {
40
- "clientKey": "enemy_forest_1",
41
- "title": "Tree",
42
- "privateParams": "{\"shouldRespawn\":true,\"childObjectType\":4,\"isAggressive\":true,\"interactionRadio\":120}",
43
- "assets": [
44
- {
45
- "assetType": "spritesheet",
46
- "assetKey": "enemy_forest_1",
47
- "assetFile": "monster-treant.png",
48
- "extraParams": "{\"frameWidth\":47,\"frameHeight\":50}"
49
- }
50
- ]
51
- },
52
- {
53
- "clientKey": "enemy_forest_2",
54
- "title": "Tree Punch",
55
- "privateParams": "{\"shouldRespawn\":true,\"childObjectType\":4,\"isAggressive\":true,\"interactionRadio\":70}",
56
- "assets": [
57
- {
58
- "assetType": "spritesheet",
59
- "assetKey": "enemy_forest_2",
60
- "assetFile": "monster-golem2.png",
61
- "extraParams": "{\"frameWidth\":47,\"frameHeight\":50}"
62
- }
63
- ]
64
- }
65
- ],
66
- "defaults": {
67
- "classType": 7,
68
- "layer": "ground-respawn-area",
69
- "clientParams": "{\"autoStart\":true}",
70
- "enabled": 1,
71
- "respawn": {
72
- "respawnTime": 2000,
73
- "instancesLimit": 200
74
- },
75
- "stats": {
76
- "hp": 50,
77
- "mp": 50,
78
- "atk": 50,
79
- "def": 50,
80
- "dodge": 50,
81
- "speed": 50,
82
- "aim": 50,
83
- "stamina": 50,
84
- "mgk-atk": 50,
85
- "mgk-def": 50
86
- },
87
- "roomsNames": [
88
- "bots-001",
89
- "bots-002",
90
- "bots-003",
91
- "bots-004",
92
- "bots-005",
93
- "bots-006",
94
- "bots-007",
95
- "bots-008",
96
- "bots-009",
97
- "bots-010",
98
- "bots-011",
99
- "bots-012",
100
- "bots-013",
101
- "bots-014",
102
- "bots-015",
103
- "bots-016",
104
- "bots-017",
105
- "bots-018",
106
- "bots-019",
107
- "bots-020",
108
- "bots-021",
109
- "bots-022",
110
- "bots-023",
111
- "bots-024",
112
- "bots-025",
113
- "bots-026",
114
- "bots-027",
115
- "bots-028",
116
- "bots-029",
117
- "bots-030",
118
- "bots-031",
119
- "bots-032",
120
- "bots-033",
121
- "bots-034",
122
- "bots-035",
123
- "bots-036",
124
- "bots-037",
125
- "bots-038",
126
- "bots-039",
127
- "bots-040",
128
- "bots-041",
129
- "bots-042",
130
- "bots-043",
131
- "bots-044",
132
- "bots-045",
133
- "bots-046",
134
- "bots-047",
135
- "bots-048",
136
- "bots-049",
137
- "bots-050"
138
- ]
139
- }
140
- });
141
- });
142
- }
143
- </script>