mirror of
https://github.com/potato47/ccc-devtools.git
synced 2024-12-25 19:29:13 +00:00
Merge branch 'master' of https://github.com/potato47/ccc-devtools
fix bug 2.0.9反复点击相同节点报错 # Conflicts: # js/app.js
This commit is contained in:
parent
6a3f5cbf5b
commit
b4acfa5612
@ -160,11 +160,14 @@ let app = new Vue({
|
||||
handleNodeClick(node) {
|
||||
if (node) {
|
||||
this.$data.node = node;
|
||||
if (!node.hex_color) {
|
||||
cc.js.getset(node, 'hex_color', () => {
|
||||
return '#' + node.color.toHEX('#rrggbb');
|
||||
}, (hex) => {
|
||||
node.color = new cc.Color().fromHEX(hex);
|
||||
}, false, true);
|
||||
}
|
||||
|
||||
let superPreLoad = node._onPreDestroy;
|
||||
node._onPreDestroy = () => {
|
||||
superPreLoad.apply(node);
|
||||
@ -182,6 +185,7 @@ let app = new Vue({
|
||||
for (let i = 0; i < schema.rows.length; i++) {
|
||||
for (let j = 0; j < schema.rows[i].length; j++) {
|
||||
if (schema.rows[i][j].type === 'color') {
|
||||
if (!node[schema.key][schema.rows[i][j].field]) {
|
||||
cc.js.getset(node[schema.key], schema.rows[i][j].field, () => {
|
||||
return '#' + node.getComponent(schema.key)[schema.rows[i][j]
|
||||
.rawField].toHEX('#rrggbb');
|
||||
@ -192,6 +196,7 @@ let app = new Vue({
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
schema = {
|
||||
title: component.__classname__,
|
||||
@ -301,11 +306,14 @@ let app = new Vue({
|
||||
},
|
||||
openDevMode() {
|
||||
setTimeout(() => {
|
||||
if (!cc.Node.prototype.isLeaf) {
|
||||
cc.js.getset(cc.Node.prototype, 'isLeaf', function() {
|
||||
return this.childrenCount === 0;
|
||||
}, function(value) {
|
||||
|
||||
}, false, true);
|
||||
}
|
||||
|
||||
let top = document.getElementById('top')
|
||||
top.appendChild(document.getElementsByClassName('toolbar')[0]);
|
||||
document.getElementById('game_panel').appendChild(document.getElementById('content'));
|
||||
|
Loading…
Reference in New Issue
Block a user