fix(config-editor): main entry exports methods object + load/unload (Cocos 3.8)

Root cause of 'Method does not exist / The methods of the module is undefined':
Cocos 3.8 expects handlers inside a 'methods' export (plus load/unload hooks),
not flat on module.exports. Handlers receive args directly (no event); return
value is the request reply. Verified vs official 3.8 first/messages docs.
Also: menu path + panel title switched to literal strings (i18n showed 'undefined').
This commit is contained in:
panFD
2026-06-21 16:30:39 +08:00
parent fb65fa79c8
commit bfa434634c
2 changed files with 47 additions and 15 deletions

View File

@@ -2,7 +2,7 @@
"package_version": 2,
"name": "pixelhero-config-editor",
"version": "0.1.0",
"description": "i18n:pixelhero-config-editor.description",
"description": "英雄/技能配置编辑器",
"main": "./dist/main.js",
"author": "pixelhero",
"editor": ">=3.8.0",
@@ -13,7 +13,7 @@
},
"panels": {
"default": {
"title": "i18n:pixelhero-config-editor.title",
"title": "英雄/技能配置",
"type": "dockable",
"main": "./dist/panels/default.js",
"size": { "width": 960, "height": 640, "min-width": 640, "min-height": 480 }
@@ -21,7 +21,7 @@
},
"contributions": {
"menu": [
{ "path": "i18n:menu.panel/英雄技能配置", "message": "open-panel" }
{ "path": "PixelHero/英雄技能配置", "message": "open-panel" }
],
"messages": {
"open-panel": { "methods": ["open-panel"] },