mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -5,7 +5,7 @@ import { instantiate } from 'cc';
|
||||
import { Label } from 'cc';
|
||||
import { EditBox } from 'cc';
|
||||
import { GUI } from '../../UIConfig';
|
||||
import { GUIChatMessage } from '../../../consts/GActionType';
|
||||
import { GUIChatMessage, GUIChatMessageDTO } from '../../../consts/GActionType';
|
||||
import { Widget } from 'cc';
|
||||
import JScrollExceedHide from '../../../../../extensions/ngame/assets/ngame/util/components/JScrollExceedHide';
|
||||
import { JNGLayerBase } from '../../../components/JNComponent';
|
||||
@@ -46,9 +46,7 @@ export class MainChatView extends JNGLayerBase {
|
||||
let messages = ChatData.getIns().datas;
|
||||
|
||||
messages.forEach(message => {
|
||||
let node = instantiate(this.chatPrefab);
|
||||
node.getComponent(Label).string = message;
|
||||
this.content.addChild(node);
|
||||
this.onMessage(message);
|
||||
})
|
||||
|
||||
}
|
||||
@@ -68,11 +66,12 @@ export class MainChatView extends JNGLayerBase {
|
||||
}
|
||||
|
||||
//接受到消息
|
||||
onMessage(info:GUIChatMessage){
|
||||
onMessage(info:GUIChatMessageDTO){
|
||||
|
||||
//插入数据
|
||||
let node = instantiate(this.chatPrefab);
|
||||
node.getComponent(Label).string = info.message;
|
||||
|
||||
node.getComponent(Label).string = `${info.playerName} : ${info.message.message}`;
|
||||
this.content.addChild(node);
|
||||
this.scheduleOnce(() => {
|
||||
this.getComponentInChildren(JScrollExceedHide).onUpdate();
|
||||
|
Reference in New Issue
Block a user