Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
PhaserEditor2D committed Jan 7, 2021
2 parents cc3e08b + 930916d commit dbe6d8b
Show file tree
Hide file tree
Showing 27 changed files with 46,162 additions and 45,584 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Change Log

## v3.9.10 - Dec 22, 2020
## v3.10.1 - January 7, 2021

### Updated

* Theme restoring is managed by the colibri platform. This is not backward-compatible, your saved theme id will be ignored the first time you run this version of the editor.
* Moved `phasereditor2d.inspector` plugin to `colibri.inspector`.
* Get Phaser v3.51.0.

## v3.10.0 - Dec 22, 2020

### Added

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "phasereditor2d.inspector",
"id": "colibri.inspector",
"styles": [
"styles/InspectorView.css"
],
"scripts": [
"_out/phasereditor2d.inspector.js"
"_out/colibri.inspector.js"
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace phasereditor2d.inspector {
namespace colibri.inspector {

import ide = colibri.ui.ide;

Expand All @@ -13,7 +13,7 @@ namespace phasereditor2d.inspector {
}

private constructor() {
super("phasereditor2d.inspector");
super("colibri.inspector");
}

registerExtensions(reg: colibri.ExtensionRegistry) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../../tsconfig-base.json",
"compilerOptions": {
"outFile": "../_out/phasereditor2d.inspector.js"
"outFile": "../_out/colibri.inspector.js"
},
"references": [{
"path": "../../colibri/src"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

namespace phasereditor2d.inspector.ui.views {
namespace colibri.inspector.ui.views {

import controls = colibri.ui.controls;
import ide = colibri.ui.ide;

export class InspectorView extends ide.ViewPart {

static VIEW_ID = "phasereditor2d.inspector.ui.views.InspectorView";
static VIEW_ID = "colibri.inspector.ui.views.InspectorView";

private _propertyPage: controls.properties.PropertyPage;
private _currentPart: ide.Part;
Expand Down
17 changes: 17 additions & 0 deletions source/editor/plugins/colibri/src/ui/controls/Controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,23 @@ namespace colibri.ui.controls {
documentClassList.add(...tokens);
}

static restoreTheme() {

const id = localStorage.getItem("colibri.theme.id");

let theme = null;

if (id) {

theme = colibri.Platform
.getExtensions<colibri.ui.ide.themes.ThemeExtension>(colibri.ui.ide.themes.ThemeExtension.POINT_ID)
.map(e => e.getTheme())
.find(t => t.id === id);
}

controls.Controls.setTheme(theme ?? controls.Controls.LIGHT_THEME);
}

static getTheme() {
return this._theme;
}
Expand Down
2 changes: 2 additions & 0 deletions source/editor/plugins/colibri/src/ui/ide/Workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ namespace colibri.ui.ide {
}
}

controls.Controls.restoreTheme();

console.log("Workbench: fetching UI icons.");

await this.preloadPluginResources();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"path": "../../phasereditor2d.outline/src"
},
{
"path": "../../phasereditor2d.inspector/src"
"path": "../../colibri.inspector/src"
},
{
"path": "../../phasereditor2d.ide/src"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace phasereditor2d.animations.ui.editors.properties {
const activePart = colibri.Platform.getWorkbench().getActivePart();

if (activePart instanceof AnimationsEditor
|| activePart instanceof phasereditor2d.inspector.ui.views.InspectorView
|| activePart instanceof colibri.inspector.ui.views.InspectorView
|| activePart instanceof phasereditor2d.outline.ui.views.OutlineView) {

return editor.getAnimations();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"path": "../../phasereditor2d.files/src"
},
{
"path": "../../phasereditor2d.inspector/src"
"path": "../../colibri.inspector/src"
},
{
"path": "../../phasereditor2d.ide/src"
Expand Down
25 changes: 1 addition & 24 deletions source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ namespace phasereditor2d.ide {

async openFirstWindow() {

this.restoreTheme();

const wb = colibri.Platform.getWorkbench();

wb.eventProjectOpened.addListener(() => {
Expand Down Expand Up @@ -294,27 +292,6 @@ namespace phasereditor2d.ide {
});
}

restoreTheme() {

const prefs = colibri.Platform.getWorkbench().getGlobalPreferences();

const themeData = prefs.getValue("phasereditor2d.ide.theme");

let theme = null;

if (themeData) {

const id = themeData.theme;

theme = colibri.Platform
.getExtensions<colibri.ui.ide.themes.ThemeExtension>(colibri.ui.ide.themes.ThemeExtension.POINT_ID)
.map(e => e.getTheme())
.find(t => t.id === id);
}

controls.Controls.setTheme(theme ?? controls.Controls.LIGHT_THEME);
}

openProjectInVSCode() {

this.openFileInVSCode(colibri.ui.ide.FileUtils.getRoot());
Expand All @@ -335,7 +312,7 @@ namespace phasereditor2d.ide {

/* program entry point */

export const VER = "3.10.0";
export const VER = "3.10.1";

async function main() {

Expand Down
2 changes: 1 addition & 1 deletion source/editor/plugins/phasereditor2d.ide/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"path": "../../phasereditor2d.outline/src"
},
{
"path": "../../phasereditor2d.inspector/src"
"path": "../../colibri.inspector/src"
},
{
"path": "../../phasereditor2d.files/src"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace phasereditor2d.ide.ui {

private _outlineView: outline.ui.views.OutlineView;
private _filesView: files.ui.views.FilesView;
private _inspectorView: inspector.ui.views.InspectorView;
private _inspectorView: colibri.inspector.ui.views.InspectorView;
private _blocksView: blocks.ui.views.BlocksView;
private _editorArea: ide.EditorArea;
private _split_Files_Blocks: controls.SplitPanel;
Expand Down Expand Up @@ -57,7 +57,7 @@ namespace phasereditor2d.ide.ui {

this._outlineView = new outline.ui.views.OutlineView();
this._filesView = new files.ui.views.FilesView();
this._inspectorView = new inspector.ui.views.InspectorView();
this._inspectorView = new colibri.inspector.ui.views.InspectorView();
this._blocksView = new blocks.ui.views.BlocksView();
this._editorArea = new ide.EditorArea();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"path": "../../phasereditor2d.outline/src"
},
{
"path": "../../phasereditor2d.inspector/src"
"path": "../../colibri.inspector/src"
},
{
"path": "../../phasereditor2d.webContentTypes/src"
Expand Down
Loading

0 comments on commit dbe6d8b

Please sign in to comment.