feat: client 上关于 mainTextboxManager 的默认主对象实例

This commit is contained in:
AncTe committed 2026-11-25 19:59:53 +08:00
1 parent 6773069c24
commit 8fe1c84693
4 files changed
+32 -11

No files matched your search

@@ -9,7 +9,9 @@ export * from './page';
export * from './scroll';
export * from './slider';
export * from './textbox';
export * from './textboxManager';
export * from './textboxTyper';
export * from './thumbnail';
export * from './tip';
export * from './types';
export * from './winskin';
@@ -1,5 +1,8 @@
import { IUIController } from '@motajs/system';
import { IGameUIPropsBase } from '../types';
import {
IUIController,
IUIDefaultPropsBase,
UIController
} from '@motajs/system';
import { ITextboxInfo, ITextboxManager } from './types';
import { TextboxProps, TextboxUI } from './textbox';
import { TextContentTyper } from './textboxTyper';
@@ -9,11 +12,15 @@ export class TextboxManager implements ITextboxManager {
/** 文本框映射 */
private readonly textboxMap: Map<number, ITextboxInfo> = new Map();
constructor(
readonly ui: IUIController<IGameUIPropsBase>,
readonly materials: ITextureManager
) {
ui.showAll(false);
readonly ui: IUIController<IUIDefaultPropsBase>;
constructor(readonly materials: ITextureManager) {
this.ui = new UIController();
this.ui.setPropsBaseCreator((instance, controller) => ({
instance,
controller
}));
this.ui.showAll(false);
}
createTextbox(code: number, props?: TextboxProps): ITextboxInfo {
@@ -1,5 +1,8 @@
import { IUIController, IUIInstance } from '@motajs/system';
import { IGameUIPropsBase } from '../types';
import {
IUIController,
IUIDefaultPropsBase,
IUIInstance
} from '@motajs/system';
import { TextboxProps } from './textbox';
import { TextContentTyper } from './textboxTyper';
import { ITextureManager } from '../material';
@@ -13,7 +16,7 @@ export interface ITextboxInfo {
export interface ITextboxManager {
/** 使用的 UI 控制器 */
readonly ui: IUIController<IGameUIPropsBase>;
readonly ui: IUIController<IUIDefaultPropsBase>;
/** 使用的贴图素材管理器 */
readonly materials: ITextureManager;
+10 -1
View File
@@ -29,7 +29,9 @@ import {
ClientHotkey,
IClientHotkey,
MapRenderItem,
IMapRendererInitConfig
IMapRendererInitConfig,
TextboxManager,
ITextboxManager
} from '@user/client-base';
import { IMapRenderer, MapRenderer } from '@user/client-base';
import {
@@ -59,6 +61,7 @@ export class ClientCore extends CoreState implements IClientCore {
readonly mainUIController: IUIController<IGameUIPropsBase>;
readonly hotkey: IClientHotkey;
readonly vueApp: App<IRenderItem>;
readonly mainTextboxManager: ITextboxManager;
// Layer 5 渲染顶层 - 目前没东西
@@ -120,6 +123,12 @@ export class ClientCore extends CoreState implements IClientCore {
this.vueApp.mount(this.renderer);
this.vueApp.provide('@defulat/materials', this.materials);
this.vueApp.provide(
'@default/expandMapRenderer',
this.expandMapRenderer
);
this.mainTextboxManager = new TextboxManager(this.materials);
this.loader.addCoreConfig('client', config.clientURL);