Skip to content

Commit 04c82c8

Browse files
committed
Merge branch 'dev'
2 parents e147137 + 79fb07d commit 04c82c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1264
-465
lines changed

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"recommendations": [
33
"VasiliyKostin.blocks-highlighter",
4-
"VasiliyKostin.thing-editor-integration",
54
"streetsidesoftware.code-spell-checker",
65
"dbaeumer.vscode-eslint"
76
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# thing-editor integration
2+
3+
4+
[Thing-Editor](https://github.com/Megabyteceer/thing-editor) integration extensions.
5+
6+
7+
For now its just reapply breakpoints after game classes dynamic reloading.
8+
9+
extension accepts commands via http requests:
10+
http://127.0.0.1:32025/classes-reloaded&my-game-name
11+
12+
But you don`t have to send them. They will be send automatically.
13+
14+
15+
## changes log
16+
1.0.2 activate extension if thing-editor workspace open only.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
var vscode = require('vscode');
2+
3+
function activate(_context) {
4+
5+
let popStackRequired = false;
6+
7+
vscode.debug.registerDebugAdapterTrackerFactory('*', {
8+
createDebugAdapterTracker(session) {
9+
return {
10+
onWillReceiveMessage: (m) => {
11+
//console.log(`,${JSON.stringify(m, undefined, 2)}`);
12+
session.name;
13+
},
14+
onDidSendMessage: (m) => {
15+
if(m.command === 'stackTrace') {
16+
const stackFrame = m.body.stackFrames[0];
17+
if(stackFrame && stackFrame.name && stackFrame.name.endsWith('_thing_editor_debug_helper')) {
18+
popStackRequired = true;
19+
}
20+
} else if(popStackRequired && m.command === 'scopes') {
21+
popStackRequired = false;
22+
vscode.commands.executeCommand('workbench.action.debug.callStackDown');
23+
}
24+
//console.log(`,${JSON.stringify(m, undefined, 2)}`);
25+
}
26+
};
27+
}
28+
});
29+
}
30+
exports.activate = activate;
31+
32+
module.exports = {
33+
activate
34+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "thing-editor-integration",
3+
"displayName": "Thing-Editor integration",
4+
"description": "thing-editor integration",
5+
"publisher": "VasiliyKostin",
6+
"repository": "https://github.com/Megabyteceer/thing-editor",
7+
"version": "1.0.4",
8+
"engines": {
9+
"vscode": "^1.43.0"
10+
},
11+
"categories": [
12+
"Other"
13+
],
14+
"activationEvents": [
15+
"workspaceContains:./thing-editor.code-workspace"
16+
],
17+
"main": "./extension.js",
18+
"scripts": {
19+
"lint": "eslint .",
20+
"pretest": "npm run lint",
21+
"test": "node ./test/runTest.js"
22+
},
23+
"devDependencies": {
24+
"@types/glob": "^7.1.1",
25+
"@types/mocha": "^7.0.1",
26+
"@types/node": "^12.11.7",
27+
"@types/vscode": "^1.43.0",
28+
"eslint": "^6.8.0",
29+
"glob": "^7.1.6",
30+
"mocha": "^7.0.1",
31+
"typescript": "^3.7.5",
32+
"vscode-test": "^1.3.0"
33+
}
34+
}

thing-editor.code-workspace

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
"**/*.ogg": true,
3535
"**/*.psd": true,
3636
"**/*.flp": true,
37+
"LICENSE": true,
38+
"run-ubuntu.sh": true,
39+
"run-win10.bat": true,
3740
"**/*.png": true,
3841
"**/*.jpg": true,
3942
"**/*.aac": true,
@@ -183,9 +186,9 @@
183186
}
184187
],
185188
"background": {
186-
"activeOnStart": true,
187-
"beginsPattern": ".",
188-
"endsPattern": "."
189+
"activeOnStart": false,
190+
"beginsPattern": "editor",
191+
"endsPattern": "launched"
189192
}
190193
}
191194
]
@@ -206,7 +209,9 @@
206209
"presentation": {
207210
//"hidden": true
208211
},
209-
"skipFiles": [],
212+
"skipFiles": [
213+
"**/debug/assert**"
214+
],
210215
"sourceMaps": true,
211216
"smartStep": true,
212217
"resolveSourceMapLocations": [
@@ -232,7 +237,9 @@
232237
"presentation": {
233238
"hidden": true
234239
},
235-
"skipFiles": [],
240+
"skipFiles": [
241+
"**/debug/assert**"
242+
],
236243
"sourceMaps": true,
237244
"smartStep": true,
238245
"resolveSourceMapLocations": [
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const ifDefPlugin = require('./vite-plugin-ifdef/if-def-loader.js');
2+
const path = require('path');
3+
const {ViteImageOptimizer} = require('vite-plugin-image-optimizer');
4+
5+
module.exports = (root, publicDir, outDir, debug, _projectDesc) => {
6+
return {
7+
root: root + '/.tmp',
8+
publicDir,
9+
base: './',
10+
esbuild: {
11+
target: 'ES2015'
12+
},
13+
plugins: [
14+
ifDefPlugin(debug),
15+
ViteImageOptimizer({})
16+
],
17+
build: {
18+
target: 'ES2015',
19+
emptyOutDir: true,
20+
minify: !debug,
21+
outDir,
22+
rollupOptions: {
23+
input: ''
24+
},
25+
},
26+
resolve: {
27+
alias: {
28+
'game-root': root,
29+
'games': path.resolve(__dirname, '../../games'),
30+
'libs': path.resolve(__dirname, '../../libs'),
31+
'thing-editor': path.resolve(__dirname, '../../thing-editor'),
32+
'howler.js': 'https://cdn.jsdelivr.net/npm/[email protected]/dist/howler.min.js',
33+
'pixi.js': 'https://cdn.jsdelivr.net/npm/[email protected]/dist/pixi-legacy.min.mjs'
34+
}
35+
}
36+
};
37+
};

thing-editor/electron-main/build.js

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ const fs = require('fs');
44
const {walkSync} = require('./editor-server-utils');
55

66
module.exports = {
7-
build: (projectDir, debug, assetsToCopy) => {
8-
9-
const ifDefPlugin = require('./vite-plugin-ifdef/if-def-loader.js');
10-
const {ViteImageOptimizer} = require('vite-plugin-image-optimizer');
11-
12-
7+
build: (projectDir, debug, assetsToCopy, projectDesc) => {
138
const editorRoot = path.resolve(__dirname, '../..');
149
const root = path.resolve(editorRoot, projectDir);
1510
const outDir = root + (debug ? '/debug' : '/release');
@@ -53,54 +48,14 @@ module.exports = {
5348
});
5449
});
5550
})).then(() => {
56-
return require('vite').build({
57-
root: root + '/.tmp',
58-
publicDir,
59-
base: './',
60-
esbuild: {
61-
target: 'ES2015'
62-
},
63-
plugins: [
64-
ifDefPlugin(debug),
65-
ViteImageOptimizer({})
66-
],
67-
build: {
68-
target: 'ES2015',
69-
emptyOutDir: true,
70-
minify: !debug,
71-
outDir,
72-
rollupOptions: {
73-
input: ''
74-
},
75-
},
76-
resolve: {
77-
alias: {
78-
'game-root': root,
79-
'games': path.resolve(__dirname, '../../games'),
80-
'libs': path.resolve(__dirname, '../../libs'),
81-
'thing-editor': path.resolve(__dirname, '../../thing-editor'),
82-
'howler.js': 'https://cdn.jsdelivr.net/npm/[email protected]/dist/howler.min.js',
83-
'pixi.js': 'https://cdn.jsdelivr.net/npm/[email protected]/dist/pixi-legacy.min.mjs'
84-
}
85-
}
86-
}).then((res) => {
51+
return require('vite').build(require(path.resolve(editorRoot, debug ? projectDesc.__buildConfigDebug : projectDesc.__buildConfigRelease))(root, publicDir, outDir, debug, projectDesc)).then((res) => {
8752
require('./static-server.js');
8853
console.log('BUILD COMPLETE: ' + 'http://localhost:5174/' + projectDir);
8954
return res;
55+
}).catch((er) => {
56+
console.error(er.stack);
57+
return er;
9058
});
9159
});
9260
}
9361
};
94-
95-
if (require.main === module) {
96-
module.exports.build('games/game1/', true, [
97-
{
98-
from: '/libs/lib1/assets/flag.png',
99-
to: 'flag.png',
100-
},
101-
{
102-
from: '/games/game1/assets/bunny.png',
103-
to: 'bunny.png',
104-
},
105-
]);
106-
}

0 commit comments

Comments
 (0)