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 12, 2022
2 parents 9d7ab72 + fa508a1 commit 7d64c03
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 22 deletions.
10 changes: 5 additions & 5 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ $ ./watch.sh
Phaser Editor 2D Core allows running the server with a different client. It is what you need to do here, to run the latest stable server but loading this client:

```
$ npx phasereditor2d-launcher -editor . -dev -project path/to/game
$ npx phasereditor2d-launcher -editor . -dev -disable-plugins phasereditor2d.code -project path/to/game
```

The [phasereditor2d-launcher](https://www.npmjs.com/package/phasereditor2d-launcher) is a cli-based node module. It launches the latest version of Phaser Editor 2D Core.

The `-editor` option configures a new location of the client code.

The `-dev` option disables the browser cache, so it always fetches a fresh version of the files. In any case, you can disable the browser cache manually in the DevTools of the browser.
The `-dev` option disables the browser cache, so it always fetches a fresh version of the files. **Note:** You will also need to manually disable your browser cache in your browser's Developer Tools.

The `-disable-plugins` option disables the [Advanced Javascript Editor](https://help.phasereditor2d.com/v3/code-editor/index.html), which is used in Phaser Editor 2D All-in-One but not in Core.

The `-project` flag indicates the path to the game project. It is mandatory.

Expand All @@ -79,8 +81,6 @@ http://127.0.0.1:1959/editor

Please, use a modern and updated browser.

If you used a previous version of the editor, it would be highly recommendable that you clean the browser cache while you load the new code.

Check in the Developer Console of the browser the version of the IDE.
If you used a previous version of the editor, be sure to clear your browser cache in your browser's Developer Tools before loading the new code.

If you have any issues, please, open an issue in this repository or contact us at `[email protected]`.
7 changes: 7 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## v3.32.0 - Jan 12, 2022

* Customize the editor with the new `phasereditor2d.config.json` file.
* [#168](https://github.com/PhaserEditor2D/PhaserEditor2D-v3/issues/168) Down Arrow in Command Palette closes palette, moves select Image in Scene Editor.
* [#171](https://github.com/PhaserEditor2D/PhaserEditor2D-v3/pull/171) Consistent use of "Import" throughout editors.
* [#169](https://github.com/PhaserEditor2D/PhaserEditor2D-v3/pull/169) Ctrl+Digit2 -> Ctrl+2 to look like Ctrl+3 and Ctrl+4

## v3.31.2 - Dec 14, 2021

* Update version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,14 @@ namespace colibri.ui.ide.actions {

manager.addKeyBinding(CMD_EDITOR_TABS_SIZE_DOWN, new commands.KeyMatcher({
control: true,
key: "3"
key: "Digit3",
keyLabel: "3",
}));

manager.addKeyBinding(CMD_EDITOR_TABS_SIZE_UP, new commands.KeyMatcher({
control: true,
key: "4"
key: "Digit4",
keyLabel: "4",
}));

// close editor
Expand Down Expand Up @@ -560,4 +562,4 @@ namespace colibri.ui.ide.actions {
});
}
}
}
}
9 changes: 8 additions & 1 deletion source/editor/plugins/phasereditor2d.ide/src/IDEPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ namespace phasereditor2d.ide {
this._externalEditorName = data.externalEditorName || "Alien";
}

async requestProjectConfig() {

const data = await colibri.core.io.apiRequest("GetProjectConfig");

return data;
}

getExternalEditorName() {

return this._externalEditorName;
Expand Down Expand Up @@ -241,7 +248,7 @@ namespace phasereditor2d.ide {

/* program entry point */

export const VER = "3.31.2";
export const VER = "3.32.0";

async function main() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ namespace phasereditor2d.ide.ui.actions {

testFunc: isNotWelcomeWindowScope,

executeFunc: args => {
executeFunc: async (args) => {

const url = colibri.ui.ide.FileUtils.getRoot().getExternalUrl();
const config = await IDEPlugin.getInstance().requestProjectConfig();

const url = config.playUrl || colibri.ui.ide.FileUtils.getRoot().getExternalUrl();

colibri.Platform.onElectron(electron => {

colibri.core.io.apiRequest("OpenBrowser", {});
colibri.core.io.apiRequest("OpenBrowser", { url: config.playUrl });

}, () => {

Expand All @@ -76,9 +78,12 @@ namespace phasereditor2d.ide.ui.actions {

testFunc: isNotWelcomeWindowScope,

executeFunc: args => {
executeFunc: async (args) => {

const config = await IDEPlugin.getInstance().requestProjectConfig();

const url = config.playUrl || colibri.ui.ide.FileUtils.getRoot().getExternalUrl();

const url = colibri.ui.ide.FileUtils.getRoot().getExternalUrl();
const dlg = new dialogs.PlayDialog(url);
dlg.create();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ namespace phasereditor2d.pack {
command: {
id: CMD_ASSET_PACK_EDITOR_ADD_FILE,
icon: colibri.Platform.getWorkbench().getWorkbenchIcon(colibri.ICON_PLUS),
name: "Add File",
tooltip: "Add new file configuration",
name: "Import File",
tooltip: "Import a new file into the project by adding an entry for it to this Asset Pack.",
category: CAT_ASSET_PACK
},
handler: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ namespace phasereditor2d.pack.ui.editor {
const manager = new controls.ToolbarManager(parent);

manager.addAction({
text: "Add File",
text: "Import File",
tooltip: "Import a new file into the project by adding an entry for it to this Asset Pack.",
icon: colibri.ColibriPlugin.getInstance().getIcon(colibri.ICON_PLUS),
callback: () => this.openAddFileDialog()
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace phasereditor2d.pack.ui.editor {
export class ImportFileSection extends controls.properties.PropertySection<io.FilePath> {

constructor(page: controls.properties.PropertyPage) {
super(page, "phasereditor2d.pack.ui.editor.ImportFileSection", "Import File", false);
super(page, "phasereditor2d.pack.ui.editor.ImportFileSection", "Asset Pack Entry", false);
}

createForm(parent: HTMLDivElement) {
Expand Down Expand Up @@ -38,7 +38,7 @@ namespace phasereditor2d.pack.ui.editor {

const btn = document.createElement("button");

btn.innerText = `Import ${importData.importer.getType()} (${importData.files.length})`;
btn.innerText = `Import as ${importData.importer.getType()} (${importData.files.length})`;

btn.addEventListener("click", async (e) => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace phasereditor2d.pack.ui.properties {
export class AddFileToPackFileSection extends controls.properties.PropertySection<io.FilePath> {

constructor(page: controls.properties.PropertyPage) {
super(page, "phasereditor2d.pack.ui.properties.AddFileToPackFileSection", "Asset Pack File", false);
super(page, "phasereditor2d.pack.ui.properties.AddFileToPackFileSection", "Asset Pack Entry", false);
}

private async getPackItems(finder: core.PackFinder) {
Expand Down Expand Up @@ -76,7 +76,7 @@ namespace phasereditor2d.pack.ui.properties {

const btn = document.createElement("button");

btn.innerText = `Import ${importData.importer.getType()} (${importData.files.length})`;
btn.innerText = `Import as ${importData.importer.getType()} (${importData.files.length})`;

btn.addEventListener("click", async (e) => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ namespace phasereditor2d.scene.core.code {

this.line(`${mod} ${fieldDecl.getName()}: ${fieldDecl.getType()} = ${fieldDecl.getInitialValueExpr()};`);

} else if (fieldDecl.isAllowUndefined()) {

this.line(`${mod} ${fieldDecl.getName()}!: ${fieldDecl.getType()};`);

} else {

this.line(`${mod} ${fieldDecl.getName()}: ${fieldDecl.getStrictType()};`);
this.line(`${mod} ${fieldDecl.getName()}: ${fieldDecl.getType()};`);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ namespace phasereditor2d.scene.ui.editor.commands {

function isSceneScope(args: colibri.ui.ide.commands.HandlerArgs) {

if (colibri.Platform.getWorkbench().getActiveDialog()) {

return false;
}

return args.activePart instanceof SceneEditor

|| (args.activeEditor instanceof SceneEditor &&
Expand Down

0 comments on commit 7d64c03

Please sign in to comment.