@nice2dev/game-engine 1.2.0 → 1.2.2
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 +142 -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 +4 -1
- package/dist/cjs/editor/AnimationRetargeting.js +110 -108
- package/dist/cjs/editor/CraftingEditor.js +2 -2
- package/dist/cjs/editor/NiceGameEditor.js +19 -6
- 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 +4 -1
- package/dist/esm/editor/AnimationRetargeting.js +110 -108
- package/dist/esm/editor/CraftingEditor.js +2 -2
- package/dist/esm/editor/NiceGameEditor.js +20 -7
- 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
|
@@ -88,7 +88,7 @@ class MonoGameExporter {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
generateSolution(
|
|
91
|
+
generateSolution(_project) {
|
|
92
92
|
const projectGuid = this.generateGuid();
|
|
93
93
|
const solutionGuid = this.generateGuid();
|
|
94
94
|
const sln = `
|
|
@@ -167,7 +167,7 @@ ${packageRefs.map((r) => ` ${r}`).join('\n')}
|
|
|
167
167
|
`;
|
|
168
168
|
this.csharpFiles.set(`${this.config.solutionName}/${this.config.solutionName}.csproj`, csproj);
|
|
169
169
|
}
|
|
170
|
-
generateGame1(
|
|
170
|
+
generateGame1(_project) {
|
|
171
171
|
const { namespace, useECS, useNez } = this.config;
|
|
172
172
|
const usings = [
|
|
173
173
|
'using Microsoft.Xna.Framework;',
|
|
@@ -130,7 +130,7 @@ ${music}
|
|
|
130
130
|
}
|
|
131
131
|
return lines.join('\n');
|
|
132
132
|
}
|
|
133
|
-
generateCoreFunctions(project,
|
|
133
|
+
generateCoreFunctions(project, _options) {
|
|
134
134
|
return `
|
|
135
135
|
-- initialization
|
|
136
136
|
function _init()
|
|
@@ -200,7 +200,7 @@ function _draw()
|
|
|
200
200
|
end
|
|
201
201
|
`;
|
|
202
202
|
}
|
|
203
|
-
generateEntitySystem(
|
|
203
|
+
generateEntitySystem(_project, _options) {
|
|
204
204
|
return `
|
|
205
205
|
-- entity system
|
|
206
206
|
function make_entity(type,x,y,props)
|
|
@@ -278,7 +278,7 @@ function collides(a,b)
|
|
|
278
278
|
end
|
|
279
279
|
`;
|
|
280
280
|
}
|
|
281
|
-
generateEntityDefinitions(project,
|
|
281
|
+
generateEntityDefinitions(project, _options) {
|
|
282
282
|
const lines = [];
|
|
283
283
|
lines.push('');
|
|
284
284
|
lines.push('-- entity types');
|
|
@@ -395,7 +395,7 @@ end
|
|
|
395
395
|
}
|
|
396
396
|
return defaultValue;
|
|
397
397
|
}
|
|
398
|
-
generateSceneSetup(project,
|
|
398
|
+
generateSceneSetup(project, _options) {
|
|
399
399
|
const lines = [];
|
|
400
400
|
lines.push('');
|
|
401
401
|
lines.push('-- scenes');
|
|
@@ -576,7 +576,7 @@ end
|
|
|
576
576
|
`;
|
|
577
577
|
}
|
|
578
578
|
/* ── Data Sections ──────────────────────────────────────────── */
|
|
579
|
-
generateGfxSection(
|
|
579
|
+
generateGfxSection(_project, _options) {
|
|
580
580
|
// Generate placeholder sprite sheet (128x128 = 256 lines of 128 hex chars)
|
|
581
581
|
// Each pixel is 4 bits (one hex char)
|
|
582
582
|
const lines = [];
|
|
@@ -638,7 +638,7 @@ end
|
|
|
638
638
|
}
|
|
639
639
|
return lines.join('\n');
|
|
640
640
|
}
|
|
641
|
-
generateGffSection(
|
|
641
|
+
generateGffSection(_project) {
|
|
642
642
|
// Sprite flags: 256 bytes (2 per line, 128 lines)
|
|
643
643
|
// All zeros for placeholder
|
|
644
644
|
const lines = [];
|
|
@@ -59,7 +59,7 @@ class RPGMakerExporter extends PlatformExporter {
|
|
|
59
59
|
await this.generateDataFiles(project, options);
|
|
60
60
|
}
|
|
61
61
|
/* ── Main Plugin ────────────────────────────────────────────── */
|
|
62
|
-
async generateMainPlugin(project,
|
|
62
|
+
async generateMainPlugin(project, _options) {
|
|
63
63
|
const versionSpecific = this.version === 'MZ' ? this.getMZPluginHeader() : this.getMVPluginHeader();
|
|
64
64
|
const plugin = `/*:
|
|
65
65
|
* @target ${this.version}
|
|
@@ -377,7 +377,7 @@ ${this.version === 'MZ' ? this.getMZPluginCommands() : this.getMVPluginCommands(
|
|
|
377
377
|
};`;
|
|
378
378
|
}
|
|
379
379
|
/* ── Utility Plugin ─────────────────────────────────────────── */
|
|
380
|
-
async generateUtilityPlugin(
|
|
380
|
+
async generateUtilityPlugin(_project, _options) {
|
|
381
381
|
const utility = `/*:
|
|
382
382
|
* @target ${this.version}
|
|
383
383
|
* @plugindesc Nice2Dev Utility Functions
|
|
@@ -749,7 +749,7 @@ ${scene.entities
|
|
|
749
749
|
return commands;
|
|
750
750
|
}
|
|
751
751
|
/* ── Prefab Export ──────────────────────────────────────────── */
|
|
752
|
-
async exportPrefab(prefab,
|
|
752
|
+
async exportPrefab(prefab, _options) {
|
|
753
753
|
const safeName = prefab.name.replace(/[^a-zA-Z0-9]/g, '');
|
|
754
754
|
// Generate prefab registration script
|
|
755
755
|
const prefabScript = `// Prefab: ${prefab.name}
|
|
@@ -775,7 +775,7 @@ ${prefab.entity.components.map((c) => ` { type: '${c.type}', properti
|
|
|
775
775
|
this.addTextFile(`js/plugins/${this.pluginPrefix}_Prefab_${safeName}.js`, prefabScript);
|
|
776
776
|
}
|
|
777
777
|
/* ── Common Events ──────────────────────────────────────────── */
|
|
778
|
-
async generateCommonEvents(_project,
|
|
778
|
+
async generateCommonEvents(_project, _options) {
|
|
779
779
|
const commonEvents = [
|
|
780
780
|
null, // Index 0 is always null
|
|
781
781
|
{
|
|
@@ -62,7 +62,7 @@ class RobloxExporter extends PlatformExporter {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
/* ── Folder Structure ───────────────────────────────────────── */
|
|
65
|
-
async generateFolderStructure(project,
|
|
65
|
+
async generateFolderStructure(project, _options) {
|
|
66
66
|
// README for the export
|
|
67
67
|
const readme = `# ${project.name} - Roblox Export
|
|
68
68
|
|
|
@@ -92,7 +92,7 @@ Generated from Nice2Dev project v${project.version}
|
|
|
92
92
|
this.addTextFile('README.md', readme);
|
|
93
93
|
}
|
|
94
94
|
/* ── Core Scripts ───────────────────────────────────────────── */
|
|
95
|
-
async generateCoreScripts(project,
|
|
95
|
+
async generateCoreScripts(project, _options) {
|
|
96
96
|
// Game Manager Module
|
|
97
97
|
const gameManagerModule = `${this.useStrictMode ? '--!strict\n' : ''}--[[
|
|
98
98
|
Game Manager Module
|
|
@@ -466,7 +466,7 @@ print("[Game] ${project.name} initialized successfully!")
|
|
|
466
466
|
this.addTextFile('ServerScriptService/GameInit.server.lua', initScript);
|
|
467
467
|
}
|
|
468
468
|
/* ── Client Scripts ─────────────────────────────────────────── */
|
|
469
|
-
async generateClientScripts(
|
|
469
|
+
async generateClientScripts(_project, _options) {
|
|
470
470
|
// Client-side game controller
|
|
471
471
|
const clientController = `${this.useStrictMode ? '--!strict\n' : ''}--[[
|
|
472
472
|
Client Controller
|
|
@@ -568,7 +568,7 @@ print("[ClientController] Initialized")
|
|
|
568
568
|
this.addTextFile('StarterPlayer/StarterPlayerScripts/ClientController.client.lua', clientController);
|
|
569
569
|
}
|
|
570
570
|
/* ── Server Scripts ─────────────────────────────────────────── */
|
|
571
|
-
async generateServerScripts(project,
|
|
571
|
+
async generateServerScripts(project, _options) {
|
|
572
572
|
// Data handling script
|
|
573
573
|
const dataScript = `${this.useStrictMode ? '--!strict\n' : ''}--[[
|
|
574
574
|
Data Handler Script
|
|
@@ -669,7 +669,7 @@ return DataHandler
|
|
|
669
669
|
this.addTextFile('ServerScriptService/DataHandler.server.lua', dataScript);
|
|
670
670
|
}
|
|
671
671
|
/* ── Scene Export ───────────────────────────────────────────── */
|
|
672
|
-
async exportScene(scene, project,
|
|
672
|
+
async exportScene(scene, project, _options) {
|
|
673
673
|
// Generate scene as a Model in RBXMX format
|
|
674
674
|
const modelXml = this.generateSceneModel(scene, project);
|
|
675
675
|
this.addTextFile(`Workspace/${scene.name}.rbxmx`, modelXml);
|
|
@@ -315,7 +315,7 @@ composer.gotoScene("scenes.${firstSceneName}", {
|
|
|
315
315
|
this.addTextFile('main.lua', mainLua);
|
|
316
316
|
}
|
|
317
317
|
/* ── Utility Modules ────────────────────────────────────────── */
|
|
318
|
-
async generateUtilityModules(_project,
|
|
318
|
+
async generateUtilityModules(_project, _options) {
|
|
319
319
|
// Game Manager
|
|
320
320
|
const gameManagerLua = `-- Game Manager Module
|
|
321
321
|
-- Central game state and utilities
|
|
@@ -1092,7 +1092,7 @@ return scene
|
|
|
1092
1092
|
return `${r.toFixed(2)}, ${g.toFixed(2)}, ${b.toFixed(2)}`;
|
|
1093
1093
|
}
|
|
1094
1094
|
/* ── Prefab Export ──────────────────────────────────────────── */
|
|
1095
|
-
async exportPrefab(prefab,
|
|
1095
|
+
async exportPrefab(prefab, _options) {
|
|
1096
1096
|
const prefabName = prefab.name.toLowerCase().replace(/[^a-z0-9_]/g, '_');
|
|
1097
1097
|
const entity = prefab.entity;
|
|
1098
1098
|
const tags = entity.tags ?? [];
|
|
@@ -564,7 +564,7 @@ export class ${sceneName}Scene ${useTS ? 'implements GameScene' : ''} {
|
|
|
564
564
|
}
|
|
565
565
|
return code;
|
|
566
566
|
}
|
|
567
|
-
generateMeshCode(entity, project,
|
|
567
|
+
generateMeshCode(entity, project, _useTS) {
|
|
568
568
|
const meshComp = entity.components.find((c) => c.type === 'mesh' ||
|
|
569
569
|
c.type === 'box' ||
|
|
570
570
|
c.type === 'sphere' ||
|
|
@@ -616,7 +616,7 @@ export class ${sceneName}Scene ${useTS ? 'implements GameScene' : ''} {
|
|
|
616
616
|
entity.receiveShadow = true;
|
|
617
617
|
`;
|
|
618
618
|
}
|
|
619
|
-
generateModelCode(entity, component, _project,
|
|
619
|
+
generateModelCode(entity, component, _project, _useTS) {
|
|
620
620
|
const compProps = component.properties ?? {};
|
|
621
621
|
const modelPath = compProps.path;
|
|
622
622
|
return ` // Model loading is handled asynchronously
|
|
@@ -630,7 +630,7 @@ export class ${sceneName}Scene ${useTS ? 'implements GameScene' : ''} {
|
|
|
630
630
|
: ''}
|
|
631
631
|
`;
|
|
632
632
|
}
|
|
633
|
-
generateLightCode(entity, component,
|
|
633
|
+
generateLightCode(entity, component, _useTS) {
|
|
634
634
|
const compProps = component.properties ?? {};
|
|
635
635
|
const color = compProps.color ?? '#ffffff';
|
|
636
636
|
const intensity = compProps.intensity ?? 1;
|
|
@@ -159,7 +159,7 @@ class Tic80Exporter extends PlatformExporter {
|
|
|
159
159
|
lines.push(this.generateLuaUtilities(platformOpts.includeDebug ?? false));
|
|
160
160
|
return lines.join('\n');
|
|
161
161
|
}
|
|
162
|
-
generateLuaCoreFunctions(project,
|
|
162
|
+
generateLuaCoreFunctions(project, _options) {
|
|
163
163
|
const bgColor = this.getClosestTic80Color(project.scenes[0]?.background ?? '#1a1c2c');
|
|
164
164
|
return `
|
|
165
165
|
-- Boot (called once)
|
|
@@ -926,7 +926,7 @@ draw_debug = ->
|
|
|
926
926
|
return lines.join('\n');
|
|
927
927
|
}
|
|
928
928
|
/* ── Wren Code Generation ───────────────────────────────────── */
|
|
929
|
-
generateWrenCode(project,
|
|
929
|
+
generateWrenCode(project, _options) {
|
|
930
930
|
return `// ${project.name} - TIC-80 Wren
|
|
931
931
|
// Generated from Nice2Dev
|
|
932
932
|
|
|
@@ -1062,7 +1062,7 @@ class UI {
|
|
|
1062
1062
|
`;
|
|
1063
1063
|
}
|
|
1064
1064
|
/* ── Data Sections ──────────────────────────────────────────── */
|
|
1065
|
-
generateSpritesSection(
|
|
1065
|
+
generateSpritesSection(_project) {
|
|
1066
1066
|
// TIC-80 sprites: each line represents 8 pixels (1 byte = 2 pixels)
|
|
1067
1067
|
// 256 sprites in 16x16 grid = 128x128 pixels
|
|
1068
1068
|
const lines = [];
|
|
@@ -1116,7 +1116,7 @@ class UI {
|
|
|
1116
1116
|
lines.push('-- </TILES>');
|
|
1117
1117
|
return lines.join('\n');
|
|
1118
1118
|
}
|
|
1119
|
-
generateMapSection(
|
|
1119
|
+
generateMapSection(_project) {
|
|
1120
1120
|
const lines = [];
|
|
1121
1121
|
lines.push('-- <MAP>');
|
|
1122
1122
|
// 240x136 / 8 = 30x17 tiles
|
|
@@ -1130,7 +1130,7 @@ class UI {
|
|
|
1130
1130
|
lines.push('-- </MAP>');
|
|
1131
1131
|
return lines.join('\n');
|
|
1132
1132
|
}
|
|
1133
|
-
generateWavesSection(
|
|
1133
|
+
generateWavesSection(_project, _options) {
|
|
1134
1134
|
return `-- <WAVES>
|
|
1135
1135
|
-- 000:00000000ffffffff00000000ffffffff
|
|
1136
1136
|
-- 001:0123456789abcdeffedcba9876543210
|
|
@@ -1138,7 +1138,7 @@ class UI {
|
|
|
1138
1138
|
-- 003:fedcba9876543210fedcba9876543210
|
|
1139
1139
|
-- </WAVES>`;
|
|
1140
1140
|
}
|
|
1141
|
-
generateSfxSection(
|
|
1141
|
+
generateSfxSection(_project) {
|
|
1142
1142
|
return `-- <SFX>
|
|
1143
1143
|
-- 000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000304000000000
|
|
1144
1144
|
-- </SFX>`;
|
|
@@ -81,7 +81,7 @@ class UnityExporter extends PlatformExporter {
|
|
|
81
81
|
this.exportPackageManifest(project);
|
|
82
82
|
}
|
|
83
83
|
/* ── Project Settings ───────────────────────────────────────── */
|
|
84
|
-
async exportProjectSettings(project,
|
|
84
|
+
async exportProjectSettings(project, _options, _unity) {
|
|
85
85
|
// ProjectSettings.asset
|
|
86
86
|
const settings = `%YAML 1.1
|
|
87
87
|
%TAG !u! tag:unity3d.com,2011:
|
|
@@ -132,7 +132,7 @@ Physics2DSettings:
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
/* ── Prefabs ────────────────────────────────────────────────── */
|
|
135
|
-
async exportPrefabs(project,
|
|
135
|
+
async exportPrefabs(project, _options) {
|
|
136
136
|
for (const prefab of project.prefabs) {
|
|
137
137
|
const yaml = this.createPrefabYAML(prefab, project);
|
|
138
138
|
const path = `Assets/Prefabs/${this.sanitizeFileName(prefab.name)}.prefab`;
|
|
@@ -193,7 +193,7 @@ Physics2DSettings:
|
|
|
193
193
|
return this.serializeUnityYAML({ objects });
|
|
194
194
|
}
|
|
195
195
|
/* ── Scenes ─────────────────────────────────────────────────── */
|
|
196
|
-
async exportScenes(project,
|
|
196
|
+
async exportScenes(project, _options) {
|
|
197
197
|
for (const scene of project.scenes) {
|
|
198
198
|
const yaml = this.createSceneYAML(scene, project);
|
|
199
199
|
const path = `Assets/Scenes/${this.sanitizeFileName(scene.name)}.unity`;
|
|
@@ -299,7 +299,7 @@ Physics2DSettings:
|
|
|
299
299
|
this.addEntityComponents(entity, objects, gameObjectId, project);
|
|
300
300
|
return transformId;
|
|
301
301
|
}
|
|
302
|
-
addEntityComponents(entity, objects, gameObjectId,
|
|
302
|
+
addEntityComponents(entity, objects, gameObjectId, _project) {
|
|
303
303
|
for (const component of entity.components) {
|
|
304
304
|
const props = component.properties ?? {};
|
|
305
305
|
switch (component.type) {
|
|
@@ -229,7 +229,7 @@ class UnrealExporter extends PlatformExporter {
|
|
|
229
229
|
};
|
|
230
230
|
this.addTextFile(`${projectName}.uproject`, JSON.stringify(uproject, null, 2));
|
|
231
231
|
}
|
|
232
|
-
async generateBuildFiles(
|
|
232
|
+
async generateBuildFiles(_project, _options) {
|
|
233
233
|
// Module Build.cs
|
|
234
234
|
const buildCs = `// Copyright Nice2Dev. All Rights Reserved.
|
|
235
235
|
|
|
@@ -330,7 +330,7 @@ IMPLEMENT_PRIMARY_GAME_MODULE(F${this.moduleName}Module, ${this.moduleName}, "${
|
|
|
330
330
|
this.generateActorClass(prefab.entity, prefab.name, options);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
generateGameMode(project,
|
|
333
|
+
generateGameMode(project, _options) {
|
|
334
334
|
const className = `A${this.moduleName}GameMode`;
|
|
335
335
|
// Header
|
|
336
336
|
const header = `// Copyright Nice2Dev. All Rights Reserved.
|
|
@@ -411,7 +411,7 @@ void ${className}::StartPlay()
|
|
|
411
411
|
`;
|
|
412
412
|
this.addTextFile(`Source/${this.moduleName}/${this.moduleName}GameMode.cpp`, source);
|
|
413
413
|
}
|
|
414
|
-
generateActorClass(entity, className,
|
|
414
|
+
generateActorClass(entity, className, _options) {
|
|
415
415
|
const sanitizedName = className.replace(/[^a-zA-Z0-9]/g, '');
|
|
416
416
|
const fullClassName = `A${sanitizedName}`;
|
|
417
417
|
this.usedHeaders.clear();
|
|
@@ -569,7 +569,7 @@ void ${fullClassName}::OnNiceUpdate_Implementation(float DeltaTime)
|
|
|
569
569
|
}
|
|
570
570
|
return String(value);
|
|
571
571
|
}
|
|
572
|
-
async generateConfigFiles(project,
|
|
572
|
+
async generateConfigFiles(project, _options) {
|
|
573
573
|
// Default Engine.ini
|
|
574
574
|
const engineIni = `[/Script/EngineSettings.GameMapsSettings]
|
|
575
575
|
GameDefaultMap=/Game/Maps/MainMenu
|
|
@@ -601,7 +601,7 @@ DefaultGravityZ=${project.settings.physics?.gravity?.y ?? -980}
|
|
|
601
601
|
this.addTextFile('Config/DefaultGame.ini', gameIni);
|
|
602
602
|
}
|
|
603
603
|
/* ── Scene Export ───────────────────────────────────────────── */
|
|
604
|
-
async exportScene(scene, project,
|
|
604
|
+
async exportScene(scene, project, _options) {
|
|
605
605
|
// Generate level blueprint
|
|
606
606
|
const levelHeader = this.generateLevelBlueprint(scene, project);
|
|
607
607
|
this.addTextFile(`Content/Maps/${scene.name}_LevelScript.h`, levelHeader.header);
|
|
@@ -610,7 +610,7 @@ DefaultGravityZ=${project.settings.physics?.gravity?.y ?? -980}
|
|
|
610
610
|
const spawnData = this.generateSpawnData(scene);
|
|
611
611
|
this.addTextFile(`Content/Data/${scene.name}_SpawnData.json`, JSON.stringify(spawnData, null, 2));
|
|
612
612
|
}
|
|
613
|
-
generateLevelBlueprint(scene,
|
|
613
|
+
generateLevelBlueprint(scene, _project) {
|
|
614
614
|
const className = `A${scene.name.replace(/[^a-zA-Z0-9]/g, '')}LevelScript`;
|
|
615
615
|
const header = `// Copyright Nice2Dev. All Rights Reserved.
|
|
616
616
|
|
|
@@ -711,7 +711,7 @@ ${scene.entities.map((e) => this.generateEntitySpawnCode(e)).join('\n')}
|
|
|
711
711
|
};
|
|
712
712
|
}
|
|
713
713
|
/* ── Asset Export ───────────────────────────────────────────── */
|
|
714
|
-
async exportAsset(asset,
|
|
714
|
+
async exportAsset(asset, _options) {
|
|
715
715
|
switch (asset.type) {
|
|
716
716
|
case 'sprite':
|
|
717
717
|
case 'texture':
|
|
@@ -376,7 +376,7 @@ export default class ${sceneName}Scene ${useTS ? 'implements Scene' : ''} {
|
|
|
376
376
|
}
|
|
377
377
|
return code;
|
|
378
378
|
}
|
|
379
|
-
async exportScripts(project, options,
|
|
379
|
+
async exportScripts(project, options, _useTS) {
|
|
380
380
|
for (const script of project.scripts) {
|
|
381
381
|
try {
|
|
382
382
|
const ast = this.graphToAST.convert(script);
|
|
@@ -968,7 +968,7 @@ export class ${sceneName}Scene extends Phaser.Scene {
|
|
|
968
968
|
(scene.tilemaps ?? []).forEach((tm) => assetIds.add(tm.tilesetId));
|
|
969
969
|
return project.assets.filter((a) => assetIds.has(a.id));
|
|
970
970
|
}
|
|
971
|
-
async exportScripts(project, options,
|
|
971
|
+
async exportScripts(project, options, _useTS) {
|
|
972
972
|
for (const script of project.scripts) {
|
|
973
973
|
try {
|
|
974
974
|
const ast = this.graphToAST.convert(script);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { NiceIcon } from '@nice2dev/ui';
|
|
3
|
-
import {
|
|
3
|
+
import { forwardRef, useReducer, useMemo, useCallback, useImperativeHandle, createContext, useContext } from 'react';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_THEME = {
|
|
6
6
|
background: '#1d2229',
|
|
@@ -91,7 +91,7 @@ const INITIAL_STATE = {
|
|
|
91
91
|
importProgress: 0,
|
|
92
92
|
tab: 'files',
|
|
93
93
|
};
|
|
94
|
-
const BrowserContext = createContext(null);
|
|
94
|
+
const BrowserContext = /* @__PURE__ */ createContext(null);
|
|
95
95
|
function useBrowser() {
|
|
96
96
|
const ctx = useContext(BrowserContext);
|
|
97
97
|
if (!ctx) {
|
|
@@ -579,7 +579,8 @@ const DEMO_PROJECT = {
|
|
|
579
579
|
{ name: 'Web Build', platform: 'Web' },
|
|
580
580
|
],
|
|
581
581
|
};
|
|
582
|
-
const GodotProjectBrowser =
|
|
582
|
+
const GodotProjectBrowser = /* @__PURE__ */ Object.assign(
|
|
583
|
+
/* @__PURE__ */ forwardRef(({ projectPath: _projectPath, theme: themeOverride, onProjectLoad, onImport, onSyncConnect, onSyncDisconnect, className, style, }, ref) => {
|
|
583
584
|
const [state, dispatch] = useReducer(browserReducer, {
|
|
584
585
|
...INITIAL_STATE,
|
|
585
586
|
projectInfo: DEMO_PROJECT,
|
|
@@ -661,7 +662,6 @@ const GodotProjectBrowser = forwardRef(({ projectPath: _projectPath, theme: them
|
|
|
661
662
|
overflow: 'hidden',
|
|
662
663
|
...style,
|
|
663
664
|
}, children: [jsx(BrowserHeader, {}), jsx(BrowserToolbar, {}), jsx(TabBar, {}), jsxs("div", { style: { flex: 1, overflow: 'auto' }, children: [state.tab === 'files' && jsx(FilesPanel, {}), state.tab === 'autoloads' && jsx(AutoloadsPanel, {}), state.tab === 'plugins' && jsx(PluginsPanel, {}), state.tab === 'exports' && jsx(ExportsPanel, {})] })] }) }));
|
|
664
|
-
});
|
|
665
|
-
GodotProjectBrowser.displayName = 'GodotProjectBrowser';
|
|
665
|
+
}), { displayName: 'GodotProjectBrowser' });
|
|
666
666
|
|
|
667
667
|
export { GodotProjectBrowser };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useContext, useState, useRef, useEffect, useCallback, createContext } from 'react';
|
|
3
3
|
import { getI18n, LOCALE_NAMES, SUPPORTED_LOCALES } from './I18n.js';
|
|
4
4
|
|
|
5
5
|
/* ── Context ──────────────────────────────────────────────────── */
|
|
6
|
-
const I18nContext = createContext(null);
|
|
6
|
+
const I18nContext = /* @__PURE__ */ createContext(null);
|
|
7
7
|
/**
|
|
8
8
|
* Provider component to supply a custom I18nManager to the tree.
|
|
9
9
|
* If not used, the global singleton (getI18n()) is used automatically.
|
|
@@ -193,8 +193,8 @@ class GodotSceneImporter extends SceneImporter {
|
|
|
193
193
|
// Handle multiline values
|
|
194
194
|
if (multilineKey) {
|
|
195
195
|
multilineValue += '\n' + line;
|
|
196
|
-
bracketDepth += (line.match(/[
|
|
197
|
-
bracketDepth -= (line.match(/[\]
|
|
196
|
+
bracketDepth += (line.match(/[[{]/g) || []).length;
|
|
197
|
+
bracketDepth -= (line.match(/[\]}]/g) || []).length;
|
|
198
198
|
if (bracketDepth === 0) {
|
|
199
199
|
currentItem[multilineKey] = this.parseGodotValue(multilineValue);
|
|
200
200
|
multilineKey = '';
|
|
@@ -208,8 +208,8 @@ class GodotSceneImporter extends SceneImporter {
|
|
|
208
208
|
const key = propMatch[1];
|
|
209
209
|
const value = propMatch[2];
|
|
210
210
|
// Check if value starts multiline
|
|
211
|
-
bracketDepth = (value.match(/[
|
|
212
|
-
bracketDepth -= (value.match(/[\]
|
|
211
|
+
bracketDepth = (value.match(/[[{]/g) || []).length;
|
|
212
|
+
bracketDepth -= (value.match(/[\]}]/g) || []).length;
|
|
213
213
|
if (bracketDepth > 0) {
|
|
214
214
|
multilineKey = key;
|
|
215
215
|
multilineValue = value;
|
|
@@ -150,7 +150,7 @@ class LDtkImporter extends SceneImporter {
|
|
|
150
150
|
const externalLevel = JSON.parse(content);
|
|
151
151
|
level.layerInstances = externalLevel.layerInstances;
|
|
152
152
|
}
|
|
153
|
-
catch
|
|
153
|
+
catch {
|
|
154
154
|
this.addWarning('LEVEL_LOAD_ERROR', `Failed to load external level: ${level.externalRelPath}`, level.externalRelPath);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -565,7 +565,7 @@ class TiledMapImporter extends SceneImporter {
|
|
|
565
565
|
// Merge external tileset data
|
|
566
566
|
Object.assign(tileset, externalTileset, { firstGid: tileset.firstGid });
|
|
567
567
|
}
|
|
568
|
-
catch
|
|
568
|
+
catch {
|
|
569
569
|
this.addWarning('TILESET_LOAD_ERROR', `Failed to load external tileset: ${tileset.source}`, tileset.source);
|
|
570
570
|
}
|
|
571
571
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, useContext, createContext } from 'react';
|
|
3
3
|
|
|
4
|
-
const Ctx = createContext(undefined);
|
|
4
|
+
const Ctx = /* @__PURE__ */ createContext(undefined);
|
|
5
5
|
/* ── Provider ──────────────────────────────────────────────────── */
|
|
6
6
|
function GamepadNavigationProvider({ children }) {
|
|
7
7
|
const [focusables, setFocusables] = useState([]);
|
|
@@ -983,7 +983,7 @@ class InventoryManager {
|
|
|
983
983
|
/* ═══════════════════════════════════════════════════════════════
|
|
984
984
|
REACT INTEGRATION
|
|
985
985
|
══════════════════════════════════════════════════════════════════ */
|
|
986
|
-
const InventoryContext = React.createContext(null);
|
|
986
|
+
const InventoryContext = /* @__PURE__ */ React.createContext(null);
|
|
987
987
|
const InventoryProvider = ({ manager, children }) => {
|
|
988
988
|
return React.createElement(InventoryContext.Provider, { value: manager }, children);
|
|
989
989
|
};
|
|
@@ -632,37 +632,48 @@ class PostProcessStack {
|
|
|
632
632
|
this.passes = [];
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
-
const QUALITY_PRESET_CONFIGS = {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
medium: {
|
|
644
|
-
sampleCount: 1,
|
|
645
|
-
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 1024, cascadeCount: 2 },
|
|
646
|
-
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, effects: [FXAA_DEFAULTS] },
|
|
647
|
-
depthPrepassEnabled: false,
|
|
648
|
-
},
|
|
649
|
-
high: {
|
|
650
|
-
sampleCount: 4,
|
|
651
|
-
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 2048, cascadeCount: 4 },
|
|
652
|
-
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, effects: [FXAA_DEFAULTS, BLOOM_DEFAULTS] },
|
|
653
|
-
depthPrepassEnabled: true,
|
|
654
|
-
},
|
|
655
|
-
ultra: {
|
|
656
|
-
sampleCount: 4,
|
|
657
|
-
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 4096, cascadeCount: 4, pcfRadius: 3 },
|
|
658
|
-
postProcess: {
|
|
659
|
-
...DEFAULT_RENDER_CONFIG.postProcess,
|
|
660
|
-
effects: [FXAA_DEFAULTS, BLOOM_DEFAULTS, SSAO_DEFAULTS, DOF_DEFAULTS, COLOR_GRADING_DEFAULTS],
|
|
635
|
+
const QUALITY_PRESET_CONFIGS = /* @__PURE__ */ (function () {
|
|
636
|
+
return {
|
|
637
|
+
low: {
|
|
638
|
+
sampleCount: 1,
|
|
639
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, enabled: false },
|
|
640
|
+
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, hdrEnabled: false, effects: [] },
|
|
641
|
+
depthPrepassEnabled: false,
|
|
642
|
+
occlusionCulling: false,
|
|
661
643
|
},
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
}
|
|
644
|
+
medium: {
|
|
645
|
+
sampleCount: 1,
|
|
646
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 1024, cascadeCount: 2 },
|
|
647
|
+
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, effects: [FXAA_DEFAULTS] },
|
|
648
|
+
depthPrepassEnabled: false,
|
|
649
|
+
},
|
|
650
|
+
high: {
|
|
651
|
+
sampleCount: 4,
|
|
652
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 2048, cascadeCount: 4 },
|
|
653
|
+
postProcess: {
|
|
654
|
+
...DEFAULT_RENDER_CONFIG.postProcess,
|
|
655
|
+
effects: [FXAA_DEFAULTS, BLOOM_DEFAULTS],
|
|
656
|
+
},
|
|
657
|
+
depthPrepassEnabled: true,
|
|
658
|
+
},
|
|
659
|
+
ultra: {
|
|
660
|
+
sampleCount: 4,
|
|
661
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 4096, cascadeCount: 4, pcfRadius: 3 },
|
|
662
|
+
postProcess: {
|
|
663
|
+
...DEFAULT_RENDER_CONFIG.postProcess,
|
|
664
|
+
effects: [
|
|
665
|
+
FXAA_DEFAULTS,
|
|
666
|
+
BLOOM_DEFAULTS,
|
|
667
|
+
SSAO_DEFAULTS,
|
|
668
|
+
DOF_DEFAULTS,
|
|
669
|
+
COLOR_GRADING_DEFAULTS,
|
|
670
|
+
],
|
|
671
|
+
},
|
|
672
|
+
depthPrepassEnabled: true,
|
|
673
|
+
occlusionCulling: true,
|
|
674
|
+
},
|
|
675
|
+
};
|
|
676
|
+
})();
|
|
666
677
|
function applyQualityPreset(preset) {
|
|
667
678
|
return { ...DEFAULT_RENDER_CONFIG, ...QUALITY_PRESET_CONFIGS[preset] };
|
|
668
679
|
}
|
|
@@ -298,7 +298,7 @@ class UnityProjectImporter {
|
|
|
298
298
|
const parts = path.replace(/\\/g, '/').split('/');
|
|
299
299
|
return parts[parts.length - 1] || 'UnknownProject';
|
|
300
300
|
}
|
|
301
|
-
async detectUnityVersion(
|
|
301
|
+
async detectUnityVersion(_projectPath) {
|
|
302
302
|
// Read ProjectSettings/ProjectVersion.txt
|
|
303
303
|
// In real implementation, read from file system
|
|
304
304
|
// Format: m_EditorVersion: 2022.3.10f1
|
|
@@ -594,7 +594,7 @@ class UnityProjectImporter {
|
|
|
594
594
|
field.tooltip = tooltipMatch[1];
|
|
595
595
|
}
|
|
596
596
|
// Range
|
|
597
|
-
const rangeMatch = attrBlock.match(/\[Range\(([^,]+),\s*([
|
|
597
|
+
const rangeMatch = attrBlock.match(/\[Range\(([^,]+),\s*([^)]+)\)\]/);
|
|
598
598
|
if (rangeMatch) {
|
|
599
599
|
field.range = {
|
|
600
600
|
min: parseFloat(rangeMatch[1]),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { NiceIcon } from '@nice2dev/ui';
|
|
3
|
-
import {
|
|
3
|
+
import { forwardRef, useReducer, useMemo, useCallback, useImperativeHandle, createContext, useState, useContext } from 'react';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_THEME = {
|
|
6
6
|
background: '#0f0f17',
|
|
@@ -78,7 +78,7 @@ const INITIAL_STATE = {
|
|
|
78
78
|
view: 'grid',
|
|
79
79
|
myAssets: false,
|
|
80
80
|
};
|
|
81
|
-
const StoreContext = createContext(null);
|
|
81
|
+
const StoreContext = /* @__PURE__ */ createContext(null);
|
|
82
82
|
function useStore() {
|
|
83
83
|
const ctx = useContext(StoreContext);
|
|
84
84
|
if (!ctx) {
|
|
@@ -695,7 +695,8 @@ const DEMO_ASSETS = [
|
|
|
695
695
|
url: 'https://assetstore.unity.com/',
|
|
696
696
|
},
|
|
697
697
|
];
|
|
698
|
-
const UnityAssetStoreBrowser =
|
|
698
|
+
const UnityAssetStoreBrowser = /* @__PURE__ */ Object.assign(
|
|
699
|
+
/* @__PURE__ */ forwardRef(({ theme: themeOverride, onDownload, onPurchase: _onPurchase, className, style }, ref) => {
|
|
699
700
|
const [state, dispatch] = useReducer(storeReducer, {
|
|
700
701
|
...INITIAL_STATE,
|
|
701
702
|
results: DEMO_ASSETS,
|
|
@@ -791,7 +792,6 @@ const UnityAssetStoreBrowser = forwardRef(({ theme: themeOverride, onDownload, o
|
|
|
791
792
|
overflow: 'hidden',
|
|
792
793
|
...style,
|
|
793
794
|
}, children: [jsx(SearchHeader, {}), jsx("div", { style: { flex: 1, overflow: 'auto' }, children: jsx(AssetGrid, {}) }), jsx(AssetDetailModal, {})] }) }));
|
|
794
|
-
});
|
|
795
|
-
UnityAssetStoreBrowser.displayName = 'UnityAssetStoreBrowser';
|
|
795
|
+
}), { displayName: 'UnityAssetStoreBrowser' });
|
|
796
796
|
|
|
797
797
|
export { UnityAssetStoreBrowser };
|