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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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