| | |
| | | // 弹窗队列,存储待处理的弹窗请求 |
| | | List<PopupWindow> popupWindowQueue = new List<PopupWindow>(); |
| | | |
| | | // 跳脸类窗口白名单:这类窗口每天/每事件只应弹一次,按窗口名去重; |
| | | // 结算类窗口(同名承载不同战斗数据、可连续多场)不在此列,不做去重。 |
| | | private static readonly HashSet<string> DeduplicateWindowNames = new HashSet<string> |
| | | { |
| | | "FirstChargeWin", |
| | | "FestivalActivityPopWin", |
| | | "HeroDebutPopWin", |
| | | "HeroReturnPopWin", |
| | | "SignWin", |
| | | "GoodReviewWin", |
| | | }; |
| | | |
| | | // 当前正在显示的弹窗 |
| | | PopupWindow currentWindow; |
| | | |
| | |
| | | functionId = functionId, |
| | | }; |
| | | |
| | | if (popupWindowQueue.Contains(popupWindow)) |
| | | // 仅对跳脸类窗口按名去重;结算类窗口同名承载不同战斗,保留重复入队 |
| | | if (DeduplicateWindowNames.Contains(name)) |
| | | { |
| | | popupWindowQueue.Remove(popupWindow); |
| | | for (int i = popupWindowQueue.Count - 1; i >= 0; i--) |
| | | { |
| | | if (popupWindowQueue[i].window == name) |
| | | { |
| | | popupWindowQueue.RemoveAt(i); |
| | | } |
| | | } |
| | | } |
| | | |
| | | popupWindowQueue.Add(popupWindow); |