聊天记录展示
This commit is contained in:
@@ -129,6 +129,12 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
|
||||
this,
|
||||
this.onChatCountChange
|
||||
);
|
||||
|
||||
Utils.addInnerEL(
|
||||
InnerMsgCode.Chat_DialogRefresh,
|
||||
this,
|
||||
this.onDialogRefresh
|
||||
);
|
||||
}
|
||||
|
||||
onDestroy(): void {
|
||||
@@ -147,6 +153,11 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
|
||||
this,
|
||||
this.onEmotionInitialized
|
||||
);
|
||||
Utils.removeInnerEL(
|
||||
InnerMsgCode.Chat_DialogRefresh,
|
||||
this,
|
||||
this.onDialogRefresh
|
||||
);
|
||||
|
||||
// 停止视频播放,释放资源
|
||||
if (this.videoLayer) {
|
||||
@@ -402,6 +413,22 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话刷新事件处理(用于加载历史记录)
|
||||
*/
|
||||
private onDialogRefresh = (): void => {
|
||||
if (!this.layout) return;
|
||||
|
||||
// 获取所有对话记录
|
||||
const dialogManager = DialogManager.getInstance();
|
||||
const allDialogs = dialogManager["dialogData"].getAllDialogs();
|
||||
|
||||
logger.log(`ChatPanel: Loading ${allDialogs.length} history dialogs to UI`);
|
||||
|
||||
// 加载所有对话到UI
|
||||
this.layout.loadAllDialogs(allDialogs);
|
||||
};
|
||||
protected onEnable(): void {
|
||||
if (!this.manager) this.manager = DialogManager.getInstance();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user