feat(ugc): brick data through the client's assets; colours from Materials.xml everywhere

The UGC server reads brickdb.zip and brickprimitives through DLU's
AssetManager (loose files first, then the client's packs, as the game
does), so packed clients and bricks added to a client work. It falls
back to loose files under res/ as before.

In the LU Toolbox palette (the default), a colour LU Toolbox doesn't
know but the client's Materials.xml has, such as one added to the brick
database, is drawn in its Materials.xml colour instead of black. Ids
neither knows stay LU Toolbox's black.

The dashboard's 3D viewers get the brick colours from the client's
Materials.xml (/api/bricks/materials.js) instead of a hardcoded copy, so
added colours show there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 17:47:00 -05:00
parent 58d9267acc
commit 47a4c23a0d
11 changed files with 136 additions and 191 deletions

View File

@@ -1,171 +0,0 @@
/**
* LDD material colours (MatID -> [r, g, b, a]) from Materials.xml in the LEGO Universe client's res/brickdb.zip.
* Static game data; regenerate only if the client's brick database changes.
*/
window.LDD_MATERIALS = {
1: [244, 244, 244, 255],
2: [138, 146, 141, 255],
3: [255, 214, 127, 255],
4: [242, 112, 94, 255],
5: [217, 187, 123, 255],
6: [173, 217, 168, 255],
7: [255, 133, 0, 255],
8: [140, 0, 255, 255],
9: [246, 169, 187, 255],
10: [255, 255, 189, 150],
11: [171, 217, 255, 255],
12: [216, 109, 44, 255],
13: [255, 128, 20, 255],
14: [120, 252, 120, 255],
15: [255, 242, 48, 255],
16: [255, 135, 156, 255],
17: [255, 148, 148, 255],
18: [214, 114, 64, 255],
19: [207, 138, 71, 255],
20: [233, 233, 233, 150],
21: [222, 0, 13, 255],
22: [208, 80, 152, 255],
23: [0, 87, 168, 255],
24: [254, 196, 0, 255],
25: [84, 51, 36, 255],
26: [50, 50, 50, 255],
27: [84, 89, 85, 255],
28: [0, 123, 40, 255],
29: [127, 196, 117, 255],
36: [253, 195, 131, 255],
37: [0, 150, 36, 255],
38: [168, 61, 21, 255],
39: [175, 190, 214, 255],
40: [238, 238, 238, 150],
41: [224, 42, 41, 150],
42: [182, 224, 239, 150],
43: [80, 177, 232, 150],
44: [249, 239, 105, 150],
45: [151, 203, 217, 255],
47: [231, 102, 72, 150],
48: [99, 178, 110, 150],
49: [250, 237, 91, 150],
50: [229, 223, 211, 255],
100: [249, 183, 165, 255],
101: [240, 109, 97, 255],
102: [71, 140, 198, 255],
103: [188, 180, 165, 255],
104: [103, 31, 129, 255],
105: [245, 134, 36, 255],
106: [231, 99, 24, 255],
107: [6, 157, 159, 255],
108: [86, 71, 47, 255],
109: [0, 20, 20, 255],
110: [38, 70, 154, 255],
111: [189, 173, 162, 150],
112: [72, 97, 172, 255],
113: [238, 157, 195, 150],
114: [254, 0, 254, 150],
115: [183, 212, 37, 255],
116: [0, 170, 164, 255],
117: [247, 247, 247, 150],
118: [156, 214, 204, 255],
119: [149, 185, 11, 255],
120: [216, 228, 141, 255],
121: [248, 154, 57, 255],
122: [254, 203, 152, 255],
123: [238, 84, 52, 255],
124: [156, 0, 107, 255],
125: [249, 167, 119, 255],
126: [156, 149, 199, 150],
127: [222, 172, 102, 255],
128: [173, 97, 64, 255],
129: [67, 84, 147, 255],
131: [141, 148, 150, 255],
133: [239, 88, 40, 255],
134: [205, 221, 52, 255],
135: [94, 116, 140, 255],
136: [117, 101, 125, 255],
137: [244, 129, 71, 255],
138: [141, 116, 82, 255],
139: [116, 73, 48, 255],
140: [0, 37, 65, 255],
141: [0, 52, 22, 255],
143: [206, 227, 246, 150],
145: [91, 117, 144, 255],
146: [129, 117, 144, 255],
147: [131, 114, 79, 255],
148: [73, 63, 59, 255],
149: [10, 19, 39, 255],
150: [152, 155, 153, 255],
151: [95, 130, 101, 255],
153: [136, 96, 94, 255],
154: [128, 8, 27, 255],
157: [255, 246, 92, 150],
158: [241, 142, 187, 150],
168: [96, 86, 76, 255],
176: [148, 81, 72, 255],
178: [171, 103, 58, 255],
179: [115, 114, 113, 255],
180: [221, 152, 46, 255],
182: [236, 118, 14, 150],
183: [246, 242, 223, 255],
184: [214, 0, 38, 255],
185: [0, 89, 163, 255],
186: [0, 142, 60, 255],
187: [87, 57, 44, 255],
188: [0, 158, 206, 255],
189: [172, 130, 71, 255],
190: [255, 207, 11, 255],
191: [244, 155, 0, 255],
192: [91, 28, 12, 255],
193: [236, 68, 29, 255],
194: [156, 146, 145, 255],
195: [28, 88, 167, 255],
196: [14, 62, 154, 255],
197: [49, 43, 135, 255],
198: [138, 18, 168, 255],
199: [76, 81, 86, 255],
200: [106, 121, 68, 255],
208: [228, 228, 218, 255],
209: [164, 118, 36, 255],
210: [70, 138, 95, 255],
211: [63, 182, 169, 255],
212: [135, 192, 234, 255],
213: [71, 111, 182, 255],
216: [135, 43, 23, 255],
217: [123, 93, 65, 255],
218: [142, 85, 151, 255],
219: [86, 78, 157, 255],
220: [145, 149, 202, 255],
221: [222, 55, 139, 255],
222: [238, 157, 195, 255],
223: [241, 120, 128, 255],
224: [243, 201, 136, 255],
225: [250, 169, 100, 255],
226: [255, 228, 104, 255],
227: [201, 231, 136, 150],
228: [85, 165, 175, 150],
229: [172, 212, 222, 150],
230: [236, 163, 201, 150],
231: [252, 183, 109, 150],
232: [119, 201, 216, 255],
233: [96, 186, 118, 255],
234: [251, 232, 144, 150],
236: [141, 115, 179, 150],
268: [44, 21, 119, 255],
269: [62, 149, 182, 255],
283: [245, 193, 137, 255],
284: [224, 208, 229, 150],
285: [228, 214, 218, 150],
294: [254, 252, 213, 150],
296: [173, 173, 173, 255],
297: [170, 127, 46, 255],
298: [118, 118, 118, 255],
308: [53, 33, 0, 255],
311: [175, 210, 70, 150],
312: [170, 125, 85, 255],
315: [140, 140, 140, 255],
316: [62, 60, 57, 255],
321: [70, 155, 195, 255],
322: [104, 195, 226, 255],
323: [211, 242, 234, 255],
324: [160, 110, 185, 255],
325: [205, 164, 222, 255],
326: [226, 249, 154, 255]
};