Files
18xchat/assets/Scripts/test/DemoManager.ts
T

55 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-07-22 16:43:10 +08:00
import { find } from "cc";
2025-07-21 22:14:06 +08:00
import { ChatContentsLayout } from "./ChatContentsLayout";
2025-07-22 16:43:10 +08:00
import { DemoData } from "./DemoData";
2025-07-25 15:20:02 +08:00
import {GirlDetailPanel} from "db://assets/Scripts/test/GirlDetailPanel";
import {ChatPanel} from "db://assets/Scripts/test/ChatPanel";
import {GirlListPanel} from "db://assets/Scripts/test/girlListPanel/GirlListPanel";
2025-07-25 18:27:30 +08:00
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
import Utils from "db://assets/Scripts/Main/Common/Utils";
import {InnerMsgCode} from "db://assets/Scripts/Main/Config/InnerMsgCode";
2025-07-22 16:43:10 +08:00
export class DemoManager {
private static _instance: DemoManager;
public static getInstance() {
if (!this._instance) {
this._instance = new DemoManager();
}
return this._instance;
}
private constructor() {
this.demoData = new DemoData();
}
2025-07-21 22:14:06 +08:00
demoData: DemoData;
2025-07-25 18:27:30 +08:00
hideMainView()
{
}
2025-07-21 22:14:06 +08:00
2025-07-30 21:52:26 +08:00
EnterGirlList(id: number) {
ViewManager.I.openBundlesView("GirlListPanel",id);
}
2025-07-22 16:43:10 +08:00
EnterChat(id: number) {
2025-07-25 18:27:30 +08:00
ViewManager.I.openBundlesView("ChatPanel",id);
2025-07-22 16:43:10 +08:00
}
EnterDetail(id: number) {
2025-07-25 18:27:30 +08:00
ViewManager.I.openBundlesView("GirlDetailPanel",id);
2025-07-21 22:14:06 +08:00
}
2025-07-25 18:27:30 +08:00
public updateDialog(isPlayer: boolean, str: string,fromPlayer:boolean = false) {
if(fromPlayer){this.demoData.cleanDialog()}
2025-07-21 22:14:06 +08:00
this.demoData.pushDialog(isPlayer, str);
console.log("update dialog");
2025-07-25 18:27:30 +08:00
Utils.sendInnerMsg(InnerMsgCode.Chat_DialogRefresh);
2025-07-21 22:14:06 +08:00
}
public getDialogs() {
return this.demoData.GetDialogs();
}
}