Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
PhaserEditor2D committed Sep 18, 2021
2 parents ef4b09a + 678b938 commit 7e11991
Show file tree
Hide file tree
Showing 219 changed files with 17,291 additions and 361,353 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Change Log

## v3.30.0 - Sep 8, 2020

### Added

* The CodeMirror text editors.
* The allInOne commands: Open project, Close project.

### Updated

* The Monaco editor always runs on advanced mode.
* Update to latest Phaser 3.55.2.

### Remove

* Removes all features related to create and load projects. It now shows a single project at the time.

## v3.20.0 - Aug 23, 2021

### Added
Expand Down Expand Up @@ -29,7 +45,7 @@
* Scene Editor (BitmapText): fixes error when the font data isn't available in the cache.
* [#134](https://github.com/PhaserEditor2D/PhaserEditor2D-v3/issues/134) Creating a list in the editor results in an initialized array in the generated code.
* [#135](https://github.com/PhaserEditor2D/PhaserEditor2D-v3/issues/135) Word wrap width does not behave correctly
* Scene Editor: fixes Move To Parent dialog in context of prefab scenes.
* Scene Editor: fixes Move To Parent dialog in context of prefab s\cenes.
* Scene Editor: fixes Scene section layout when shows a prefab's instance.
* [#142](https://github.com/PhaserEditor2D/PhaserEditor2D-v3/issues/142) Animations Editor: fixes changing multiple properties of the same animation.

Expand Down
31 changes: 10 additions & 21 deletions source/editor/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions source/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
"description": "Phaser Editor 2D IDE.",
"repository": "github:PhaserEditor2D/PhaserEditor2D-v3",
"devDependencies": {
"tslint": "^6.1.3"
"tslint": "^6.1.3",
"typescript": "^4.3.2"
},
"author": "Arian Fornaris <[email protected]> (https://phasereditor2d.com)",
"license": "MIT",
"dependencies": {
"monaco-editor": "^0.25.2",
"typescript": "^4.3.2"
}
}
"license": "MIT"
}
23 changes: 5 additions & 18 deletions source/editor/plugins/colibri/src/core/io/FilePath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,32 +154,19 @@ namespace colibri.core.io {

getUrl(): string {

if (this._parent) {

const url = this._parent.getUrl() + "/" + this._name;

if (this.isFile()) {
let relName = this.getProjectRelativeName();

return url + "?m=" + this._modTime;
}
if (this.isFile()) {

return url;
relName += "?m=" + this.getModTime()
}

const projectName = this.getProject().getName();

return `./project/${projectName}`;
return `./project${relName}`;
}

getExternalUrl() {

if (this._parent) {
return this._parent.getExternalUrl() + "/" + this._name;
}

const projectName = this.getProject().getName();

return `./external/${projectName}`;
return `./external${this.getProjectRelativeName()}`;
}

getProject(): FilePath {
Expand Down
75 changes: 5 additions & 70 deletions source/editor/plugins/colibri/src/core/io/HTTPServerFileStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace colibri.core.io {

private _root: FilePath;
private _changeListeners: ChangeListenerFunc[];
private _projectName: string;
private _hash: string;

constructor() {
Expand Down Expand Up @@ -96,14 +95,7 @@ namespace colibri.core.io {

private async updateWithServerChanges() {

if (!this._projectName) {

return;
}

const hashData = await apiRequest("GetProjectFilesHash", {
project: this._projectName
});
const hashData = await apiRequest("GetProjectFilesHash", {});

if (hashData.error) {

Expand All @@ -122,9 +114,7 @@ namespace colibri.core.io {

this._hash = hash;

const data = await apiRequest("GetProjectFiles", {
project: this._projectName
}) as IGetProjectFilesData;
const data = await apiRequest("GetProjectFiles", {}) as IGetProjectFilesData;

if (data.error) {

Expand Down Expand Up @@ -292,12 +282,10 @@ namespace colibri.core.io {
return this._root;
}

async openProject(projectName: string): Promise<FilePath> {
async openProject(): Promise<FilePath> {

this._root = null;

this._projectName = projectName;

this._hash = "";

await this.reload();
Expand All @@ -313,29 +301,6 @@ namespace colibri.core.io {
return root;
}

async isValidAccount(): Promise<string> {

const data = await apiRequest("GetIsValidAccount", {});

return data.message;
}

async getProjectTemplates(): Promise<ProjectTemplatesData> {

const data = await apiRequest("GetProjectTemplates", {});

if (data.error) {

alert("Cannot get the project templates");

return {
providers: []
};
}

return data["templatesData"];
}

async createProject(templatePath: string, projectName: string): Promise<boolean> {

const data = await apiRequest("CreateProject", {
Expand All @@ -355,16 +320,14 @@ namespace colibri.core.io {

async reload(): Promise<void> {

const data = await apiRequest("GetProjectFiles", {
project: this._projectName
}) as IGetProjectFilesData;
const data = await apiRequest("GetProjectFiles", {}) as IGetProjectFilesData;

let newRoot: FilePath;

if (data.projectNumberOfFiles > data.maxNumberOfFiles) {

newRoot = new FilePath(null, {
name: this._projectName,
name: "Unavailable",
modTime: 0,
size: 0,
children: [],
Expand Down Expand Up @@ -402,34 +365,6 @@ namespace colibri.core.io {
}
}

async changeWorkspace(path: string) {

const data = await apiRequest("ChangeWorkspace", { path });

if (data.error) {

alert(`Cannot get the projects list`);

throw new Error(data.error);
}
}

async getProjects(workspacePath?: string): Promise<IProjectsData> {

const data = await apiRequest("GetProjects", {
workspace: workspacePath
});

if (data.error) {

alert(`Cannot get the projects list`);

throw new Error(data.error);
}

return { projects: data.projects, workspacePath: data.workspace };
}

async createFile(folder: FilePath, fileName: string, content: string): Promise<FilePath> {

const file = new FilePath(folder, {
Expand Down
11 changes: 1 addition & 10 deletions source/editor/plugins/colibri/src/core/io/IFileStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,7 @@ namespace colibri.core.io {

reload(): Promise<void>;

changeWorkspace(serverPath: string): Promise<void>

getProjects(workspacePath?: string): Promise<IProjectsData>;

openProject(projectName: string): Promise<FilePath>;

isValidAccount(): Promise<string>;

getProjectTemplates(): Promise<ProjectTemplatesData>;
openProject(): Promise<FilePath>;

createProject(templatePath: string, projectName: string): Promise<boolean>;

Expand Down Expand Up @@ -66,5 +58,4 @@ namespace colibri.core.io {

removeChangeListener(listener: ChangeListenerFunc): void;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace colibri.ui.ide {

private _name: string;
private _contentType: string;
private _newEditor?: () => EditorPart;
private _newEditor?: (factory?: ContentTypeEditorFactory) => EditorPart;

constructor(name:string, contentType: string, newEditor: () => EditorPart) {
constructor(name: string, contentType: string, newEditor: (factory?: ContentTypeEditorFactory) => EditorPart) {
super();

this._name = name;
Expand All @@ -36,7 +36,8 @@ namespace colibri.ui.ide {
}

createEditor() {
return this._newEditor();

return this._newEditor(this);
}
}
}
14 changes: 0 additions & 14 deletions source/editor/plugins/colibri/src/ui/ide/FileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,6 @@ namespace colibri.ui.ide {
return await storage.copyFile(fromFile, toFile);
}

static async getProjects_async(workspacePath?: string) {

const storage = Workbench.getWorkbench().getFileStorage();

return storage.getProjects(workspacePath);
}

static async getProjectTemplates_async() {

const storage = Workbench.getWorkbench().getFileStorage();

return storage.getProjectTemplates();
}

static async createProject_async(templatePath: string, projectName: string) {

const storage = Workbench.getWorkbench().getFileStorage();
Expand Down
17 changes: 8 additions & 9 deletions source/editor/plugins/colibri/src/ui/ide/Workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,21 @@ namespace colibri.ui.ide {
this._editorSessionStateRegistry.clear();
}

async openProject(projectName: string, workspacePath: string, monitor: controls.IProgressMonitor) {
async openProject(monitor: controls.IProgressMonitor) {

this.eventBeforeOpenProject.fire(projectName);

this._projectPreferences = new core.preferences.Preferences("__project__" + projectName);
this.eventBeforeOpenProject.fire("");

this.resetCache();

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

if (workspacePath) {
await this._fileStorage.openProject();

await this._fileStorage.changeWorkspace(workspacePath);
}
const projectName =this._fileStorage.getRoot().getName();

await this._fileStorage.openProject(projectName);
console.log(`Workbench: project ${projectName} loaded.`);

this._projectPreferences = new core.preferences.Preferences("__project__" + projectName);

console.log("Workbench: fetching required project resources.");

Expand Down
6 changes: 6 additions & 0 deletions source/editor/plugins/phasereditor2d.allInOne/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "phasereditor2d.allInOne",
"scripts": [
"_out/phasereditor2d.allInOne.js"
]
}
Loading

0 comments on commit 7e11991

Please sign in to comment.