This commit is contained in:
2025-07-17 17:18:21 +08:00
commit 1ffc1b5cf0
5309 changed files with 1150310 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

@@ -0,0 +1,361 @@
{
"__version__": "1.3.8",
"log": {
"level": 4
},
"common": {
"polyfills": {
"asyncFunctions": true
},
"buildPath": "project://build",
"outputName": "wechatgame_kuai",
"mainBundleCompressionType": "merge_dep",
"platform": "wechatgame",
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.wx.1.0.2",
"nativeCodeBundleMode": "asmjs",
"md5Cache": true,
"name": "XiangQin"
},
"BuildTaskManager": {
"taskMap": {
"1736231456475": {
"type": "build",
"id": "1736231456475",
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-3-10 17:13:51 build success in 16 s!",
"detailMessage": "builder:build-project-total (16469ms)\r",
"options": {
"name": "XiangQin",
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.wx.1.0.2",
"platform": "wechatgame",
"buildPath": "project://build",
"debug": false,
"md5Cache": true,
"skipCompressTexture": false,
"sourceMaps": false,
"overwriteProjectSettings": {
"macroConfig": {
"cleanupImageCache": "on"
},
"includeModules": {
"physics": "inherit-project-setting",
"physics-2d": "inherit-project-setting",
"gfx-webgl2": "off"
}
},
"nativeCodeBundleMode": "asmjs",
"polyfills": {
"asyncFunctions": false
},
"experimentalEraseModules": false,
"startSceneAssetBundle": false,
"bundleConfigs": [],
"useBuiltinServer": false,
"md5CacheOptions": {
"excludes": [],
"includes": [],
"replaceOnly": [],
"handleTemplateMd5Link": true
},
"mainBundleIsRemote": false,
"mainBundleCompressionType": "merge_dep",
"useSplashScreen": true,
"bundleCommonChunk": false,
"packAutoAtlas": true,
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"outputName": "wechatgame",
"taskName": "wechatgame",
"scenes": [
{
"url": "db://assets/Scenes/MainScene.scene",
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
{
"url": "db://assets/Scenes/PreloadScene.scene",
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
}
],
"wasmCompressionMode": false,
"packages": {},
"__version__": "1.3.8",
"logDest": "project://temp/builder/log/wechatgame2025-1-7 14-30.log"
},
"time": "2025-3-10 17:13:34",
"dirty": false
},
"1736573831185": {
"type": "build",
"id": "1736573831185",
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-3-6 14:21:54 build success in 42 s!",
"detailMessage": "// ---- build task cocos-service:onAfterBuild ----\r",
"options": {
"name": "XiangQin",
"server": "",
"platform": "web-mobile",
"buildPath": "project://build",
"debug": false,
"md5Cache": false,
"skipCompressTexture": false,
"sourceMaps": false,
"overwriteProjectSettings": {
"includeModules": {
"gfx-webgl2": "on",
"physics": "inherit-project-setting",
"physics-2d": "inherit-project-setting"
},
"macroConfig": {
"cleanupImageCache": "inherit-project-setting"
}
},
"nativeCodeBundleMode": "both",
"polyfills": {
"asyncFunctions": true
},
"experimentalEraseModules": false,
"startSceneAssetBundle": false,
"bundleConfigs": [],
"useBuiltinServer": false,
"md5CacheOptions": {
"excludes": [],
"includes": [],
"replaceOnly": [],
"handleTemplateMd5Link": true
},
"mainBundleIsRemote": false,
"mainBundleCompressionType": "merge_dep",
"useSplashScreen": true,
"bundleCommonChunk": false,
"packAutoAtlas": true,
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"outputName": "web-mobile",
"taskName": "web-mobile",
"scenes": [
{
"url": "db://assets/Scenes/MainScene.scene",
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
{
"url": "db://assets/Scenes/PreloadScene.scene",
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
}
],
"wasmCompressionMode": false,
"packages": {},
"__version__": "1.3.8",
"buildMode": "normal",
"logDest": "project://temp/builder/log/web-mobile2025-1-11 13-37.log"
},
"time": "2025-3-6 14:21:11",
"dirty": false
},
"1736821502634": {
"type": "build",
"id": "1736821502634",
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-2-7 09:01:29 build success in 13 s!",
"detailMessage": "// ---- build task cocos-service:onAfterCompressSettings ----\r",
"options": {
"name": "XiangQin",
"server": "",
"platform": "web-mobile",
"buildPath": "project://build",
"debug": false,
"md5Cache": false,
"skipCompressTexture": false,
"sourceMaps": false,
"overwriteProjectSettings": {
"includeModules": {
"gfx-webgl2": "on",
"physics": "inherit-project-setting",
"physics-2d": "inherit-project-setting"
},
"macroConfig": {
"cleanupImageCache": "inherit-project-setting"
}
},
"nativeCodeBundleMode": "both",
"polyfills": {
"asyncFunctions": true
},
"experimentalEraseModules": false,
"startSceneAssetBundle": false,
"bundleConfigs": [],
"useBuiltinServer": false,
"md5CacheOptions": {
"excludes": [],
"includes": [],
"replaceOnly": [],
"handleTemplateMd5Link": true
},
"mainBundleIsRemote": false,
"mainBundleCompressionType": "merge_dep",
"useSplashScreen": true,
"bundleCommonChunk": false,
"packAutoAtlas": true,
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"outputName": "web-mobile-console",
"taskName": "web-mobile-console",
"scenes": [
{
"url": "db://assets/Scenes/MainScene.scene",
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
{
"url": "db://assets/Scenes/PreloadScene.scene",
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
}
],
"wasmCompressionMode": false,
"packages": {},
"__version__": "1.3.8",
"buildMode": "normal",
"logDest": "project://temp/builder/log/web-mobile2025-1-14 10-25.log"
},
"time": "2025-2-7 09:01:15",
"dirty": false
},
"1736838627770": {
"type": "build",
"id": "1736838627770",
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-2-28 10:45:42 build success in 22 s!",
"detailMessage": "builder:build-project-total (22353ms)\r",
"options": {
"name": "XiangQin",
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.bd.1.0.0",
"platform": "bytedance-mini-game",
"buildPath": "project://build",
"debug": false,
"md5Cache": false,
"skipCompressTexture": false,
"sourceMaps": false,
"overwriteProjectSettings": {
"macroConfig": {
"cleanupImageCache": "inherit-project-setting"
},
"includeModules": {
"physics": "inherit-project-setting",
"physics-2d": "inherit-project-setting",
"gfx-webgl2": "off"
}
},
"nativeCodeBundleMode": "both",
"polyfills": {
"asyncFunctions": false
},
"experimentalEraseModules": false,
"startSceneAssetBundle": false,
"bundleConfigs": [],
"useBuiltinServer": false,
"md5CacheOptions": {
"excludes": [],
"includes": [],
"replaceOnly": [],
"handleTemplateMd5Link": true
},
"mainBundleIsRemote": false,
"mainBundleCompressionType": "merge_dep",
"useSplashScreen": true,
"bundleCommonChunk": false,
"packAutoAtlas": true,
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"outputName": "bytedance-mini-game",
"taskName": "bytedance-mini-game",
"scenes": [
{
"url": "db://assets/Scenes/MainScene.scene",
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
{
"url": "db://assets/Scenes/PreloadScene.scene",
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
}
],
"wasmCompressionMode": false,
"packages": {},
"__version__": "1.3.8",
"logDest": "project://temp/builder/log/bytedance-mini-game2025-1-14 15-10.log"
},
"time": "2025-2-28 10:45:19",
"dirty": false
},
"1736905523241": {
"type": "build",
"id": "1736905523241",
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-3-6 17:16:16 build success in 16 s!",
"detailMessage": "// ---- build task wechatgame:onAfterBuild ----\r",
"options": {
"name": "XiangQin",
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.ks.1.0.0",
"platform": "wechatgame",
"buildPath": "project://build",
"debug": false,
"md5Cache": true,
"skipCompressTexture": false,
"sourceMaps": false,
"overwriteProjectSettings": {
"macroConfig": {
"cleanupImageCache": "on"
},
"includeModules": {
"physics": "inherit-project-setting",
"physics-2d": "inherit-project-setting",
"gfx-webgl2": "off"
}
},
"nativeCodeBundleMode": "asmjs",
"polyfills": {
"asyncFunctions": false
},
"experimentalEraseModules": false,
"startSceneAssetBundle": false,
"bundleConfigs": [],
"useBuiltinServer": false,
"md5CacheOptions": {
"excludes": [],
"includes": [],
"replaceOnly": [],
"handleTemplateMd5Link": true
},
"mainBundleIsRemote": false,
"mainBundleCompressionType": "merge_dep",
"useSplashScreen": true,
"bundleCommonChunk": false,
"packAutoAtlas": true,
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"outputName": "wechatgame_kuai",
"taskName": "wechatgame_kuai",
"scenes": [
{
"url": "db://assets/Scenes/MainScene.scene",
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
{
"url": "db://assets/Scenes/PreloadScene.scene",
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
}
],
"wasmCompressionMode": false,
"packages": {},
"__version__": "1.3.8",
"logDest": "project://temp/builder/log/wechatgame2025-1-15 09-45.log"
},
"time": "2025-3-6 17:15:59",
"dirty": false
}
}
}
}
@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "a54bab01-8cd5-41c0-8fe1-18f2321016fb",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "a54bab01-8cd5-41c0-8fe1-18f2321016fb@6c48a",
"displayName": "danyu_laugh",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "a54bab01-8cd5-41c0-8fe1-18f2321016fb",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "a54bab01-8cd5-41c0-8fe1-18f2321016fb@f9941",
"displayName": "danyu_laugh",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -9,
"trimX": 159,
"trimY": 18,
"width": 607,
"height": 1171,
"rawWidth": 925,
"rawHeight": 1189,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-303.5,
-585.5,
0,
303.5,
-585.5,
0,
-303.5,
585.5,
0,
303.5,
585.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
159,
1171,
766,
1171,
159,
0,
766,
0
],
"nuv": [
0.17189189189189188,
0,
0.8281081081081081,
0,
0.17189189189189188,
0.9848612279226241,
0.8281081081081081,
0.9848612279226241
],
"minPos": [
-303.5,
-585.5,
0
],
"maxPos": [
303.5,
585.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "a54bab01-8cd5-41c0-8fe1-18f2321016fb@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "a54bab01-8cd5-41c0-8fe1-18f2321016fb@6c48a"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,250 @@
import { _decorator, instantiate, Label, Layout, Node, Prefab, ScrollView, Sprite, tween, UIOpacity, UITransform } from 'cc';
import { GButton } from '../../Main/Common/GButton';
import Utils from '../../Main/Common/Utils';
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
import li_BaseView from '../../Main/Common/li_BaseView';
import GameManager from '../../Main/Manager/GameManager';
import ResManager from '../../Main/Manager/ResManager';
import { SDKManager } from '../../Main/Channel/SDKManager';
import { ViewManager } from '../../Main/Manager/ViewManager';
import { E_AD_TARGET } from './TalkAdDialog';
import SubManager from '../SubManager';
import HttpUnit from '../../Main/Common/HttpUnit';
const { ccclass, property } = _decorator;
//聊天记录界面
@ccclass('Record_UI')
export class Record_UI extends li_BaseView {
@property(Prefab)
private talkNpcItem: Prefab = null;
@property(Prefab)
private talkUserItem: Prefab = null;
private _nodeTab: any = {};
private talkSV: ScrollView = null;
private _data;
private itemNodeList: any[] = [];
private itemDataList: any[] = [];
//----重写父类接口---------------------------------------
onLoadCT() {
this.registerListenner();
Utils.parseNode(this.node, this._nodeTab)
this.talkSV = this._nodeTab.talkSV.getComponent(ScrollView);
}
openUIDataCT(data: any): void {
this._data = data
}
registerListenner() {
// Utils.addInnerEL(InnerMsgCode.GM_UI_Close, this, this.resiveGMClose)
}
start() {
GButton.BandClick(this._nodeTab.btnBack, ()=>{
this.onClose();
}, this);
//撤回按钮
GButton.BandClick(this._nodeTab.chehuiNode, ()=>{
let cellLen = this.itemDataList.length
if (cellLen <= 1) {
SubManager.ShowPrompt("没有可以撤回的对话")
return
}
let contStr = ""
let levelData = GameManager.CurLevelData
if (!levelData || levelData.can_use_cancel_cnt <= 0) {
contStr = "关卡内撤回次数已用完"
} else {
contStr = `观看广告,可撤回最近一次对话并返还 1 次对话次数,剩余${levelData.can_use_cancel_cnt}次`
}
ViewManager.I.openBundlesView("UI/StartUI/TalkAdDialog", {
type: E_AD_TARGET.chehui, //撤回,并加聊天次数
content: contStr,
adCallback: ()=>{
SDKManager.show_reward_video_ad(this.node.uuid, 1)
},
shareCallback: ()=>{
SDKManager.show_reward_share(this.node.uuid, 1)
}
})
}, this);
SDKManager.register_video_reward(this.node.uuid, (tag:number)=>{
console.log("视频广告回调", tag)
if (tag == 1) {
// 撤回聊天
this.doChehuiTalk()
}
})
SDKManager.register_share_reward(this.node.uuid, (tag:number)=>{
console.log("分享回调", tag)
if (tag == 1) {
// 撤回聊天
this.doChehuiTalk()
}
})
let lvCfg = GameManager.getLevelCfg(GameManager.CurLevelId)
//npc名字
Utils.setString(this._nodeTab.npcName, lvCfg.name)
this.itemNodeList = []
this.itemDataList = []
let talkLay: Layout = this.talkSV.content.getComponent(Layout)
let talkCellLen = GameManager.TalkRecordList.length
let aniTime = 0 //滚动动作总时间
talkLay.enabled = false;
for (let i=0; i<talkCellLen; i++) {
// for (let i=talkCellLen-1; i>=0; i--) {
let info = GameManager.TalkRecordList[i];
let titem = info.isMe ? this.talkUserItem : this.talkNpcItem;
let itemClone:any = instantiate(titem);
this._nodeTab.talkLay.addChild(itemClone);
Utils.parseNode(itemClone);
this.itemNodeList.push(itemClone);
this.itemDataList.push(info);
//头像
let spt = itemClone.headIcon.getComponent(Sprite)
if (info.isMe) {
let avatarUrl = SDKManager.avatarUrl;
if (avatarUrl == "" || avatarUrl == null) {
SDKManager.getUserInfo((data) => {
ResManager.I.changeRemoteSpriteFrame(spt, data.avatarUrl)
})
} else {
ResManager.I.changeRemoteSpriteFrame(spt, avatarUrl)
}
} else {
let headPath = `head/${lvCfg.characterAvatar}`
ResManager.I.changeBundleSpriteFrame(spt.getComponent(Sprite), headPath, "Raw")
}
//对话文本
Utils.setString(itemClone.labTalk, info.talk)
//基础得分
let scoreBase = info.scoreBase || -1;
if (info.isMe || scoreBase < 0) {
itemClone.labScore.active = false;
} else {
itemClone.labScore.active = true;
Utils.setString(itemClone.labScore, `得分:${scoreBase}`)
}
//额外加分
let scoreAdditional = info.scoreAdditional || 0;
if (info.isMe || scoreAdditional <= 0) {
itemClone.labScoreAdd.active = false;
} else {
itemClone.labScoreAdd.active = true;
Utils.setString(itemClone.labScoreAdd, `加分:${scoreAdditional}`)
}
//动作
let kuangOpa:UIOpacity = itemClone.kuang.getComponent(UIOpacity)
kuangOpa.opacity = 1;
// let didx = talkCellLen-1-i;
let didx = i;
let tdelay = didx * 0.03;
let self = this;
if (i == talkCellLen-1) {
aniTime = 0.2 + tdelay;
}
tween(kuangOpa)
.delay(0.2 + tdelay)
.to(0.2, { opacity: 255 })
.call(()=>{
//滚动到当前节点处
self.talkSV.scrollToPercentVertical((talkCellLen-1-i) / talkCellLen, 0.1);
//调整框宽度
let labTf:UITransform = itemClone.labTalk.getComponent(UITransform);
let kuangTf:UITransform = itemClone.kuang.getComponent(UITransform);
kuangTf.width = labTf.width + 30;
})
.start();
}
//延迟一下,设置文本换行模式
this.scheduleOnce(()=>{
for (let i=0; i<this.itemNodeList.length; i++) {
let item = this.itemNodeList[i];
let labTf:UITransform = item.labTalk.getComponent(UITransform);
let lab:Label = item.labTalk.getComponent(Label);
if (labTf.height < 50) { //小于50,说明没换行,改为自动宽度
lab.overflow = Label.Overflow.NONE;
} else {
lab.overflow = Label.Overflow.RESIZE_HEIGHT;
}
}
}, 0.1)
//延迟一下,调整文本框的宽度。高度由layout自动调整
this.scheduleOnce(()=>{
talkLay.enabled = true;
}, 0.15)
//撤回按钮显示动画
let chehuiOpa: UIOpacity = this._nodeTab.chehuiNode.getComponent(UIOpacity);
chehuiOpa.opacity = 0;
tween(chehuiOpa)
.delay(aniTime)
.to(0.2, {opacity: 255})
.start();
//刷新撤回次数
this.refreshChehuiCount()
}
update(deltaTime: number) {
}
/**刷新撤回次数 */
refreshChehuiCount() {
let levelData = GameManager.CurLevelData
let n_cur = levelData.can_use_cancel_cnt || 0
let n_max = 3
Utils.setString(this._nodeTab.labChehui, n_cur + "/" + n_max)
}
/**撤回上一轮发言 */
doChehuiTalk() {
HttpUnit.ins.sendTalkChehui({record_id: GameManager.RecordId}, (data) => {
if (data) {
SubManager.ShowPrompt("撤回成功,已返还聊天次数")
GameManager.CurLevelData = data.level
GameManager.srouceCnt = data.level.current_cnt
GameManager.RemoveLastRoundTalkRecord()
GameManager.RemoveLastSetpScore()
GameManager.removeLastNpcTalkData()
Utils.sendInnerMsg(InnerMsgCode.Data_ChehuiUp, {})
this.onClose()
// this.refreshChehuiCount()
// let cellLen = this.itemNodeList.length
// if (cellLen > 1) {
// for (let i=cellLen-1; i>=0; i--) {
// let item: Node = this.itemNodeList[i]
// let info = this.itemDataList[i]
// item.removeFromParent()
// this.itemNodeList.splice(i, 1)
// this.itemDataList.splice(i, 1)
// if (info && info.isMe) {
// break
// }
// }
// GameManager.RemoveLastRoundTalkRecord()
// }
}
})
}
}
@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "40fb4944-bb22-4c6f-9b2a-05434f9d05ed",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "40fb4944-bb22-4c6f-9b2a-05434f9d05ed@6c48a",
"displayName": "shuqing_stage_icon",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "40fb4944-bb22-4c6f-9b2a-05434f9d05ed",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "40fb4944-bb22-4c6f-9b2a-05434f9d05ed@f9941",
"displayName": "shuqing_stage_icon",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 174,
"height": 174,
"rawWidth": 174,
"rawHeight": 174,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-87,
-87,
0,
87,
-87,
0,
-87,
87,
0,
87,
87,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
174,
174,
174,
0,
0,
174,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-87,
-87,
0
],
"maxPos": [
87,
87,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "40fb4944-bb22-4c6f-9b2a-05434f9d05ed@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "40fb4944-bb22-4c6f-9b2a-05434f9d05ed@6c48a"
}
}
@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "7d939368-180a-41fe-857c-3c59db863ed7",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "7d939368-180a-41fe-857c-3c59db863ed7@6c48a",
"displayName": "hanako_portrait",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "7d939368-180a-41fe-857c-3c59db863ed7",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "7d939368-180a-41fe-857c-3c59db863ed7@f9941",
"displayName": "hanako_portrait",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 1,
"offsetY": -12,
"trimX": 19,
"trimY": 24,
"width": 240,
"height": 340,
"rawWidth": 276,
"rawHeight": 364,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-120,
-170,
0,
120,
-170,
0,
-120,
170,
0,
120,
170,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
19,
340,
259,
340,
19,
0,
259,
0
],
"nuv": [
0.06884057971014493,
0,
0.9384057971014492,
0,
0.06884057971014493,
0.9340659340659341,
0.9384057971014492,
0.9340659340659341
],
"minPos": [
-120,
-170,
0
],
"maxPos": [
120,
170,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "7d939368-180a-41fe-857c-3c59db863ed7@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "7d939368-180a-41fe-857c-3c59db863ed7@6c48a"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 835 KiB

@@ -0,0 +1,106 @@
import { _decorator, Node, AudioClip, AudioSource, director } from "cc";
import PlayerDataManager from "./PlayerDataManager";
import ResManager from "./ResManager";
import Resource from "../Config/Resource";
const { ccclass, property } = _decorator;
//音频管理器
@ccclass('AudioManager')
export default class AudioManager {
private _audoSource: AudioSource;
private curBgId: number = -1; //当前播放中的背景乐id 用于记录
private lastBgId: number = -1; //上次播放的背景乐id 用于音乐开关切换时播放
private curBgId_confirm: number = -1; //当前播放中的背景乐id 实际播放
private static _I: AudioManager = null;
public static get I(): AudioManager {
if (!AudioManager._I) {
AudioManager._I = new AudioManager();
AudioManager._I.init();
}
return AudioManager._I;
}
private init(){
let audioMgr = new Node();
audioMgr.name = '__audioMgr__';
director.getScene().addChild(audioMgr);
director.addPersistRootNode(audioMgr);
this._audoSource = audioMgr.addComponent(AudioSource);
}
/**播放音效 */
PlayEffect(sound, volume:number=1.0) {
if (!sound) return;
if (!PlayerDataManager.I.IsSoundOn) {
return;
}
let cfgs = Resource.getConfig("Sound")
if (!cfgs[sound]) return;
let path = `Sound/${cfgs[sound].AssetName}`
console.log("PlayEffect:", sound, path)
ResManager.I.getBundleAudio(path, (res: AudioClip)=>{
this._audoSource.playOneShot(res, volume)
});
}
/**播放背景乐 */
PlayMusic(sound, loop:boolean = true, volume:number=1.0) {
if (!sound || sound == this.curBgId_confirm) return;
let cfgs = Resource.getConfig("Music")
if (!cfgs[sound]) return;
this.curBgId = sound;
this.lastBgId = sound;
if (!PlayerDataManager.I.IsMusicOn) {
return; //这个放在记录后面判断,防止开关打开时,没有记录
}
this.curBgId_confirm = sound;
let path = `Music/${cfgs[sound].AssetName}`
console.log("PlayMusic:", sound, path)
ResManager.I.getBundleAudio(path, (res: AudioClip)=>{
this._audoSource.clip = res
this._audoSource.play()
this._audoSource.volume = volume
this._audoSource.loop = loop
});
}
/**停止播放背景乐 */
StopMusic(){
this._audoSource.stop()
this.curBgId = -1
this.curBgId_confirm = -1
}
// 重新播放背景乐
ReplayMusic(){
if (this.lastBgId < 0)
return
this.PlayMusic(this.lastBgId)
}
/**暂停播放背景乐 */
PauseMusic(){
this._audoSource.pause()
}
/**继续播放背景乐 */
ResumeMusic(){
this._audoSource.play()
}
}
@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "f98da039-ce72-4ec7-a113-ff1b1b934a38",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "f98da039-ce72-4ec7-a113-ff1b1b934a38@6c48a",
"displayName": "qingye_disgust",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "f98da039-ce72-4ec7-a113-ff1b1b934a38",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "f98da039-ce72-4ec7-a113-ff1b1b934a38@f9941",
"displayName": "qingye_disgust",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -8,
"offsetY": -7,
"trimX": 14,
"trimY": 14,
"width": 881,
"height": 1175,
"rawWidth": 925,
"rawHeight": 1189,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-440.5,
-587.5,
0,
440.5,
-587.5,
0,
-440.5,
587.5,
0,
440.5,
587.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
14,
1175,
895,
1175,
14,
0,
895,
0
],
"nuv": [
0.015135135135135135,
0,
0.9675675675675676,
0,
0.015135135135135135,
0.9882253994953742,
0.9675675675675676,
0.9882253994953742
],
"minPos": [
-440.5,
-587.5,
0
],
"maxPos": [
440.5,
587.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "f98da039-ce72-4ec7-a113-ff1b1b934a38@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "f98da039-ce72-4ec7-a113-ff1b1b934a38@6c48a"
}
}
@@ -0,0 +1,361 @@
{
"__version__": "1.3.8",
"log": {
"level": 4
},
"common": {
"polyfills": {
"asyncFunctions": true
},
"buildPath": "project://build",
"outputName": "wechatgame_kuai",
"mainBundleCompressionType": "merge_dep",
"platform": "wechatgame",
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.wx.1.0.3",
"nativeCodeBundleMode": "asmjs",
"md5Cache": true,
"name": "XiangQin"
},
"BuildTaskManager": {
"taskMap": {
"1736231456475": {
"type": "build",
"id": "1736231456475",
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-3-12 11:38:09 build success in 18 s!",
"detailMessage": "// ---- build task adsense-h5g-plugin:onAfterBuild ----\r",
"options": {
"name": "XiangQin",
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.wx.1.0.3",
"platform": "wechatgame",
"buildPath": "project://build",
"debug": false,
"md5Cache": true,
"skipCompressTexture": false,
"sourceMaps": false,
"overwriteProjectSettings": {
"macroConfig": {
"cleanupImageCache": "on"
},
"includeModules": {
"physics": "inherit-project-setting",
"physics-2d": "inherit-project-setting",
"gfx-webgl2": "off"
}
},
"nativeCodeBundleMode": "asmjs",
"polyfills": {
"asyncFunctions": false
},
"experimentalEraseModules": false,
"startSceneAssetBundle": false,
"bundleConfigs": [],
"useBuiltinServer": false,
"md5CacheOptions": {
"excludes": [],
"includes": [],
"replaceOnly": [],
"handleTemplateMd5Link": true
},
"mainBundleIsRemote": false,
"mainBundleCompressionType": "merge_dep",
"useSplashScreen": true,
"bundleCommonChunk": false,
"packAutoAtlas": true,
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"outputName": "wechatgame",
"taskName": "wechatgame",
"scenes": [
{
"url": "db://assets/Scenes/MainScene.scene",
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
{
"url": "db://assets/Scenes/PreloadScene.scene",
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
}
],
"wasmCompressionMode": false,
"packages": {},
"__version__": "1.3.8",
"logDest": "project://temp/builder/log/wechatgame2025-1-7 14-30.log"
},
"time": "2025-3-12 11:37:50",
"dirty": false
},
"1736573831185": {
"type": "build",
"id": "1736573831185",
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-3-12 14:26:53 build success in 16 s!",
"detailMessage": "// ---- build task 给所有的资源加上 MD5 后缀 ----\r",
"options": {
"name": "XiangQin",
"server": "",
"platform": "web-mobile",
"buildPath": "project://build",
"debug": false,
"md5Cache": false,
"skipCompressTexture": false,
"sourceMaps": false,
"overwriteProjectSettings": {
"includeModules": {
"gfx-webgl2": "on",
"physics": "inherit-project-setting",
"physics-2d": "inherit-project-setting"
},
"macroConfig": {
"cleanupImageCache": "inherit-project-setting"
}
},
"nativeCodeBundleMode": "both",
"polyfills": {
"asyncFunctions": true
},
"experimentalEraseModules": false,
"startSceneAssetBundle": false,
"bundleConfigs": [],
"useBuiltinServer": false,
"md5CacheOptions": {
"excludes": [],
"includes": [],
"replaceOnly": [],
"handleTemplateMd5Link": true
},
"mainBundleIsRemote": false,
"mainBundleCompressionType": "merge_dep",
"useSplashScreen": true,
"bundleCommonChunk": false,
"packAutoAtlas": true,
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"outputName": "web-mobile",
"taskName": "web-mobile",
"scenes": [
{
"url": "db://assets/Scenes/MainScene.scene",
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
{
"url": "db://assets/Scenes/PreloadScene.scene",
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
}
],
"wasmCompressionMode": false,
"packages": {},
"__version__": "1.3.8",
"buildMode": "normal",
"logDest": "project://temp/builder/log/web-mobile2025-1-11 13-37.log"
},
"time": "2025-3-12 14:26:37",
"dirty": false
},
"1736821502634": {
"type": "build",
"id": "1736821502634",
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-2-7 09:01:29 build success in 13 s!",
"detailMessage": "// ---- build task cocos-service:onAfterCompressSettings ----\r",
"options": {
"name": "XiangQin",
"server": "",
"platform": "web-mobile",
"buildPath": "project://build",
"debug": false,
"md5Cache": false,
"skipCompressTexture": false,
"sourceMaps": false,
"overwriteProjectSettings": {
"includeModules": {
"gfx-webgl2": "on",
"physics": "inherit-project-setting",
"physics-2d": "inherit-project-setting"
},
"macroConfig": {
"cleanupImageCache": "inherit-project-setting"
}
},
"nativeCodeBundleMode": "both",
"polyfills": {
"asyncFunctions": true
},
"experimentalEraseModules": false,
"startSceneAssetBundle": false,
"bundleConfigs": [],
"useBuiltinServer": false,
"md5CacheOptions": {
"excludes": [],
"includes": [],
"replaceOnly": [],
"handleTemplateMd5Link": true
},
"mainBundleIsRemote": false,
"mainBundleCompressionType": "merge_dep",
"useSplashScreen": true,
"bundleCommonChunk": false,
"packAutoAtlas": true,
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"outputName": "web-mobile-console",
"taskName": "web-mobile-console",
"scenes": [
{
"url": "db://assets/Scenes/MainScene.scene",
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
{
"url": "db://assets/Scenes/PreloadScene.scene",
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
}
],
"wasmCompressionMode": false,
"packages": {},
"__version__": "1.3.8",
"buildMode": "normal",
"logDest": "project://temp/builder/log/web-mobile2025-1-14 10-25.log"
},
"time": "2025-2-7 09:01:15",
"dirty": false
},
"1736838627770": {
"type": "build",
"id": "1736838627770",
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-2-28 10:45:42 build success in 22 s!",
"detailMessage": "builder:build-project-total (22353ms)\r",
"options": {
"name": "XiangQin",
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.bd.1.0.0",
"platform": "bytedance-mini-game",
"buildPath": "project://build",
"debug": false,
"md5Cache": false,
"skipCompressTexture": false,
"sourceMaps": false,
"overwriteProjectSettings": {
"macroConfig": {
"cleanupImageCache": "inherit-project-setting"
},
"includeModules": {
"physics": "inherit-project-setting",
"physics-2d": "inherit-project-setting",
"gfx-webgl2": "off"
}
},
"nativeCodeBundleMode": "both",
"polyfills": {
"asyncFunctions": false
},
"experimentalEraseModules": false,
"startSceneAssetBundle": false,
"bundleConfigs": [],
"useBuiltinServer": false,
"md5CacheOptions": {
"excludes": [],
"includes": [],
"replaceOnly": [],
"handleTemplateMd5Link": true
},
"mainBundleIsRemote": false,
"mainBundleCompressionType": "merge_dep",
"useSplashScreen": true,
"bundleCommonChunk": false,
"packAutoAtlas": true,
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"outputName": "bytedance-mini-game",
"taskName": "bytedance-mini-game",
"scenes": [
{
"url": "db://assets/Scenes/MainScene.scene",
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
{
"url": "db://assets/Scenes/PreloadScene.scene",
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
}
],
"wasmCompressionMode": false,
"packages": {},
"__version__": "1.3.8",
"logDest": "project://temp/builder/log/bytedance-mini-game2025-1-14 15-10.log"
},
"time": "2025-2-28 10:45:19",
"dirty": false
},
"1736905523241": {
"type": "build",
"id": "1736905523241",
"progress": 1,
"state": "success",
"stage": "build",
"message": "2025-3-6 17:16:16 build success in 16 s!",
"detailMessage": "// ---- build task wechatgame:onAfterBuild ----\r",
"options": {
"name": "XiangQin",
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.ks.1.0.0",
"platform": "wechatgame",
"buildPath": "project://build",
"debug": false,
"md5Cache": true,
"skipCompressTexture": false,
"sourceMaps": false,
"overwriteProjectSettings": {
"macroConfig": {
"cleanupImageCache": "on"
},
"includeModules": {
"physics": "inherit-project-setting",
"physics-2d": "inherit-project-setting",
"gfx-webgl2": "off"
}
},
"nativeCodeBundleMode": "asmjs",
"polyfills": {
"asyncFunctions": false
},
"experimentalEraseModules": false,
"startSceneAssetBundle": false,
"bundleConfigs": [],
"useBuiltinServer": false,
"md5CacheOptions": {
"excludes": [],
"includes": [],
"replaceOnly": [],
"handleTemplateMd5Link": true
},
"mainBundleIsRemote": false,
"mainBundleCompressionType": "merge_dep",
"useSplashScreen": true,
"bundleCommonChunk": false,
"packAutoAtlas": true,
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
"outputName": "wechatgame_kuai",
"taskName": "wechatgame_kuai",
"scenes": [
{
"url": "db://assets/Scenes/MainScene.scene",
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
},
{
"url": "db://assets/Scenes/PreloadScene.scene",
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
}
],
"wasmCompressionMode": false,
"packages": {},
"__version__": "1.3.8",
"logDest": "project://temp/builder/log/wechatgame2025-1-15 09-45.log"
},
"time": "2025-3-6 17:15:59",
"dirty": false
}
}
}
}
@@ -0,0 +1,144 @@
import { _decorator, Node, Sprite, tween, UIOpacity, UITransform, Vec3, view } from 'cc';
import { GButton } from '../../Main/Common/GButton';
import Utils from '../../Main/Common/Utils';
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
import li_BaseView from '../../Main/Common/li_BaseView';
import GameManager from '../../Main/Manager/GameManager';
import ResManager from '../../Main/Manager/ResManager';
import GameRootUI from '../../Main/Common/GameRootUI';
import { ViewManager } from '../../Main/Manager/ViewManager';
import { I_LevelStepData } from '../../Main/Config/CommonConfig';
import AudioManager from '../../Main/Manager/AudioManager';
const { ccclass, property } = _decorator;
//结算界面
@ccclass('Finish_UI')
export class Finish_UI extends li_BaseView {
private _nodeTab: any = {};
private _data: I_LevelStepData = null;
private picDefScale:Vec3; //图片默认缩放
private isPicFull:boolean = false; //图片是否全屏
//----重写父类接口---------------------------------------
onLoadCT() {
this.registerListenner();
Utils.parseNode(this.node, this._nodeTab)
this.picDefScale = (this._nodeTab.cgPic as Node).scale.clone();
GameRootUI.DisableOper(1)
}
openUIDataCT(data: any): void {
this._data = data
}
registerListenner() {
// Utils.addInnerEL(InnerMsgCode.GM_UI_Close, this, this.resiveGMClose)
}
start() {
GButton.BandClick(this._nodeTab.mask, ()=>{
// this.doClose();
ViewManager.I.closeAllView();
Utils.sendInnerMsg(InnerMsgCode.UI_Talk_Back, {})
}, this, 0, null, null, false);
GButton.BandClick(this._nodeTab.cgPic, ()=>{
this.changePicScale();
}, this, 0, null, null, false);
let lvCfg = GameManager.getLevelCfg(GameManager.CurLevelId)
//星级
for (let i = 1; i <= 3; i++) {
let starSpt = this._nodeTab["star" + i].getComponent(Sprite)
let starPath = ""
if(this._data.end_star == 3) {
starPath = "lv_23"
} else if (this._data.end_star < i) {
starPath = "lv_21"
} else {
starPath = "lv_22"
}
ResManager.I.changeBundleSpriteFrame(starSpt, starPath, "Zhujiemian")
}
//成功失败
let iswin = this._data.end_star > 0
let endPath = iswin ? "lv_19" : "lv_20"
let winSpt = this._nodeTab.winSpt.getComponent(Sprite)
ResManager.I.changeBundleSpriteFrame(winSpt, endPath, "Zhujiemian")
if (iswin) {
AudioManager.I.PlayEffect(10003); //胜利音效
} else {
AudioManager.I.PlayEffect(10001); //失败音效
}
//结算显示
let picPath = "" //表情图
let talkStr = "" //对话
if (this._data.end_star == 3) {
picPath = `cg3/${lvCfg.threeStarCG}`
talkStr = lvCfg.threeStarSummary
} else if (this._data.end_star == 2) {
picPath = `cg2/${lvCfg.twoStarCG}`
talkStr = lvCfg.twoStarSummary
} else if (this._data.end_star == 1) {
picPath = `cg1/${lvCfg.oneStarCG}`
talkStr = lvCfg.oneStarSummary
} else {
picPath = `cg0/${lvCfg.failureCG}`
talkStr = lvCfg.failureSummary
}
let cgPic = this._nodeTab.cgPic.getComponent(Sprite)
ResManager.I.changeBundleSpriteFrame(cgPic, picPath, "Raw")
Utils.setString(this._nodeTab.labTalk, talkStr)
}
update(deltaTime: number) {
}
/**肖像放大缩小 */
changePicScale() {
let ttime = 0.3;
GameRootUI.DisableOper(ttime+0.1)
if (this.isPicFull) {
this.isPicFull = false;
tween((this._nodeTab.cgPic as Node))
.to(ttime, { scale: this.picDefScale }, { easing: 'quadOut' })
.start();
let hideNodeOpa:UIOpacity = this._nodeTab.hideNode.getComponent(UIOpacity)
tween(hideNodeOpa)
.delay(ttime*0.7)
.to(ttime*0.3, { opacity: 255 }, { easing: 'quadOut' })
.start();
} else {
this.isPicFull = true;
let s = 1
let windowSize = view.getVisibleSize(); // 获取窗口大小
let picTf:UITransform = this._nodeTab.cgPic.getComponent(UITransform);
if (picTf.height < windowSize.height) {
s = windowSize.height / picTf.height;
}
tween((this._nodeTab.cgPic as Node))
.to(ttime, { scale: new Vec3(s, s, s) }, { easing: 'quadOut' })
.start();
let hideNodeOpa:UIOpacity = this._nodeTab.hideNode.getComponent(UIOpacity)
tween(hideNodeOpa)
.to(ttime*0.3, { opacity: 0 }, { easing: 'quadOut' })
.start();
}
}
}
@@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "33527234-cc47-4da2-8b3b-0d20deb14282",
"files": [
".jpg",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "33527234-cc47-4da2-8b3b-0d20deb14282@6c48a",
"displayName": "mochiduki_aoi_0_cg",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "33527234-cc47-4da2-8b3b-0d20deb14282",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "33527234-cc47-4da2-8b3b-0d20deb14282@f9941",
"displayName": "mochiduki_aoi_0_cg",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 996,
"height": 1280,
"rawWidth": 996,
"rawHeight": 1280,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-498,
-640,
0,
498,
-640,
0,
-498,
640,
0,
498,
640,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
1280,
996,
1280,
0,
0,
996,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-498,
-640,
0
],
"maxPos": [
498,
640,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "33527234-cc47-4da2-8b3b-0d20deb14282@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": false,
"fixAlphaTransparencyArtifacts": false,
"redirect": "33527234-cc47-4da2-8b3b-0d20deb14282@6c48a"
}
}
@@ -0,0 +1,214 @@
import { _decorator, isValid, Node, Sprite, Toggle, tween, UIOpacity, UITransform, Vec3, view } from 'cc';
import { GButton } from '../../Main/Common/GButton';
import Utils from '../../Main/Common/Utils';
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
import li_BaseView from '../../Main/Common/li_BaseView';
import GameManager from '../../Main/Manager/GameManager';
import ResManager from '../../Main/Manager/ResManager';
import { tj_huiyi } from './tj_huiyi';
import GameRootUI from '../../Main/Common/GameRootUI';
const { ccclass, property } = _decorator;
/**宠物主界面页签类型 */
export enum TujianPageType {
None, //未知
huiyi, //心动回忆
zhencang, //私房珍藏
jilu, //相遇记录
}
//心动回忆界面
@ccclass('Tujian_UI')
export class Tujian_UI extends li_BaseView {
private _nodeTab: any = {};
private _data;
private _pageType: TujianPageType = TujianPageType.huiyi;
private tgHuiyi: Toggle = null!;//回忆
private tgZhencang: Toggle = null!;//珍藏
private tgJilu: Toggle = null!;//记录
private _btmHuiyi?: tj_huiyi;
/**缩放图片信息 */
private bigPicInfo = {
hyItem: null, //回忆item
npcPic: null, //npc图片
origScale: Vec3.ZERO, //原始缩放
}
//----重写父类接口---------------------------------------
onLoadCT() {
this.registerListenner();
Utils.parseNode(this.node, this._nodeTab)
this.tgHuiyi = this._nodeTab.tjPage1.getComponent(Toggle)
this.tgZhencang = this._nodeTab.tjPage2.getComponent(Toggle)
this.tgJilu = this._nodeTab.tjPage3.getComponent(Toggle)
}
openUIDataCT(data: any): void {
this._data = data
}
registerListenner() {
Utils.addInnerEL(InnerMsgCode.UI_Tj_huiyi_Pic, this, this.resiveHuiyiPic)
}
start() {
GButton.BandClick(this._nodeTab.mask, ()=>{
this.onClose();
}, this, 0, null, null, false);
GButton.BandClick(this._nodeTab.btnBack, ()=>{
this.onClose();
}, this);
GButton.RemoveAndBandClick(this._nodeTab.tjPage1,()=>{
this.changePageType(TujianPageType.huiyi);
},this)
GButton.RemoveAndBandClick(this._nodeTab.tjPage2,()=>{
this.changePageType(TujianPageType.zhencang);
},this)
GButton.RemoveAndBandClick(this._nodeTab.tjPage3,()=>{
this.changePageType(TujianPageType.huiyi);
},this)
//回忆
GButton.BandClick(this._nodeTab.btnBPBack, ()=>{
this.doHideBigPic();
}, this);
this._nodeTab.BigPicUI.active = false;
this.changePageType(TujianPageType.huiyi, true);
}
update(deltaTime: number) {
}
/**回忆显示大图 */
resiveHuiyiPic(data: any) {
this.doShowBigPic(data);
}
//切换页面
changePageType(type: TujianPageType, isFroce: boolean = false) {
if (this._pageType == type && !isFroce) {
return
}
//页签改变了,先隐藏所有节点
if (this._pageType != type) {
if(this._btmHuiyi) this._btmHuiyi.node.active = false;
// if(this._btmZhuangbei) this._btmZhuangbei.node.active = false;
// if(this._btmHecheng) this._btmHecheng.node.active = false;
// if(this._btmTujian) this._btmTujian.node.active = false;
}
this._pageType = type;
if (type == TujianPageType.huiyi) {//回忆
this.tgHuiyi.isChecked = true;
if (this._btmHuiyi) {
this._btmHuiyi.node.active = true;
} else {
ResManager.I.loadSubpackagePrefab("UI/StartUI/TJ_Huiyi", (res:Node)=>{
if (isValid(this._nodeTab.MidNode)) {
this._nodeTab.MidNode.addChild(res)
this._btmHuiyi = res.getComponent(tj_huiyi)
if (this._pageType == TujianPageType.huiyi) {
this._btmHuiyi.node.active = true;
} else {
this._btmHuiyi.node.active = false;
}
}
})
}
} else if (type == TujianPageType.zhencang) { //珍藏
} else if (type == TujianPageType.jilu) { //记录
}
}
/**显示大图 */
doShowBigPic(data:any) {
if (!data.hyItem) {
return
}
let npcPic:Node = data.hyItem.npcPic;
this.bigPicInfo.hyItem = data.hyItem;
this.bigPicInfo.npcPic = npcPic;
this.bigPicInfo.origScale = npcPic.scale.clone();
let wpos = new Vec3(0,0,0);
npcPic.getWorldPosition(wpos);
let BigPicRoot:Node = this._nodeTab.BigPicRoot;
let npos = BigPicRoot.getComponent(UITransform).convertToNodeSpaceAR(wpos);
npcPic.setParent(BigPicRoot);
npcPic.setPosition(npos);
let ttime = 0.3;
GameRootUI.DisableOper(ttime+0.1)
//放大图片
let s = 1
let windowSize = view.getVisibleSize(); // 获取窗口大小
let picTf:UITransform = npcPic.getComponent(UITransform);
if (picTf.height < windowSize.height) {
s = windowSize.height / picTf.height;
}
tween((npcPic))
.to(ttime, { scale: new Vec3(s, s, s), position: new Vec3(0, 0, 0) }, { easing: 'quadOut' })
.start();
//显示UI
this._nodeTab.BigPicUI.active = true;
Utils.setString(this._nodeTab.labBPTalk, data.talk);
let bigPicUIOpa:UIOpacity = this._nodeTab.BigPicUI.getComponent(UIOpacity)
bigPicUIOpa.opacity = 0;
tween(bigPicUIOpa)
.delay(ttime*0.7)
.to(ttime*0.3, { opacity: 255 }, { easing: 'quadOut' })
.start();
}
/**隐藏大图 */
doHideBigPic() {
if (!this.bigPicInfo.hyItem) return;
let npcPic = this.bigPicInfo.npcPic
let wpos = new Vec3(0,0,0);
this.bigPicInfo.hyItem.picRoot.getWorldPosition(wpos);
let npos = this._nodeTab.BigPicRoot.getComponent(UITransform).convertToNodeSpaceAR(wpos);
// npcPic.setParent(this.bigPicInfo.hyItem.picRoot);
// npcPic.setPosition(npos);
let ttime = 0.3;
GameRootUI.DisableOper(ttime+0.1)
tween((npcPic))
.to(ttime, { scale: this.bigPicInfo.origScale, position: npos }, { easing: 'quadOut' })
.call(() => {
npcPic.setParent(this.bigPicInfo.hyItem.picRoot);
npcPic.setPosition(new Vec3(0,0,0));
this.bigPicInfo.hyItem = null;
this.bigPicInfo.npcPic = null;
})
.start();
let bigPicUIOpa:UIOpacity = this._nodeTab.BigPicUI.getComponent(UIOpacity)
tween(bigPicUIOpa)
.to(ttime*0.3, { opacity: 0 }, { easing: 'quadOut' })
.call(() => {
this._nodeTab.BigPicUI.active = false;
})
.start();
}
}