This commit is contained in:
2025-09-10 15:48:27 +08:00
parent 6b3176ed39
commit 146c9a75a2
1564 changed files with 101785 additions and 257 deletions
+18 -19
View File
@@ -41,8 +41,8 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
@property(Label)
girlName: Label = null;
@property(Sprite)
girlImg: Sprite = null;
// @property(Sprite)
// girlImg: Sprite = null;
@property(VideoPlayer)
girlVideo: VideoPlayer = null;
@@ -188,19 +188,19 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
this.nameKey = data.nameKey;
this.girlName.string = LanguageUtils.getText(data.nameKey);
ResManager.I.changeBundleSpriteFrame(
this.girlImg,
data.avatarPath,
"Chat18x",
() => {
let sizeTran = this.girlImg.node.parent.getComponent(UITransform);
Utils.adjustBgPixelRatioToSize(
sizeTran.contentSize,
this.girlImg.node,
2
);
}
);
// ResManager.I.changeBundleSpriteFrame(
// this.girlImg,
// data.avatarPath,
// "Girls",
// () => {
// let sizeTran = this.girlImg.node.parent.getComponent(UITransform);
// Utils.adjustBgPixelRatioToSize(
// sizeTran.contentSize,
// this.girlImg.node,
// 2
// );
// }
// );
// 通过ChatController获取商业视频数据
const chatModel = this.chatController.getChatModel();
@@ -238,7 +238,7 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
ResManager.I.changeBundleVideo(
this.girlVideo,
initialVideo.path,
"Chat18x"
"Girls"
);
// Also immediately try to adjust scale (in case already loaded)
this.adjustVideoScale();
@@ -335,7 +335,7 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
ResManager.I.changeBundleVideo(
this.girlVideo,
matchingVideo.path,
"Chat18x"
"Girls"
);
// Update current emotion state
@@ -401,7 +401,6 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
}
protected onEnable(): void {
if (!this.manager) this.manager = DialogManager.getInstance();
}
public async OnClickSend() {
@@ -451,7 +450,7 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
console.error("Chat error:", error);
// 出错时加载动画会被自动移除,可以在这里显示错误提示给用户
}
onChatLimitReached(): void {
this.payToTalkPanel.show();
}