适配fix

This commit is contained in:
2025-10-13 17:40:11 +08:00
parent 104e7f566c
commit 0f6a9fcc47
3 changed files with 41 additions and 35 deletions
+3
View File
@@ -4,6 +4,7 @@ import { ConfigManager } from "../manager/ConfigManager";
import { DataId, DataManager } from "./DataManager"; import { DataId, DataManager } from "./DataManager";
import { GirlData } from "./GirlData"; import { GirlData } from "./GirlData";
import { logger } from "db://assets/Scripts/Main/Common/Logger"; import { logger } from "db://assets/Scripts/Main/Common/Logger";
import { WalletData } from "./WalletData";
/** /**
* 单个角色的聊天数据结构 * 单个角色的聊天数据结构
@@ -523,6 +524,8 @@ export class ChatModel {
* @returns 是否可以继续聊天 * @returns 是否可以继续聊天
*/ */
public canChat(roleId?: number): boolean { public canChat(roleId?: number): boolean {
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
if (walletData.isVip) return true;
//return false; //return false;
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl); const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
const roleData = this.rolesData.get(this.currentGirlId); const roleData = this.rolesData.get(this.currentGirlId);
@@ -137,17 +137,20 @@ export class DialogBubble extends Component {
//const bgHeight = actualHeight + 17; //const bgHeight = actualHeight + 17;
this.bg.setContentSize(new Size(actualSize.x + 40, actualSize.y + 30)); this.bg.setContentSize(new Size(actualSize.x + 40, actualSize.y + 30));
this.uiTransform.setContentSize( this.uiTransform.setContentSize(
new Size(actualSize.x + 40, actualSize.y + 30) new Size(
actualSize.x + 40,
actualSize.y + 30 > 110 ? actualSize.y + 30 : 110
)
); );
// 回调通知实际高度 // 回调通知实际高度
if (callback) { if (callback) {
callback(actualSize.y); callback(actualSize.y > 110 ? actualSize.y : 110);
} }
}, 0); }, 0);
// 返回预估的背景高度(用于同步计算) // 返回预估的背景高度(用于同步计算)
const estimatedHeight = Math.max(lines.length * 35 + 20, 60); // 最小高度60 const estimatedHeight = Math.max(lines.length * 35 + 20, 110); // 最小高度60
return estimatedHeight; return estimatedHeight;
} }
+32 -32
View File
@@ -25,10 +25,10 @@
"__id__": 305 "__id__": 305
}, },
{ {
"__id__": 70 "__id__": 110
}, },
{ {
"__id__": 110 "__id__": 70
}, },
{ {
"__id__": 391 "__id__": 391
@@ -1762,8 +1762,8 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -215, "x": -81.42899999999997,
"y": -43.837999999999965, "y": -303.626,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -1879,7 +1879,7 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -315.97230713246, "x": -301.17230713246,
"y": 34.515499999999975, "y": 34.515499999999975,
"z": 0 "z": 0
}, },
@@ -2129,7 +2129,7 @@
}, },
"_alignFlags": 9, "_alignFlags": 9,
"_target": null, "_target": null,
"_left": -112.3, "_left": -97.5,
"_right": 0, "_right": 0,
"_top": 0, "_top": 0,
"_bottom": 0, "_bottom": 0,
@@ -2523,8 +2523,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 182.20000000000005, "width": 197.26300000000003,
"height": 82.5 "height": 110
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -2551,8 +2551,8 @@
}, },
"_alignFlags": 40, "_alignFlags": 40,
"_target": null, "_target": null,
"_left": 160, "_left": 293.571,
"_right": 407.79999999999995, "_right": 259.16599999999994,
"_top": 0, "_top": 0,
"_bottom": 0, "_bottom": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
@@ -2652,8 +2652,8 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 215, "x": 69.286,
"y": 402.971, "y": -33.625999999999976,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -2713,7 +2713,7 @@
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -267.2, "x": -267.2,
"y": 88.268, "y": 21.732,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -2772,8 +2772,8 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 329.5, "x": 321.306,
"y": 43.268, "y": 37.968,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -3045,8 +3045,8 @@
"_alignFlags": 33, "_alignFlags": 33,
"_target": null, "_target": null,
"_left": -112.3, "_left": -112.3,
"_right": -107.3, "_right": -99.10599999999998,
"_top": 0, "_top": 5.3,
"_bottom": 0, "_bottom": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
@@ -3105,8 +3105,8 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 331.08299999999997, "x": 322.889,
"y": 48.168000000000006, "y": 41.968,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -3183,7 +3183,7 @@
"a": 255 "a": 255
}, },
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "34df2326-52d3-4164-9be7-4d2cd33563a3@f9941", "__uuid__": "55cf8250-a826-49ec-98bf-3ec397ac9481@f9941",
"__expectedType__": "cc.SpriteFrame" "__expectedType__": "cc.SpriteFrame"
}, },
"_type": 0, "_type": 0,
@@ -3220,8 +3220,8 @@
"_alignFlags": 33, "_alignFlags": 33,
"_target": null, "_target": null,
"_left": -112.3, "_left": -112.3,
"_right": -118.883, "_right": -110.68900000000004,
"_top": -14.9, "_top": -8.7,
"_bottom": 0, "_bottom": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
@@ -3294,7 +3294,7 @@
"__prefab": { "__prefab": {
"__id__": 139 "__id__": 139
}, },
"_alignFlags": 36, "_alignFlags": 33,
"_target": null, "_target": null,
"_left": 0, "_left": 0,
"_right": 0, "_right": 0,
@@ -3309,7 +3309,7 @@
"_isAbsHorizontalCenter": true, "_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 500, "_originalWidth": 500,
"_originalHeight": 153.8, "_originalHeight": 176.536,
"_alignMode": 1, "_alignMode": 1,
"_lockFlags": 45, "_lockFlags": 45,
"_id": "" "_id": ""
@@ -3402,8 +3402,8 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": -37, "x": -28.8,
"y": 89.169, "y": 25.23100000000001,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -3540,11 +3540,11 @@
"__prefab": { "__prefab": {
"__id__": 149 "__id__": 149
}, },
"_alignFlags": 36, "_alignFlags": 33,
"_target": null, "_target": null,
"_left": 20, "_left": 20,
"_right": 37, "_right": 28.8,
"_top": 10, "_top": 15.6,
"_bottom": 20, "_bottom": 20,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
@@ -3555,7 +3555,7 @@
"_isAbsHorizontalCenter": true, "_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true, "_isAbsVerticalCenter": true,
"_originalWidth": 0, "_originalWidth": 0,
"_originalHeight": 0, "_originalHeight": 138.338,
"_alignMode": 1, "_alignMode": 1,
"_lockFlags": 45, "_lockFlags": 45,
"_id": "" "_id": ""
@@ -3592,7 +3592,7 @@
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 100,
"height": 100 "height": 110
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -3620,7 +3620,7 @@
"_alignFlags": 32, "_alignFlags": 32,
"_target": null, "_target": null,
"_left": 0, "_left": 0,
"_right": 160, "_right": 305.714,
"_top": 0, "_top": 0,
"_bottom": 0, "_bottom": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,