update
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { _decorator, Component, EditBox, Node,Label } from "cc";
|
||||
import { _decorator, Component, EditBox, Node,Label,Sprite,UITransform } from "cc";
|
||||
import { DemoManager } from "./DemoManager";
|
||||
import { ChatGPTService } from "./ChatGPTService";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
@@ -8,7 +8,9 @@ import {ChatContentsLayout} from "db://assets/Scripts/test/ChatContentsLayout";
|
||||
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import GameRootUI from "db://assets/Scripts/Main/Common/GameRootUI";
|
||||
import {ImagePopup} from "db://assets/Scripts/test/ImagePopup";
|
||||
import {characters} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import {girlDetailInfo, GirlsData} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import {VideoRoleType} from "db://assets/Scripts/Main/Common/GlobalValue";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("ChatPanel")
|
||||
@@ -21,6 +23,9 @@ export class ChatPanel extends li_BaseView {
|
||||
@property(Label)
|
||||
girlName: Label = null;
|
||||
|
||||
@property(Sprite)
|
||||
girlImg: Sprite = null;
|
||||
|
||||
@property(ChatContentsLayout)
|
||||
layout: ChatContentsLayout = null;
|
||||
|
||||
@@ -28,10 +33,19 @@ export class ChatPanel extends li_BaseView {
|
||||
popUpImage: ImagePopup = null;
|
||||
|
||||
id:number
|
||||
private _nodeTab: any = {};
|
||||
|
||||
openUIDataCT(data)
|
||||
{
|
||||
this.id = data;
|
||||
}
|
||||
|
||||
onLoadCT()
|
||||
{
|
||||
Utils.parseNode(this.node,this._nodeTab);
|
||||
|
||||
this.register();
|
||||
this.refresh(this.id);
|
||||
}
|
||||
register()
|
||||
{
|
||||
@@ -39,8 +53,17 @@ export class ChatPanel extends li_BaseView {
|
||||
}
|
||||
refresh(id:number) {
|
||||
this.id = id;
|
||||
const data = characters[id-1];
|
||||
this.girlName.string = data.name;
|
||||
const data = girlDetailInfo.filter(value=>value.baseInfo.id == id)[0];
|
||||
if(!data) return;
|
||||
this.girlName.string = data.baseInfo.name;
|
||||
ResManager.I.changeBundleSpriteFrame(this.girlImg,data.baseInfo.pic.url,"Chat18x",()=>{
|
||||
let sizeTran = this.girlImg.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize,this.girlImg.node,2);
|
||||
});
|
||||
let uiTransform:UITransform = this._nodeTab.BgFrame.getComponent(UITransform);
|
||||
|
||||
Utils.sendInnerMsg(InnerMsgCode.SimplePlayVide,{path:data.pics[0].url,size:uiTransform.contentSize} )
|
||||
|
||||
}
|
||||
onDialogUpdate()
|
||||
{
|
||||
@@ -79,7 +102,7 @@ export class ChatPanel extends li_BaseView {
|
||||
console.log("ret:" + rep);
|
||||
|
||||
//测试
|
||||
this.popUpImage.refresh("Image/1/blur_naked_1");
|
||||
//this.popUpImage.refresh("Image/1/blur_naked_1");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user