Files
oops-plugin-framework/assets/core/gui/layer/Defines.ts
dgflash e643839488 1、修复PopUp多窗口打开时,关闭一个导致PopUp层事件阻挡消失问题
2、修复Dialog窗口连续弹出时,且带关闭动画情况下,有几率后续窗口关闭不了的问题
3、扩展GUI框架可配置是否触摸非窗口区域关闭
4、扩展GUI框架可配置是否打开窗口后显示背景遮罩
5、扩展GUI框架可配置是否缓存打开的界面,使下次打开立即显示
6、重构GUI框架,代码更简洁,源API使用体验不变
2024-03-16 13:15:55 +08:00

57 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* @Author: dgflash
* @Date: 2021-11-18 11:21:32
* @LastEditors: dgflash
* @LastEditTime: 2023-01-09 11:52:38
*/
import { Node } from "cc";
import { UIConfig } from "./LayerManager";
/*** 界面回调参数对象定义 */
export interface UICallbacks {
/**
* 节点添加到层级以后的回调
* @param node 当前界面节点
* @param params 外部传递参数
*/
onAdded?: (node: Node, params: any) => void,
/**
* 窗口节点 destroy 之后回调
* @param node 当前界面节点
* @param params 外部传递参数
*/
onRemoved?: (node: Node | null, params: any) => void,
/**
* 如果指定onBeforeRemoved则next必须调用否则节点不会被正常删除。
*
* 比如希望节点做一个FadeOut然后删除则可以在`onBeforeRemoved`当中播放action动画动画结束后调用next
* @param node 当前界面节点
* @param next 回调方法
*/
onBeforeRemove?: (node: Node, next: Function) => void
}
/** 本类型仅供gui模块内部使用请勿在功能逻辑中使用 */
export class ViewParams {
/** 界面配置 */
config: UIConfig = null!;
/** 传递给打开界面的参数 */
params: any = null!;
/** 窗口事件 */
callbacks: UICallbacks = null!;
/** 是否在使用状态 */
valid: boolean = true;
/** 界面根节点 */
node: Node = null!;
}
/** 弹框层回调对象定义(废弃) */
export interface PopViewParams extends UICallbacks {
/** 是否触摸背景关闭弹窗 */
touchClose?: boolean,
/** 控制暗色背景的透明度 默认为190*/
opacity?: number;
}