@yuebai008/cli
Version:
Command line interface for rapid qg-minigame development
1 lines • 1.31 kB
JavaScript
import*as Host from"../../core/host/host.js";import*as i18n from"../../core/i18n/i18n.js";import*as SDK from"../../core/sdk/sdk.js";import*as UI from"../../ui/legacy/legacy.js";import{ApplicationPanelTreeElement}from"./ApplicationPanelTreeElement.js";import{InterestGroupStorageView}from"./InterestGroupStorageView.js";const UIStrings={interestGroups:"Interest groups"},str_=i18n.i18n.registerUIStrings("panels/application/InterestGroupTreeElement.ts",UIStrings);export const i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_);export class InterestGroupTreeElement extends ApplicationPanelTreeElement{view;constructor(e){super(e,i18nString(UIStrings.interestGroups),!1);const t=UI.Icon.Icon.create("database","resource-tree-item");this.setLeadingIcons([t]),this.view=new InterestGroupStorageView(this)}get itemURL(){return"interest-groups://"}async getInterestGroupDetails(e,t){const r=SDK.TargetManager.TargetManager.instance().primaryPageTarget();if(!r)return null;return(await r.storageAgent().invoke_getInterestGroupDetails({ownerOrigin:e,name:t})).details}onselect(e){return super.onselect(e),this.showView(this.view),Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.interest_groups]),!1}addEvent(e){this.view.addEvent(e)}clearEvents(){this.view.clearEvents()}}