Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
PhaserEditor2D committed Dec 13, 2022
2 parents 43f34e4 + b00871c commit 59375d1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
2 changes: 2 additions & 0 deletions source/editor/plugins/colibri/src/ColibriPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace colibri {

export let CAPABILITY_FILE_STORAGE = true;

export const ICON_FILE = "file";
export const ICON_FOLDER = "folder";
export const ICON_PLUS = "plus";
Expand Down
15 changes: 11 additions & 4 deletions source/editor/plugins/colibri/src/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,21 @@ namespace colibri {
return image;
}

getResourceURL(pathInPlugin: string) {
getResourceURL(pathInPlugin: string, version?: string) {

return `app/plugins/${this.getId()}/${pathInPlugin}?v=${Date.now()}`;
if (version === undefined) {

version = Date.now().toString();
}

return `app/plugins/${this.getId()}/${pathInPlugin}?v=${version}`;
}

async getJSON(pathInPlugin: string) {
async getJSON(pathInPlugin: string, version?: string) {

const result = await fetch(this.getResourceURL(pathInPlugin));
const url = this.getResourceURL(pathInPlugin, version);

const result = await fetch(url);

const data = await result.json();

Expand Down
9 changes: 6 additions & 3 deletions source/editor/plugins/colibri/src/ui/ide/Workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ namespace colibri.ui.ide {

this._fileImageSizeCache = new ImageSizeFileCache();

this._fileStorage = new core.io.FileStorage_HTTPServer();
if (CAPABILITY_FILE_STORAGE) {

this._fileStringCache = new core.io.FileStringCache(this._fileStorage);
this._fileStorage = new core.io.FileStorage_HTTPServer();

this._fileStringCache = new core.io.FileStringCache(this._fileStorage);
}

this._globalPreferences = new core.preferences.Preferences("__global__");

Expand Down Expand Up @@ -197,7 +200,7 @@ namespace colibri.ui.ide {

await this._fileStorage.openProject();

const projectName =this._fileStorage.getRoot().getName();
const projectName = this._fileStorage.getRoot().getName();

console.log(`Workbench: project ${projectName} loaded.`);

Expand Down
9 changes: 6 additions & 3 deletions source/editor/plugins/colibri/src/ui/ide/WorkbenchWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,13 @@ namespace colibri.ui.ide {

Platform.getWorkbench().eventThemeChanged.addListener(() => this.layout());

FileUtils.getFileStorage().addChangeListener(e => {
if (colibri.CAPABILITY_FILE_STORAGE) {

this.onStorageChanged(e);
});
FileUtils.getFileStorage().addChangeListener(e => {

this.onStorageChanged(e);
});
}

this._toolbar = new MainToolbar();
this._clientArea = new controls.Control("div", "WindowClientArea");
Expand Down
2 changes: 1 addition & 1 deletion source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ namespace phasereditor2d.ide {

/* program entry point */

export const VER = "3.36.0";
export const VER = "3.36.1";

async function main() {

Expand Down

0 comments on commit 59375d1

Please sign in to comment.