Skip to content

Commit 513de5a

Browse files
Scener editor: reloads page when the editor is active.
1 parent 09d279f commit 513de5a

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

source/v2/phasereditor/phasereditor.scene.ui.editor.html/html/Editor.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ namespace PhaserEditor2D {
213213

214214
private onReloadPage() {
215215
this._socket.close();
216-
// window.location.reload();
217-
window.location.href = window.location.href;
216+
window.location.reload();
218217
}
219218

220219
private onUpdateSceneProperties(msg: any) {

source/v2/phasereditor/phasereditor.scene.ui.editor.html/html/out/Editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ var PhaserEditor2D;
157157
};
158158
Editor.prototype.onReloadPage = function () {
159159
this._socket.close();
160-
window.location.href = window.location.href;
160+
window.location.reload();
161161
};
162162
Editor.prototype.onUpdateSceneProperties = function (msg) {
163163
this.sceneProperties = msg.sceneProperties;

source/v2/phasereditor/phasereditor.scene.ui.editor/src/phasereditor/scene/ui/editor/SceneEditor.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public String getLabel() {
133133
private IContextActivation _searchContextActivation;
134134
private SceneEditorBlockProvider _blocksProvider;
135135
private IPartListener _partListener;
136+
private boolean _pendingBuild;
136137

137138
public SceneEditor() {
138139
_outlinerSelectionListener = new ISelectionChangedListener() {
@@ -260,6 +261,16 @@ private void reloadMethod() {
260261
}
261262

262263
public void build() {
264+
if (this == getEditorSite().getPage().getActiveEditor()) {
265+
realBuild();
266+
} else {
267+
_pendingBuild = true;
268+
}
269+
}
270+
271+
private void realBuild() {
272+
_pendingBuild = false;
273+
263274
updatePropertyPagesContentWithSelection();
264275

265276
refreshOutline();
@@ -587,6 +598,10 @@ public void partActivated(IWorkbenchPart part) {
587598
var actionBars = getEditorSite().getActionBars();
588599
_undoRedoGroup.fillActionBars(actionBars);
589600
actionBars.updateActionBars();
601+
602+
if (_pendingBuild) {
603+
realBuild();
604+
}
590605
}
591606
}
592607
};

source/v2/phasereditor/phasereditor.scene.ui.editor/src/phasereditor/scene/ui/editor/SceneWebView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class SceneWebView extends Composite {
4242
private IBrowser _webView;
4343
private SceneEditor _editor;
4444

45+
4546
public SceneWebView(SceneEditor editor, Composite parent, int style) {
4647
super(parent, style);
4748
var layout = new FillLayout();
@@ -50,6 +51,7 @@ public SceneWebView(SceneEditor editor, Composite parent, int style) {
5051
setLayout(layout);
5152

5253
_editor = editor;
54+
5355

5456
_webView = IBrowser.create(this, SWT.NONE);
5557

source/v2/releng/.project

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,10 @@
1919
<type>1</type>
2020
<locationURI>$%7BPARENT-1-PROJECT_LOC%7D/pom.xml</locationURI>
2121
</link>
22+
<link>
23+
<name>scripts</name>
24+
<type>2</type>
25+
<location>/home/arian/Documents/PhaserEditor/Public/scripts</location>
26+
</link>
2227
</linkedResources>
2328
</projectDescription>

0 commit comments

Comments
 (0)