update
This commit is contained in:
@@ -26,8 +26,8 @@ export namespace Config18x
|
||||
|
||||
export enum Category
|
||||
{
|
||||
shunv = 1,
|
||||
lama = 2
|
||||
shunv = 1001,
|
||||
lama = 1002
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,5 +24,6 @@ export enum InnerMsgCode {
|
||||
BgVideo_End, //背景视频播放完毕
|
||||
|
||||
|
||||
Chat_DialogRefresh
|
||||
Chat_DialogRefresh,
|
||||
SimplePlayVide,
|
||||
}
|
||||
@@ -10,82 +10,36 @@ export interface Character {
|
||||
description: string;
|
||||
}
|
||||
|
||||
|
||||
export const characters: Character[] = [
|
||||
{
|
||||
id: 1,
|
||||
name: "Anaya Kapoor",
|
||||
age: 29,
|
||||
description: "🌸 Hi, I'm Anaya Kapoor, a 24-year-old dreamer from Mumbai. I blend tradition with trend — from vibrant saris to sleek streetwear, fashion is how I express my story.\n" +
|
||||
"\n" +
|
||||
"As a lifestyle influencer with over 1 million followers, I celebrate beauty in all its forms — skin, spirit, and self-love.\n" +
|
||||
"\n" +
|
||||
"I grew up watching Bollywood classics and dancing to every beat — now, I create my own rhythms with my camera, my words, and my smile.\n" +
|
||||
"\n" +
|
||||
"Coffee lover ☕ | Dancer 💃 | Proud Desi ✨\n" +
|
||||
"\n" +
|
||||
"Be your own kind of beautiful."
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Anaya Kapoor",
|
||||
age: 28,
|
||||
description: "🌸 Hi, I'm Anaya Kapoor, a 24-year-old dreamer from Mumbai. I blend tradition with trend — from vibrant saris to sleek streetwear, fashion is how I express my story.\n" +
|
||||
"\n" +
|
||||
"As a lifestyle influencer with over 1 million followers, I celebrate beauty in all its forms — skin, spirit, and self-love.\n" +
|
||||
"\n" +
|
||||
"I grew up watching Bollywood classics and dancing to every beat — now, I create my own rhythms with my camera, my words, and my smile.\n" +
|
||||
"\n" +
|
||||
"Coffee lover ☕ | Dancer 💃 | Proud Desi ✨\n" +
|
||||
"\n" +
|
||||
"Be your own kind of beautiful."
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Anaya Kapoor",
|
||||
age: 25,
|
||||
description: "🌸 Hi, I'm Anaya Kapoor, a 24-year-old dreamer from Mumbai. I blend tradition with trend — from vibrant saris to sleek streetwear, fashion is how I express my story.\n" +
|
||||
"\n" +
|
||||
"As a lifestyle influencer with over 1 million followers, I celebrate beauty in all its forms — skin, spirit, and self-love.\n" +
|
||||
"\n" +
|
||||
"I grew up watching Bollywood classics and dancing to every beat — now, I create my own rhythms with my camera, my words, and my smile.\n" +
|
||||
"\n" +
|
||||
"Coffee lover ☕ | Dancer 💃 | Proud Desi ✨\n" +
|
||||
"\n" +
|
||||
"Be your own kind of beautiful."
|
||||
},
|
||||
]
|
||||
|
||||
export const GirlsData: GirlInfo[] =
|
||||
[
|
||||
{
|
||||
id: 10001,
|
||||
name: "AAA",
|
||||
name: "Anaya Kapoor",
|
||||
age: 29,
|
||||
category: Category.shunv,
|
||||
tag: ["AAA", "VBB"],
|
||||
tag: ["Hot", "Horny"],
|
||||
priceType: Config18x.PriceType.Free,
|
||||
pic: {picType: PicType.LocalImage, url: "asd", imageState: ImageState.Release},
|
||||
pic: {picType: PicType.LocalImage, url: "Image/Girls/10001/Avatar/10001_avatar", imageState: ImageState.Release},
|
||||
starCount: 5
|
||||
},
|
||||
{
|
||||
id: 10002,
|
||||
name: "ABB",
|
||||
age: 30,
|
||||
name: "Meher Joshi",
|
||||
age: 26,
|
||||
category: Category.shunv,
|
||||
tag: ["AAA", "VBB"],
|
||||
tag: ["Earth-tone linens", "handcrafted jewelry"],
|
||||
priceType: Config18x.PriceType.Try,
|
||||
pic: {picType: PicType.LocalImage, url: "asd", imageState: ImageState.Release},
|
||||
pic: {picType: PicType.LocalImage, url: "Image/Girls/10002/Avatar/10002_avatar", imageState: ImageState.Release},
|
||||
starCount: 4
|
||||
},
|
||||
{
|
||||
id: 10003,
|
||||
name: "CCB",
|
||||
age: 24,
|
||||
name: "Sana Reddy",
|
||||
age: 29,
|
||||
category: Category.shunv,
|
||||
tag: ["AAA", "VBB"],
|
||||
tag: [" Singer-Songwriter", "Dancer"],
|
||||
priceType: Config18x.PriceType.Coin,
|
||||
pic: {picType: PicType.LocalImage, url: "asd", imageState: ImageState.Release},
|
||||
pic: {picType: PicType.LocalImage, url: "Image/Girls/10003/Avatar/10003_avatar", imageState: ImageState.Release},
|
||||
starCount: 3
|
||||
}
|
||||
]
|
||||
@@ -93,104 +47,97 @@ export const GirlsData: GirlInfo[] =
|
||||
export const girlDetailInfo:GirlDetailInfo[] = [
|
||||
{
|
||||
baseInfo:GirlsData[0],
|
||||
detailDesc:" \"🌸 Hi, I'm Anaya Kapoor, a 24-year-old dreamer from Mumbai. I blend tradition with trend — from vibrant saris to sleek streetwear, fashion is how I express my story.\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"As a lifestyle influencer with over 1 million followers, I celebrate beauty in all its forms — skin, spirit, and self-love.\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"I grew up watching Bollywood classics and dancing to every beat — now, I create my own rhythms with my camera, my words, and my smile.\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"Coffee lover ☕ | Dancer 💃 | Proud Desi ✨\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"Be your own kind of beautiful.\"",
|
||||
pics:[{picType:PicType.LocalImage,url:"",imageState:ImageState.Release}]
|
||||
detailDesc:"🌸 Hi, I'm Anaya Kapoor, a 24-year-old dreamer from Mumbai. I blend tradition with trend — from vibrant saris to sleek streetwear, fashion is how I express my story.\n" +
|
||||
"Coffee lover ☕ | Dancer 💃 | Proud Desi ✨\n" +
|
||||
"Be your own kind of beautiful.",
|
||||
pics:[
|
||||
{picType:PicType.LocalGif,url:"Image/Girls/10001/DescImg/10001_video",imageState:ImageState.Release},
|
||||
{picType:PicType.LocalImage,url:"Image/Girls/10001/DetailImg/10001_1",imageState:ImageState.Release},
|
||||
{picType:PicType.LocalImage,url:"Image/Girls/10001/DetailImg/10001_2",imageState:ImageState.Lock},
|
||||
{picType:PicType.LocalImage,url:"Image/Girls/10001/DetailImg/10001_3",imageState:ImageState.UnKnown}
|
||||
]
|
||||
},
|
||||
{
|
||||
baseInfo:GirlsData[1],
|
||||
detailDesc:" \"🌸 Hi2, I'm Anaya Kapoor, a 24-year-old dreamer from Mumbai. I blend tradition with trend — from vibrant saris to sleek streetwear, fashion is how I express my story.\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"As a lifestyle influencer with over 1 million followers, I celebrate beauty in all its forms — skin, spirit, and self-love.\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"I grew up watching Bollywood classics and dancing to every beat — now, I create my own rhythms with my camera, my words, and my smile.\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"Coffee lover ☕ | Dancer 💃 | Proud Desi ✨\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"Be your own kind of beautiful.\"",
|
||||
pics:[{picType:PicType.LocalImage,url:"",imageState:ImageState.Lock}]
|
||||
detailDesc:"I’m Meher Joshi, a 26-year-old architect passionate about green " +
|
||||
"design and timeless spaces. Whether I’m sketching under a banyan tree or supervising a modern villa in Goa," +
|
||||
" I find inspiration in nature and culture.",
|
||||
pics:[{picType:PicType.LocalGif,url:"Image/Girls/10002/DescImg/10002_chatBg",imageState:ImageState.Release},
|
||||
{picType:PicType.LocalImage,url:"Image/Girls/10002/DetailImg/10002_1",imageState:ImageState.Release},
|
||||
{picType:PicType.LocalImage,url:"Image/Girls/10002/DetailImg/10002_2",imageState:ImageState.Release},
|
||||
{picType:PicType.LocalImage,url:"Image/Girls/10002/DetailImg/10002_3",imageState:ImageState.Release}]
|
||||
},
|
||||
{
|
||||
baseInfo:GirlsData[2],
|
||||
detailDesc:" \"🌸 Hi3, I'm Anaya Kapoor, a 24-year-old dreamer from Mumbai. I blend tradition with trend — from vibrant saris to sleek streetwear, fashion is how I express my story.\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"As a lifestyle influencer with over 1 million followers, I celebrate beauty in all its forms — skin, spirit, and self-love.\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"I grew up watching Bollywood classics and dancing to every beat — now, I create my own rhythms with my camera, my words, and my smile.\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"Coffee lover ☕ | Dancer 💃 | Proud Desi ✨\\n\" +\n" +
|
||||
" \"\\n\" +\n" +
|
||||
" \"Be your own kind of beautiful.\"",
|
||||
pics:[{picType:PicType.LocalImage,url:"",imageState:ImageState.UnKnown}]
|
||||
detailDesc:"I'm Sana Reddy, India’s rising pop rebel. I sing in Telugu, " +
|
||||
"Hindi, and English — because music has no language, just energy. " +
|
||||
"Off stage, I’m chill and goofy. On stage? I’m a storm.",
|
||||
pics:[{picType:PicType.LocalGif,url:"Image/Girls/10003/DescImg/10003_chatBg",imageState:ImageState.Release},
|
||||
{picType:PicType.LocalImage,url:"Image/Girls/10003/DetailImg/10003_1",imageState:ImageState.Release},
|
||||
{picType:PicType.LocalImage,url:"Image/Girls/10003/DetailImg/10003_2",imageState:ImageState.Release},
|
||||
{picType:PicType.LocalImage,url:"Image/Girls/10003/DetailImg/10003_3",imageState:ImageState.Release}]
|
||||
},
|
||||
]
|
||||
|
||||
export const themes: Theme[] = [
|
||||
{
|
||||
themeId: 1,
|
||||
themeId: 1001,
|
||||
name: "熟女",
|
||||
isRelease: true,
|
||||
pic: {
|
||||
picType: PicType.LocalImage,
|
||||
imageState: ImageState.Release,
|
||||
url: ""
|
||||
url: "Image/Theme/1001"
|
||||
}
|
||||
},
|
||||
{
|
||||
themeId: 2,
|
||||
themeId: 1002,
|
||||
name: "18岁",
|
||||
isRelease: false,
|
||||
pic: {
|
||||
picType: PicType.LocalImage,
|
||||
imageState: ImageState.Lock,
|
||||
url: ""
|
||||
url: "Image/Theme/1002"
|
||||
}
|
||||
},
|
||||
{
|
||||
themeId: 3,
|
||||
themeId: 1003,
|
||||
name: "辣妈",
|
||||
isRelease: false,
|
||||
pic: {
|
||||
picType: PicType.LocalImage,
|
||||
imageState: ImageState.Lock,
|
||||
url: ""
|
||||
url: "Image/Theme/1003"
|
||||
}
|
||||
},
|
||||
{
|
||||
themeId: 4,
|
||||
themeId: 1004,
|
||||
name: "捆绑",
|
||||
isRelease: false,
|
||||
pic: {
|
||||
picType: PicType.LocalImage,
|
||||
imageState: ImageState.Lock,
|
||||
url: ""
|
||||
url: "Image/Theme/1004"
|
||||
}
|
||||
},
|
||||
{
|
||||
themeId: 5,
|
||||
themeId: 1005,
|
||||
name: "公众野战",
|
||||
isRelease: false,
|
||||
pic: {
|
||||
picType: PicType.LocalImage,
|
||||
imageState: ImageState.Lock,
|
||||
url: ""
|
||||
url: "Image/Theme/1005"
|
||||
}
|
||||
},
|
||||
{
|
||||
themeId: 6,
|
||||
themeId: 1006,
|
||||
name: "卡通",
|
||||
isRelease: false,
|
||||
pic: {
|
||||
picType: PicType.LocalImage,
|
||||
imageState: ImageState.Lock,
|
||||
url: ""
|
||||
url: "Image/Theme/1006"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { _decorator, AssetManager, assetManager, Component, Node, director, Prefab, resources, Sprite, SpriteFrame, Texture2D, v2, SpriteAtlas, ImageAsset, instantiate, AudioClip, Asset, JsonAsset, Material } from 'cc';
|
||||
import { _decorator, AssetManager, assetManager, Component, Node, director, Prefab, resources, Sprite, SpriteFrame, Texture2D, v2, SpriteAtlas, ImageAsset, instantiate, AudioClip, Asset, JsonAsset, Material, VideoPlayer, VideoClip } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('ResManager')
|
||||
@@ -156,7 +156,38 @@ export default class ResManager {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 改变图片--bundle资源 sprite-frame类型的图片*/
|
||||
changeBundleVideo(spt: VideoPlayer, url: string, packageName: string, cb: Function = null) {
|
||||
if (!spt || !url) return;
|
||||
let spttemp:any = spt
|
||||
spttemp.frameUrl = url
|
||||
let bundle = assetManager.getBundle(packageName);
|
||||
if (bundle){
|
||||
bundle.load(url, VideoClip, (err, res: VideoClip) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return
|
||||
}
|
||||
if (!spt.isValid) {
|
||||
return;
|
||||
}
|
||||
if (spttemp.frameUrl != url) {
|
||||
return;
|
||||
}
|
||||
spt.clip = res;
|
||||
//spt.spriteFrame = res;
|
||||
cb && cb(res);
|
||||
});
|
||||
}else{
|
||||
assetManager.loadBundle(packageName, (err: Error, _bundle: AssetManager.Bundle) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
return
|
||||
}
|
||||
this.changeBundleVideo(spt, url, packageName, cb);
|
||||
});
|
||||
}
|
||||
}
|
||||
/** 改变图片--bundle资源 sprite-frame类型的图片*/
|
||||
changeBundleSpriteFrame(spt: Sprite, url: string, packageName: string, cb: Function = null) {
|
||||
if (!spt || !url) return;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { _decorator, instantiate, isValid, Label, Node, Sprite, UITransform, Vec3, VideoPlayer, view } from 'cc';
|
||||
import { _decorator, instantiate, isValid, Label, Node,VideoClip, Sprite, UITransform, Vec3, VideoPlayer, view } from 'cc';
|
||||
import Utils from '../../Main/Common/Utils';
|
||||
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
|
||||
import li_BaseView from '../../Main/Common/li_BaseView';
|
||||
@@ -23,6 +23,8 @@ export class SceneBgVideoLayer extends li_BaseView {
|
||||
private vpWait: BgVideo | null = null; //播表情视频时暂停的背景视频
|
||||
private emoReady: BgVideo | null = null; //已准备好播放的表情
|
||||
|
||||
private videoPlayer: VideoPlayer = null;
|
||||
|
||||
/**获取videoplayer副本 */
|
||||
getVideoClone() {
|
||||
let vp = instantiate(this._nodeTab.videoRole)
|
||||
@@ -36,6 +38,7 @@ export class SceneBgVideoLayer extends li_BaseView {
|
||||
this.registerListenner();
|
||||
Utils.parseNode(this.node, this._nodeTab)
|
||||
this.sceneBg = this._nodeTab.sceneBg.getComponent(Sprite)!;
|
||||
this.videoPlayer = this._nodeTab.videoRole.getComponent(VideoPlayer);
|
||||
if (GlobalValue.NpcVideoMod) {
|
||||
this.setVideoInited(true, true)
|
||||
}
|
||||
@@ -47,18 +50,13 @@ export class SceneBgVideoLayer extends li_BaseView {
|
||||
|
||||
|
||||
registerListenner() {
|
||||
Utils.addInnerEL(InnerMsgCode.SimplePlayVide,this,this.playLocalLoopVideo);
|
||||
Utils.addInnerEL(InnerMsgCode.SceneLayerBgUp, this, this.resiveBgUp)
|
||||
Utils.addInnerEL(InnerMsgCode.BgVideo_Ready, this, this.resiveBgVideoReady)
|
||||
Utils.addInnerEL(InnerMsgCode.BgVideo_End, this, this.resiveBgVideoEnd)
|
||||
}
|
||||
|
||||
|
||||
start() {
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
|
||||
//刷新场景背景消息
|
||||
resiveBgUp(data) {
|
||||
@@ -116,6 +114,19 @@ export class SceneBgVideoLayer extends li_BaseView {
|
||||
}
|
||||
}
|
||||
|
||||
playLocalLoopVideo(data:any) {
|
||||
ResManager.I.changeBundleVideo(this.videoPlayer,data.path,"Chat18x",(res:VideoClip)=>{
|
||||
this.videoPlayer.play();
|
||||
let uiT:UITransform = this.videoPlayer.node.getComponent(UITransform);
|
||||
|
||||
const size = uiT.contentSize;
|
||||
console.log(size);
|
||||
const targetSize = data.size;
|
||||
console.log(targetSize);
|
||||
|
||||
this.videoPlayer.node.setScale(new Vec3(targetSize.y/576,targetSize.y/576,1));
|
||||
});
|
||||
}
|
||||
|
||||
/**播放循环视频 */
|
||||
playLoopVideo(path: string, force = false) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,8 +29,12 @@ export class DemoManager {
|
||||
|
||||
}
|
||||
|
||||
EnterGirlList(id: number) {
|
||||
ViewManager.I.openBundlesView("GirlListPanel",id);
|
||||
themeId = -1;
|
||||
EnterGirlList(id: number = null) {
|
||||
if(id != null) {this.themeId = id;}
|
||||
if(this.themeId == -1) {return;}
|
||||
console.log("EnterGirlList id:"+id);
|
||||
ViewManager.I.openBundlesView("GirlListPanel",this.themeId);
|
||||
}
|
||||
EnterChat(id: number) {
|
||||
ViewManager.I.openBundlesView("ChatPanel",id);
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
import { _decorator, Component, Label, Node, Sprite } from "cc";
|
||||
import { DemoManager } from "./DemoManager";
|
||||
import {_decorator, Label, Node, Sprite, VideoPlayer,instantiate} from "cc";
|
||||
import {DemoManager} from "./DemoManager";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import {characters, girlDetailInfo} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import {girlDetailInfo} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import {Config18x} from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import PicType = Config18x.PicType;
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import {DetailImageItem} from "db://assets/Scripts/test/girlListPanel/DetailImageItem";
|
||||
import {GirlListItem} from "db://assets/Scripts/test/girlListPanel/GirlListItem";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("GirlDetailPanel")
|
||||
export class GirlDetailPanel extends li_BaseView {
|
||||
@property(Sprite)
|
||||
avatar: Sprite;
|
||||
@property(VideoPlayer)
|
||||
avatarVideo: VideoPlayer;
|
||||
@property(Label)
|
||||
girlName: Label;
|
||||
|
||||
@@ -29,6 +37,12 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
chatBtn: Node;
|
||||
id = 0;
|
||||
|
||||
@property(DetailImageItem)
|
||||
imgItemInst:DetailImageItem;
|
||||
|
||||
@property(Node)
|
||||
imgsLayout:Node;
|
||||
|
||||
openUIDataCT(data)
|
||||
{
|
||||
this.id = data;
|
||||
@@ -36,19 +50,50 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
|
||||
onLoadCT() {
|
||||
super.onLoadCT();
|
||||
this.imgItemInst.node.active =false;
|
||||
this.refresh(this.id);
|
||||
|
||||
}
|
||||
|
||||
setVideEnable(enable:boolean) {
|
||||
this.avatarVideo.enabled = enable;
|
||||
if(enable)
|
||||
{
|
||||
this.avatarVideo.play();
|
||||
}
|
||||
}
|
||||
|
||||
refresh(index:number)
|
||||
{
|
||||
console.log(index);
|
||||
const data = girlDetailInfo.find(v=>v.baseInfo.id === index);
|
||||
this.girlName.string=this.descName.string = data.baseInfo.name;
|
||||
|
||||
if(data.pics[0].picType == PicType.LocalGif)
|
||||
{
|
||||
ResManager.I.changeBundleVideo(this.avatarVideo,data.pics[0].url,"Chat18x");
|
||||
}
|
||||
if(data.pics.length>1)
|
||||
{
|
||||
for (let i = this.imgsLayout.children.length-1; i >=0 ; i--) {
|
||||
this.imgsLayout.children[i].destroy();
|
||||
}
|
||||
|
||||
for (let i = 1; i < data.pics.length; i++) {
|
||||
const cfg = data.pics[i];
|
||||
let newNode = instantiate(this.imgItemInst.node)
|
||||
let item = newNode.getComponent(DetailImageItem);
|
||||
item.refresh(cfg,this);
|
||||
newNode.active = true;
|
||||
this.imgsLayout.addChild(newNode);
|
||||
}
|
||||
}
|
||||
|
||||
this.desc.string = data.detailDesc;
|
||||
let desc = '';
|
||||
for (let i = 0; i < data.baseInfo.tag.length; i++) {
|
||||
desc += data.baseInfo.tag[i]+"/";
|
||||
if(i!=0) desc += "\n"
|
||||
desc += data.baseInfo.tag[i];
|
||||
}
|
||||
this.tags.string = desc;
|
||||
for (let i = 0; i <5; i++) {
|
||||
@@ -67,6 +112,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
returnBtn()
|
||||
{
|
||||
this.onClose();
|
||||
DemoManager.getInstance().EnterGirlList();
|
||||
//ViewManager.I.openBundlesView("GirlListPanel");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ export class ImagePopup extends Component {
|
||||
|
||||
start()
|
||||
{
|
||||
this.node.setPosition(new Vec3(-1000,493,0));
|
||||
this.node.setPosition(new Vec3(-1500,493,0));
|
||||
this.image.node.on(Node.EventType.TOUCH_START,this.openImage);
|
||||
}
|
||||
|
||||
onDestroy()
|
||||
{
|
||||
this.image.node.off(Node.EventType.TOUCH_START,this.openImage);
|
||||
//this.image.node.off(Node.EventType.TOUCH_START,this.openImage);
|
||||
}
|
||||
|
||||
refresh(path:string)
|
||||
@@ -33,7 +33,8 @@ export class ImagePopup extends Component {
|
||||
|
||||
openImage()
|
||||
{
|
||||
ViewManager.I.openBundlesView('ShowPanel');
|
||||
let data = {url:"Image/Girls/10001/DetailImg/10001_3"};
|
||||
ViewManager.I.openBundlesView('ShowPanel',data);
|
||||
}
|
||||
popUp()
|
||||
{
|
||||
@@ -44,7 +45,7 @@ export class ImagePopup extends Component {
|
||||
}
|
||||
popDown()
|
||||
{
|
||||
tween(this.node).to(0.5,{position:new Vec3(-1000,493,0)},{easing:"backIn"}).start();
|
||||
tween(this.node).to(0.5,{position:new Vec3(-1500,493,0)},{easing:"backIn"}).start();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
import {_decorator, Component, math, Node, Sprite} from 'cc';
|
||||
import {Config18x, PicInfo} from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import PicType = Config18x.PicType;
|
||||
import ImageState = Config18x.ImageState;
|
||||
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
import {GirlDetailPanel} from "db://assets/Scripts/test/GirlDetailPanel";
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
|
||||
@ccclass('DetailImageItem')
|
||||
export class DetailImageItem extends Component {
|
||||
@property(Sprite)
|
||||
img: Sprite;
|
||||
|
||||
@property(Node)
|
||||
lock: Node;
|
||||
@property(Node)
|
||||
question: Node;
|
||||
|
||||
base:GirlDetailPanel;
|
||||
url:string;
|
||||
|
||||
onLoad()
|
||||
{
|
||||
GButton.BandClick(this.node,this.onClickThis,this);
|
||||
}
|
||||
|
||||
onClickThis()
|
||||
{
|
||||
let data = {url:this.url,closeFunc:()=>{
|
||||
this.base.setVideEnable(true);
|
||||
|
||||
}
|
||||
}
|
||||
if(this.url){
|
||||
ViewManager.I.openBundlesView('ShowPanel',data);
|
||||
this.base.setVideEnable(false);
|
||||
}
|
||||
}
|
||||
refresh(info: PicInfo,base:GirlDetailPanel) {
|
||||
this.base = base;
|
||||
this.lock.active = info.imageState === ImageState.Lock;
|
||||
this.question.active = info.imageState === ImageState.UnKnown
|
||||
|
||||
if (info.picType == PicType.LocalImage) {
|
||||
this.url = info.url;
|
||||
if (info.imageState !== ImageState.Release) {
|
||||
this.url += '_blured';
|
||||
if (info.imageState === ImageState.Lock)
|
||||
this.img.color = new math.Color(127, 127, 127, 255);
|
||||
else
|
||||
this.img.color = new math.Color(50, 50, 50, 255);
|
||||
|
||||
} else {
|
||||
this.img.color = new math.Color(255, 255, 255, 255);
|
||||
}
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, this.url, "Chat18x");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "74c99e6b-07c8-45f8-a14f-be20e3b47a61",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
import {_decorator, Component, Label, Node, Sprite,} from "cc";
|
||||
import {_decorator, Component, Label, Node, Sprite, UITransform,} from "cc";
|
||||
import {DemoManager} from "../DemoManager";
|
||||
import {Config18x, GirlInfo} from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import PriceType = Config18x.PriceType;
|
||||
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -34,13 +36,19 @@ export class GirlListItem extends Component {
|
||||
this.girlName.string = data.name;
|
||||
let desc = '';
|
||||
for (let i = 0; i < data.tag.length; i++) {
|
||||
desc += data.tag[i]+"/";
|
||||
if(i!=0) desc += "&";
|
||||
desc += data.tag[i];
|
||||
}
|
||||
this.tags.string = desc;
|
||||
this.price.node .active = data.priceType == PriceType.Coin;
|
||||
this.freeNode.active = data.priceType == PriceType.Free;
|
||||
this.tryNode.active = data.priceType == PriceType.Try;
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(this.avatar,data.pic.url,"Chat18x",()=>{
|
||||
let sizeTran = this.avatar.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize,this.avatar.node,2);
|
||||
});
|
||||
|
||||
for (let i = 0; i <5; i++) {
|
||||
this.starParent.children[i].active =(i<data.starCount);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { _decorator, Component, Node,instantiate } from 'cc';
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import {GirlListItem} from "db://assets/Scripts/test/girlListPanel/GirlListItem";
|
||||
import {characters, GirlsData} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import { GirlsData} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -6,6 +6,12 @@ import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
interface ShowPanelData
|
||||
{
|
||||
url: string;
|
||||
closeFunc:Function;
|
||||
}
|
||||
|
||||
@ccclass('ShowPanel')
|
||||
export class ShowPanel extends li_BaseView {
|
||||
@property(Sprite)
|
||||
@@ -13,18 +19,34 @@ export class ShowPanel extends li_BaseView {
|
||||
@property(Sprite)
|
||||
splash:Sprite;
|
||||
|
||||
url:string;
|
||||
func:Function;
|
||||
openUIDataCT(data:ShowPanelData) {
|
||||
super.openUIDataCT(data);
|
||||
this.url = data.url;
|
||||
this.func = data.closeFunc;
|
||||
}
|
||||
|
||||
onLoadCT() {
|
||||
this.show("Image/1/naked_1");
|
||||
this.show(this.url);
|
||||
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
//this.splash.node.on(Node.EventType.TOUCH_START,this.onclickback);
|
||||
GButton.BandClick(this.splash.node,()=>{this.close()},this);
|
||||
GButton.BandClick(this.splash.node,this.onClose,this);
|
||||
}
|
||||
|
||||
|
||||
protected onClose() {
|
||||
if(this.func)
|
||||
{
|
||||
this.func();
|
||||
}
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
show(path:string)
|
||||
{
|
||||
ResManager.I.changeBundleSpriteFrame(this.image,path,"Chat18x",()=>{
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { _decorator, Component, Label, Node, Sprite } from 'cc';
|
||||
import { _decorator, Component, Label, Node, Sprite, UITransform } from 'cc';
|
||||
import {Theme} from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
import {DemoManager} from "db://assets/Scripts/test/DemoManager";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('ThemeItem')
|
||||
@@ -11,22 +13,32 @@ export class ThemeItem extends Component {
|
||||
@property(Label)
|
||||
titleName:Label;
|
||||
|
||||
@property(Sprite)
|
||||
img:Sprite;
|
||||
|
||||
private id:number;
|
||||
|
||||
private isLocked:boolean;
|
||||
start()
|
||||
{
|
||||
}
|
||||
refresh(themeData:Theme)
|
||||
{
|
||||
this.lockImg.node.active = !themeData.isRelease;
|
||||
this.isLocked = !themeData.isRelease;
|
||||
this.titleName.string = themeData.name;
|
||||
this.id = themeData.themeId;
|
||||
ResManager.I.changeBundleSpriteFrame(this.img,themeData.pic.url,"Chat18x",()=>{
|
||||
let sizeTran = this.img.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize,this.img.node,2);
|
||||
});
|
||||
GButton.RemoveAndBandClick(this.node,this.OnClickThis,this);
|
||||
|
||||
}
|
||||
|
||||
OnClickThis()
|
||||
{
|
||||
if(this.isLocked){ return;}
|
||||
DemoManager.getInstance().EnterGirlList(this.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import {_decorator, Component, Node, instantiate, Label, Sprite} from 'cc';
|
||||
import {_decorator, Component, Node, instantiate, Label, Sprite, UITransform} from 'cc';
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import {GirlListItem} from "db://assets/Scripts/test/girlListPanel/GirlListItem";
|
||||
import {characters, themes} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import { GirlsData, themes} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
import {DemoManager} from "db://assets/Scripts/test/DemoManager";
|
||||
import {ThemeItem} from "db://assets/Scripts/test/girlListPanel/ThemeItem";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
|
||||
@@ -58,8 +59,16 @@ export class ThemePanel extends li_BaseView {
|
||||
this.cache.push(item);
|
||||
this.content.addChild(newNode);
|
||||
}
|
||||
}
|
||||
|
||||
const rectInfo = GirlsData[0];
|
||||
this.recId = rectInfo.id;
|
||||
this.recName.string = rectInfo.name;
|
||||
ResManager.I.changeBundleSpriteFrame(this.recSprite,rectInfo.pic.url,"Chat18x",()=>{
|
||||
let sizeTran = this.recSprite.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize,this.recSprite.node,2);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private registerListener() {
|
||||
GButton.BandClick(this._nodeTab.settingBtn, this.openSetting, this);
|
||||
@@ -70,7 +79,6 @@ export class ThemePanel extends li_BaseView {
|
||||
|
||||
chatWithRec() {
|
||||
DemoManager.getInstance().EnterChat(this.recId);
|
||||
|
||||
}
|
||||
|
||||
openSetting() {
|
||||
|
||||
Reference in New Issue
Block a user