mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-20 00:48:43 +00:00
增加log功能
This commit is contained in:
parent
67dea61ffe
commit
8702f666d0
@ -44,6 +44,7 @@ module.exports = {
|
|||||||
"@typescript-eslint/ban-ts-comment": "off",
|
"@typescript-eslint/ban-ts-comment": "off",
|
||||||
"no-inner-declarations": "off",
|
"no-inner-declarations": "off",
|
||||||
"vue/no-unused-vars": "off",
|
"vue/no-unused-vars": "off",
|
||||||
"@typescript-eslint/no-namespace": "off"
|
"@typescript-eslint/no-namespace": "off",
|
||||||
|
"@typescript-eslint/no-this-alias": "off"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -17,6 +17,7 @@ export enum Msg {
|
|||||||
UpdateFrames = "UpdateFrames", // 更新页面的frame
|
UpdateFrames = "UpdateFrames", // 更新页面的frame
|
||||||
UseFrame = "UseFrame",
|
UseFrame = "UseFrame",
|
||||||
GetObjectItemData = "GetObjectItemData",
|
GetObjectItemData = "GetObjectItemData",
|
||||||
|
LogData = "LogData",
|
||||||
SetProperty = "set-property", // 设置node属性
|
SetProperty = "set-property", // 设置node属性
|
||||||
UpdateProperty = "update-property", // 更新属性
|
UpdateProperty = "update-property", // 更新属性
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import Vue from "vue"
|
|||||||
export enum BusMsg {
|
export enum BusMsg {
|
||||||
ShowPlace = "ShowPlace",
|
ShowPlace = "ShowPlace",
|
||||||
RequestObjectData = "RequestObjectData",
|
RequestObjectData = "RequestObjectData",
|
||||||
|
LogData = "LogData",
|
||||||
FoldAllGroup = "FoldAllGroup"
|
FoldAllGroup = "FoldAllGroup"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,11 +193,13 @@ export class Property {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class Group {
|
export class Group {
|
||||||
|
public id: string = "";
|
||||||
public name: string = "group";
|
public name: string = "group";
|
||||||
public data: Array<Property> = [];
|
public data: Array<Property> = [];
|
||||||
|
|
||||||
constructor(name: string) {
|
constructor(name: string,id?:string) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
this.id=id||'';
|
||||||
}
|
}
|
||||||
|
|
||||||
addProperty(property: Property) {
|
addProperty(property: Property) {
|
||||||
|
@ -147,7 +147,6 @@ export default class Index extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private syncSettings() {
|
private syncSettings() {
|
||||||
if (settings.data) {
|
if (settings.data) {
|
||||||
const {refreshType, refreshTime} = settings.data;
|
const {refreshType, refreshTime} = settings.data;
|
||||||
@ -204,6 +203,9 @@ export default class Index extends Vue {
|
|||||||
this.requestList.push({id: data.id, cb});
|
this.requestList.push({id: data.id, cb});
|
||||||
this.sendMsgToContentScript(Msg.GetObjectItemData, data)
|
this.sendMsgToContentScript(Msg.GetObjectItemData, data)
|
||||||
});
|
});
|
||||||
|
Bus.$on(BusMsg.LogData, (data: string[]) => {
|
||||||
|
this.sendMsgToContentScript(Msg.LogData, data);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
filterNode(value: any, data: any) {
|
filterNode(value: any, data: any) {
|
||||||
|
@ -1,12 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="property-group">
|
<div class="property-group">
|
||||||
<div class="header" @click="onClickHeader">
|
<div class="header" @click="onClickHeader"
|
||||||
|
@mouseenter="showLogBtn=true"
|
||||||
|
@mouseleave="showLogBtn=false">
|
||||||
<div style="margin: 0 5px;">
|
<div style="margin: 0 5px;">
|
||||||
<i v-if="fold" class="el-icon-caret-right"></i>
|
<i v-if="fold" class="el-icon-caret-right"></i>
|
||||||
<i v-if="!fold" class="el-icon-caret-bottom"></i>
|
<i v-if="!fold" class="el-icon-caret-bottom"></i>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="flex:1;">
|
||||||
{{ group.name }}
|
{{ group.name }}
|
||||||
</div>
|
</div>
|
||||||
|
<el-button style="margin-right: 10px;"
|
||||||
|
v-show="showLogBtn"
|
||||||
|
type="success" icon="el-icon-chat-dot-round" @click.stop="onLog">
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
<div class="content" v-show="!fold">
|
<div class="content" v-show="!fold">
|
||||||
<ui-prop v-for="(item, index) in group.data" :key="index"
|
<ui-prop v-for="(item, index) in group.data" :key="index"
|
||||||
:name="item.name" :value="item.value">
|
:name="item.name" :value="item.value">
|
||||||
@ -29,6 +37,7 @@ import Bus, {BusMsg} from "@/devtools/bus";
|
|||||||
})
|
})
|
||||||
export default class PropertyGroup extends Vue {
|
export default class PropertyGroup extends Vue {
|
||||||
private fold = false;
|
private fold = false;
|
||||||
|
private showLogBtn = false;
|
||||||
@Prop({
|
@Prop({
|
||||||
default: () => {
|
default: () => {
|
||||||
return new Group("test")
|
return new Group("test")
|
||||||
@ -45,6 +54,10 @@ export default class PropertyGroup extends Vue {
|
|||||||
mounted() {
|
mounted() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onLog() {
|
||||||
|
Bus.$emit(BusMsg.LogData, [this.group.id]);
|
||||||
|
}
|
||||||
|
|
||||||
onClickHeader() {
|
onClickHeader() {
|
||||||
this.fold = !this.fold;
|
this.fold = !this.fold;
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,12 @@ class CCInspector {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Msg.LogData: {
|
||||||
|
const data: string[] = pluginEvent.data;
|
||||||
|
const value = getValue(this.inspectorGameMemoryStorage, data);
|
||||||
|
console.log(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Msg.GetObjectItemData: {
|
case Msg.GetObjectItemData: {
|
||||||
const data: ObjectData = pluginEvent.data;
|
const data: ObjectData = pluginEvent.data;
|
||||||
let val = getValue(this.inspectorGameMemoryStorage, data.path);
|
let val = getValue(this.inspectorGameMemoryStorage, data.path);
|
||||||
@ -526,7 +532,7 @@ class CCInspector {
|
|||||||
|
|
||||||
_getGroupData(node: any) {
|
_getGroupData(node: any) {
|
||||||
const name = this.getCompName(node);
|
const name = this.getCompName(node);
|
||||||
let nodeGroup = new Group(name);
|
let nodeGroup = new Group(name, node.uuid);
|
||||||
let keys = this._getNodeKeys(node);
|
let keys = this._getNodeKeys(node);
|
||||||
for (let i = 0; i < keys.length;) {
|
for (let i = 0; i < keys.length;) {
|
||||||
let key = keys[i];
|
let key = keys[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user