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
@@ -19,7 +19,7 @@ import { SimpleToggle } from "../components/SimpleToggle";
import { DataManager, DataId } from "../../data/DataManager";
import { GirlData } from "../../data/GirlData";
import { GirlService } from "db://assets/Scripts/chat18x/network/services/GirlService";
import proto from 'db://assets/Scripts/proto/proto.pb.js';
import proto from "db://assets/Scripts/proto/proto.pb.js";
const { ccclass, property } = _decorator;
@@ -76,6 +76,7 @@ export class GirlDetailPanel extends li_BaseView {
desc += tags[i];
}
this.tags.string = desc;
this.desc.string = LanguageUtils.getText(this.descKey);
});
this.imgToggle.callback = this.bindImgToggle.bind(this);
@@ -134,6 +135,7 @@ export class GirlDetailPanel extends li_BaseView {
}
nameKey: string;
tagKey: string;
descKey: string;
category: number;
async refresh(index: number) {
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
@@ -148,14 +150,15 @@ export class GirlDetailPanel extends li_BaseView {
girlData.setGirlDetailData(this.category.toString(), res.data);
// 根据数据,刷新界面
this.nameKey = girlData.getGrilName(this.category.toString(), this.id);
this.girlName.string = LanguageUtils.getText(this.nameKey);
this.desc.string = girlData.getGrilDesc(this.category.toString(), this.id);
this.girlName.string = LanguageUtils.getText(this.nameKey);
this.descKey = girlData.getGrilDesc(this.category.toString(), this.id);
this.desc.string = LanguageUtils.getText(this.descKey);
let desc = "";
this.tagKey = girlData.getGrilTagKey(this.category.toString(), this.id);
const tags = LanguageUtils.getText(this.tagKey).split("|");
for (let i = 0; i < tags.length; i++) {
if (i != 0) desc += "|";
if (i != 0) desc += "\n";
desc += tags[i];
}
this.tags.string = desc;
@@ -165,38 +168,61 @@ export class GirlDetailPanel extends li_BaseView {
let age = girlData.getGrilAge(this.category.toString(), this.id);
this.descAge.string =
LanguageUtils.getText("girldetailpanel.age") + age.toString();
const firstPath = girlData.getFirstGrilVideoPath(this.category.toString(), this.id);
ResManager.I.changeBundleVideo(
this.avatarVideo,
firstPath,
"Chat18x"
);
let resIds = girlData.getAllDisplayGrilPhotoId(this.category.toString(), this.id);
const firstPath = girlData.getFirstGrilVideoPath(
this.category.toString(),
this.id
);
ResManager.I.changeBundleVideo(this.avatarVideo, firstPath, "Girls");
let resIds = girlData.getAllDisplayGrilPhotoId(
this.category.toString(),
this.id
);
// 也立即尝试调整(以防已经加载完成)
this.adjustVideoScale();
this.refreshImgs(proto.cs.EnmResType.ERT_Image, this.category, this.id, resIds);
}
this.refreshImgs(
proto.cs.EnmResType.ERT_Image,
this.category,
this.id,
resIds
);
}
}
bindImgToggle() {
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
let resIds = girlData.getAllDisplayGrilPhotoId(this.category.toString(), this.id);
this.refreshImgs(proto.cs.EnmResType.ERT_Image, this.category, this.id, resIds);
let resIds = girlData.getAllDisplayGrilPhotoId(
this.category.toString(),
this.id
);
this.refreshImgs(
proto.cs.EnmResType.ERT_Image,
this.category,
this.id,
resIds
);
}
bindVideoToggle() {
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
let resIds = girlData.getAllDisplayGrilVideoId(this.category.toString(), this.id);
this.refreshImgs(proto.cs.EnmResType.ERT_Video, this.category, this.id, resIds);
let resIds = girlData.getAllDisplayGrilVideoId(
this.category.toString(),
this.id
);
this.refreshImgs(
proto.cs.EnmResType.ERT_Video,
this.category,
this.id,
resIds
);
}
refreshImgs(
type: proto.cs.EnmResType,
category: number,
id: number,
resIds: number[]
resIds: number[]
) {
for (let i = this.imgsLayout.children.length - 1; i >= 0; i--) {
this.imgsLayout.children[i].destroy();