配置全部转移luban
This commit is contained in:
@@ -18,12 +18,10 @@ import { ChatContentsLayout } from "../components/ChatContentsLayout";
|
||||
import { ViewManager } from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import GameRootUI from "db://assets/Scripts/Main/Common/GameRootUI";
|
||||
import { ImagePopup } from "../components/ImagePopup";
|
||||
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";
|
||||
import ConfigManager from "../../manager/ConfigManager";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("ChatPanel")
|
||||
@@ -69,12 +67,13 @@ export class ChatPanel extends li_BaseView {
|
||||
}
|
||||
refresh(id: number) {
|
||||
this.id = id;
|
||||
const data = girlDetailInfo.filter((value) => value.baseInfo.id == id)[0];
|
||||
const data = ConfigManager.tables.TbGirls.get(this.id);
|
||||
const dataDetail = ConfigManager.tables.TbGirlsDetail.get(this.id);
|
||||
if (!data) return;
|
||||
this.girlName.string = data.baseInfo.name;
|
||||
this.girlName.string = data.name;
|
||||
ResManager.I.changeBundleSpriteFrame(
|
||||
this.girlImg,
|
||||
data.baseInfo.pic.url,
|
||||
data.avatarPath,
|
||||
"Chat18x",
|
||||
() => {
|
||||
let sizeTran = this.girlImg.node.parent.getComponent(UITransform);
|
||||
@@ -89,7 +88,7 @@ export class ChatPanel extends li_BaseView {
|
||||
this._nodeTab.BgFrame.getComponent(UITransform);
|
||||
|
||||
Utils.sendInnerMsg(InnerMsgCode.SimplePlayVide, {
|
||||
path: data.pics[0].url,
|
||||
path: dataDetail.pics[0],
|
||||
size: uiTransform.contentSize,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,67 +1,60 @@
|
||||
import {_decorator, Component, math, Node, Sprite} from 'cc';
|
||||
import {Config18x, PicInfo} from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import { _decorator, Component, math, Node, Sprite } from "cc";
|
||||
import { Config18x } 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 "./GirlDetailPanel";
|
||||
import { ViewManager } from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import { GButton } from "db://assets/Scripts/Main/Common/GButton";
|
||||
import { GirlDetailPanel } from "./GirlDetailPanel";
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('DetailImageItem')
|
||||
@ccclass("DetailImageItem")
|
||||
export class DetailImageItem extends Component {
|
||||
@property(Sprite)
|
||||
img: Sprite;
|
||||
@property(Sprite)
|
||||
img: Sprite;
|
||||
|
||||
@property(Node)
|
||||
lock: Node;
|
||||
@property(Node)
|
||||
question: Node;
|
||||
@property(Node)
|
||||
lock: Node;
|
||||
@property(Node)
|
||||
question: Node;
|
||||
|
||||
base:GirlDetailPanel;
|
||||
url:string;
|
||||
base: GirlDetailPanel;
|
||||
url: string;
|
||||
|
||||
onLoad()
|
||||
{
|
||||
GButton.BandClick(this.node,this.onClickThis,this);
|
||||
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(path: string, base: GirlDetailPanel) {
|
||||
this.base = base;
|
||||
this.lock.active = false;
|
||||
this.question.active = false;
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
if (true) {
|
||||
this.url = path;
|
||||
// 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import {_decorator, Label, Node, Sprite, VideoPlayer,instantiate} from "cc";
|
||||
import { _decorator, Label, Node, Sprite, VideoPlayer, instantiate } from "cc";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
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 Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import { DetailImageItem } from "./DetailImageItem";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
|
||||
import ConfigManager from "../../manager/ConfigManager";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -38,79 +34,77 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
id = 0;
|
||||
|
||||
@property(DetailImageItem)
|
||||
imgItemInst:DetailImageItem;
|
||||
imgItemInst: DetailImageItem;
|
||||
|
||||
@property(Node)
|
||||
imgsLayout:Node;
|
||||
imgsLayout: Node;
|
||||
|
||||
openUIDataCT(data)
|
||||
{
|
||||
openUIDataCT(data) {
|
||||
this.id = data;
|
||||
}
|
||||
|
||||
onLoadCT() {
|
||||
super.onLoadCT();
|
||||
this.imgItemInst.node.active =false;
|
||||
this.imgItemInst.node.active = false;
|
||||
this.refresh(this.id);
|
||||
|
||||
}
|
||||
|
||||
setVideEnable(enable:boolean) {
|
||||
setVideEnable(enable: boolean) {
|
||||
this.avatarVideo.enabled = enable;
|
||||
if(enable)
|
||||
{
|
||||
if (enable) {
|
||||
this.avatarVideo.play();
|
||||
}
|
||||
}
|
||||
|
||||
refresh(index:number)
|
||||
{
|
||||
refresh(index: number) {
|
||||
console.log(index);
|
||||
const data = girlDetailInfo.find(v=>v.baseInfo.id === index);
|
||||
this.girlName.string=this.descName.string = data.baseInfo.name;
|
||||
const dataDetail = ConfigManager.tables.TbGirlsDetail.get(this.id);
|
||||
const data = ConfigManager.tables.TbGirls.get(this.id);
|
||||
this.girlName.string = this.descName.string = data.name;
|
||||
|
||||
if(data.pics[0].picType == PicType.LocalGif)
|
||||
{
|
||||
ResManager.I.changeBundleVideo(this.avatarVideo,data.pics[0].url,"Chat18x");
|
||||
if (dataDetail.pics[0].endsWith("video")) {
|
||||
ResManager.I.changeBundleVideo(
|
||||
this.avatarVideo,
|
||||
dataDetail.pics[0],
|
||||
"Chat18x"
|
||||
);
|
||||
}
|
||||
if(data.pics.length>1)
|
||||
{
|
||||
for (let i = this.imgsLayout.children.length-1; i >=0 ; i--) {
|
||||
if (dataDetail.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)
|
||||
for (let i = 1; i < dataDetail.pics.length; i++) {
|
||||
const path = dataDetail.pics[i];
|
||||
let newNode = instantiate(this.imgItemInst.node);
|
||||
let item = newNode.getComponent(DetailImageItem);
|
||||
item.refresh(cfg,this);
|
||||
item.refresh(path, 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++) {
|
||||
if(i!=0) desc += "\n"
|
||||
desc += data.baseInfo.tag[i];
|
||||
this.desc.string = dataDetail.detailDesc;
|
||||
let desc = "";
|
||||
for (let i = 0; i < data.tag.length; i++) {
|
||||
if (i != 0) desc += "\n";
|
||||
desc += data.tag[i];
|
||||
}
|
||||
this.tags.string = desc;
|
||||
for (let i = 0; i <5; i++) {
|
||||
this.starParent.children[i].active =(i<data.baseInfo.starCount);
|
||||
for (let i = 0; i < 5; i++) {
|
||||
this.starParent.children[i].active = i < data.starCount;
|
||||
}
|
||||
this.descAge.string = data.baseInfo.age.toString();
|
||||
this.desc.string = data.detailDesc;
|
||||
this.descAge.string = data.age.toString();
|
||||
this.desc.string = dataDetail.detailDesc;
|
||||
|
||||
this.id = data.baseInfo.id;
|
||||
this.id = data.id;
|
||||
}
|
||||
OnClickChatBtn() {
|
||||
NavigationManager.Instance.navigateToChat(this.id);
|
||||
this.onClose();
|
||||
}
|
||||
|
||||
returnBtn()
|
||||
{
|
||||
returnBtn() {
|
||||
this.onClose();
|
||||
NavigationManager.Instance.navigateToGirlList(1001);
|
||||
//ViewManager.I.openBundlesView("GirlListPanel");
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { _decorator, Component, Label, Node, Sprite, UITransform } from "cc";
|
||||
import { Config18x, GirlInfo } from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import PriceType = Config18x.PriceType;
|
||||
import { Config18x } from "db://assets/Scripts/Main/Config/Config18x";
|
||||
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";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import { Girl, PriceType } from "../../../schema/schema";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -30,7 +30,7 @@ export class GirlListItem extends Component {
|
||||
id: number = -1;
|
||||
|
||||
baseNode: Node;
|
||||
refreshData(data: GirlInfo, baseNode: Node) {
|
||||
refreshData(data: Girl, baseNode: Node) {
|
||||
this.baseNode = baseNode;
|
||||
this.id = data.id;
|
||||
this.girlName.string = data.name;
|
||||
@@ -40,13 +40,13 @@ export class GirlListItem extends Component {
|
||||
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;
|
||||
this.price.node.active = data.priceType == PriceType.pay;
|
||||
this.freeNode.active = data.priceType == PriceType.free;
|
||||
this.tryNode.active = data.priceType == PriceType.first_time_free;
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(
|
||||
this.avatar,
|
||||
data.pic.url,
|
||||
data.avatarPath,
|
||||
"Chat18x",
|
||||
() => {
|
||||
let sizeTran = this.avatar.node.parent.getComponent(UITransform);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
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 { GirlsData } from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import { GButton } from "db://assets/Scripts/Main/Common/GButton";
|
||||
import { GirlListItem } from "./GirlListItem";
|
||||
import ConfigManager from "../../manager/ConfigManager";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("GirlListPanel")
|
||||
@@ -15,9 +15,9 @@ export class GirlListPanel extends li_BaseView {
|
||||
|
||||
cache: GirlListItem[] = [];
|
||||
|
||||
id: number;
|
||||
category: number;
|
||||
openUIDataCT(data) {
|
||||
this.id = data;
|
||||
this.category = data;
|
||||
}
|
||||
onLoadCT() {
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
@@ -25,16 +25,17 @@ export class GirlListPanel extends li_BaseView {
|
||||
this.itemInst = this._nodeTab.BubbleItem.getComponent(GirlListItem);
|
||||
this.itemInst.node.active = false;
|
||||
this.content = this._nodeTab.content;
|
||||
this.refresh(this.id);
|
||||
this.refresh(this.category);
|
||||
}
|
||||
|
||||
refresh(index: number) {
|
||||
refresh(category: number) {
|
||||
if (this.cache) {
|
||||
for (let i = this.cache.length - 1; i >= 0; i--) {
|
||||
this.cache[i].node.destroy();
|
||||
}
|
||||
}
|
||||
const config = GirlsData.filter((value) => value.category == index);
|
||||
const GirlsData = ConfigManager.tables.TbGirls.getDataList();
|
||||
const config = GirlsData.filter((value) => value.category == category);
|
||||
for (let i = 0; i < config.length; i++) {
|
||||
const cfg = config[i];
|
||||
let newNode = instantiate(this.itemInst.node);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
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 ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import { TbThemes, Theme } from "../../../schema/schema";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("ThemeItem")
|
||||
@@ -16,7 +16,7 @@ export class ThemeItem extends Component {
|
||||
@property(Sprite)
|
||||
img: Sprite;
|
||||
|
||||
private id: number;
|
||||
private category: number;
|
||||
|
||||
private isLocked: boolean;
|
||||
start() {}
|
||||
@@ -24,10 +24,10 @@ export class ThemeItem extends Component {
|
||||
this.lockImg.node.active = !themeData.isRelease;
|
||||
this.isLocked = !themeData.isRelease;
|
||||
this.titleName.string = themeData.name;
|
||||
this.id = themeData.themeId;
|
||||
this.category = themeData.category;
|
||||
ResManager.I.changeBundleSpriteFrame(
|
||||
this.img,
|
||||
themeData.pic.url,
|
||||
themeData.path,
|
||||
"Chat18x",
|
||||
() => {
|
||||
let sizeTran = this.img.node.parent.getComponent(UITransform);
|
||||
@@ -41,6 +41,6 @@ export class ThemeItem extends Component {
|
||||
if (this.isLocked) {
|
||||
return;
|
||||
}
|
||||
NavigationManager.Instance.navigateToGirlList(this.id);
|
||||
NavigationManager.Instance.navigateToGirlList(this.category);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,15 +9,12 @@ import {
|
||||
} from "cc";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import {
|
||||
GirlsData,
|
||||
themes,
|
||||
} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import { GButton } from "db://assets/Scripts/Main/Common/GButton";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import { ThemeItem } from "./ThemeItem";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import { GirlListItem } from "./GirlListItem";
|
||||
import ConfigManager from "../../manager/ConfigManager";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -59,9 +56,10 @@ export class ThemePanel extends li_BaseView {
|
||||
this.cache[i].node.destroy();
|
||||
}
|
||||
}
|
||||
const config = themes;
|
||||
for (let i = 0; i < config.length; i++) {
|
||||
const cfg = config[i];
|
||||
const cfgs = ConfigManager.tables.TbThemes.getDataList();
|
||||
for (let i = 0; i < cfgs.length; i++) {
|
||||
const cfg = cfgs[i];
|
||||
if (!cfg) return;
|
||||
let newNode = instantiate(this.itemInst.node);
|
||||
let item = newNode.getComponent(ThemeItem);
|
||||
item.refresh(cfg);
|
||||
@@ -70,12 +68,12 @@ export class ThemePanel extends li_BaseView {
|
||||
this.content.addChild(newNode);
|
||||
}
|
||||
|
||||
const rectInfo = GirlsData[0];
|
||||
const rectInfo = cfgs[0];
|
||||
this.recId = rectInfo.id;
|
||||
this.recName.string = rectInfo.name;
|
||||
ResManager.I.changeBundleSpriteFrame(
|
||||
this.recSprite,
|
||||
rectInfo.pic.url,
|
||||
rectInfo.path,
|
||||
"Chat18x",
|
||||
() => {
|
||||
let sizeTran = this.recSprite.node.parent.getComponent(UITransform);
|
||||
|
||||
Reference in New Issue
Block a user