Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add javascript inspector #4

Merged
merged 13 commits into from
Mar 15, 2021
Merged

Add javascript inspector #4

merged 13 commits into from
Mar 15, 2021

Conversation

chichinohaha
Copy link

迁移javascript的inspector

@chichinohaha
Copy link
Author

image

const uiElements = {
isPluginCheckBox: {
ready () {
this.isPluginCheckBox = this.$['is-plugin'];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接在 $ 定义那边使用 isPluginCheckBox ,就不需要在这里转一次

},
},
code: {
ready () {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在调用处增加判断 if(Element.code.ready){} 就不需要这里必须定义一个空函数

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

学到了

优化代码
- 减少多余的层级
- 在update的时候加了一层判断
- 删掉多余的$
分而治之
不再把变量写在全局上
优化代码
- 减少多余的层级
- 在update的时候加了一层判断
- 删掉多余的$
- 将代码结构优化了一下
    - 将不是公用的方法放在了各自元素的update方法上
    - 调用_onPluginStateChanged 的时候将会update所有ui元素
- 将样式优化了一下
    - 取消没必要的缩进
@VisualSJ VisualSJ merged commit cbfc3e5 into VisualSJ:develop Mar 15, 2021
VisualSJ added a commit that referenced this pull request Apr 30, 2021
* [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 <[email protected]>

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

* 增加容错

* 完成 sprite-editor 的编辑联调

* add audio-clip inspector (#6)

Co-authored-by: SijieWang <[email protected]>

* create effect-header inspector (#7)

Co-authored-by: SijieWang <[email protected]>

* 增加 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* Add render flow inspector (#12)

* add renderer-flow

* not use requestAnimationFrame

Co-authored-by: SijieWang <[email protected]>

* add text inspector (#14)

Co-authored-by: SijieWang <[email protected]>

* add video-clip inspector (#17)

Co-authored-by: SijieWang <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* add slider inspector (#30)

* add slider inspector

* format html

* Update slider.js

Co-authored-by: SijieWang <[email protected]>

* add sphere light inspector (#31)

* add sphere light

* format html

* Update sphere-light.js

Co-authored-by: SijieWang <[email protected]>

* add safe-area inspector (#27)

* add safe-area inspector

* format html

* Update safe-area.js

Co-authored-by: SijieWang <[email protected]>

* add sprite inspector (#33)

* add sprite inspector

* format html

Co-authored-by: SijieWang <[email protected]>

* add terrain inspector (#34)

* add terrain inspector

* update format

* format html

Co-authored-by: SijieWang <[email protected]>

* add scroll view inspector (#28)

* add scroll view inspector

* format html

* Update scroll-view.js

Co-authored-by: SijieWang <[email protected]>

* add skeletal animation inspector (#29)

Co-authored-by: SijieWang <[email protected]>

* add spot light inspector (#32)

* add spot light inspector

* format

* format html

Co-authored-by: SijieWang <[email protected]>

* add toggle inspector (#36)

* add toggle inspector

* format html

* format html

Co-authored-by: SijieWang <[email protected]>

* add particle-system inspector (#38)

* add particle-system inspector

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

* format html

Co-authored-by: SijieWang <[email protected]>

* Add batched skinning model inspector (#40)

* add batched-skinning-model insepctor

* Update batched-skinning-model.js

* Update components.js

Co-authored-by: SijieWang <[email protected]>

* add button inspector (#42)

* add button inspector

* format html

* format and don't change displayname

Co-authored-by: SijieWang <[email protected]>

* Add layout inspector (#43)

* Add layout inspector

* format html

Co-authored-by: SijieWang <[email protected]>

* Add web view inspector (#44)

* add webview inspector

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

* Update webview.js

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

* format html

Co-authored-by: SijieWang <[email protected]>

* add particle system 2d inspector (#45)

Co-authored-by: SijieWang <[email protected]>

* add widget inspector (#47)

Co-authored-by: SijieWang <[email protected]>

* 检查了几种资源的编辑 (#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 <[email protected]>

Co-authored-by: 黄森斌 <[email protected]>
Co-authored-by: zhangxin <[email protected]>
Co-authored-by: 媛媛 <[email protected]>
Co-authored-by: zhangxin <[email protected]>
VisualSJ pushed a commit that referenced this pull request Oct 23, 2022
* when checking useSystemFont, the fontFamily should appear (cocos#12684)

Co-authored-by: zhangmingzhen <[email protected]>

* remove rebundant useLocalData (cocos#12640)

(cherry picked from commit 7cca981)

Co-authored-by: zhangmingzhen <[email protected]>

* Modify version number (cocos#12726)

Co-authored-by: liuyi <[email protected]>

* fix builtin asset hot-reload (cocos#12736)

* improve: move xr init to infrastructure (cocos#12765)

* improve: move xr init to infrastructure

* fix: move initxr, before gfx

* fix: format warning

* [Feature] build template add config file (cocos#12701)

* part of build template add config json for creating build templates and version checks for each platform

* update default template version

* add RenderQueue custom ability to classic pipeline (cocos#12760)

* Wgpu 3.6.2 WGPU_CI_ON  (cocos#12731)

* fix okhttp onClosing not call close (cocos#12783)

* fix transparency, emissive and  specularfactor with dcc effects (cocos#12798)

* reverse occlusion parameter in effects (cocos#12795)

* [native] Fix getting wrong value of globals.ambient.skyLightingColor (cocos#12810)

* refine:  remove unneeded code (cocos#12808)

* feat: update meta files (cocos#12807)

* middleware2d components rendering in native mode (cocos#12788)

* middleware2d components rendering in native mode

* support spine/dragonbones set enable batch

* support spine rendering in batching mode

* get batcher2d instance from root

* process about with type conversion

* fix some code style

* use material hash to merge draw batch

* deal with fill z

* fix dragonbones fill z

* remove some code no used any more

* refactoring some code

* modify some code

* add free memory

* fix clang-tidy

* delete mesh-buffer-layout in destructor

* byte alignment

* [ci skip][AUTO]: Automated code generating update: 88c3a7f  (cocos#12788) (cocos#12818)

Co-authored-by: cocos-robot <[email protected]>

* simplify (cocos#12782)

* [code] move decode32 to unpack.chunk (cocos#12823)

* [Optimize] Cache current time for audio player in minigame. (cocos#12814)

* Cache current time for minigames

* Save current time as private member

* Make cache time changed in callback

* update cache time to abort middle state for seek

* LogRemote upgrade configuration protocol (cocos#12833)

* update config

* Update LogRemote.cpp

* update default_skybox and sun direction (cocos#12811)

* fix submeshes have different instancing options (cocos#12786)

* [ci skip][AUTO]: Automated code generating update: 3200403  (cocos#12786) (cocos#12871)

Co-authored-by: cocos-robot <[email protected]>

* spine/dragonbones support batch mode in web platform (cocos#12847)

* spine/dragonbones support batch mode in web platform

* set data hash 0 in commitMiddleware

* optimizate merge draw batch for middleware

* keep commitIA in batcher2d

* modify deprecated about commitIA

* feat: support webgpu on build-engine (cocos#12627)

* feat: support webgpu

* build-engine-feat: support building external asset

* update

* Publish @cocos/[email protected]

* fix tiled merge draw call with sprite (cocos#12877)

* fix:CC_ASSERT(!_currentApp.expired()); (cocos#12844)

application has destroyed when WebSocketServer process callback in game thread

* [Bug fix] remove the player of the audio source when its clip is set to null  (cocos#12865)

* remove player when the audio source's clip is set to null

* fix binary format spine load crash (cocos#12894)

* wgpu: remove reinit on same object (cocos#12799)

* add i18n for skybox (cocos#12899)

* 3.6.2 fix android orientation crash (cocos#12885)

* do not cache argument in global space

* add doc

* add a comment for readAttachment (cocos#12902)

* If it is preview, replace overrideUuid  directly (cocos#12905)

* sort the attributes (cocos#12904)

Co-authored-by: zhangmingzhen <[email protected]>

* add i18n for shadow (cocos#12906)

* update default-skybox and sun direction (cocos#12917)

* fix:WebSocket connection to 'ws://XXXX/' failed: A server must not mask any frames that it sends to the client. (cocos#12882)

* remove USE_BATCHING (cocos#12892)

* fix a native middleware blend problem (cocos#12914)

* migrated remove USE_BATCHING (cocos#12895)

* [feature] support output bullet.wasm on  runtime based platform which the using of wasm api is more similar with weixin (cocos#12881)

* V3.6.2 fix particle crash (cocos#12913)

* fix native crash

* revert to pointer

* revert

* do not use reference

* if PREVIEW load cce scripts before loadProjectBundles (cocos#12916)

* If it is preview, replace overrideUuid  directly

* load cce scripts before loadProjectBundles

* Update game.ts

* Update game.ts

* Update game.ts

* Update game.ts

* fix download url request not encode space (cocos#12826)

* Export texture info for wgpu WGPU_CI_ON (cocos#12926)

* export texture info for wgpu

* missing js file

* update external config

Co-authored-by: Zeqiang Li <[email protected]>

* fix: build-engine (cocos#12929)

* richtext addChild optimization (cocos#12928)

* 1. remove rebundant invoking
2. ttf canvas texture resizes to width and height as (1,1)

* remove start() and move it to onLoad()

Co-authored-by: zhangmingzhen <[email protected]>

* fix animation asset on inspector preview bug (cocos#12900)

* optimize label component editing

* fix animation asset on inspector preview bug

* optimize i18n break words

* update node-executable by env (cocos#12930)

* Fix: toDataURL is not supported for this content on iPhone 7p (cocos#12830)

* Fix: toDataURL is not supported for this content on iPhone 7p

* Add srgb transform. (cocos#12873)

* add localCfg.cmake (cocos#12932)

* _loadCCEScripts  will be browser-preview only  (cocos#12925)

* _loadCCEScripts  will be browser-preview only

* add comment

* a compatible way of data copy & default buffer size for uniform buffer (cocos#12935)

* a compatible way of data copy & default buffer size for uniform buffer

* update external config

* [fix] default scene ambient and dirlight color (cocos#12955)

* sync readme for wgpu (cocos#12966)

* [fix] specularIntensity is invalid with builtin-standard (cocos#12971)

* [native] type2writer:add FLOAT3 to Color case for compatiblity (cocos#12962)

* V3.6.2 format return null error fix (cocos#12973)

* add i18n for model (cocos#12985)

* fix potential mem leak (cocos#12995)

* [fix] camera clear flag is skybox but skybox is disabled cocos#13589 (cocos#12964)

* [fix] shader compilation error with CC_DEVICE_SUPPORT_FLOAT_TEXTURE=0 (cocos#13015)

* fix import

* sync tojs to swig about middleware and 2d module (#4)

* sync tojs to swig about scene module (#5)

* remove Model::getInstancedAttributeBlock

Co-authored-by: Zhang mingzhen <[email protected]>
Co-authored-by: zhangmingzhen <[email protected]>
Co-authored-by: LIUYIa <[email protected]>
Co-authored-by: liuyi <[email protected]>
Co-authored-by: fqamic <[email protected]>
Co-authored-by: minggo <[email protected]>
Co-authored-by: changhua <[email protected]>
Co-authored-by: hyde zhou <[email protected]>
Co-authored-by: Zeqiang Li <[email protected]>
Co-authored-by: mmyduckx <[email protected]>
Co-authored-by: 徐兵 <[email protected]>
Co-authored-by: James Chen <[email protected]>
Co-authored-by: bofeng-song <[email protected]>
Co-authored-by: 袁炜海 <[email protected]>
Co-authored-by: zhakesi <[email protected]>
Co-authored-by: Cocos Robot <[email protected]>
Co-authored-by: cocos-robot <[email protected]>
Co-authored-by: 江战 <[email protected]>
Co-authored-by: jk20012001 <[email protected]>
Co-authored-by: timlyeee <[email protected]>
Co-authored-by: PP <[email protected]>
Co-authored-by: oahc09 <[email protected]>
Co-authored-by: zhangxin <[email protected]>
Co-authored-by: troublemaker52025 <[email protected]>
Co-authored-by: CC9701 <[email protected]>
Co-authored-by: zxx43 <[email protected]>
Co-authored-by: Zeqiang Li <[email protected]>
Co-authored-by: 黄森斌 <[email protected]>
Co-authored-by: ycg <[email protected]>
Co-authored-by: AFeiYA <[email protected]>
Co-authored-by: zhakesi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants