Example #1
0
        // Remove the hide other forms from the qeueu of current show forms
        private void RemoveFromHideOthers(string uiName, BaseUIForm uiForm)
        {
            uiForm.Hide();
            _showFormsCach.Remove(uiName);

            // Redisplay other forms
            foreach (BaseUIForm item in _showFormsCach.Values)
            {
                item.Redisplay();
            }
            foreach (BaseUIForm item in _moduelFormsStack)
            {
                item.Redisplay();
            }
        }
Example #2
0
 // Remove the moduel ui form from the moduel stack
 private void RemoveFromModuelStack(string uiName, BaseUIForm uiForm)
 {
     // Only allowed to close the top form of the stack
     if (_moduelFormsStack.Peek() != uiForm)
     {
         return;
     }
     uiForm.Hide();
     _moduelFormsStack.Pop();
     if (_moduelFormsStack.Count > 0)
     {
         var preForm = _moduelFormsStack.Peek();
         preForm.Redisplay();
     }
 }
Example #3
0
        // Add the hide other forms into the qeueu of current show forms
        private void AddToHideOthers(string uiName, BaseUIForm uiForm)
        {
            // Hide all the other forms
            foreach (BaseUIForm item in _allFormsCach.Values)
            {
                item.Hide();
            }
            foreach (BaseUIForm item in _moduelFormsStack)
            {
                item.Hide();
            }

            // Add current form into the queue of show forms
            _showFormsCach.Add(uiName, uiForm);
            uiForm.Display();
        }
Example #4
0
        /// <summary>
        /// When a pop up form is displayed in the schene,
        /// Use this function to set UIMask properly.
        /// </summary>
        /// <param name="uIForm">The pop up ui form</param>
        public void SetMask(BaseUIForm uIForm)
        {
            // BLock all the other operations except
            // the new ui form
            _currentMaskPanel.transform.SetAsLastSibling();

            // Set the status of ui mask
            switch (uIForm.CurrentUIType.luencyType)
            {
            case UILuencyType.Luency:
                _currentMaskPanel.GetComponent <Image>().color =
                    new Color(
                        GlobalConfig.COLOR_LUENCY_RGB,
                        GlobalConfig.COLOR_LUENCY_RGB,
                        GlobalConfig.COLOR_LUENCY_RGB,
                        GlobalConfig.COLOR_LUENCY_RGB_A);
                _currentMaskPanel.SetActive(true);
                break;

            case UILuencyType.Transluency:
                _currentMaskPanel.GetComponent <Image>().color =
                    new Color(
                        GlobalConfig.COLOR_TRANS_LUENCY_RGB,
                        GlobalConfig.COLOR_TRANS_LUENCY_RGB,
                        GlobalConfig.COLOR_TRANS_LUENCY_RGB,
                        GlobalConfig.COLOR_TRANS_LUENCY_RGB_A);
                _currentMaskPanel.SetActive(true);
                break;

            case UILuencyType.ImPenetrable:
                _currentMaskPanel.GetComponent <Image>().color =
                    new Color(
                        GlobalConfig.COLOR_IMPENETRABLE_COLOR_RGB,
                        GlobalConfig.COLOR_IMPENETRABLE_COLOR_RGB,
                        GlobalConfig.COLOR_IMPENETRABLE_COLOR_RGB,
                        GlobalConfig.COLOR_IMPENETRABLE_COLOR_RGB_A);
                _currentMaskPanel.SetActive(true);
                break;

            case UILuencyType.Pentrate:
                _currentMaskPanel.SetActive(false);
                break;
            }
        }
Example #5
0
 // Remove the ui form from the queue of current shown forms
 private void RemoveFromCurrentShow(string uiName, BaseUIForm uiForm)
 {
     uiForm.Hide();
     _showFormsCach.Remove(uiName);
 }
Example #6
0
 // Add the ui form into the queue of current shown forms
 private void AddToCurrentShow(string uiName, BaseUIForm uiForm)
 {
     _showFormsCach.Add(uiName, uiForm);
     uiForm.Display();
 }