示例#1
0
        // ----------------------------------------------------------------------------------------
        public bool ShowPopup(string popupText, string popupLabel = "", PopupDialogButtonCallback onClose = null, PopupType mode = PopupType.Notification, bool closeOnFinish = true, params string[] stringArgs)
        // ----------------------------------------------------------------------------------------
        {
            PopupInfo info = new PopupInfo(popupText, popupLabel, onClose, mode, closeOnFinish, stringArgs);

            _waitingPopups.Add(info);
            if (_currentPopup == null)
            {
                ShowNextPopup();
            }

            return(true);
        }
示例#2
0
        // ----------------------------------------------------------------------------------------
        public void ClearPersistentMessage()
        // ----------------------------------------------------------------------------------------
        {
            for (int i = _waitingPopups.Count - 1; i >= 0; i--)
            {
                if (_waitingPopups[i].Mode == PopupType.PersistentMessage)
                {
                    _waitingPopups.RemoveAt(i);
                }
            }

            if (_currentPopup != null && _currentPopup.Mode == PopupType.PersistentMessage)
            {
                _interface.HidePopup(_currentPopup.CloseOnFinish);
                _currentPopup = null;
            }
        }
示例#3
0
        // -------------------------------------------------------------------
        // this closes the current popup and shows the next one
        void ShowNextPopup()
        // -------------------------------------------------------------------
        {
            if (_waitingPopups.Count == 0)  // no popups in queue, hide stuff
            {
                if (_currentPopup != null)
                {
                    bool hideOnClose = _currentPopup.CloseOnFinish;
                    _currentPopup = null;
                    _interface.HidePopup(hideOnClose);
                }
            }
            else
            {
                _currentPopup = _waitingPopups[0];
                _waitingPopups.RemoveAt(0);
                _popupStartTime = Time.time;

                _interface.ShowPopup(_currentPopup);
            }
        }