sunrize 2.4.0 → 2.5.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.
- package/package.json +7 -7
- package/src/Application/Application.js +21 -2
- package/src/Application/Dashboard.js +21 -19
- package/src/Application/DataStorage.js +10 -37
- package/src/Application/Document.js +149 -22
- package/src/Application/Footer.js +62 -16
- package/src/Application/Hierarchy.js +1 -1
- package/src/Application/Interface.js +1 -1
- package/src/Application/Sidebar.js +12 -9
- package/src/Application/Tabs.js +79 -11
- package/src/Controls/Splitter.js +146 -19
- package/src/Controls/Tabs.js +17 -12
- package/src/Editors/AnimationEditor.js +203 -194
- package/src/Editors/AnimationMemberList.js +37 -6
- package/src/Editors/BrowserFrame.js +17 -10
- package/src/Editors/Console.js +9 -13
- package/src/Editors/MediaRecorder.js +27 -0
- package/src/Editors/NodeList.js +35 -0
- package/src/Editors/OutlineEditor.js +20 -20
- package/src/Editors/OutlineView.js +85 -61
- package/src/Editors/Panel.js +6 -3
- package/src/Editors/RouteGraph.js +72 -102
- package/src/Editors/SceneProperties.js +4 -4
- package/src/Editors/ScriptEditor.js +37 -23
- package/src/Tools/Core/X3DBaseTool.js +11 -10
- package/src/Tools/Core/X3DImportedNodeInstanceTool.js +52 -0
- package/src/Tools/Core/X3DPrototypeInstanceTool.js +6 -6
- package/src/Tools/Grids/GridTool.js +6 -2
- package/src/Tools/Grids/X3DGridNodeTool.js +1 -1
- package/src/Tools.js +0 -3
- package/src/Undo/Editor.js +19 -16
- package/src/Undo/UndoManager.js +1 -1
- package/src/assets/fonts/Roboto/OFL.txt +93 -0
- package/src/assets/fonts/Roboto/README.txt +118 -0
- package/src/assets/fonts/Roboto/Roboto-Italic-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/fonts/Roboto/Roboto-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/fonts/Roboto_Mono/OFL.txt +93 -0
- package/src/assets/fonts/Roboto_Mono/README.txt +77 -0
- package/src/assets/fonts/Roboto_Mono/RobotoMono-Italic-VariableFont_wght.ttf +0 -0
- package/src/assets/fonts/Roboto_Mono/RobotoMono-VariableFont_wght.ttf +0 -0
- package/src/assets/html/application.html +34 -9
- package/src/assets/html/window.html +6 -7
- package/src/assets/themes/default.css +133 -156
- package/src/assets/themes/{system-colors.css → definitions.css} +50 -7
- package/src/assets/themes/media-template.css +3 -2
- package/src/assets/themes/media.css +3 -2
- package/src/assets/themes/prompt-template.css +4 -1
- package/src/assets/themes/prompt.css +4 -1
- package/src/assets/html/application-template.html +0 -164
- package/src/assets/html/window-template.html +0 -39
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sunrize",
|
|
3
3
|
"productName": "Sunrize X3D Editor",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"description": "Sunrize — A Multi-Platform X3D Editor",
|
|
6
6
|
"main": "src/main.js",
|
|
7
7
|
"bin": {
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"3D",
|
|
40
40
|
"3DGS",
|
|
41
41
|
"editor",
|
|
42
|
-
"
|
|
42
|
+
"Electron",
|
|
43
|
+
"Gaussian-Splatting",
|
|
43
44
|
"GLB",
|
|
44
45
|
"glTF2",
|
|
45
46
|
"JavaScript",
|
|
@@ -99,7 +100,7 @@
|
|
|
99
100
|
"@vscode/codicons": "^0.0.45",
|
|
100
101
|
"capitalize": "^2.0.4",
|
|
101
102
|
"console": "^0.7.2",
|
|
102
|
-
"electron": "^44.
|
|
103
|
+
"electron": "^44.7.0",
|
|
103
104
|
"electron-prompt": "^1.7.0",
|
|
104
105
|
"electron-squirrel-startup": "^1.0.1",
|
|
105
106
|
"electron-tabs": "^1.0.4",
|
|
@@ -107,8 +108,7 @@
|
|
|
107
108
|
"jquery": "^3.7.1",
|
|
108
109
|
"jquery-ui-dist": "^1.13.3",
|
|
109
110
|
"jstree": "^3.3.17",
|
|
110
|
-
"material-
|
|
111
|
-
"material-symbols": "^0.47.6",
|
|
111
|
+
"material-symbols": "^0.48.0",
|
|
112
112
|
"md5": "^2.3.0",
|
|
113
113
|
"mime-types": "^3.0.2",
|
|
114
114
|
"monaco-editor": "^0.55.1",
|
|
@@ -118,11 +118,11 @@
|
|
|
118
118
|
"string-similarity": "^4.0.4",
|
|
119
119
|
"tweakpane": "^4.0.5",
|
|
120
120
|
"update-electron-app": "^3.3.0",
|
|
121
|
-
"x_ite": "^16.
|
|
121
|
+
"x_ite": "^16.5.0",
|
|
122
122
|
"x_ite-off-parser": "^1.3.0",
|
|
123
123
|
"x_ite-sog-parser": "^2.1.0",
|
|
124
124
|
"x_ite-spz-parser": "^2.1.0",
|
|
125
|
-
"x3d-traverse": "^
|
|
125
|
+
"x3d-traverse": "^3.0.2"
|
|
126
126
|
},
|
|
127
127
|
"allowScripts": {
|
|
128
128
|
"electron-winstaller@5.4.4": true,
|
|
@@ -61,6 +61,8 @@ module .exports = class Application
|
|
|
61
61
|
defaultEditMenu: false,
|
|
62
62
|
undoLabel: _("Undo"),
|
|
63
63
|
redoLabel: _("Redo"),
|
|
64
|
+
sidebar: true,
|
|
65
|
+
footer: true,
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
this .config .setDefaultValues ({
|
|
@@ -77,8 +79,6 @@ module .exports = class Application
|
|
|
77
79
|
size: [1100, 680],
|
|
78
80
|
});
|
|
79
81
|
|
|
80
|
-
Template .create (path .join (__dirname, "../assets/html/application-template.html"));
|
|
81
|
-
Template .create (path .join (__dirname, "../assets/html/window-template.html"));
|
|
82
82
|
Template .create (path .join (__dirname, "../assets/themes/media-template.css"));
|
|
83
83
|
Template .create (path .join (__dirname, "../assets/themes/prompt-template.css"));
|
|
84
84
|
|
|
@@ -586,6 +586,25 @@ module .exports = class Application
|
|
|
586
586
|
click: () => this .mainWindow .webContents .send ("toggle-developer-tools"),
|
|
587
587
|
},
|
|
588
588
|
{ type: "separator" },
|
|
589
|
+
{
|
|
590
|
+
label: _("Appearance"),
|
|
591
|
+
submenu: [
|
|
592
|
+
{
|
|
593
|
+
label: _("Sidebar"),
|
|
594
|
+
type: "checkbox",
|
|
595
|
+
checked: this .menuOptions .sidebar,
|
|
596
|
+
accelerator: "CmdOrCtrl+B",
|
|
597
|
+
click: () => this .mainWindow .webContents .send ("toggle-sidebar", !this .menuOptions .sidebar),
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
label: _("Panel"),
|
|
601
|
+
type: "checkbox",
|
|
602
|
+
checked: this .menuOptions .footer,
|
|
603
|
+
accelerator: "CmdOrCtrl+J",
|
|
604
|
+
click: () => this .mainWindow .webContents .send ("toggle-footer", !this .menuOptions .footer),
|
|
605
|
+
},
|
|
606
|
+
],
|
|
607
|
+
},
|
|
589
608
|
{
|
|
590
609
|
label: _("Outline Editor"),
|
|
591
610
|
submenu: [
|
|
@@ -16,6 +16,9 @@ module .exports = class Dashboard extends Interface
|
|
|
16
16
|
this .document = document;
|
|
17
17
|
this .toolbar = element;
|
|
18
18
|
|
|
19
|
+
this .toolbar
|
|
20
|
+
.addClass (["toolbar", "vertical-toolbar", "secondary-toolbar", "dash-board"]);
|
|
21
|
+
|
|
19
22
|
this .setup ();
|
|
20
23
|
}
|
|
21
24
|
|
|
@@ -36,17 +39,18 @@ module .exports = class Dashboard extends Interface
|
|
|
36
39
|
.on ("click", () => this .arrow ());
|
|
37
40
|
|
|
38
41
|
this .playButton = $("<span></span>")
|
|
39
|
-
.addClass (["material-
|
|
42
|
+
.addClass (["material-symbols-outlined", "fill"])
|
|
40
43
|
.attr ("title", _("Toggle browser update."))
|
|
41
|
-
.css (
|
|
44
|
+
.css ("translate", "-1px")
|
|
45
|
+
.css ("scale", "1.4")
|
|
42
46
|
.text ("play_arrow")
|
|
43
47
|
.appendTo (this .toolbar)
|
|
44
48
|
.on ("click", () => this .play (!this .config .file .play));
|
|
45
49
|
|
|
46
50
|
this .volumeButton = $("<span></span>")
|
|
47
|
-
.addClass (["material-
|
|
51
|
+
.addClass (["material-symbols-outlined", "fill"])
|
|
48
52
|
.attr ("title", _("Adjust global sound intensity."))
|
|
49
|
-
.css (
|
|
53
|
+
.css ("translate", "1px")
|
|
50
54
|
.text ("volume_down")
|
|
51
55
|
.appendTo (this .toolbar)
|
|
52
56
|
.on ("click", () => this .showVolumeSlider ());
|
|
@@ -59,17 +63,21 @@ module .exports = class Dashboard extends Interface
|
|
|
59
63
|
const hierarchy = require ("./Hierarchy");
|
|
60
64
|
|
|
61
65
|
this .upButton = $("<span></span>")
|
|
62
|
-
.addClass (["material-
|
|
66
|
+
.addClass (["material-symbols-outlined", "fill", "disabled"])
|
|
63
67
|
.attr ("title", _("Select parent node(s)."))
|
|
64
|
-
.css (
|
|
68
|
+
.css ("rotate", "-90deg")
|
|
69
|
+
.css ("scale", "1 1.2")
|
|
70
|
+
.css ("margin", "-2px 0 -6px 0")
|
|
65
71
|
.text ("play_arrow")
|
|
66
72
|
.appendTo (this .toolbar)
|
|
67
73
|
.on ("click", () => this .selectParent ());
|
|
68
74
|
|
|
69
75
|
this .downButton = $("<span></span>")
|
|
70
|
-
.addClass (["material-
|
|
76
|
+
.addClass (["material-symbols-outlined", "fill", "disabled"])
|
|
71
77
|
.attr ("title", _("Select child node(s)."))
|
|
72
|
-
.css (
|
|
78
|
+
.css ("rotate", "90deg")
|
|
79
|
+
.css ("scale", "1 1.2")
|
|
80
|
+
.css ("margin", "-6px 0 -2px 0")
|
|
73
81
|
.text ("play_arrow")
|
|
74
82
|
.appendTo (this .toolbar)
|
|
75
83
|
.on ("click", () => this .selectChild ());
|
|
@@ -79,14 +87,14 @@ module .exports = class Dashboard extends Interface
|
|
|
79
87
|
$("<span></span>") .addClass ("separator") .appendTo (this .toolbar);
|
|
80
88
|
|
|
81
89
|
this .viewSelectedButton = $("<span></span>")
|
|
82
|
-
.addClass (
|
|
90
|
+
.addClass ("material-symbols-outlined")
|
|
83
91
|
.attr ("title", _("Look at selected objects."))
|
|
84
92
|
.text ("center_focus_strong")
|
|
85
93
|
.appendTo (this .toolbar)
|
|
86
94
|
.on ("click", () => this .viewAll (true));
|
|
87
95
|
|
|
88
96
|
this .viewAllButton = $("<span></span>")
|
|
89
|
-
.addClass (
|
|
97
|
+
.addClass ("material-symbols-outlined")
|
|
90
98
|
.attr ("title", _("Look at all objects in active layer."))
|
|
91
99
|
.text ("zoom_out_map")
|
|
92
100
|
.appendTo (this .toolbar)
|
|
@@ -102,7 +110,7 @@ module .exports = class Dashboard extends Interface
|
|
|
102
110
|
$("<span></span>") .addClass ("separator") .appendTo (this .toolbar);
|
|
103
111
|
|
|
104
112
|
this .showPanelsButton = $("<span></span>")
|
|
105
|
-
.addClass (
|
|
113
|
+
.addClass ("material-symbols-outlined")
|
|
106
114
|
.attr ("title", _("Show Node Panel."))
|
|
107
115
|
.text ("edit_note")
|
|
108
116
|
.appendTo (this .toolbar)
|
|
@@ -214,7 +222,7 @@ module .exports = class Dashboard extends Interface
|
|
|
214
222
|
outlineEditor .expandTo (node, { expandObject: true, expandAll: true });
|
|
215
223
|
|
|
216
224
|
const elements = nodes .map (node => outlineEditor .sceneGraph
|
|
217
|
-
.find (`:is(.node, .imported-node.
|
|
225
|
+
.find (`:is(.node, .imported-node.instance)[node-id="${node .getId ()}"]`));
|
|
218
226
|
|
|
219
227
|
outlineEditor .deselectAll ({ target: false });
|
|
220
228
|
|
|
@@ -223,19 +231,13 @@ module .exports = class Dashboard extends Interface
|
|
|
223
231
|
if (element .is (".node"))
|
|
224
232
|
outlineEditor .selectNodeElement (element, { add: true });
|
|
225
233
|
|
|
226
|
-
else if (element .is (".imported-node.
|
|
234
|
+
else if (element .is (".imported-node.instance"))
|
|
227
235
|
outlineEditor .selectPrimaryElement (element, { add: true });
|
|
228
236
|
}
|
|
229
237
|
|
|
230
238
|
// Scroll element into view.
|
|
231
|
-
// Hide scrollbars during scroll to prevent overlay issue.
|
|
232
|
-
|
|
233
|
-
outlineEditor .treeView .css ("overflow", "hidden");
|
|
234
239
|
|
|
235
240
|
elements [0] ?.[0] ?.scrollIntoView ({ block: "center", inline: "start", behavior: "smooth" });
|
|
236
|
-
$(window) .scrollTop (0);
|
|
237
|
-
|
|
238
|
-
setTimeout (() => outlineEditor .treeView .css ("overflow", ""), 1000);
|
|
239
241
|
}
|
|
240
242
|
|
|
241
243
|
onHierarchy ()
|
|
@@ -22,9 +22,6 @@ const handler =
|
|
|
22
22
|
if (String (value) .match (/^(?:undefined|null)$/))
|
|
23
23
|
return target .getDefaultValue (key);
|
|
24
24
|
|
|
25
|
-
// Update timestamp.
|
|
26
|
-
storage [namespace + key + ".#timeStamp"] = JSON .stringify (Date .now ());
|
|
27
|
-
|
|
28
25
|
return JSON .parse (value);
|
|
29
26
|
},
|
|
30
27
|
set (target, key, value)
|
|
@@ -34,15 +31,9 @@ const handler =
|
|
|
34
31
|
namespace = target .getNameSpace ();
|
|
35
32
|
|
|
36
33
|
if (value === undefined)
|
|
37
|
-
{
|
|
38
|
-
storage .removeItem (namespace + key + ".#timeStamp");
|
|
39
34
|
storage .removeItem (namespace + key);
|
|
40
|
-
}
|
|
41
35
|
else
|
|
42
|
-
|
|
43
|
-
storage [namespace + key + ".#timeStamp"] = JSON .stringify (Date .now ());
|
|
44
|
-
storage [namespace + key] = JSON .stringify (value);
|
|
45
|
-
}
|
|
36
|
+
storage [namespace + key] = JSON .stringify (value);
|
|
46
37
|
|
|
47
38
|
return true;
|
|
48
39
|
},
|
|
@@ -61,8 +52,15 @@ const handler =
|
|
|
61
52
|
|
|
62
53
|
for (const key of Object .keys (storage))
|
|
63
54
|
{
|
|
64
|
-
if (key .startsWith (namespace)
|
|
65
|
-
|
|
55
|
+
if (!key .startsWith (namespace))
|
|
56
|
+
continue;
|
|
57
|
+
|
|
58
|
+
const end = key .substring (namespace .length);
|
|
59
|
+
|
|
60
|
+
if (end .includes ("."))
|
|
61
|
+
continue;
|
|
62
|
+
|
|
63
|
+
ownKeys .push (end);
|
|
66
64
|
}
|
|
67
65
|
|
|
68
66
|
return ownKeys;
|
|
@@ -148,31 +146,6 @@ module .exports = class DataStorage
|
|
|
148
146
|
return value === undefined ? undefined : JSON .parse (JSON .stringify (value));
|
|
149
147
|
}
|
|
150
148
|
|
|
151
|
-
/**
|
|
152
|
-
*
|
|
153
|
-
* @param {number} before
|
|
154
|
-
*/
|
|
155
|
-
removeItems (before = Date .now ())
|
|
156
|
-
{
|
|
157
|
-
const
|
|
158
|
-
storage = this .getStorage (),
|
|
159
|
-
namespace = this .getNameSpace ();
|
|
160
|
-
|
|
161
|
-
for (const key of Object .keys (storage))
|
|
162
|
-
{
|
|
163
|
-
if (key .startsWith (namespace) && !key .endsWith (".#timeStamp"))
|
|
164
|
-
{
|
|
165
|
-
const timeStamp = JSON .parse (storage [key + ".#timeStamp"]);
|
|
166
|
-
|
|
167
|
-
if (timeStamp < before)
|
|
168
|
-
{
|
|
169
|
-
storage .removeItem (key + ".#timeStamp");
|
|
170
|
-
storage .removeItem (key);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
149
|
clear ()
|
|
177
150
|
{
|
|
178
151
|
const
|
|
@@ -40,6 +40,8 @@ module .exports = class Document extends Interface
|
|
|
40
40
|
autoSave: true,
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
this .config .file .clear ();
|
|
44
|
+
|
|
43
45
|
// Layout
|
|
44
46
|
|
|
45
47
|
this .verticalSplitter = new Splitter ($("#vertical-splitter"), "vertical");
|
|
@@ -52,6 +54,23 @@ module .exports = class Document extends Interface
|
|
|
52
54
|
// Prevent scrolling when Panel becomes larger.
|
|
53
55
|
$("#vertical-splitter") .on ("scroll", () => $("#vertical-splitter") .scrollTop (0));
|
|
54
56
|
|
|
57
|
+
// Splitter
|
|
58
|
+
|
|
59
|
+
this .verticalSplitter .snapToBorder = true;
|
|
60
|
+
this .horizontalSplitter .snapToBorder = true;
|
|
61
|
+
|
|
62
|
+
this .verticalSplitter .handle .on ("position", () => this .verticalSplitterPosition ());
|
|
63
|
+
this .horizontalSplitter .handle .on ("position", () => this .horizontalSplitterPosition ());
|
|
64
|
+
|
|
65
|
+
this .verticalSplitter .handle .on ("position", () => this .updateBrowserSize ());
|
|
66
|
+
this .horizontalSplitter .handle .on ("position", () => this .updateBrowserSize ());
|
|
67
|
+
this .verticalSplitter .handle .on ("resizestart", () => this .startBrowserSize ());
|
|
68
|
+
this .horizontalSplitter .handle .on ("resizestart", () => this .startBrowserSize ());
|
|
69
|
+
this .verticalSplitter .handle .on ("resizestop", () => this .endBrowserSize ());
|
|
70
|
+
this .horizontalSplitter .handle .on ("resizestop", () => this .endBrowserSize ());
|
|
71
|
+
|
|
72
|
+
this .footer .maximizeButton .on ("click", () => this .toggleFooterMaximize ());
|
|
73
|
+
|
|
55
74
|
// Additional Parsers
|
|
56
75
|
|
|
57
76
|
X3D .GoldenGate .addParsers (ImageParser, VideoParser, AudioParser);
|
|
@@ -62,9 +81,7 @@ module .exports = class Document extends Interface
|
|
|
62
81
|
*/
|
|
63
82
|
async initialize ()
|
|
64
83
|
{
|
|
65
|
-
$("html")
|
|
66
|
-
.attr ("platform", process .platform)
|
|
67
|
-
.addClass ("read-only");
|
|
84
|
+
$("html") .addClass ([process .platform, "readonly"]);
|
|
68
85
|
|
|
69
86
|
// Actions
|
|
70
87
|
|
|
@@ -104,6 +121,8 @@ module .exports = class Document extends Interface
|
|
|
104
121
|
|
|
105
122
|
// View Menu
|
|
106
123
|
|
|
124
|
+
electron .ipcRenderer .on ("toggle-sidebar", (event, value) => this .toggleSidebar (value));
|
|
125
|
+
electron .ipcRenderer .on ("toggle-footer", (event, value) => this .toggleFooter (value));
|
|
107
126
|
electron .ipcRenderer .on ("primitive-quality", (event, value) => this .setPrimitiveQuality (value, true));
|
|
108
127
|
electron .ipcRenderer .on ("texture-quality", (event, value) => this .setTextureQuality (value, true));
|
|
109
128
|
electron .ipcRenderer .on ("text-compression", (event, value) => this .setTextCompression (value, true));
|
|
@@ -177,7 +196,7 @@ module .exports = class Document extends Interface
|
|
|
177
196
|
.on ("mouseup", event => this .onselect (event));
|
|
178
197
|
|
|
179
198
|
$("#browser-frame")
|
|
180
|
-
.on ("contextmenu", event => this .
|
|
199
|
+
.on ("contextmenu", event => this .showContextMenu (event));
|
|
181
200
|
|
|
182
201
|
electron .ipcRenderer .on ("document", (event, key, ... args) => this [key] (... args));
|
|
183
202
|
|
|
@@ -204,7 +223,7 @@ module .exports = class Document extends Interface
|
|
|
204
223
|
await this .restoreFile ();
|
|
205
224
|
|
|
206
225
|
if (!this .isInitialScene)
|
|
207
|
-
$("html") .removeClass ("
|
|
226
|
+
$("html") .removeClass ("readonly");
|
|
208
227
|
}
|
|
209
228
|
|
|
210
229
|
configure ()
|
|
@@ -212,6 +231,8 @@ module .exports = class Document extends Interface
|
|
|
212
231
|
this .config .file .setDefaultValues ({
|
|
213
232
|
commonMetaData: true,
|
|
214
233
|
inferProfileAndComponents: true,
|
|
234
|
+
sidebar: true,
|
|
235
|
+
footer: true,
|
|
215
236
|
primitiveQuality: "MEDIUM",
|
|
216
237
|
textureQuality: "MEDIUM",
|
|
217
238
|
textCompression: "CHAR_SPACING",
|
|
@@ -228,6 +249,7 @@ module .exports = class Document extends Interface
|
|
|
228
249
|
|
|
229
250
|
// Configure browser options.
|
|
230
251
|
|
|
252
|
+
this .setTextureQuality (this .config .file .textureQuality);
|
|
231
253
|
this .setPrimitiveQuality (this .config .file .primitiveQuality);
|
|
232
254
|
this .setTextureQuality (this .config .file .textureQuality);
|
|
233
255
|
this .setTextCompression (this .config .file .textCompression);
|
|
@@ -271,6 +293,8 @@ module .exports = class Document extends Interface
|
|
|
271
293
|
this .updateMenu ();
|
|
272
294
|
|
|
273
295
|
electron .ipcRenderer .sendToHost ("focus");
|
|
296
|
+
electron .ipcRenderer .sendToHost ("sidebar", this .config .file .sidebar);
|
|
297
|
+
electron .ipcRenderer .sendToHost ("footer", this .config .file .footer);
|
|
274
298
|
|
|
275
299
|
// Live Handling
|
|
276
300
|
|
|
@@ -298,7 +322,7 @@ module .exports = class Document extends Interface
|
|
|
298
322
|
|
|
299
323
|
this .updateEditMenu (menu);
|
|
300
324
|
this .updateUndoMenus (menu);
|
|
301
|
-
this .
|
|
325
|
+
this .updateViewMenus (menu);
|
|
302
326
|
this .updateGridMenus (menu);
|
|
303
327
|
this .updateSnapToolMenus (menu);
|
|
304
328
|
|
|
@@ -317,13 +341,13 @@ module .exports = class Document extends Interface
|
|
|
317
341
|
{
|
|
318
342
|
this .activeElement
|
|
319
343
|
.off ("contextmenu.Document")
|
|
320
|
-
.on ("contextmenu.Document", () => this .
|
|
344
|
+
.on ("contextmenu.Document", () => this .showEditContextMenu ());
|
|
321
345
|
}
|
|
322
346
|
|
|
323
347
|
electron .ipcRenderer .send ("update-menu", this .updateEditMenu ({ }));
|
|
324
348
|
}
|
|
325
349
|
|
|
326
|
-
async
|
|
350
|
+
async showEditContextMenu ()
|
|
327
351
|
{
|
|
328
352
|
await $.sleep ();
|
|
329
353
|
|
|
@@ -727,6 +751,107 @@ module .exports = class Document extends Interface
|
|
|
727
751
|
* View Menu
|
|
728
752
|
*/
|
|
729
753
|
|
|
754
|
+
toggleSidebar ()
|
|
755
|
+
{
|
|
756
|
+
if (this .verticalSplitter .position < 1)
|
|
757
|
+
this .verticalSplitter .toggle ("maximize");
|
|
758
|
+
else
|
|
759
|
+
this .verticalSplitter .toggle ("restore");
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
verticalSplitterPosition ()
|
|
763
|
+
{
|
|
764
|
+
const sidebar = this .verticalSplitter .position < 1;
|
|
765
|
+
|
|
766
|
+
if (this .config .file .sidebar === sidebar)
|
|
767
|
+
return;
|
|
768
|
+
|
|
769
|
+
this .config .file .sidebar = sidebar;
|
|
770
|
+
|
|
771
|
+
electron .ipcRenderer .sendToHost ("sidebar", sidebar);
|
|
772
|
+
|
|
773
|
+
this .updateMenu ();
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
toggleFooter ()
|
|
777
|
+
{
|
|
778
|
+
if (this .horizontalSplitter .position < 1)
|
|
779
|
+
this .horizontalSplitter .toggle ("maximize");
|
|
780
|
+
else
|
|
781
|
+
this .horizontalSplitter .toggle ("restore");
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
horizontalSplitterPosition ()
|
|
785
|
+
{
|
|
786
|
+
const
|
|
787
|
+
footer = this .horizontalSplitter .position < 1,
|
|
788
|
+
maximized = this .horizontalSplitter .position === 0;
|
|
789
|
+
|
|
790
|
+
if (maximized)
|
|
791
|
+
{
|
|
792
|
+
this .footer .footer .addClass ("maximized");
|
|
793
|
+
this .footer .maximizeButton .addClass ("active");
|
|
794
|
+
}
|
|
795
|
+
else
|
|
796
|
+
{
|
|
797
|
+
this .footer .footer .removeClass ("maximized");
|
|
798
|
+
this .footer .maximizeButton .removeClass ("active");
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
if (this .config .file .footer === footer)
|
|
802
|
+
return;
|
|
803
|
+
|
|
804
|
+
this .config .file .footer = footer;
|
|
805
|
+
|
|
806
|
+
electron .ipcRenderer .sendToHost ("footer", footer);
|
|
807
|
+
|
|
808
|
+
this .updateMenu ();
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
toggleFooterMaximize ()
|
|
812
|
+
{
|
|
813
|
+
const maximized = this .horizontalSplitter .position === 0;
|
|
814
|
+
|
|
815
|
+
if (maximized)
|
|
816
|
+
this .horizontalSplitter .toggle ("restore");
|
|
817
|
+
else
|
|
818
|
+
this .horizontalSplitter .toggle ("minimize");
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
toggleMaximizeView ()
|
|
822
|
+
{
|
|
823
|
+
if (this .config .file .sidebar || this .config .file .footer)
|
|
824
|
+
{
|
|
825
|
+
this .verticalSplitter .toggle ("maximize");
|
|
826
|
+
this .horizontalSplitter .toggle ("maximize");
|
|
827
|
+
}
|
|
828
|
+
else
|
|
829
|
+
{
|
|
830
|
+
this .verticalSplitter .toggle ("restore");
|
|
831
|
+
this .horizontalSplitter .toggle ("restore");
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
updateBrowserSize ()
|
|
836
|
+
{
|
|
837
|
+
const
|
|
838
|
+
frame = $("#browser-frame"),
|
|
839
|
+
width = Math .round (frame .innerWidth ()),
|
|
840
|
+
height = Math .round (frame .innerHeight ());
|
|
841
|
+
|
|
842
|
+
$("#browser-size") .text (`${width} × ${height}`);
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
startBrowserSize ()
|
|
846
|
+
{
|
|
847
|
+
$("#browser-size") .addClass ("visible");
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
endBrowserSize ()
|
|
851
|
+
{
|
|
852
|
+
$("#browser-size") .removeClass ("visible");
|
|
853
|
+
}
|
|
854
|
+
|
|
730
855
|
/**
|
|
731
856
|
*
|
|
732
857
|
* @param {string} value
|
|
@@ -895,10 +1020,17 @@ module .exports = class Document extends Interface
|
|
|
895
1020
|
this .updateMenu ();
|
|
896
1021
|
}
|
|
897
1022
|
|
|
898
|
-
|
|
1023
|
+
showLibrary ()
|
|
1024
|
+
{
|
|
1025
|
+
require ("../Editors/Library") .open (this .browser .currentScene);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
updateViewMenus (menu)
|
|
899
1029
|
{
|
|
900
1030
|
Object .assign (menu,
|
|
901
1031
|
{
|
|
1032
|
+
sidebar: this .config .file .sidebar,
|
|
1033
|
+
footer: this .config .file .footer,
|
|
902
1034
|
primitiveQuality: this .config .file .primitiveQuality,
|
|
903
1035
|
textureQuality: this .config .file .textureQuality,
|
|
904
1036
|
textCompression: this .config .file .textCompression,
|
|
@@ -912,11 +1044,6 @@ module .exports = class Document extends Interface
|
|
|
912
1044
|
});
|
|
913
1045
|
}
|
|
914
1046
|
|
|
915
|
-
showLibrary ()
|
|
916
|
-
{
|
|
917
|
-
require ("../Editors/Library") .open (this .browser .currentScene);
|
|
918
|
-
}
|
|
919
|
-
|
|
920
1047
|
/*
|
|
921
1048
|
* Layout Menu
|
|
922
1049
|
*/
|
|
@@ -1194,14 +1321,8 @@ module .exports = class Document extends Interface
|
|
|
1194
1321
|
outlineEditor .selectNodeElement ($(element), { add: (event .shiftKey || event .metaKey) || i > 0, target: true });
|
|
1195
1322
|
|
|
1196
1323
|
// Scroll element into view.
|
|
1197
|
-
// Hide scrollbars during scroll to prevent overlay issue.
|
|
1198
|
-
|
|
1199
|
-
outlineEditor .treeView .css ("overflow", "hidden");
|
|
1200
1324
|
|
|
1201
1325
|
elements [0] ?.scrollIntoView ({ block: "center", inline: "start", behavior: "smooth" });
|
|
1202
|
-
$(window) .scrollTop (0);
|
|
1203
|
-
|
|
1204
|
-
setTimeout (() => outlineEditor .treeView .css ("overflow", ""), 1000);
|
|
1205
1326
|
}
|
|
1206
1327
|
|
|
1207
1328
|
activateSnapTarget (visible)
|
|
@@ -1312,7 +1433,7 @@ module .exports = class Document extends Interface
|
|
|
1312
1433
|
* Context Menu
|
|
1313
1434
|
*/
|
|
1314
1435
|
|
|
1315
|
-
|
|
1436
|
+
showContextMenu (event)
|
|
1316
1437
|
{
|
|
1317
1438
|
if (event .shiftKey || event .ctrlKey || event .metaKey)
|
|
1318
1439
|
return;
|
|
@@ -1329,7 +1450,13 @@ module .exports = class Document extends Interface
|
|
|
1329
1450
|
type: "radio",
|
|
1330
1451
|
checked: viewpointNode ._isBound .getValue (),
|
|
1331
1452
|
args: ["bindViewpoint", index + 1],
|
|
1332
|
-
}))
|
|
1453
|
+
}))
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
label: _("Maximize View"),
|
|
1457
|
+
type: "checkbox",
|
|
1458
|
+
checked: !(this .config .file .sidebar || this .config .file .footer),
|
|
1459
|
+
args: ["toggleMaximizeView"],
|
|
1333
1460
|
},
|
|
1334
1461
|
];
|
|
1335
1462
|
|