UNPKG

@yuebai008/cli

Version:

Command line interface for rapid qg-minigame development

1 lines 1.13 kB
import*as Common from"../../core/common/common.js";import*as i18n from"../../core/i18n/i18n.js";import*as UI from"../../ui/legacy/legacy.js";import{ApplicationPanelTreeElement}from"./ApplicationPanelTreeElement.js";import{SharedStorageEventsView}from"./SharedStorageEventsView.js";const UIStrings={sharedStorage:"Shared storage"},str_=i18n.i18n.registerUIStrings("panels/application/SharedStorageListTreeElement.ts",UIStrings),i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_);export class SharedStorageListTreeElement extends ApplicationPanelTreeElement{#e;view;constructor(e,t=!1){super(e,i18nString(UIStrings.sharedStorage),!1),this.#e=Common.Settings.Settings.instance().createSetting("resourcesSharedStorageExpanded",t);const n=UI.Icon.Icon.create("database","resource-tree-item");this.setLeadingIcons([n]),this.view=new SharedStorageEventsView}get itemURL(){return"shared-storage://"}onselect(e){return super.onselect(e),this.resourcesPanel.showView(this.view),!1}onattach(){super.onattach(),this.#e.get()&&this.expand()}onexpand(){this.#e.set(!0)}oncollapse(){this.#e.set(!1)}addEvent(e){this.view.addEvent(e)}}