2025-07-17 17:18:21 +08:00
|
|
|
import { _decorator, Node } from "cc";
|
|
|
|
|
import ResManager from "../Main/Manager/ResManager";
|
|
|
|
|
import GameRootUI from "../Main/Common/GameRootUI";
|
|
|
|
|
import { CommonConfig } from "../Main/Config/CommonConfig";
|
|
|
|
|
import { promptItem } from "./Item/promptItem";
|
|
|
|
|
import { ConfirmDialog } from "./Item/ConfirmDialog";
|
|
|
|
|
import { CommAdDialog } from "./Item/CommAdDialog";
|
|
|
|
|
import Utils from "../Main/Common/Utils";
|
|
|
|
|
import { InnerMsgCode } from "../Main/Config/InnerMsgCode";
|
2025-09-21 14:28:17 +08:00
|
|
|
import { TipsPanel } from "../chat18x/ui/panels/TipsPanel";
|
2025-09-21 20:36:19 +08:00
|
|
|
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
2025-07-17 17:18:21 +08:00
|
|
|
|
|
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
|
|
|
|
//项目管理器
|
2025-09-21 14:28:17 +08:00
|
|
|
@ccclass("SubManager")
|
2025-07-17 17:18:21 +08:00
|
|
|
export default class SubManager {
|
2025-09-21 14:28:17 +08:00
|
|
|
private static _I: SubManager = null;
|
|
|
|
|
public static get I(): SubManager {
|
|
|
|
|
if (!SubManager._I) {
|
|
|
|
|
SubManager._I = new SubManager();
|
|
|
|
|
SubManager._I.init();
|
2025-07-17 17:18:21 +08:00
|
|
|
}
|
2025-09-21 14:28:17 +08:00
|
|
|
return SubManager._I;
|
|
|
|
|
}
|
2025-07-17 17:18:21 +08:00
|
|
|
|
2025-09-21 14:28:17 +08:00
|
|
|
private init() {}
|
|
|
|
|
|
|
|
|
|
//飘字提示----------------------------------------------------------------------------
|
|
|
|
|
public static ShowPrompt(text: string) {
|
|
|
|
|
TipsPanel.show(text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//显示确定框----------------------------------------------------------------------------
|
|
|
|
|
/**通用确认框 { content: string, strYes?: string, strNo?: string, yesCallback?: Function, noCallback?: Function, closeCallback?: Function } */
|
|
|
|
|
public static ShowConfirm(param: any) {
|
|
|
|
|
if (!GameRootUI.I) {
|
2025-09-21 20:36:19 +08:00
|
|
|
logger.warn("GameRootUI还未初始化", param);
|
2025-09-21 14:28:17 +08:00
|
|
|
return;
|
2025-07-17 17:18:21 +08:00
|
|
|
}
|
2025-09-21 14:28:17 +08:00
|
|
|
ResManager.I.loadSubpackagePrefab("item/ConfirmDialog", (n_node: Node) => {
|
|
|
|
|
GameRootUI.I.AddUIToLayer(n_node, CommonConfig.UILayerGroup.Layer_tips);
|
|
|
|
|
let pItem = n_node.getComponent(ConfirmDialog);
|
|
|
|
|
pItem.setParam(param);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//显示通用广告框----------------------------------------------------------------------------
|
|
|
|
|
/**通用广告框 { content: string, strAd?: string, strLeft?: string, adCallback?: Function, leftCallback?: Function, closeCallback?: Function } */
|
|
|
|
|
public static ShowCommonAdDialog(param: any) {
|
|
|
|
|
if (!GameRootUI.I) {
|
2025-09-21 20:36:19 +08:00
|
|
|
logger.warn("GameRootUI还未初始化", param);
|
2025-09-21 14:28:17 +08:00
|
|
|
return;
|
2025-07-17 17:18:21 +08:00
|
|
|
}
|
2025-09-21 14:28:17 +08:00
|
|
|
ResManager.I.loadSubpackagePrefab("item/CommAdDialog", (n_node: Node) => {
|
|
|
|
|
GameRootUI.I.AddUIToLayer(n_node, CommonConfig.UILayerGroup.Layer_tips);
|
|
|
|
|
let pItem = n_node.getComponent(CommAdDialog);
|
|
|
|
|
pItem.setParam(param);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|