-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdecorations.js
63 lines (61 loc) · 1.84 KB
/
decorations.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
module.exports = function(config) {
if(config.backend) {
function getDecorations(location) {
const wall = {
"active": {
"foregroundColor": "#FFFF",
"foregroundBrightness": 1,
"foregroundAlpha": 1,
"backgroundColor": "#011417",
"backgroundBrightness": 1,
"strokeColor": "#10191B",
"strokeBrightness": 1,
"strokeLighting": 1,
"strokeWidth": 34,
"world": true,
"room": location.room
},
"decoration": {
"graphics": [],
"type": "wallLandscape",
"name": "Seasonal wall",
"foregroundUrl": `${config.assetsUrl}walls.png`
}
};
const floor = {
"active": {
"floorBackgroundColor": "#51787A",
"floorBackgroundBrightness": 1,
"floorForegroundColor": "#446D70",
"floorForegroundBrightness": 1,
"floorForegroundAlpha": 1,
"swampColor": "#FF1F1F",
"swampStrokeColor": "#C70F0F",
"swampStrokeWidth": 40,
"roadsColor": "#77B2A4",
"roadsBrightness": 1,
"world": true,
"room": location.room
},
"decoration": {
"graphics": [],
"type": "floorLandscape",
"name": "Seasonal floor",
"floorForegroundUrl": `${config.assetsUrl}floor.png`,
"tileScale": 1.5
}
};
if(location.shard) {
wall.active.shard = location.shard;
floor.active.shard = location.shard;
}
return [floor, wall];
};
config.backend.on('expressPostConfig', function(app) {
config.backend.router.get('/game/room-decorations', (request, response) => {
const decorations = getDecorations(request.query);
response.json({ ok: 1, decorations });
});
});
}
}