Skip to content

Commit

Permalink
[Move] Move the Inspector template to the engine (cocos#8300)
Browse files Browse the repository at this point in the history
* [Feature] 将 inspector 模版移动到引擎

* 支持 material 的渲染

* 增加 assets 的 i18n 文案; 修改 scene 编辑 (#1)

* 添加 i18n 的 assets 配置

* 增加 assets 的 i18n 文案

* 增加只读样式

* 初步添加 image 类型的几个资源编辑

* 初步完成 image 编辑

* image 增加 i18n 文案

* 完成 sprite-frame 属性编辑

* 回退修改

* 完成 sprite-frame 除九宫格编辑外的功能

* 添加 texture 资源编辑

* 调整图片显示

* 调整 ui-image 使用时背景透明的样式

* Add inspector typescript (#2)

* inspector增加typescript

https://github.com/cocos-creator/3d-tasks/issues/6427

* 修复多选的样式

* Update typescript.js

全部设置为英文注释

* Update typescript.js

去掉了多余的替换

* update style

* Add javascript inspector (#4)

* create javascript inspector

* 修复样式,完善代码

* Update javascript.js

分而治之
不再把变量写在全局上

* Update javascript.js

优化代码
- 减少多余的层级
- 在update的时候加了一层判断
- 删掉多余的$

* create javascript inspector

* 修复样式,完善代码

* Update javascript.js

分而治之
不再把变量写在全局上

* Update javascript.js

优化代码
- 减少多余的层级
- 在update的时候加了一层判断
- 删掉多余的$

* update i18n of inspector,update inspector of javascript

- 将代码结构优化了一下
    - 将不是公用的方法放在了各自元素的update方法上
    - 调用_onPluginStateChanged 的时候将会update所有ui元素
- 将样式优化了一下
    - 取消没必要的缩进

* Update javascript.js

* add tooltip

Co-authored-by: SijieWang <itharbors@outlook.com>

* 完成 sprite-editor 九宫格编辑的联调 (#5)

* 增加容错

* 完成 sprite-editor 的编辑联调

* add audio-clip inspector (#6)

Co-authored-by: SijieWang <itharbors@outlook.com>

* create effect-header inspector (#7)

Co-authored-by: SijieWang <itharbors@outlook.com>

* 增加 footer 和 header 功能

* 分离 image 显示 (#16)

* Add json inspector (#3)

* add json inspector

https://github.com/cocos-creator/3d-tasks/issues/6427

* 修复 inspector json多选的样式

* Update json.js

修改注释全部为英文

* Update json.js

去掉了多余的代码

* update style

* add json inspector

https://github.com/cocos-creator/3d-tasks/issues/6427

* 修复 inspector json多选的样式

* Update json.js

修改注释全部为英文

* Update json.js

去掉了多余的代码

* update style

* Add era texture cube inspector (#8)

* create inspector of erp-texture-cube

* Update erp-texture-cube.js

* add i18n ,make code better

* add i18n ,support multi-select

* effect 资源的编辑 (#15)

* 增加容错

* 完成 sprite-editor 的编辑联调

* 初步显示 effect 资源

* 完成 effect 的编辑

Co-authored-by: SijieWang <itharbors@outlook.com>

* add inspector of particle (#10)

* add inspector of particle

It is not clear how to import other inspectors,
for example, here we need to import the texture inspector

* add tooltip

Co-authored-by: SijieWang <itharbors@outlook.com>

* Create prop.js (#18)

* Create prop.js

* Update prop.js

* Update prop.js

* add getCustomPropElements function

* Update prop.js

* Update prop.js

* add description

* add label-atlas inspector (#9)

* add label-atlas inspector

* Update label-atlas.js

去掉了多余的层级,直接使用this.$.xxx
每次更改元素属性的时候都会调用一次update

* add i18n

* Update label-atlas.js

调用update\ready方法前判断方法是否存在

* Update label-atlas.js

增加了对只读状态的判断

* fixed i18n

* update i18n

add i18n to all label

* allow multi select

* Update label-atlas.js

fix getInvalid

* remove useless update

Co-authored-by: SijieWang <itharbors@outlook.com>

* add physics-meterial inspector (#11)

* add physics-meterial inspector

* fixed wrong code

* Update physics-material.js

* hide content when multiselect

* add render-texture inspector (#13)

* add render-texture inspector

* Update tsconfig.json

Co-authored-by: SijieWang <itharbors@outlook.com>

* Add render flow inspector (#12)

* add renderer-flow

* not use requestAnimationFrame

Co-authored-by: SijieWang <itharbors@outlook.com>

* add text inspector (#14)

Co-authored-by: SijieWang <itharbors@outlook.com>

* add video-clip inspector (#17)

Co-authored-by: SijieWang <itharbors@outlook.com>

* Add page view inspector (#25)

* add page view inspector

* add page view inspector

* remove empty line

* add page view inspector

* remove empty line

* 完成 fbx 的编辑 (#20)

* fbx 内部模块拆分

* 调通 model 模块

* 完成预览分离及显示的调试

* 添加 material fbx 模块的编辑

* 材质图片的编辑

* 初步 fbx animation 编辑界面

* 完成了 fbx animation 编辑

* 添加 gltf 编辑

* 更新中文 fbx 文案

* 合并

Co-authored-by: SijieWang <itharbors@outlook.com>

* add video player inspector (#37)

* 检查并调整部分 assets 资源的编辑 (#39)

* audio 支持多选显示

* effect 补充部分元素 readonly 状态

* sprite-frame 增加 九宫格编辑按钮的 disabled 状态

* 图片多选情况下不显示 edit 按钮和预览面板

* 补充 mesh 文件预览

* 补充 2d particle 编辑

* 补充 physics-material 的编辑

* 补充 typescript 编辑

* 修改 javascript 的编辑

* 添加 gltf-skeleton 预览

* 修改 text 文件编辑

* 修改 erp-textrue-cube 编辑;修改 image sub ui-panel 的数据引用

* add texture-cube inspector (#19)

* add texture-cube inspector

目前无法监听width变化

* Update texture-cube.js

update style

* listen confirm event instead of change event

* Update assets.js

Co-authored-by: SijieWang <itharbors@outlook.com>

* add prefab-link inspector ,creat i18n of components 's inspector (#24)

* add prefab-link inspector ,creat i18n of components

* Update prefab-link.js

* format html

* add polygon collider2d inspector (#23)

* add polygon collider2d inspector

* remove useless update

* Update polygon-collider.js

* Update polygon-collider.js

format

* format html

Co-authored-by: SijieWang <itharbors@outlook.com>

* add inspector of rich text (#26)

* add inspector of rich text

* Update rich-text.js

* Update components.js

* dormat html

* Update rich-text.js

Co-authored-by: SijieWang <itharbors@outlook.com>

* add slider inspector (#30)

* add slider inspector

* format html

* Update slider.js

Co-authored-by: SijieWang <itharbors@outlook.com>

* add sphere light inspector (#31)

* add sphere light

* format html

* Update sphere-light.js

Co-authored-by: SijieWang <itharbors@outlook.com>

* add safe-area inspector (#27)

* add safe-area inspector

* format html

* Update safe-area.js

Co-authored-by: SijieWang <itharbors@outlook.com>

* add sprite inspector (#33)

* add sprite inspector

* format html

Co-authored-by: SijieWang <itharbors@outlook.com>

* add terrain inspector (#34)

* add terrain inspector

* update format

* format html

Co-authored-by: SijieWang <itharbors@outlook.com>

* add scroll view inspector (#28)

* add scroll view inspector

* format html

* Update scroll-view.js

Co-authored-by: SijieWang <itharbors@outlook.com>

* add skeletal animation inspector (#29)

Co-authored-by: SijieWang <itharbors@outlook.com>

* add spot light inspector (#32)

* add spot light inspector

* format

* format html

Co-authored-by: SijieWang <itharbors@outlook.com>

* add toggle inspector (#36)

* add toggle inspector

* format html

* format html

Co-authored-by: SijieWang <itharbors@outlook.com>

* add particle-system inspector (#38)

* add particle-system inspector

rotation的xyz修改会出现错误,需要帮助

* format html

Co-authored-by: SijieWang <itharbors@outlook.com>

* Add batched skinning model inspector (#40)

* add batched-skinning-model insepctor

* Update batched-skinning-model.js

* Update components.js

Co-authored-by: SijieWang <itharbors@outlook.com>

* add button inspector (#42)

* add button inspector

* format html

* format and don't change displayname

Co-authored-by: SijieWang <itharbors@outlook.com>

* Add layout inspector (#43)

* Add layout inspector

* format html

Co-authored-by: SijieWang <itharbors@outlook.com>

* Add web view inspector (#44)

* add webview inspector

我不清楚如何在自己修改dump得时候如何通知

* Update webview.js

使用了hack的方法发出了change-dump

* format html

Co-authored-by: SijieWang <itharbors@outlook.com>

* add particle system 2d inspector (#45)

Co-authored-by: SijieWang <itharbors@outlook.com>

* add widget inspector (#47)

Co-authored-by: SijieWang <itharbors@outlook.com>

* 检查了几种资源的编辑 (#46)

* 添加 texture-cube 的编辑

* 修改 video 预览

* 修改 render-texture 编辑

* 增加 render-pipeline 编辑

* 补充 label-atlas 编辑

* 修复节点复用时的事件绑定

* add texture to auto atlas (#49)

* add texture to auto atlas

* 修改带下划线变量名

* 继续部分资源编辑调整 (#48)

* 补充 teture-cube 的赋值

(cherry picked from commit 5a3c9a8ef1d1313922197ae04ba27cff81d4c474)

* 修改 render-pipeline 编辑

(cherry picked from commit e34418074ddd271941663e57c210b98f4d73f7f7)

* 修改 chunk 文件编辑

* 修改代码显示的相关文件

* 调整代码类显示效果

* 调整剩余三个文件中的 _asset 写法,去掉下划线

* 合并 image 编辑的代码

* 回退 json 代码的输出修改

* 调整 node component 编辑 (#50)

* 增加 setReadonly 工具函数

* 注册的组件按字母排序,以便剔除重复注册

* 新的节点组件编辑模式

* 增加 cc.Layout 编辑

* cc.PageView 没有额外交互不需要自定义编辑

* 修改 cc.RichText 编辑

* 修改 cc.ScrollView 编辑

* 取消 cc.Slider 自定义编辑

* 修改 cc.Toggle 编辑

* 增加一个基类,减少重复代码

* 修改 cc.SphereLight 编辑

* 修改 cc.WebView 编辑

* 修改 cc.VideoPlayer 编辑

* 修改 cc.SpotLight 编辑

* 修改 cc.Terrain 编辑

* 检查多选后属性值是否一致

* 修改 cc.SafeArea 编辑

* 修改 cc.PolygonCollider2D 编辑

* 修改 batched-skinning-model 编辑

* 回退一处修改;添加 displayOrder 100 的注释

* 回退一处修改

* Update particle-system.js

修正了显示的内容

* Update particle-system.js

* 修改 cc.ParticleSystem2D 编辑

* Update particle-system.js

* Update particle-system.js

* 修改属性同行的样式;增加 emitterMode 值切换其他属性显示

* 去掉 cc.SkeletalAnimation 编辑模板

Co-authored-by: zhangxin <13622872688@163.com>

Co-authored-by: 黄森斌 <arsen2010@126.com>
Co-authored-by: zhangxin <59186205+chichinohaha@users.noreply.github.com>
Co-authored-by: 媛媛 <yuanyuan1497@foxmail.com>
Co-authored-by: zhangxin <13622872688@163.com>
  • Loading branch information
5 people committed Apr 15, 2021
1 parent b89c07f commit 122e568
Show file tree
Hide file tree
Showing 65 changed files with 10,021 additions and 4 deletions.
6 changes: 6 additions & 0 deletions editor/i18n/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### 在编辑器里已经做了 ENGINE 的 i18n/en 和 /zh 里文件的数据自动合并

### 所以里面的数据不需要再互相 require

### 新模块 xxx 的 i18n 直接新增一个文件,
### 内容写 module.exports = { xxx: {} }
274 changes: 274 additions & 0 deletions editor/i18n/en/assets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
module.exports = {
assets: {
'label-atlas': {
SpriteFrameTip: 'SpriteFrame',
ItemWidthTip: 'Item Width',
ItemHeightTip: 'Item Height',
StartCharTip: 'Start Char',
FontSizeTip: 'Font Size',
SpriteFrame: 'SpriteFrame',
ItemWidth: 'Item Width',
ItemHeight: 'Item Height',
StartChar: 'Start Char',
FontSize: 'Font Size',
},
particle: {
spriteFrame:'Sprite Frame',
spriteFrameTip:'Sprite Frame'
},
erpTextureCube: {
anisotropy: 'Anisotropy',
minFilter: 'Min Filter',
magFilter: 'Mag Filter',
mipFilter: 'Mip Filter',
wrapModeS: 'Wrap Mode S',
wrapModeT: 'Wrap Mode T',
anisotropyTip: 'Anisotropy',
minFilterTip: 'Min Filter',
magFilterTip: 'Mag Filter',
mipFilterTip: 'Mip Filter',
wrapModeSTip: 'Wrap Mode S',
wrapModeTTip: 'Wrap Mode T',
faceSize: {
name: 'Face Size',
title: 'Size of each cube face. If not specified, or specified as 0, the default size, which is the nearest power of two to (image.width)/4, is used.',
},
},
javascript: {
plugin: 'Import As Plugin',
dependencies: 'Dependencies',
executionScope: 'Execution Scope',
global: 'Global',
enclosed: 'Enclosed',
loadPluginInWeb: 'Load In Web',
loadPluginInEditor: 'Load In Editor',
loadPluginInNative: 'Load In Native',
simulateGlobals: 'Simulate global variables',
executionScopeTip: 'Do not transpile or wrap this plugin script.',
executionScopeEnclosed: 'Simulate global variables',
pluginTip: 'Import As Plugin',
dependenciesTip: 'Dependencies',
globalTip: 'Global',
enclosedTip: 'Enclosed',
loadPluginInWebTip: 'Load In Web',
loadPluginInEditorTip: 'Load In Editor',
loadPluginInNativeTip: 'Load In Native',
simulateGlobalsTip: 'Simulate global variables',
},
scene: {
asyncLoadAssets: 'Async Load Assets',
},
effect: {
shader: 'Shaders',
shaderTip: 'Shaders',
combinations: 'Precompile Combinations',
combinationsTip: 'Precompile Combinations',
choose: 'Choose all possible branches.',
glsl3: 'GLSL 300 ES Output',
glsl1: 'GLSL 100 Output',
vert: 'Vertex Shader',
frag: 'Fragment Shader',
},
image: {
type: 'Type',
typeTip: 'Type',
flipVertical: 'Flip Vertical',
flipVerticalTip: 'Flip Vertical',
isRGBE: 'Is RGBE',
isRGBETip: 'Is RGBE',
},
spriteFrame: {
packable: 'Packable',
packableTip: 'Packable',
rotated: 'Rotated',
rotatedTip: 'Rotated',
offsetX: 'Offset X',
offsetXTip: 'Offset X',
offsetY: 'Offset Y',
offsetYTip: 'Offset Y',
trimType: 'Trim Type',
trimTypeTip: 'Trim Type',
trimThreshold: 'Trim Threshold',
trimThresholdTip: 'Trim Threshold',
trimX: 'Trim X',
trimXTip: 'Trim X',
trimY: 'Trim Y',
trimYTip: 'Trim Y',
width: 'Trim Width',
widthTip: 'Trim Width',
height: 'Trim Height',
heightTip: 'Trim Height',
borderTop: 'Border Top',
borderTopTip: 'Border Top',
borderBottom: 'Border Bottom',
borderBottomTip: 'Border Bottom',
borderLeft: 'Border Left',
borderLeftTip: 'Border Left',
borderRight: 'Border Right',
borderRightTip: 'Border Right',
edit: 'Edit',
},
texture: {
anisotropy: 'Anisotropy',
anisotropyTip: 'Anisotropy',
minfilter: 'Min Filter',
minfilterTip: 'Min Filter',
magfilter: 'Mag Filter',
magfilterTip: 'Mag Filter',
mipfilter: 'Mip Filter',
mipfilterTip: 'Mip Filter',
wrapModeS: 'Wrap Mode S',
wrapModeSTip: 'Wrap Mode S',
wrapModeT: 'Wrap Mode T',
wrapModeTTip: 'Wrap Mode T',
modeWarn: 'Warning: WebGL 1.0 platform doesn\'t support \'repeat\' filter for non-power-of-two textures(runtime fallback to \'clamp-to-edge\'), effectively disabling features like the \'tilingOffset\' property in many materials.',
},
fbx: {
browse: 'Change Target',
model: 'Model',
animation: 'Animation',
material: 'Material',
fbx: 'FBX',
GlTFUserData: {
normals: {
name: 'Normals',
title: 'Normals import setting.',
optional: {
name: 'Optional',
title: 'Import normals only if the model file contains normals.',
},
exclude: {
name: 'Exclude',
title: 'Do not import normals.',
},
require: {
name: 'Required',
title: 'Import normals that are contained in the model file, or calculated if not contained.',
},
recalculate: {
name: 'Recalculate',
title: 'Recalculate normals and import, ingoring whether if the model file contain normals.',
},
},
tangents: {
name: 'Tangents',
title: 'Tangents import setting.',
optional: {
name: 'Optional',
title: 'Import tangents only if the model file contains tangents.',
},
exclude: {
name: 'Exclude',
title: 'Do not import tangents.',
},
require: {
name: 'Required',
title:
'Import tangents that are contained in the model file, or calculated if not contained and texture coordinates exist.',
},
recalculate: {
name: 'Recalculate',
title: 'Recalculate tangents and import, ingoring whether if the model file contain tangents.',
},
},
dumpMaterials: {
name: 'Dump materials',
title: 'Whether to extract material assets out of embedded (sub)assets, so that the assets become editable.',
},
materialDumpDir: {
name: 'Material dump directory',
title: 'The directory to dump the materials.\nDefault to a direct sub-folder named `Materials_${model-file-base-name}` under current path.',
},
useVertexColors: {
name: 'Use vertex colors',
title: 'Whether to use vertex colors. ',
},
depthWriteInAlphaModeBlend: {
name: 'Depth-write if blending',
title: 'Enable depth-write if the alpha mode is set to "BLEND". ',
},
skipValidation: {
name: 'Skip Validation',
title: 'Skip validation of the model file.',
},
},
ImageRemap: {
remapAs: 'Remap as',
original: 'Original',
},
limitMaterialDumpDir: 'The extracted path needs to be scoped to the project path.',
legacyFbxImporter: {
name: 'Compatible with v1.*',
title: 'Whether this importer should be compatible with its behaviour prior to Cocos Creator version 1.* .',
warn: 'Warning: Changing this property may break imported assets that have been using or referencing. ',
},
disableMeshSplit: {
name: 'Disable mesh split',
title:
'Currently there is a joint-counting-based mesh splitting process during the <br>' +
'import pipeline to workaround the max uniform vector limit problem for real-time <br>' +
'calculated skeletal animation system on many platforms. This process has a performance <br>' +
'impact on other runtime systems too. So if it can be pre-determined that the real-time <br>' +
'calculated skeletal animations (when useBakedAnimations is unchecked on SkeletalAnimation <br>' +
'component) will not be used, this option can be checked to improve performance. But note that <br> ' +
'toggling this would update the corresponding prefab, so all the references in the scene should be <br>' +
'updated as well to accompany that. To be removed in further refactors.',
},
meshOptimizer: {
name: 'Mesh Optimizer',
title: 'Mesh Optimizer',
simplification: {
name: 'Simplification',
title: 'Simplification',
si: {
name: 'Achieve the ratio R',
title: 'Achieve the ratio R',
},
sa: {
name: 'Aggressively simplify',
title: 'Aggressively simplify',
},
},
scene: {
name: 'Scene',
title: 'Scene',
kn: {
name: 'Keep nodes transform',
title: 'Keep nodes transform',
},
ke: {
name: 'Keep extras data',
title: 'Keep extras data',
},
},
miscellaneous: {
name: 'Miscellaneous',
title: 'Miscellaneous',
noq: {
name: 'Disable quantization',
title: 'Disable quantization',
},
v: {
name: 'Verbose output',
title: 'Verbose output',
},
},
},
},
textureCube: {
anisotropy: 'Anisotropy',
anisotropyTip: 'Anisotropy',
minFilter: 'Min Filter',
minFilterTip: 'Min Filter',
magFilter: 'Mag Filter',
magFilterTip: 'Mag Filter',
mipFilter: 'Mip Filter',
mipFilterTip: 'Mip Filter',
wrapModeS: 'Wrap Mode S',
wrapModeSTip: 'Wrap Mode S',
wrapModeT: 'Wrap Mode T',
wrapModeTTip: 'Wrap Mode T',
modeWarn: 'Warning: WebGL 1.0 platform doesn\'t support \'repeat\' filter for non-power-of-two textures(runtime fallback to \'clamp-to-edge\'), effectively disabling features like the \'tilingOffset\' property in many materials.',
},
},
};
24 changes: 24 additions & 0 deletions editor/i18n/en/components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
components: {
safe_area: {
brief_help:
'This component is used to adjust the layout of current node to respect the safe area of a notched mobile device such as the iPhone X.' +
'It is typically used for the top node of the UI interaction area. (It will take effect automatically on mobile device and has no effect in the editor.)',
},

particle_system_2d: {
sync: 'Sync',
sync_tips: 'Synchronize the parameters in the File to Custom.',
export: 'Export',
export_error: 'This resource does not support exports outside of the project.',
export_tips: 'Export custom particle data to plist file.',
},

prefab_link: {
brief_help:
'Since the new Prefab system is not yet complete, the prefab that has a large difference with prefab asset cannot be automatically migrated. ' +
'This component is used to save the relationship between the node with the referenced prefab asset in the old Prefab system. ' +
'When the new Prefab system is complete, it will be automatically migrated to the new Prefab system.',
},
},
};
2 changes: 0 additions & 2 deletions editor/i18n/en/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
menu: {
custom_script: 'Custom script',
},

help: {
cc: {
Node: `${url}/${version}/manual/en/concepts/scene/node-component.html`,
Expand Down Expand Up @@ -67,7 +66,6 @@ module.exports = {
Spine: ``,
},
},

animation: {
default_clip: 'When checking, the deault animation clip is automatically played.',
clips: 'You can access and play animation clips via a script',
Expand Down
Loading

0 comments on commit 122e568

Please sign in to comment.