diff --git a/cc-inspector/src/ga/type.ts b/cc-inspector/src/ga/type.ts index 12c3946..6935a2f 100644 --- a/cc-inspector/src/ga/type.ts +++ b/cc-inspector/src/ga/type.ts @@ -82,6 +82,8 @@ export enum GA_EventName { GamePlayer = "game_player", GamePause = "game_pause", GameStep = "game_step", + PickTop = "pick_top", + InspectorClear = "inspector_clear", GameInspectorFilter = "game_inspector_filter", /** * 用户点击store广告链接 diff --git a/cc-inspector/src/scripts/inject-view/app.vue b/cc-inspector/src/scripts/inject-view/app.vue index f3fb1f4..2be1367 100644 --- a/cc-inspector/src/scripts/inject-view/app.vue +++ b/cc-inspector/src/scripts/inject-view/app.vue @@ -138,12 +138,21 @@ export default defineComponent({ }; }); ccui.menu.showMenuByMouseEvent(event, [ + { + name: "Clear", + callback: (menu: IUiMenuItem) => { + const event = new CustomEvent(DocumentEvent.InspectorClear); + document.dispatchEvent(event); + ga(GA_EventName.InspectorClear); + }, + }, { name: "Pick Top", selected: config.value.pickTop, callback: (menu: IUiMenuItem) => { config.value.pickTop = !config.value.pickTop; appStore().save(); + ga(GA_EventName.PickTop); }, }, { diff --git a/cc-inspector/src/scripts/inject/hint/index.ts b/cc-inspector/src/scripts/inject/hint/index.ts index 440b700..c287d52 100644 --- a/cc-inspector/src/scripts/inject/hint/index.ts +++ b/cc-inspector/src/scripts/inject/hint/index.ts @@ -28,6 +28,10 @@ export class Hint { private inspector: Inspector = null; constructor(inspector: Inspector) { this.inspector = inspector; + document.addEventListener(DocumentEvent.InspectorClear, () => { + this.cleanHover(); + this.cleanSelected(); + }); document.addEventListener(DocumentEvent.GameInspectorBegan, (event: CustomEvent) => { const el = this.getTargetElement(); if (!el) {