mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-06-06 16:24:01 +00:00
增加节点hover,click的功能开关
This commit is contained in:
parent
eff88ea20c
commit
de1d19a51b
@ -189,8 +189,10 @@ export default defineComponent({
|
|||||||
function updateSelect(uuid: string | null) {
|
function updateSelect(uuid: string | null) {
|
||||||
selectedUUID = uuid;
|
selectedUUID = uuid;
|
||||||
Bus.emit(BusMsg.SelectNode, uuid);
|
Bus.emit(BusMsg.SelectNode, uuid);
|
||||||
|
if (config.value.clickInspect) {
|
||||||
bridge.send(Msg.SelectNode, uuid);
|
bridge.send(Msg.SelectNode, uuid);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
const rotateType = ref<RotateType>(RotateType.None);
|
const rotateType = ref<RotateType>(RotateType.None);
|
||||||
if (config.value.refreshHirarchy) {
|
if (config.value.refreshHirarchy) {
|
||||||
rotateType.value = RotateType.Loop;
|
rotateType.value = RotateType.Loop;
|
||||||
@ -211,6 +213,9 @@ export default defineComponent({
|
|||||||
updateSelect(null);
|
updateSelect(null);
|
||||||
},
|
},
|
||||||
handleNodeEnter(data: TreeData | null) {
|
handleNodeEnter(data: TreeData | null) {
|
||||||
|
if (!config.value.hoverInspect) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (data) {
|
if (data) {
|
||||||
bridge.send(Msg.HoverNode, data.id);
|
bridge.send(Msg.HoverNode, data.id);
|
||||||
}
|
}
|
||||||
@ -262,56 +267,79 @@ export default defineComponent({
|
|||||||
menus.push({
|
menus.push({
|
||||||
name: "update hierarchy",
|
name: "update hierarchy",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
callback: () => {
|
callback: (item) => {
|
||||||
ga.fireEventWithParam(GA_EventName.MouseMenu, "update hierarchy");
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
updateTree();
|
updateTree();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
menus.push({ type: ccui.menu.MenuType.Separator });
|
||||||
menus.push({
|
menus.push({
|
||||||
name: "fresh auto",
|
name: "fresh auto",
|
||||||
callback: () => {
|
callback: (item) => {
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
timer.create(true);
|
timer.create(true);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
menus.push({
|
menus.push({
|
||||||
name: "fresh manual",
|
name: "fresh manual",
|
||||||
callback: () => {
|
callback: (item) => {
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
timer.clean();
|
timer.clean();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
menus.push({ type: ccui.menu.MenuType.Separator });
|
||||||
menus.push({
|
menus.push({
|
||||||
name: "fps show",
|
name: "fps show",
|
||||||
callback: () => {
|
callback: (item) => {
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
bridge.send(Msg.VisibleFPS, true);
|
bridge.send(Msg.VisibleFPS, true);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
menus.push({
|
menus.push({
|
||||||
name: "fps hide",
|
name: "fps hide",
|
||||||
callback: () => {
|
callback: (item) => {
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
bridge.send(Msg.VisibleFPS, false);
|
bridge.send(Msg.VisibleFPS, false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
menus.push({ type: ccui.menu.MenuType.Separator });
|
||||||
menus.push({
|
menus.push({
|
||||||
name: "game info",
|
name: "game info",
|
||||||
callback() {
|
callback(item) {
|
||||||
ga.fireEventWithParam(GA_EventName.MouseMenu, "game info");
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
ccui.dialog.showDialog({
|
ccui.dialog.showDialog({
|
||||||
comp: GameInfo,
|
comp: GameInfo,
|
||||||
title: "Game Info",
|
title: "Game Info",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (data) {
|
menus.push({ type: ccui.menu.MenuType.Separator });
|
||||||
menus.push({
|
menus.push({
|
||||||
name: "",
|
name: "hover inspect",
|
||||||
type: ccui.menu.MenuType.Separator,
|
selected: config.value.hoverInspect,
|
||||||
callback() {},
|
callback: (item) => {
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
|
config.value.hoverInspect = !config.value.hoverInspect;
|
||||||
|
appStore().save();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
menus.push({
|
||||||
|
name: "click inspect",
|
||||||
|
selected: config.value.clickInspect,
|
||||||
|
callback: (item) => {
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
|
config.value.clickInspect = !config.value.clickInspect;
|
||||||
|
appStore().save();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (data) {
|
||||||
|
menus.push({ type: ccui.menu.MenuType.Separator });
|
||||||
menus.push({
|
menus.push({
|
||||||
name: "copy name",
|
name: "copy name",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
callback() {
|
callback(item) {
|
||||||
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
console.log(data.text);
|
console.log(data.text);
|
||||||
|
|
||||||
if (!data.text) {
|
if (!data.text) {
|
||||||
@ -333,16 +361,16 @@ export default defineComponent({
|
|||||||
name: "visible",
|
name: "visible",
|
||||||
shortKey: "space",
|
shortKey: "space",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
callback: () => {
|
callback: (item) => {
|
||||||
ga.fireEventWithParam(GA_EventName.MouseMenu, "visible");
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
onQuickVisible();
|
onQuickVisible();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
menus.push({
|
menus.push({
|
||||||
name: "destroy",
|
name: "destroy",
|
||||||
enabled: true,
|
enabled: true,
|
||||||
callback: () => {
|
callback: (item) => {
|
||||||
ga.fireEventWithParam(GA_EventName.MouseMenu, "destroy");
|
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
|
||||||
bridge.send(Msg.RequestDestroy, data.id);
|
bridge.send(Msg.RequestDestroy, data.id);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user