iobroker.mywebui 1.42.5 → 1.42.7
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.
package/package.json
CHANGED
|
@@ -27,10 +27,6 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
<div id="viewport" style="flex:1;background:#333;position:relative;overflow:hidden;"></div>
|
|
30
|
-
<div id="rightPanel" style="width:300px;background:#1e1e1e;border-left:1px solid #444;overflow:auto;">
|
|
31
|
-
<div style="padding:10px;font-weight:bold;color:#aaa;border-bottom:1px solid #444;">Properties</div>
|
|
32
|
-
<div id="propertyPanel" style="padding:10px;"></div>
|
|
33
|
-
</div>
|
|
34
30
|
</div>
|
|
35
31
|
</div>
|
|
36
32
|
`;
|
|
@@ -246,9 +242,6 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
|
|
|
246
242
|
|
|
247
243
|
// Update scene tree
|
|
248
244
|
this.updateSceneTree();
|
|
249
|
-
|
|
250
|
-
// Update property panel
|
|
251
|
-
this.updatePropertyPanel();
|
|
252
245
|
}
|
|
253
246
|
|
|
254
247
|
loadAsset(asset) {
|
|
@@ -354,23 +347,19 @@ export class IobrokerWebui3DScreenEditor extends BaseCustomWebComponentConstruct
|
|
|
354
347
|
this.selectedObject = obj;
|
|
355
348
|
obj.userData.selected = true;
|
|
356
349
|
|
|
357
|
-
// Apply highlight
|
|
350
|
+
// Apply subtle highlight (outline glow, not full color change)
|
|
358
351
|
obj.traverse((child) => {
|
|
359
|
-
if (child.material) {
|
|
352
|
+
if (child.isMesh && child.material) {
|
|
360
353
|
child.userData.originalMaterial = child.material;
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
metalness: 0.3,
|
|
366
|
-
roughness: 0.4
|
|
367
|
-
});
|
|
354
|
+
// Clone original material and add slight emission
|
|
355
|
+
const hlMat = child.material.clone();
|
|
356
|
+
hlMat.emissive.setHex(0xffff00);
|
|
357
|
+
hlMat.emissiveIntensity = 0.15; // Subtle glow
|
|
368
358
|
child.material = hlMat;
|
|
369
359
|
}
|
|
370
360
|
});
|
|
371
361
|
|
|
372
362
|
console.log('✅ Selected:', obj.userData.assetData.name);
|
|
373
|
-
this.updatePropertyPanel();
|
|
374
363
|
}
|
|
375
364
|
|
|
376
365
|
updateSceneTree() {
|
|
@@ -119,8 +119,69 @@ export class IobrokerWebuiSolutionExplorer extends BaseCustomWebComponentConstru
|
|
|
119
119
|
try {
|
|
120
120
|
let screenName = prompt("New " + type + " Name:");
|
|
121
121
|
if (screenName) {
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
if (type === '3dscreen') {
|
|
123
|
+
// Create new 3D screen with default scene
|
|
124
|
+
const defaultScene = {
|
|
125
|
+
id: 'scene_' + Date.now().toString(36),
|
|
126
|
+
name: screenName,
|
|
127
|
+
version: '1.0',
|
|
128
|
+
createdAt: new Date().toISOString(),
|
|
129
|
+
modifiedAt: new Date().toISOString(),
|
|
130
|
+
assets: [],
|
|
131
|
+
lights: [
|
|
132
|
+
{
|
|
133
|
+
id: 'ambient_light',
|
|
134
|
+
name: 'Ambient Light',
|
|
135
|
+
type: 'ambient',
|
|
136
|
+
color: '#ffffff',
|
|
137
|
+
intensity: 0.6
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 'directional_light',
|
|
141
|
+
name: 'Directional Light',
|
|
142
|
+
type: 'directional',
|
|
143
|
+
color: '#ffffff',
|
|
144
|
+
intensity: 0.8,
|
|
145
|
+
position: { x: 10, y: 10, z: 10 },
|
|
146
|
+
castShadow: true
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
camera: {
|
|
150
|
+
position: { x: 10, y: 10, z: 10 },
|
|
151
|
+
target: { x: 0, y: 0, z: 0 },
|
|
152
|
+
fov: 75
|
|
153
|
+
},
|
|
154
|
+
grid: {
|
|
155
|
+
visible: true,
|
|
156
|
+
size: 20,
|
|
157
|
+
divisions: 20,
|
|
158
|
+
colorCenterLine: '#888888',
|
|
159
|
+
colorGrid: '#444444'
|
|
160
|
+
},
|
|
161
|
+
axes: {
|
|
162
|
+
visible: true,
|
|
163
|
+
size: 5
|
|
164
|
+
},
|
|
165
|
+
settings: {
|
|
166
|
+
backgroundColor: '#333333',
|
|
167
|
+
enableControls: true,
|
|
168
|
+
enableRaycasting: true,
|
|
169
|
+
shadowsEnabled: true,
|
|
170
|
+
antialiasing: true
|
|
171
|
+
},
|
|
172
|
+
edits: {
|
|
173
|
+
ops: []
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
await iobrokerHandler.saveObject('3dscreen', (dir ?? '') + '/' + screenName, defaultScene);
|
|
177
|
+
// Open the 3D editor
|
|
178
|
+
const editor = document.createElement('iobroker-webui-3dscreen-editor');
|
|
179
|
+
editor.setAttribute('scene-name', screenName);
|
|
180
|
+
window.appShell.openDialog(editor, { x: 50, y: 50, width: 1200, height: 800 });
|
|
181
|
+
} else {
|
|
182
|
+
const defaultScript = type === 'control' ? defaultNewControlScript : null;
|
|
183
|
+
window.appShell.openScreenEditor((dir ?? '') + '/' + screenName, type, '', defaultNewStyle, defaultScript, {});
|
|
184
|
+
}
|
|
124
185
|
}
|
|
125
186
|
}
|
|
126
187
|
catch (err) {
|
|
@@ -308,9 +369,17 @@ export class IobrokerWebuiSolutionExplorer extends BaseCustomWebComponentConstru
|
|
|
308
369
|
window.appShell.openScreenEditor(nm, type, s.html, s.style, s.script, s.settings, s.properties);
|
|
309
370
|
}
|
|
310
371
|
else if (type == '3dscreen') {
|
|
372
|
+
// Create 3D editor component
|
|
311
373
|
const editor = document.createElement('iobroker-webui-3dscreen-editor');
|
|
312
374
|
editor.setAttribute('scene-name', nm);
|
|
313
|
-
|
|
375
|
+
// Open as borderless, full-size dialog
|
|
376
|
+
window.appShell.openDialog(editor, {
|
|
377
|
+
x: 0, y: 0,
|
|
378
|
+
width: window.innerWidth,
|
|
379
|
+
height: window.innerHeight,
|
|
380
|
+
modal: true,
|
|
381
|
+
title: '3D Screen: ' + nm
|
|
382
|
+
});
|
|
314
383
|
}
|
|
315
384
|
});
|
|
316
385
|
},
|