@nice2dev/game-engine 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -0
- package/dist/cjs/ai/BehaviorTree.js +4 -4
- package/dist/cjs/audio/AudioBridge.js +3 -1
- package/dist/cjs/build-cloud/GodotBuildCloud.js +1 -1
- package/dist/cjs/build-cloud/UnrealBuildCloud.js +1 -1
- package/dist/cjs/core/GameConfig.js +11 -9
- package/dist/cjs/devtools/GameplayAnalytics.js +3 -1
- package/dist/cjs/editor/AnimationRetargeting.js +110 -108
- package/dist/cjs/editor/CraftingEditor.js +2 -2
- package/dist/cjs/editor/NiceGameEditor.js +1 -1
- package/dist/cjs/editor/UndoRedoPro.js +49 -47
- package/dist/cjs/export/BevyExporter.js +1 -1
- package/dist/cjs/export/CocosExporter.js +4 -4
- package/dist/cjs/export/Construct3Exporter.js +4 -4
- package/dist/cjs/export/DefoldExporter.js +4 -4
- package/dist/cjs/export/GDevelopExporter.js +2 -2
- package/dist/cjs/export/GameMakerExporter.js +3 -3
- package/dist/cjs/export/GodotExporter.js +3 -3
- package/dist/cjs/export/MinecraftBedrockExporter.js +2 -2
- package/dist/cjs/export/MonoGameExporter.js +2 -2
- package/dist/cjs/export/Pico8Exporter.js +6 -6
- package/dist/cjs/export/RPGMakerExporter.js +4 -4
- package/dist/cjs/export/RobloxExporter.js +5 -5
- package/dist/cjs/export/Solar2DExporter.js +2 -2
- package/dist/cjs/export/ThreeJSExporter.js +3 -3
- package/dist/cjs/export/Tic80Exporter.js +6 -6
- package/dist/cjs/export/UnityExporter.js +4 -4
- package/dist/cjs/export/UnrealExporter.js +7 -7
- package/dist/cjs/export/WebExporter.js +2 -2
- package/dist/cjs/godot-integration/components/GodotProjectBrowser.js +4 -4
- package/dist/cjs/i18n/useTranslation.js +1 -1
- package/dist/cjs/import/GodotSceneImporter.js +4 -4
- package/dist/cjs/import/LDtkImporter.js +1 -1
- package/dist/cjs/import/OgmoImporter.js +1 -1
- package/dist/cjs/import/TiledMapImporter.js +1 -1
- package/dist/cjs/input/GamepadNavigation.js +1 -1
- package/dist/cjs/inventory/InventorySystem.js +1 -1
- package/dist/cjs/native-engine/NetworkingSystem.js +1 -1
- package/dist/cjs/rendering/WebGPURenderPipeline.js +41 -30
- package/dist/cjs/unity-integration/UnityImport.js +2 -2
- package/dist/cjs/unity-integration/components/UnityAssetStoreBrowser.js +4 -4
- package/dist/cjs/unity-integration/components/UnityProjectBrowser.js +8 -5
- package/dist/cjs/unreal-integration/components/UnrealProjectBrowser.js +5 -5
- package/dist/esm/ai/BehaviorTree.js +4 -4
- package/dist/esm/audio/AudioBridge.js +3 -1
- package/dist/esm/build-cloud/GodotBuildCloud.js +1 -1
- package/dist/esm/build-cloud/UnrealBuildCloud.js +1 -1
- package/dist/esm/core/GameConfig.js +11 -9
- package/dist/esm/devtools/GameplayAnalytics.js +3 -1
- package/dist/esm/editor/AnimationRetargeting.js +110 -108
- package/dist/esm/editor/CraftingEditor.js +2 -2
- package/dist/esm/editor/NiceGameEditor.js +2 -2
- package/dist/esm/editor/UndoRedoPro.js +49 -47
- package/dist/esm/export/BevyExporter.js +1 -1
- package/dist/esm/export/CocosExporter.js +4 -4
- package/dist/esm/export/Construct3Exporter.js +4 -4
- package/dist/esm/export/DefoldExporter.js +4 -4
- package/dist/esm/export/GDevelopExporter.js +2 -2
- package/dist/esm/export/GameMakerExporter.js +3 -3
- package/dist/esm/export/GodotExporter.js +3 -3
- package/dist/esm/export/MinecraftBedrockExporter.js +2 -2
- package/dist/esm/export/MonoGameExporter.js +2 -2
- package/dist/esm/export/Pico8Exporter.js +6 -6
- package/dist/esm/export/RPGMakerExporter.js +4 -4
- package/dist/esm/export/RobloxExporter.js +5 -5
- package/dist/esm/export/Solar2DExporter.js +2 -2
- package/dist/esm/export/ThreeJSExporter.js +3 -3
- package/dist/esm/export/Tic80Exporter.js +6 -6
- package/dist/esm/export/UnityExporter.js +4 -4
- package/dist/esm/export/UnrealExporter.js +7 -7
- package/dist/esm/export/WebExporter.js +2 -2
- package/dist/esm/godot-integration/components/GodotProjectBrowser.js +5 -5
- package/dist/esm/i18n/useTranslation.js +2 -2
- package/dist/esm/import/GodotSceneImporter.js +4 -4
- package/dist/esm/import/LDtkImporter.js +1 -1
- package/dist/esm/import/OgmoImporter.js +1 -1
- package/dist/esm/import/TiledMapImporter.js +1 -1
- package/dist/esm/input/GamepadNavigation.js +2 -2
- package/dist/esm/inventory/InventorySystem.js +1 -1
- package/dist/esm/native-engine/NetworkingSystem.js +1 -1
- package/dist/esm/rendering/WebGPURenderPipeline.js +41 -30
- package/dist/esm/unity-integration/UnityImport.js +2 -2
- package/dist/esm/unity-integration/components/UnityAssetStoreBrowser.js +5 -5
- package/dist/esm/unity-integration/components/UnityProjectBrowser.js +9 -6
- package/dist/esm/unreal-integration/components/UnrealProjectBrowser.js +6 -6
- package/dist/types/ai/BehaviorTree.d.ts +4 -4
- package/dist/types/editor/CraftingEditor.d.ts +1 -1
- package/dist/types/godot-integration/components/GodotProjectBrowser.d.ts +3 -1
- package/dist/types/unity-integration/components/UnityAssetStoreBrowser.d.ts +3 -1
- package/dist/types/unity-integration/components/UnityProjectBrowser.d.ts +3 -1
- package/dist/types/unreal-integration/components/UnrealProjectBrowser.d.ts +3 -1
- package/package.json +5 -5
|
@@ -277,7 +277,7 @@ class Construct3Exporter extends PlatformExporter.PlatformExporter {
|
|
|
277
277
|
await this.generateObjectType(typeName, prefab.entity, options);
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
async generateObjectType(typeName, entity,
|
|
280
|
+
async generateObjectType(typeName, entity, _options) {
|
|
281
281
|
const behaviors = {};
|
|
282
282
|
const instanceVariables = {};
|
|
283
283
|
// Map components to behaviors
|
|
@@ -333,7 +333,7 @@ class Construct3Exporter extends PlatformExporter.PlatformExporter {
|
|
|
333
333
|
return result;
|
|
334
334
|
}
|
|
335
335
|
/* ── Layout Export ──────────────────────────────────────────── */
|
|
336
|
-
async exportLayout(scene, project,
|
|
336
|
+
async exportLayout(scene, project, _options) {
|
|
337
337
|
const layoutName = scene.name.replace(/[^a-zA-Z0-9_]/g, '_');
|
|
338
338
|
const layout = {
|
|
339
339
|
c3dtg: true,
|
|
@@ -400,7 +400,7 @@ class Construct3Exporter extends PlatformExporter.PlatformExporter {
|
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
402
|
/* ── Event Sheet ────────────────────────────────────────────── */
|
|
403
|
-
async generateEventSheet(scene, _project,
|
|
403
|
+
async generateEventSheet(scene, _project, _options) {
|
|
404
404
|
const sheetName = `${scene.name.replace(/[^a-zA-Z0-9_]/g, '_')}_Events`;
|
|
405
405
|
const eventSheet = {
|
|
406
406
|
c3eventsheet: true,
|
|
@@ -463,7 +463,7 @@ class Construct3Exporter extends PlatformExporter.PlatformExporter {
|
|
|
463
463
|
return events;
|
|
464
464
|
}
|
|
465
465
|
/* ── Scripts ────────────────────────────────────────────────── */
|
|
466
|
-
async generateScripts(project,
|
|
466
|
+
async generateScripts(project, _options) {
|
|
467
467
|
// Main script
|
|
468
468
|
const mainScript = `// ${project.name} - Nice2Dev Export for Construct 3
|
|
469
469
|
// Generated automatically
|
|
@@ -323,7 +323,7 @@ _plugins =
|
|
|
323
323
|
this.addTextFile('game.project', projectContent);
|
|
324
324
|
}
|
|
325
325
|
/* ── Main Collection ────────────────────────────────────────── */
|
|
326
|
-
async generateMainCollection(project,
|
|
326
|
+
async generateMainCollection(project, _options) {
|
|
327
327
|
const firstScene = project.scenes[0];
|
|
328
328
|
const sceneName = firstScene
|
|
329
329
|
? firstScene.name.toLowerCase().replace(/[^a-z0-9_]/g, '_')
|
|
@@ -439,7 +439,7 @@ scale_along_z: 0
|
|
|
439
439
|
}
|
|
440
440
|
`;
|
|
441
441
|
}
|
|
442
|
-
async generateGameObject(entity,
|
|
442
|
+
async generateGameObject(entity, _options) {
|
|
443
443
|
const name = (entity.name ?? entity.id).toLowerCase().replace(/[^a-z0-9_]/g, '_');
|
|
444
444
|
let goContent = '';
|
|
445
445
|
// Add components
|
|
@@ -686,7 +686,7 @@ end
|
|
|
686
686
|
`;
|
|
687
687
|
}
|
|
688
688
|
/* ── Shared Scripts ─────────────────────────────────────────── */
|
|
689
|
-
async generateSharedScripts(project,
|
|
689
|
+
async generateSharedScripts(project, _options) {
|
|
690
690
|
// Game Manager Script
|
|
691
691
|
const gameManagerScript = `-- Game Manager
|
|
692
692
|
-- Central game state and utility management
|
|
@@ -940,7 +940,7 @@ return M
|
|
|
940
940
|
this.addTextFile('main/scripts/utility.lua', utilityModule);
|
|
941
941
|
}
|
|
942
942
|
/* ── App Manifest ───────────────────────────────────────────── */
|
|
943
|
-
async generateAppManifest(_project,
|
|
943
|
+
async generateAppManifest(_project, _options) {
|
|
944
944
|
const manifest = `platforms:
|
|
945
945
|
x86_64-osx:
|
|
946
946
|
context:
|
|
@@ -357,7 +357,7 @@ class GDevelopExporter extends PlatformExporter.PlatformExporter {
|
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
359
|
/* ── Event Generation ───────────────────────────────────────── */
|
|
360
|
-
generateSceneEvents(scene, _project,
|
|
360
|
+
generateSceneEvents(scene, _project, _options) {
|
|
361
361
|
const events = [];
|
|
362
362
|
// Header comment
|
|
363
363
|
events.push({
|
|
@@ -677,7 +677,7 @@ class GDevelopExporter extends PlatformExporter.PlatformExporter {
|
|
|
677
677
|
sceneVariables: [],
|
|
678
678
|
};
|
|
679
679
|
}
|
|
680
|
-
async generateNice2DevExtension(project,
|
|
680
|
+
async generateNice2DevExtension(project, _options) {
|
|
681
681
|
// Extension is already embedded in the project, this generates a standalone version
|
|
682
682
|
const extension = this.createNice2DevExtension(project);
|
|
683
683
|
this.addTextFile('extensions/Nice2Dev.json', JSON.stringify(extension, null, 2));
|
|
@@ -89,7 +89,7 @@ class GameMakerExporter extends PlatformExporter.PlatformExporter {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
/* ── Project File ───────────────────────────────────────────── */
|
|
92
|
-
async generateProjectFile(project,
|
|
92
|
+
async generateProjectFile(project, _options) {
|
|
93
93
|
const projectFile = {
|
|
94
94
|
resourceType: 'GMProject',
|
|
95
95
|
resourceVersion: '1.6',
|
|
@@ -157,7 +157,7 @@ class GameMakerExporter extends PlatformExporter.PlatformExporter {
|
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
/* ── Scripts ────────────────────────────────────────────────── */
|
|
160
|
-
async generateScripts(
|
|
160
|
+
async generateScripts(_project, _options) {
|
|
161
161
|
// Utility script
|
|
162
162
|
const utilScript = `/// @description Nice2Dev Utility Functions
|
|
163
163
|
|
|
@@ -392,7 +392,7 @@ event_inherited();
|
|
|
392
392
|
id: { name: 'obj_nice2dev_base', path: 'objects/obj_nice2dev_base/obj_nice2dev_base.yy' },
|
|
393
393
|
});
|
|
394
394
|
}
|
|
395
|
-
async generateObjectFromEntity(entity, objectName,
|
|
395
|
+
async generateObjectFromEntity(entity, objectName, _options) {
|
|
396
396
|
const safeName = objectName.replace(/[^a-zA-Z0-9_]/g, '_');
|
|
397
397
|
const hasPhysics = entity.components.some((c) => c.type === 'rigidbody');
|
|
398
398
|
// Find sprite component
|
|
@@ -181,7 +181,7 @@ environment/defaults/default_clear_color=Color(${this.hexToGodotColor(project.se
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
/* ── Scenes ─────────────────────────────────────────────────── */
|
|
184
|
-
async exportScenes(project,
|
|
184
|
+
async exportScenes(project, _options) {
|
|
185
185
|
for (const scene of project.scenes) {
|
|
186
186
|
const tscn = this.createSceneTSCN(scene, project);
|
|
187
187
|
const path = `scenes/${this.sanitizeName(scene.name)}.tscn`;
|
|
@@ -500,7 +500,7 @@ environment/defaults/default_clear_color=Color(${this.hexToGodotColor(project.se
|
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
502
|
/* ── Prefabs ────────────────────────────────────────────────── */
|
|
503
|
-
async exportPrefabs(project,
|
|
503
|
+
async exportPrefabs(project, _options) {
|
|
504
504
|
for (const prefab of project.prefabs) {
|
|
505
505
|
const tscn = this.createPrefabTSCN(prefab, project);
|
|
506
506
|
const path = `prefabs/${this.sanitizeName(prefab.name)}.tscn`;
|
|
@@ -514,7 +514,7 @@ environment/defaults/default_clear_color=Color(${this.hexToGodotColor(project.se
|
|
|
514
514
|
return this.serializeTSCN(resources, [rootNode], prefab.name);
|
|
515
515
|
}
|
|
516
516
|
/* ── Resources ──────────────────────────────────────────────── */
|
|
517
|
-
async exportResources(project,
|
|
517
|
+
async exportResources(project, _options) {
|
|
518
518
|
// Export materials as ShaderMaterial resources
|
|
519
519
|
const materials = project.assets.filter((a) => a.type === 'material');
|
|
520
520
|
for (const material of materials) {
|
|
@@ -215,7 +215,7 @@ class MinecraftBedrockExporter extends PlatformExporter.PlatformExporter {
|
|
|
215
215
|
this.addTextFile(`${bpPath}/texts/en_US.lang`, `pack.name=${project.name} Behavior Pack\npack.description=Behavior pack from Nice2Dev project`);
|
|
216
216
|
}
|
|
217
217
|
/* ── Scripts ────────────────────────────────────────────────── */
|
|
218
|
-
async generateScripts(project,
|
|
218
|
+
async generateScripts(project, _options) {
|
|
219
219
|
const bpPath = `${this.projectName}_BP`;
|
|
220
220
|
// Main entry script
|
|
221
221
|
const mainScript = `// ${project.name} - Nice2Dev Minecraft Bedrock Export
|
|
@@ -454,7 +454,7 @@ export function playSound(dimension, soundId, location, options = {}) {
|
|
|
454
454
|
this.addTextFile(`${bpPath}/scripts/utilities.js`, utilities);
|
|
455
455
|
}
|
|
456
456
|
/* ── Prefab Export (Custom Entity) ──────────────────────────── */
|
|
457
|
-
async exportPrefab(prefab,
|
|
457
|
+
async exportPrefab(prefab, _options) {
|
|
458
458
|
const bpPath = `${this.projectName}_BP`;
|
|
459
459
|
const rpPath = `${this.projectName}_RP`;
|
|
460
460
|
const entityId = `${this.namespace}:${prefab.name.toLowerCase().replace(/[^a-z0-9_]/g, '_')}`;
|
|
@@ -90,7 +90,7 @@ class MonoGameExporter {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
generateSolution(
|
|
93
|
+
generateSolution(_project) {
|
|
94
94
|
const projectGuid = this.generateGuid();
|
|
95
95
|
const solutionGuid = this.generateGuid();
|
|
96
96
|
const sln = `
|
|
@@ -169,7 +169,7 @@ ${packageRefs.map((r) => ` ${r}`).join('\n')}
|
|
|
169
169
|
`;
|
|
170
170
|
this.csharpFiles.set(`${this.config.solutionName}/${this.config.solutionName}.csproj`, csproj);
|
|
171
171
|
}
|
|
172
|
-
generateGame1(
|
|
172
|
+
generateGame1(_project) {
|
|
173
173
|
const { namespace, useECS, useNez } = this.config;
|
|
174
174
|
const usings = [
|
|
175
175
|
'using Microsoft.Xna.Framework;',
|
|
@@ -132,7 +132,7 @@ ${music}
|
|
|
132
132
|
}
|
|
133
133
|
return lines.join('\n');
|
|
134
134
|
}
|
|
135
|
-
generateCoreFunctions(project,
|
|
135
|
+
generateCoreFunctions(project, _options) {
|
|
136
136
|
return `
|
|
137
137
|
-- initialization
|
|
138
138
|
function _init()
|
|
@@ -202,7 +202,7 @@ function _draw()
|
|
|
202
202
|
end
|
|
203
203
|
`;
|
|
204
204
|
}
|
|
205
|
-
generateEntitySystem(
|
|
205
|
+
generateEntitySystem(_project, _options) {
|
|
206
206
|
return `
|
|
207
207
|
-- entity system
|
|
208
208
|
function make_entity(type,x,y,props)
|
|
@@ -280,7 +280,7 @@ function collides(a,b)
|
|
|
280
280
|
end
|
|
281
281
|
`;
|
|
282
282
|
}
|
|
283
|
-
generateEntityDefinitions(project,
|
|
283
|
+
generateEntityDefinitions(project, _options) {
|
|
284
284
|
const lines = [];
|
|
285
285
|
lines.push('');
|
|
286
286
|
lines.push('-- entity types');
|
|
@@ -397,7 +397,7 @@ end
|
|
|
397
397
|
}
|
|
398
398
|
return defaultValue;
|
|
399
399
|
}
|
|
400
|
-
generateSceneSetup(project,
|
|
400
|
+
generateSceneSetup(project, _options) {
|
|
401
401
|
const lines = [];
|
|
402
402
|
lines.push('');
|
|
403
403
|
lines.push('-- scenes');
|
|
@@ -578,7 +578,7 @@ end
|
|
|
578
578
|
`;
|
|
579
579
|
}
|
|
580
580
|
/* ── Data Sections ──────────────────────────────────────────── */
|
|
581
|
-
generateGfxSection(
|
|
581
|
+
generateGfxSection(_project, _options) {
|
|
582
582
|
// Generate placeholder sprite sheet (128x128 = 256 lines of 128 hex chars)
|
|
583
583
|
// Each pixel is 4 bits (one hex char)
|
|
584
584
|
const lines = [];
|
|
@@ -640,7 +640,7 @@ end
|
|
|
640
640
|
}
|
|
641
641
|
return lines.join('\n');
|
|
642
642
|
}
|
|
643
|
-
generateGffSection(
|
|
643
|
+
generateGffSection(_project) {
|
|
644
644
|
// Sprite flags: 256 bytes (2 per line, 128 lines)
|
|
645
645
|
// All zeros for placeholder
|
|
646
646
|
const lines = [];
|
|
@@ -61,7 +61,7 @@ class RPGMakerExporter extends PlatformExporter.PlatformExporter {
|
|
|
61
61
|
await this.generateDataFiles(project, options);
|
|
62
62
|
}
|
|
63
63
|
/* ── Main Plugin ────────────────────────────────────────────── */
|
|
64
|
-
async generateMainPlugin(project,
|
|
64
|
+
async generateMainPlugin(project, _options) {
|
|
65
65
|
const versionSpecific = this.version === 'MZ' ? this.getMZPluginHeader() : this.getMVPluginHeader();
|
|
66
66
|
const plugin = `/*:
|
|
67
67
|
* @target ${this.version}
|
|
@@ -379,7 +379,7 @@ ${this.version === 'MZ' ? this.getMZPluginCommands() : this.getMVPluginCommands(
|
|
|
379
379
|
};`;
|
|
380
380
|
}
|
|
381
381
|
/* ── Utility Plugin ─────────────────────────────────────────── */
|
|
382
|
-
async generateUtilityPlugin(
|
|
382
|
+
async generateUtilityPlugin(_project, _options) {
|
|
383
383
|
const utility = `/*:
|
|
384
384
|
* @target ${this.version}
|
|
385
385
|
* @plugindesc Nice2Dev Utility Functions
|
|
@@ -751,7 +751,7 @@ ${scene.entities
|
|
|
751
751
|
return commands;
|
|
752
752
|
}
|
|
753
753
|
/* ── Prefab Export ──────────────────────────────────────────── */
|
|
754
|
-
async exportPrefab(prefab,
|
|
754
|
+
async exportPrefab(prefab, _options) {
|
|
755
755
|
const safeName = prefab.name.replace(/[^a-zA-Z0-9]/g, '');
|
|
756
756
|
// Generate prefab registration script
|
|
757
757
|
const prefabScript = `// Prefab: ${prefab.name}
|
|
@@ -777,7 +777,7 @@ ${prefab.entity.components.map((c) => ` { type: '${c.type}', properti
|
|
|
777
777
|
this.addTextFile(`js/plugins/${this.pluginPrefix}_Prefab_${safeName}.js`, prefabScript);
|
|
778
778
|
}
|
|
779
779
|
/* ── Common Events ──────────────────────────────────────────── */
|
|
780
|
-
async generateCommonEvents(_project,
|
|
780
|
+
async generateCommonEvents(_project, _options) {
|
|
781
781
|
const commonEvents = [
|
|
782
782
|
null, // Index 0 is always null
|
|
783
783
|
{
|
|
@@ -64,7 +64,7 @@ class RobloxExporter extends PlatformExporter.PlatformExporter {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
/* ── Folder Structure ───────────────────────────────────────── */
|
|
67
|
-
async generateFolderStructure(project,
|
|
67
|
+
async generateFolderStructure(project, _options) {
|
|
68
68
|
// README for the export
|
|
69
69
|
const readme = `# ${project.name} - Roblox Export
|
|
70
70
|
|
|
@@ -94,7 +94,7 @@ Generated from Nice2Dev project v${project.version}
|
|
|
94
94
|
this.addTextFile('README.md', readme);
|
|
95
95
|
}
|
|
96
96
|
/* ── Core Scripts ───────────────────────────────────────────── */
|
|
97
|
-
async generateCoreScripts(project,
|
|
97
|
+
async generateCoreScripts(project, _options) {
|
|
98
98
|
// Game Manager Module
|
|
99
99
|
const gameManagerModule = `${this.useStrictMode ? '--!strict\n' : ''}--[[
|
|
100
100
|
Game Manager Module
|
|
@@ -468,7 +468,7 @@ print("[Game] ${project.name} initialized successfully!")
|
|
|
468
468
|
this.addTextFile('ServerScriptService/GameInit.server.lua', initScript);
|
|
469
469
|
}
|
|
470
470
|
/* ── Client Scripts ─────────────────────────────────────────── */
|
|
471
|
-
async generateClientScripts(
|
|
471
|
+
async generateClientScripts(_project, _options) {
|
|
472
472
|
// Client-side game controller
|
|
473
473
|
const clientController = `${this.useStrictMode ? '--!strict\n' : ''}--[[
|
|
474
474
|
Client Controller
|
|
@@ -570,7 +570,7 @@ print("[ClientController] Initialized")
|
|
|
570
570
|
this.addTextFile('StarterPlayer/StarterPlayerScripts/ClientController.client.lua', clientController);
|
|
571
571
|
}
|
|
572
572
|
/* ── Server Scripts ─────────────────────────────────────────── */
|
|
573
|
-
async generateServerScripts(project,
|
|
573
|
+
async generateServerScripts(project, _options) {
|
|
574
574
|
// Data handling script
|
|
575
575
|
const dataScript = `${this.useStrictMode ? '--!strict\n' : ''}--[[
|
|
576
576
|
Data Handler Script
|
|
@@ -671,7 +671,7 @@ return DataHandler
|
|
|
671
671
|
this.addTextFile('ServerScriptService/DataHandler.server.lua', dataScript);
|
|
672
672
|
}
|
|
673
673
|
/* ── Scene Export ───────────────────────────────────────────── */
|
|
674
|
-
async exportScene(scene, project,
|
|
674
|
+
async exportScene(scene, project, _options) {
|
|
675
675
|
// Generate scene as a Model in RBXMX format
|
|
676
676
|
const modelXml = this.generateSceneModel(scene, project);
|
|
677
677
|
this.addTextFile(`Workspace/${scene.name}.rbxmx`, modelXml);
|
|
@@ -317,7 +317,7 @@ composer.gotoScene("scenes.${firstSceneName}", {
|
|
|
317
317
|
this.addTextFile('main.lua', mainLua);
|
|
318
318
|
}
|
|
319
319
|
/* ── Utility Modules ────────────────────────────────────────── */
|
|
320
|
-
async generateUtilityModules(_project,
|
|
320
|
+
async generateUtilityModules(_project, _options) {
|
|
321
321
|
// Game Manager
|
|
322
322
|
const gameManagerLua = `-- Game Manager Module
|
|
323
323
|
-- Central game state and utilities
|
|
@@ -1094,7 +1094,7 @@ return scene
|
|
|
1094
1094
|
return `${r.toFixed(2)}, ${g.toFixed(2)}, ${b.toFixed(2)}`;
|
|
1095
1095
|
}
|
|
1096
1096
|
/* ── Prefab Export ──────────────────────────────────────────── */
|
|
1097
|
-
async exportPrefab(prefab,
|
|
1097
|
+
async exportPrefab(prefab, _options) {
|
|
1098
1098
|
const prefabName = prefab.name.toLowerCase().replace(/[^a-z0-9_]/g, '_');
|
|
1099
1099
|
const entity = prefab.entity;
|
|
1100
1100
|
const tags = entity.tags ?? [];
|
|
@@ -566,7 +566,7 @@ export class ${sceneName}Scene ${useTS ? 'implements GameScene' : ''} {
|
|
|
566
566
|
}
|
|
567
567
|
return code;
|
|
568
568
|
}
|
|
569
|
-
generateMeshCode(entity, project,
|
|
569
|
+
generateMeshCode(entity, project, _useTS) {
|
|
570
570
|
const meshComp = entity.components.find((c) => c.type === 'mesh' ||
|
|
571
571
|
c.type === 'box' ||
|
|
572
572
|
c.type === 'sphere' ||
|
|
@@ -618,7 +618,7 @@ export class ${sceneName}Scene ${useTS ? 'implements GameScene' : ''} {
|
|
|
618
618
|
entity.receiveShadow = true;
|
|
619
619
|
`;
|
|
620
620
|
}
|
|
621
|
-
generateModelCode(entity, component, _project,
|
|
621
|
+
generateModelCode(entity, component, _project, _useTS) {
|
|
622
622
|
const compProps = component.properties ?? {};
|
|
623
623
|
const modelPath = compProps.path;
|
|
624
624
|
return ` // Model loading is handled asynchronously
|
|
@@ -632,7 +632,7 @@ export class ${sceneName}Scene ${useTS ? 'implements GameScene' : ''} {
|
|
|
632
632
|
: ''}
|
|
633
633
|
`;
|
|
634
634
|
}
|
|
635
|
-
generateLightCode(entity, component,
|
|
635
|
+
generateLightCode(entity, component, _useTS) {
|
|
636
636
|
const compProps = component.properties ?? {};
|
|
637
637
|
const color = compProps.color ?? '#ffffff';
|
|
638
638
|
const intensity = compProps.intensity ?? 1;
|
|
@@ -161,7 +161,7 @@ class Tic80Exporter extends PlatformExporter.PlatformExporter {
|
|
|
161
161
|
lines.push(this.generateLuaUtilities(platformOpts.includeDebug ?? false));
|
|
162
162
|
return lines.join('\n');
|
|
163
163
|
}
|
|
164
|
-
generateLuaCoreFunctions(project,
|
|
164
|
+
generateLuaCoreFunctions(project, _options) {
|
|
165
165
|
const bgColor = this.getClosestTic80Color(project.scenes[0]?.background ?? '#1a1c2c');
|
|
166
166
|
return `
|
|
167
167
|
-- Boot (called once)
|
|
@@ -928,7 +928,7 @@ draw_debug = ->
|
|
|
928
928
|
return lines.join('\n');
|
|
929
929
|
}
|
|
930
930
|
/* ── Wren Code Generation ───────────────────────────────────── */
|
|
931
|
-
generateWrenCode(project,
|
|
931
|
+
generateWrenCode(project, _options) {
|
|
932
932
|
return `// ${project.name} - TIC-80 Wren
|
|
933
933
|
// Generated from Nice2Dev
|
|
934
934
|
|
|
@@ -1064,7 +1064,7 @@ class UI {
|
|
|
1064
1064
|
`;
|
|
1065
1065
|
}
|
|
1066
1066
|
/* ── Data Sections ──────────────────────────────────────────── */
|
|
1067
|
-
generateSpritesSection(
|
|
1067
|
+
generateSpritesSection(_project) {
|
|
1068
1068
|
// TIC-80 sprites: each line represents 8 pixels (1 byte = 2 pixels)
|
|
1069
1069
|
// 256 sprites in 16x16 grid = 128x128 pixels
|
|
1070
1070
|
const lines = [];
|
|
@@ -1118,7 +1118,7 @@ class UI {
|
|
|
1118
1118
|
lines.push('-- </TILES>');
|
|
1119
1119
|
return lines.join('\n');
|
|
1120
1120
|
}
|
|
1121
|
-
generateMapSection(
|
|
1121
|
+
generateMapSection(_project) {
|
|
1122
1122
|
const lines = [];
|
|
1123
1123
|
lines.push('-- <MAP>');
|
|
1124
1124
|
// 240x136 / 8 = 30x17 tiles
|
|
@@ -1132,7 +1132,7 @@ class UI {
|
|
|
1132
1132
|
lines.push('-- </MAP>');
|
|
1133
1133
|
return lines.join('\n');
|
|
1134
1134
|
}
|
|
1135
|
-
generateWavesSection(
|
|
1135
|
+
generateWavesSection(_project, _options) {
|
|
1136
1136
|
return `-- <WAVES>
|
|
1137
1137
|
-- 000:00000000ffffffff00000000ffffffff
|
|
1138
1138
|
-- 001:0123456789abcdeffedcba9876543210
|
|
@@ -1140,7 +1140,7 @@ class UI {
|
|
|
1140
1140
|
-- 003:fedcba9876543210fedcba9876543210
|
|
1141
1141
|
-- </WAVES>`;
|
|
1142
1142
|
}
|
|
1143
|
-
generateSfxSection(
|
|
1143
|
+
generateSfxSection(_project) {
|
|
1144
1144
|
return `-- <SFX>
|
|
1145
1145
|
-- 000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000304000000000
|
|
1146
1146
|
-- </SFX>`;
|
|
@@ -83,7 +83,7 @@ class UnityExporter extends PlatformExporter.PlatformExporter {
|
|
|
83
83
|
this.exportPackageManifest(project);
|
|
84
84
|
}
|
|
85
85
|
/* ── Project Settings ───────────────────────────────────────── */
|
|
86
|
-
async exportProjectSettings(project,
|
|
86
|
+
async exportProjectSettings(project, _options, _unity) {
|
|
87
87
|
// ProjectSettings.asset
|
|
88
88
|
const settings = `%YAML 1.1
|
|
89
89
|
%TAG !u! tag:unity3d.com,2011:
|
|
@@ -134,7 +134,7 @@ Physics2DSettings:
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
/* ── Prefabs ────────────────────────────────────────────────── */
|
|
137
|
-
async exportPrefabs(project,
|
|
137
|
+
async exportPrefabs(project, _options) {
|
|
138
138
|
for (const prefab of project.prefabs) {
|
|
139
139
|
const yaml = this.createPrefabYAML(prefab, project);
|
|
140
140
|
const path = `Assets/Prefabs/${this.sanitizeFileName(prefab.name)}.prefab`;
|
|
@@ -195,7 +195,7 @@ Physics2DSettings:
|
|
|
195
195
|
return this.serializeUnityYAML({ objects });
|
|
196
196
|
}
|
|
197
197
|
/* ── Scenes ─────────────────────────────────────────────────── */
|
|
198
|
-
async exportScenes(project,
|
|
198
|
+
async exportScenes(project, _options) {
|
|
199
199
|
for (const scene of project.scenes) {
|
|
200
200
|
const yaml = this.createSceneYAML(scene, project);
|
|
201
201
|
const path = `Assets/Scenes/${this.sanitizeFileName(scene.name)}.unity`;
|
|
@@ -301,7 +301,7 @@ Physics2DSettings:
|
|
|
301
301
|
this.addEntityComponents(entity, objects, gameObjectId, project);
|
|
302
302
|
return transformId;
|
|
303
303
|
}
|
|
304
|
-
addEntityComponents(entity, objects, gameObjectId,
|
|
304
|
+
addEntityComponents(entity, objects, gameObjectId, _project) {
|
|
305
305
|
for (const component of entity.components) {
|
|
306
306
|
const props = component.properties ?? {};
|
|
307
307
|
switch (component.type) {
|
|
@@ -231,7 +231,7 @@ class UnrealExporter extends PlatformExporter.PlatformExporter {
|
|
|
231
231
|
};
|
|
232
232
|
this.addTextFile(`${projectName}.uproject`, JSON.stringify(uproject, null, 2));
|
|
233
233
|
}
|
|
234
|
-
async generateBuildFiles(
|
|
234
|
+
async generateBuildFiles(_project, _options) {
|
|
235
235
|
// Module Build.cs
|
|
236
236
|
const buildCs = `// Copyright Nice2Dev. All Rights Reserved.
|
|
237
237
|
|
|
@@ -332,7 +332,7 @@ IMPLEMENT_PRIMARY_GAME_MODULE(F${this.moduleName}Module, ${this.moduleName}, "${
|
|
|
332
332
|
this.generateActorClass(prefab.entity, prefab.name, options);
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
generateGameMode(project,
|
|
335
|
+
generateGameMode(project, _options) {
|
|
336
336
|
const className = `A${this.moduleName}GameMode`;
|
|
337
337
|
// Header
|
|
338
338
|
const header = `// Copyright Nice2Dev. All Rights Reserved.
|
|
@@ -413,7 +413,7 @@ void ${className}::StartPlay()
|
|
|
413
413
|
`;
|
|
414
414
|
this.addTextFile(`Source/${this.moduleName}/${this.moduleName}GameMode.cpp`, source);
|
|
415
415
|
}
|
|
416
|
-
generateActorClass(entity, className,
|
|
416
|
+
generateActorClass(entity, className, _options) {
|
|
417
417
|
const sanitizedName = className.replace(/[^a-zA-Z0-9]/g, '');
|
|
418
418
|
const fullClassName = `A${sanitizedName}`;
|
|
419
419
|
this.usedHeaders.clear();
|
|
@@ -571,7 +571,7 @@ void ${fullClassName}::OnNiceUpdate_Implementation(float DeltaTime)
|
|
|
571
571
|
}
|
|
572
572
|
return String(value);
|
|
573
573
|
}
|
|
574
|
-
async generateConfigFiles(project,
|
|
574
|
+
async generateConfigFiles(project, _options) {
|
|
575
575
|
// Default Engine.ini
|
|
576
576
|
const engineIni = `[/Script/EngineSettings.GameMapsSettings]
|
|
577
577
|
GameDefaultMap=/Game/Maps/MainMenu
|
|
@@ -603,7 +603,7 @@ DefaultGravityZ=${project.settings.physics?.gravity?.y ?? -980}
|
|
|
603
603
|
this.addTextFile('Config/DefaultGame.ini', gameIni);
|
|
604
604
|
}
|
|
605
605
|
/* ── Scene Export ───────────────────────────────────────────── */
|
|
606
|
-
async exportScene(scene, project,
|
|
606
|
+
async exportScene(scene, project, _options) {
|
|
607
607
|
// Generate level blueprint
|
|
608
608
|
const levelHeader = this.generateLevelBlueprint(scene, project);
|
|
609
609
|
this.addTextFile(`Content/Maps/${scene.name}_LevelScript.h`, levelHeader.header);
|
|
@@ -612,7 +612,7 @@ DefaultGravityZ=${project.settings.physics?.gravity?.y ?? -980}
|
|
|
612
612
|
const spawnData = this.generateSpawnData(scene);
|
|
613
613
|
this.addTextFile(`Content/Data/${scene.name}_SpawnData.json`, JSON.stringify(spawnData, null, 2));
|
|
614
614
|
}
|
|
615
|
-
generateLevelBlueprint(scene,
|
|
615
|
+
generateLevelBlueprint(scene, _project) {
|
|
616
616
|
const className = `A${scene.name.replace(/[^a-zA-Z0-9]/g, '')}LevelScript`;
|
|
617
617
|
const header = `// Copyright Nice2Dev. All Rights Reserved.
|
|
618
618
|
|
|
@@ -713,7 +713,7 @@ ${scene.entities.map((e) => this.generateEntitySpawnCode(e)).join('\n')}
|
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
715
|
/* ── Asset Export ───────────────────────────────────────────── */
|
|
716
|
-
async exportAsset(asset,
|
|
716
|
+
async exportAsset(asset, _options) {
|
|
717
717
|
switch (asset.type) {
|
|
718
718
|
case 'sprite':
|
|
719
719
|
case 'texture':
|
|
@@ -378,7 +378,7 @@ export default class ${sceneName}Scene ${useTS ? 'implements Scene' : ''} {
|
|
|
378
378
|
}
|
|
379
379
|
return code;
|
|
380
380
|
}
|
|
381
|
-
async exportScripts(project, options,
|
|
381
|
+
async exportScripts(project, options, _useTS) {
|
|
382
382
|
for (const script of project.scripts) {
|
|
383
383
|
try {
|
|
384
384
|
const ast = this.graphToAST.convert(script);
|
|
@@ -970,7 +970,7 @@ export class ${sceneName}Scene extends Phaser.Scene {
|
|
|
970
970
|
(scene.tilemaps ?? []).forEach((tm) => assetIds.add(tm.tilesetId));
|
|
971
971
|
return project.assets.filter((a) => assetIds.has(a.id));
|
|
972
972
|
}
|
|
973
|
-
async exportScripts(project, options,
|
|
973
|
+
async exportScripts(project, options, _useTS) {
|
|
974
974
|
for (const script of project.scripts) {
|
|
975
975
|
try {
|
|
976
976
|
const ast = this.graphToAST.convert(script);
|
|
@@ -93,7 +93,7 @@ const INITIAL_STATE = {
|
|
|
93
93
|
importProgress: 0,
|
|
94
94
|
tab: 'files',
|
|
95
95
|
};
|
|
96
|
-
const BrowserContext = React.createContext(null);
|
|
96
|
+
const BrowserContext = /* @__PURE__ */ React.createContext(null);
|
|
97
97
|
function useBrowser() {
|
|
98
98
|
const ctx = React.useContext(BrowserContext);
|
|
99
99
|
if (!ctx) {
|
|
@@ -581,7 +581,8 @@ const DEMO_PROJECT = {
|
|
|
581
581
|
{ name: 'Web Build', platform: 'Web' },
|
|
582
582
|
],
|
|
583
583
|
};
|
|
584
|
-
const GodotProjectBrowser =
|
|
584
|
+
const GodotProjectBrowser = /* @__PURE__ */ Object.assign(
|
|
585
|
+
/* @__PURE__ */ React.forwardRef(({ projectPath: _projectPath, theme: themeOverride, onProjectLoad, onImport, onSyncConnect, onSyncDisconnect, className, style, }, ref) => {
|
|
585
586
|
const [state, dispatch] = React.useReducer(browserReducer, {
|
|
586
587
|
...INITIAL_STATE,
|
|
587
588
|
projectInfo: DEMO_PROJECT,
|
|
@@ -663,7 +664,6 @@ const GodotProjectBrowser = React.forwardRef(({ projectPath: _projectPath, theme
|
|
|
663
664
|
overflow: 'hidden',
|
|
664
665
|
...style,
|
|
665
666
|
}, children: [jsxRuntime.jsx(BrowserHeader, {}), jsxRuntime.jsx(BrowserToolbar, {}), jsxRuntime.jsx(TabBar, {}), jsxRuntime.jsxs("div", { style: { flex: 1, overflow: 'auto' }, children: [state.tab === 'files' && jsxRuntime.jsx(FilesPanel, {}), state.tab === 'autoloads' && jsxRuntime.jsx(AutoloadsPanel, {}), state.tab === 'plugins' && jsxRuntime.jsx(PluginsPanel, {}), state.tab === 'exports' && jsxRuntime.jsx(ExportsPanel, {})] })] }) }));
|
|
666
|
-
});
|
|
667
|
-
GodotProjectBrowser.displayName = 'GodotProjectBrowser';
|
|
667
|
+
}), { displayName: 'GodotProjectBrowser' });
|
|
668
668
|
|
|
669
669
|
exports.GodotProjectBrowser = GodotProjectBrowser;
|
|
@@ -5,7 +5,7 @@ var React = require('react');
|
|
|
5
5
|
var I18n = require('./I18n.js');
|
|
6
6
|
|
|
7
7
|
/* ── Context ──────────────────────────────────────────────────── */
|
|
8
|
-
const I18nContext = React.createContext(null);
|
|
8
|
+
const I18nContext = /* @__PURE__ */ React.createContext(null);
|
|
9
9
|
/**
|
|
10
10
|
* Provider component to supply a custom I18nManager to the tree.
|
|
11
11
|
* If not used, the global singleton (getI18n()) is used automatically.
|
|
@@ -195,8 +195,8 @@ class GodotSceneImporter extends SceneImporter.SceneImporter {
|
|
|
195
195
|
// Handle multiline values
|
|
196
196
|
if (multilineKey) {
|
|
197
197
|
multilineValue += '\n' + line;
|
|
198
|
-
bracketDepth += (line.match(/[
|
|
199
|
-
bracketDepth -= (line.match(/[\]
|
|
198
|
+
bracketDepth += (line.match(/[[{]/g) || []).length;
|
|
199
|
+
bracketDepth -= (line.match(/[\]}]/g) || []).length;
|
|
200
200
|
if (bracketDepth === 0) {
|
|
201
201
|
currentItem[multilineKey] = this.parseGodotValue(multilineValue);
|
|
202
202
|
multilineKey = '';
|
|
@@ -210,8 +210,8 @@ class GodotSceneImporter extends SceneImporter.SceneImporter {
|
|
|
210
210
|
const key = propMatch[1];
|
|
211
211
|
const value = propMatch[2];
|
|
212
212
|
// Check if value starts multiline
|
|
213
|
-
bracketDepth = (value.match(/[
|
|
214
|
-
bracketDepth -= (value.match(/[\]
|
|
213
|
+
bracketDepth = (value.match(/[[{]/g) || []).length;
|
|
214
|
+
bracketDepth -= (value.match(/[\]}]/g) || []).length;
|
|
215
215
|
if (bracketDepth > 0) {
|
|
216
216
|
multilineKey = key;
|
|
217
217
|
multilineValue = value;
|
|
@@ -152,7 +152,7 @@ class LDtkImporter extends SceneImporter.SceneImporter {
|
|
|
152
152
|
const externalLevel = JSON.parse(content);
|
|
153
153
|
level.layerInstances = externalLevel.layerInstances;
|
|
154
154
|
}
|
|
155
|
-
catch
|
|
155
|
+
catch {
|
|
156
156
|
this.addWarning('LEVEL_LOAD_ERROR', `Failed to load external level: ${level.externalRelPath}`, level.externalRelPath);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
@@ -68,7 +68,7 @@ class OgmoImporter extends SceneImporter.SceneImporter {
|
|
|
68
68
|
const scene = this.convertLevelToScene(levelData, levelPath);
|
|
69
69
|
scenes.push(scene);
|
|
70
70
|
}
|
|
71
|
-
catch
|
|
71
|
+
catch {
|
|
72
72
|
this.addWarning('LEVEL_LOAD', `Failed to load level: ${levelPath}`, levelPath);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -567,7 +567,7 @@ class TiledMapImporter extends SceneImporter.SceneImporter {
|
|
|
567
567
|
// Merge external tileset data
|
|
568
568
|
Object.assign(tileset, externalTileset, { firstGid: tileset.firstGid });
|
|
569
569
|
}
|
|
570
|
-
catch
|
|
570
|
+
catch {
|
|
571
571
|
this.addWarning('TILESET_LOAD_ERROR', `Failed to load external tileset: ${tileset.source}`, tileset.source);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
|
|
6
|
-
const Ctx = React.createContext(undefined);
|
|
6
|
+
const Ctx = /* @__PURE__ */ React.createContext(undefined);
|
|
7
7
|
/* ── Provider ──────────────────────────────────────────────────── */
|
|
8
8
|
function GamepadNavigationProvider({ children }) {
|
|
9
9
|
const [focusables, setFocusables] = React.useState([]);
|