示例#1
0
	private void AddPopupToQueue(FMPopup popup, FMPopupManager.FMPopupPriority priority)
	{
		FMPopupManager.FMPPopupQueueItem item = new FMPopupManager.FMPPopupQueueItem(popup, priority);
		if (this.queuedList.Count == 0)
		{
			this.queuedList.Add(item);
		}
		else
		{
			int num = this.queuedList.Count;
			for (int i = this.queuedList.Count - 1; i >= 0; i--)
			{
				if (item.priority < this.queuedList[i].priority)
				{
					num = i;
				}
				else if (this.queuedList[i].priority == item.priority)
				{
					break;
				}
			}
			if (num >= this.queuedList.Count)
			{
				this.queuedList.Add(item);
			}
			else
			{
				this.queuedList.Insert(num, item);
			}
		}
	}
示例#2
0
	protected void CloseActivePopup(bool openQueued = true)
	{
		if (this.ActivePopup != null)
		{
			this.ActivePopup.Close();
			this.ActivePopup = null;
		}
		if (openQueued && this.queuedList.Count > 0)
		{
			this.ActivePopup = this.GetFirstQueuedPopup();
			this.ActivePopup.Open();
		}
	}
示例#3
0
	protected void Open(FMPopup popup, FMPopupManager.FMPopupPriority priority = FMPopupManager.FMPopupPriority.Normal)
	{
		if (this.ActivePopup == null)
		{
			this.ActivePopup = popup;
			this.ActivePopup.Open();
		}
		else
		{
			this.AddPopupToQueue(popup, priority);
			if (priority == FMPopupManager.FMPopupPriority.ForceOpen)
			{
				this.CloseActivePopup(true);
			}
		}
	}
示例#4
0
		public FMPPopupQueueItem(FMPopup popup, FMPopupManager.FMPopupPriority priority)
		{
			this.popup = popup;
			this.priority = priority;
		}
示例#5
0
	private FMPopup GetFirstQueuedPopup()
	{
		FMPopup popup = this.queuedList[0].popup;
		this.queuedList.RemoveAt(0);
		return popup;
	}