代码整理,ai相关配置转luban,聊天气泡缓存
This commit is contained in:
@@ -48,6 +48,12 @@ export class ChatPanel extends li_BaseView {
|
||||
private _nodeTab: any = {};
|
||||
|
||||
nameKey: string;
|
||||
|
||||
private onLanguageChangeCallback = () => {
|
||||
if (!this.girlName) return;
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
};
|
||||
|
||||
openUIDataCT(data) {
|
||||
this.id = data;
|
||||
// 设置当前聊天的角色ID
|
||||
@@ -67,14 +73,10 @@ export class ChatPanel extends li_BaseView {
|
||||
this.onDialogUpdate
|
||||
);
|
||||
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
});
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, this.onLanguageChangeCallback);
|
||||
}
|
||||
onDestroy(): void {
|
||||
Utils.removeInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
});
|
||||
Utils.removeInnerEL(InnerMsgCode.LanguageChange, this, this.onLanguageChangeCallback);
|
||||
}
|
||||
refresh(id: number) {
|
||||
this.id = id;
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
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 { 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;
|
||||
|
||||
@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(path: string, base: GirlDetailPanel) {
|
||||
this.base = base;
|
||||
this.lock.active = false;
|
||||
this.question.active = false;
|
||||
|
||||
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,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "da3f4fde-7c2a-41b5-b59f-2b539cc41eec",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { _decorator, Label, Node, Sprite, VideoPlayer, instantiate } from "cc";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import { DetailImageItem } from "./DetailImageItem";
|
||||
import { DetailImageItem } from "../../uiitems/DetailImageItem";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import ConfigManager from "../../manager/ConfigManager";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
import { _decorator, Component, Label, Node, Sprite, UITransform } from "cc";
|
||||
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";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import { InnerMsgCode } from "../../../Main/Config/InnerMsgCode";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("GirlListItem")
|
||||
export class GirlListItem extends Component {
|
||||
@property(Sprite)
|
||||
avatar: Sprite;
|
||||
@property(Label)
|
||||
girlName: Label;
|
||||
@property(Label)
|
||||
tags: Label;
|
||||
@property(Label)
|
||||
price: Label;
|
||||
@property(Node)
|
||||
freeNode: Node;
|
||||
@property(Node)
|
||||
tryNode: Node;
|
||||
@property(Node)
|
||||
chatBtn: Node;
|
||||
@property(Node)
|
||||
starParent: Node;
|
||||
|
||||
id: number = -1;
|
||||
|
||||
nameKey: string;
|
||||
tagKey: string;
|
||||
protected onLoad(): void {
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.girlName.string = this.girlName.string = LanguageUtils.getText(
|
||||
this.nameKey
|
||||
);
|
||||
let desc = "";
|
||||
const tags = LanguageUtils.getText(this.tagKey).split("|");
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
if (i != 0) desc += "\n";
|
||||
desc += tags[i];
|
||||
}
|
||||
this.tags.string = desc;
|
||||
});
|
||||
}
|
||||
protected onDestroy(): void {
|
||||
Utils.removeInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.girlName.string = this.girlName.string = LanguageUtils.getText(
|
||||
this.nameKey
|
||||
);
|
||||
let desc = "";
|
||||
const tags = LanguageUtils.getText(this.tagKey).split("|");
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
if (i != 0) desc += "\n";
|
||||
desc += tags[i];
|
||||
}
|
||||
this.tags.string = desc;
|
||||
});
|
||||
}
|
||||
|
||||
baseNode: Node;
|
||||
refreshData(data: Girl, baseNode: Node) {
|
||||
this.baseNode = baseNode;
|
||||
this.id = data.id;
|
||||
this.nameKey = data.nameKey;
|
||||
this.girlName.string = LanguageUtils.getText(data.nameKey);
|
||||
this.tagKey = data.tagKey;
|
||||
let desc = "";
|
||||
const tags = LanguageUtils.getText(data.tagKey).split("|");
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
if (i != 0) desc += "|";
|
||||
desc += tags[i];
|
||||
}
|
||||
this.tags.string = desc;
|
||||
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.avatarPath,
|
||||
"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;
|
||||
}
|
||||
}
|
||||
|
||||
onClickDetail() {
|
||||
NavigationManager.Instance.navigateToGirlDetail(this.id);
|
||||
ViewManager.I.closeView(this.baseNode);
|
||||
}
|
||||
|
||||
update(deltaTime: number) {}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "c9c66d7b-1a74-4d16-8410-324541cfc05e",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -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 { GButton } from "db://assets/Scripts/Main/Common/GButton";
|
||||
import { GirlListItem } from "./GirlListItem";
|
||||
import { GirlListItem } from "../../uiitems/GirlListItem";
|
||||
import ConfigManager from "../../manager/ConfigManager";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
import { _decorator, Component, Label, Node, Sprite, UITransform } from "cc";
|
||||
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";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import { InnerMsgCode } from "../../../Main/Config/InnerMsgCode";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("ThemeItem")
|
||||
export class ThemeItem extends Component {
|
||||
@property(Sprite)
|
||||
lockImg: Sprite;
|
||||
@property(Label)
|
||||
titleName: Label;
|
||||
|
||||
@property(Sprite)
|
||||
img: Sprite;
|
||||
|
||||
private category: number;
|
||||
|
||||
private isLocked: boolean;
|
||||
|
||||
key: string;
|
||||
protected onLoad(): void {
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.titleName.string = LanguageUtils.getText(this.key);
|
||||
});
|
||||
}
|
||||
protected onDestroy(): void {
|
||||
Utils.removeInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.titleName.string = LanguageUtils.getText(this.key);
|
||||
});
|
||||
}
|
||||
|
||||
refresh(themeData: Theme) {
|
||||
this.lockImg.node.active = !themeData.isRelease;
|
||||
this.isLocked = !themeData.isRelease;
|
||||
this.key = themeData.key;
|
||||
this.titleName.string = LanguageUtils.getText(themeData.key);
|
||||
this.category = themeData.category;
|
||||
ResManager.I.changeBundleSpriteFrame(
|
||||
this.img,
|
||||
themeData.path,
|
||||
"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;
|
||||
}
|
||||
NavigationManager.Instance.navigateToGirlList(this.category);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "c715a0ca-612c-4b4b-9cb3-ba48081a2f55",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -11,9 +11,9 @@ import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import { GButton } from "db://assets/Scripts/Main/Common/GButton";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import { ThemeItem } from "./ThemeItem";
|
||||
import { ThemeItem } from "../../uiitems/ThemeItem";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import { GirlListItem } from "./GirlListItem";
|
||||
import { GirlListItem } from "../../uiitems/GirlListItem";
|
||||
import ConfigManager from "../../manager/ConfigManager";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import { ViewManager } from "../../../Main/Manager/ViewManager";
|
||||
|
||||
Reference in New Issue
Block a user