Beispiel #1
0
    public void ShowPopUp(PopUpType type, Vector3 position, Quaternion rotation)
    {
        Poolable poolable;

        switch (type)
        {
        case PopUpType.Perfect:
            poolable = PoolManager.instance.GetPoolable(perfect);
            break;

        case PopUpType.Great:
            poolable = PoolManager.instance.GetPoolable(great);
            break;

        case PopUpType.Miss:
            poolable = PoolManager.instance.GetPoolable(miss);
            break;

        default:
            poolable = PoolManager.instance.GetPoolable(miss);
            break;
        }
        poolable.transform.position = position;
        poolable.transform.rotation = rotation;
        poolable.gameObject.SetActive(true);
        poolable.GetComponent <PopUp>().Show();
    }
Beispiel #2
0
        private void OpenPopUp(PopUpType type)
        {
            NotificationParam popUpStore = new NotificationParam(Mode.intData);

            popUpStore.intData["popUpType"] = (int)type;
            App.Notify(Notification.ShowPopup, popUpStore);
        }
Beispiel #3
0
    public GameObject AddPopup(string windowTitle, string description, PopUpType type)
    {
        GameObject objectType = null;
        string     name       = "";

        switch (type)
        {
        case PopUpType.ALERT:
            objectType = alertPopUp; name = "alert"; break;

        case PopUpType.INFO:
            objectType = infoPopUp; name = "info"; break;

        case PopUpType.SYS32:
            objectType = sys32Popup; name = "sys32"; break;

        case PopUpType.BIGERROR:
            objectType = bigErrorPopUp; name = "bigerror"; break;

        default:
            return(null);
        }
        GameObject go = InstanciateWindow(objectType, name);

        go.GetComponent <PopupController> ().setTitle(windowTitle).setDescription(description);
        return(go);
    }
Beispiel #4
0
    public void PopUp(PopUpType popUpType)
    {
        type = popUpType;
        GetComponent<UIWidget>().alpha = 1;
        label.text = type.ToString();
        ButtonLabel.text = "OK";

        switch (type)
        {
            case PopUpType.LOBBY_READY:
                Button.isEnabled = true;
                break;

            case PopUpType.MATCH_READY:
                
                break;

            case PopUpType.MATCH_LOADING:
                ButtonLabel.text = "Cancel";
                break;

            case PopUpType.LOBBY_LOADING:
                Button.isEnabled = false;
                break;

            case PopUpType.MATCH_END:
                UserScript user = GameObject.FindGameObjectWithTag("Network").GetComponent<UserScript>();
                label.text = user.MyMatchResult.ToString();
                user.MyMatchResult = MatchResult.NONE;
                Button.isEnabled = false;
                ButtonLabel.text = "Wait";
                break;
        }
    }
    public void SpawnPopUp(Vector3 position, PopUpType type)
    {
        switch (type)
        {
        case PopUpType.Health:
            Instantiate(defensePopUp, position, Quaternion.identity);
            break;

        case PopUpType.Damage:
            Instantiate(attackPopUp, position, Quaternion.identity);
            break;

        case PopUpType.OnePoint:
            Instantiate(onePointPopUp, position, Quaternion.identity);
            break;

        case PopUpType.FivePoints:
            Instantiate(fivePointsPopUp, position, Quaternion.identity);
            break;

        default:
            break;
        }
        popUpSound.Play();
    }
        public PopUpWindow(string title, PopUpType popUpType)
        {
            InitializeComponent();

            this.popUpType    = popUpType;
            TitleTextBox.Text = title;
        }
Beispiel #7
0
        private void OpenPopUp(PopUpType type)
        {
            NotificationParam popUpStore = new NotificationParam(Mode.intData);

            popUpStore.intData.Add((int)type);
            App.GetNotificationCenter().Notify(Notification.OpenPopUp, popUpStore);
        }
Beispiel #8
0
        private IEnumerator typeText(PopUpType type, string fullText, float displayTime)
        {
            lifeTimeLeft = displayTime;

            if (fullText == currentFullText)
            {
                yield break;
            }

            ChangeFontOnType(type);

            currentFullText = fullText;

            string typingText = "";

            EndCurrentFades();

            Sequence showText = DOTween.Sequence();

            showText.Append(DOTween.ToAlpha(() => popUpTextObject.color, x => popUpTextObject.color = x, 1, 0));

            foreach (char letter in fullText.ToCharArray())
            {
                if (currentFullText != fullText)
                {
                    yield break;
                }
                typingText += letter;
                popUpTextObject.SetText(typingText);
                yield return(new WaitForSeconds(textDelay));

                lifeTimeLeft = displayTime;
            }
        }
 /// <summary>
 /// Pops up.
 /// </summary>
 /// <param name="text">Text.</param>
 /// <param name="type">Type.</param>
 /// <param name="finished">Finished.</param>
 public virtual void PopUp(string text, PopUpType type, PopUpController.FinishedDelegate finished = null)
 {
     PopUp(popUpSceneName, new PopUpData(text, type), delegate(SSceneController ctrl) {
         PopUpController popUp  = (PopUpController)ctrl;
         popUp.finishedDelegate = finished;
     });
 }
Beispiel #10
0
    /// <summary>
    /// Create popup entry.
    /// Returns instance.
    /// If fadeTime <= zero, then popup entry doesn't fade away.
    /// </summary>
    /// <returns>The pop up entry.</returns>
    /// <param name="txt">Text.</param>
    /// <param name="pos">Position.</param>
    /// <param name="type">Type.</param>
    /// <param name="fadeTime">Fade time.</param>
    public GameObject CreatePopUpEntry(string txt, Vector2 pos, PopUpType type, float fadeTime = 1f, TextAnchor alignment = TextAnchor.MiddleCenter)
    {
        GameObject obj    = (GameObject)Instantiate(popUptextPrefab);
        Text       txtobj = obj.GetComponent <Text>();

        // set the text.
        txtobj.text = txt;

        // set the alignment.
        txtobj.alignment = alignment;

        // calculate offset.
        Vector2 offset = new Vector2(Random.Range(-0.5f, 0.5f), 0.4f);

        // set the position.
        obj.transform.position = new Vector3(pos.x + offset.x, pos.y + offset.y, GameMaster.instance.worldGuiZLevel);

        // set the color.
        switch (type)
        {
        case PopUpType.Damage:
            txtobj.color = new Color32(155, 28, 17, 255);             // red
            break;

        case PopUpType.Crit:
            txtobj.color = new Color32(207, 209, 26, 255);             // yellow
            break;

        case PopUpType.Miss:
            txtobj.color = new Color32(194, 225, 194, 255);             // gray/green
            break;

        case PopUpType.Other:
            txtobj.color = new Color32(193, 193, 193, 255);             // gray
            break;

        case PopUpType.Heal:
            txtobj.color = new Color32(24, 221, 60, 255);             // green
            break;

        case PopUpType.Gold:
            txtobj.color = new Color32(254, 198, 1, 255);             // yellow
            break;

        case PopUpType.LevelUp:
            txtobj.color = new Color32(254, 198, 1, 255);             // yellow
            break;
        }

        // start fade effect if fadetime is greater than zero.
        if (fadeTime > 0f)
        {
            obj.GetComponent <PopUpText>().StartFadeUp(fadeTime);
        }

        // lastly return the object.
        return(obj);
    }
        public void ShowPopUp(string a_Message, PopUpType a_type)
        {
            SliderData newData = new SliderData();

            newData.Message      = a_Message;
            newData.PopUpSetting = a_type;

            runtimeList.Add(newData);
        }
Beispiel #12
0
 private void OnPopUpButtonPressed(PopUpType popUpType, PopUpButtonActions popUpButtonActions)
 {
     switch (popUpButtonActions)
     {
     case PopUpButtonActions.ClosePopUp:
         HidePopup(popUpType);
         break;
     }
 }
Beispiel #13
0
        private void ShowPopUp(PopUpType popUpType)
        {
            normalControl.IsEnabled = false;
            this.Opacity = .3;
            popupControl.IsEnabled = true;
            logincontrol1.IsOpen = true;
            pop.Width = Window.Current.Bounds.Width;

            UpdatePopupBoxContent(popUpType);
        }
Beispiel #14
0
 public void ShowPopUp(PopUpType type)
 {
     gameObject.SetActive(true);
     anim.SetTrigger("Start");
     for (int i = 0; i < popUpType.Length; i++)
     {
         popUpType [i].SetActive(false);
     }
     popUpType [(int)type].SetActive(true);
 }
Beispiel #15
0
        public void SetArrayList(ArrayList ar)
        {
            _ar = ar;

            _pt = PopUpType.ARRAYLIST;

            foreach (object obj in _ar)
            {
                searchlistbox.Items.Add(obj.ToString());
            }
        }
Beispiel #16
0
 public IPopUpView GetCorrectPopUp(PopUpType type)
 {
     for (int i = 0; i < popUpViews.Count; i++)
     {
         if (popUpViews[i].Type == type)
         {
             return(popUpViews[i]);
         }
     }
     return(null);
 }
        public PopUpWindow(String popupTitle, String popupText, PopUpType type = PopUpType.Default)
        {
            InitializeComponent();

            MessageTitle.Text = popupTitle;
            MessageText.Text  = popupText;

            if (type == PopUpType.Default)
            {
                CancelButtonBorder.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #18
0
        public override void OnSet(object data)
        {
            base.OnSet(data);

            PopUpData popupData = (PopUpData)data;

            SetText(text, popupData.Title);
            type = popupData.Type;

            buttonYes.SetActive(type == PopUpType.YesAndNo);
            buttonNo.SetActive(type == PopUpType.YesAndNo);
            buttonOk.SetActive(type == PopUpType.Ok);
        }
        public void InitAddEntry(List <string> langKeys)
        {
            _currentType    = PopUpType.Add;
            originalEntries = new List <LocalizationEntry>();

            for (int i = 0; i < langKeys.Count; i++)
            {
                originalEntries.Add(new LocalizationEntry(langKeys[i], "newKey", ""));
            }
            entries = new List <LocalizationEntry>(originalEntries);

            Init();
        }
 protected override void HandleData(object obj)
 {
     base.HandleData(obj);
     if (obj is string)
     {
         OnMessageRecevie("温馨提示", (string)obj);
     }
     else if (obj is string[])
     {
         var strs = (string[])obj;
         if (strs.Length > 1)
         {
             var title = strs[0];
             var info  = strs[1];
             OnMessageRecevie(title, info);
         }
         else if (strs.Length > 0)
         {
             var title = "温馨提示";
             var info  = strs[0];
             OnMessageRecevie(title, info);
         }
     }
     else if (obj is Hashtable)
     {
         var dic = obj as Hashtable;
         if (dic["popInfo"] != null)
         {
             PopUpType type = (PopUpType)dic["popInfo"];
             donthide = dic["closeAble"] != null ? (bool)dic["closeAble"] : false;
             var data = popUpObj.GetPopData(type);
             if (data != null)
             {
                 var title = data.title;
                 var info  = data.info;
                 OnMessageRecevie(title, info);
             }
             else
             {
                 Debug.Log("Empty::" + type);
             }
         }
         else
         {
             var title = dic["title"] != null ? (string)dic["title"] : "温馨提示";
             var info  = dic["info"] != null ? dic["info"] as string : "";
             donthide = dic["closeAble"] != null ? (bool)dic["closeAble"] : false;
             OnMessageRecevie(title, info);
         }
     }
 }
        public void InitEditEntry(IEnumerable <LocalizationEntry> targetEntries)
        {
            _currentType    = PopUpType.Edit;
            originalEntries = new List <LocalizationEntry>();
            entries         = new List <LocalizationEntry>();

            foreach (var e in targetEntries)
            {
                originalEntries.Add(new LocalizationEntry(e));
                entries.Add(new LocalizationEntry(e));
            }

            Init();
        }
Beispiel #22
0
        private GameObject GetCorrectPopUp(PopUpType type)
        {
            GameObject popUp = null;

            for (int i = 0; i < popUps.Length; i++)
            {
                if (popUps[i].type == type)
                {
                    popUp = popUps[i].popUp;
                    break;
                }
            }

            return(popUp);
        }
Beispiel #23
0
        private void ShowPopUp(PopUpType type)
        {
            IPopUpView popUpView = GetCorrectPopUp(type);

            if (popUpView != null)
            {
                BringForth(popUpView.popUpTransform);
                popUpView.ShowPopUp();

                if (!App.GetData <PopUpData>().openPopUpsList.Contains(type))
                {
                    App.GetData <PopUpData>().openPopUpsList.Add(type);
                }
            }
        }
Beispiel #24
0
        public void ShowText(PopUpType type, string fullText, float displayTime)
        {
            EndCurrentFades();

            Sequence showText = DOTween.Sequence();

            showText.Append(DOTween.ToAlpha(() => popUpTextObject.color, x => popUpTextObject.color = x, 1, 0));

            currentFullText = fullText;

            ChangeFontOnType(type);

            popUpTextObject.SetText(fullText);

            lifeTimeLeft = displayTime;
        }
Beispiel #25
0
        public void SetDataTable(DataTable dt, int[] a, int [] b)
        {
            _dt     = dt;
            _fields = (int[])a;
            this._fields_to_return = (int[])b;
            _pt = PopUpType.DATATABLE;

            foreach (DataRow dr in _dt.Rows)
            {
                String prompt = "";
                foreach (int s in a)
                {
                    prompt += dr[s] + " ";
                }
                searchlistbox.Items.Add(prompt);
            }
        }
Beispiel #26
0
    public PopUpModel(PopUpType _type, string _title, string _description, System.Action <PopUpReturnModel> action, Sprite _icon = null, Color _color = new Color(), bool _showHud = true)
    {
        type           = _type;
        title          = _title;
        description    = _description;
        delegateAction = action;
        showHud        = _showHud;
        icon           = _icon;

        if (_color.a == 0)
        {
            color = Color.white;
        }
        else
        {
            color = _color;
        }
    }
Beispiel #27
0
 public void CreateNumericlPopUp(PopUpType pt, int value, Transform spawnPoint)
 {
     popUpType = pt;
     if (popUpType == PopUpType.damage)
     {
         popUpPrefab = Instantiate(damagePopUp);
         popUpPrefab.transform.GetChild(1).GetComponent <Text>().text = "+";
     }
     else if (popUpType == PopUpType.production)
     {
         popUpPrefab = Instantiate(productionPopUp);
         popUpPrefab.transform.GetChild(1).GetComponent <Text>().text = "+";
     }
     popUpPrefab.transform.GetChild(1).GetComponent <Text>().text += value.ToString();
     popUpPrefab.transform.position = spawnPoint.position;
     popUpPrefab.transform.LookAt(Camera.main.transform);
     popUpPrefab.GetComponent <CanvasGroup>().DOFade(0, 0);
     StartCoroutine(BasicAnimation(popUpPrefab));
 }
Beispiel #28
0
        private void ChangeFontOnType(PopUpType type)
        {
            if (type == PopUpType.Alert)
            {
                popUpTextObject.fontStyle = FontStyles.Bold;
                popUpTextObject.faceColor = Color.magenta;
            }

            if (type == PopUpType.Enemy)
            {
                popUpTextObject.fontStyle = FontStyles.Normal;
                popUpTextObject.color     = Color.red;
            }

            if (type == PopUpType.PlayerDialogue)
            {
                popUpTextObject.fontStyle = FontStyles.Normal;
                popUpTextObject.color     = Color.white;
            }
        }
        private void OpenPopup_Click(object sender, RoutedEventArgs e)
        {
            if (sender as Button == null || !Enum.TryParse((sender as Button).Name, out PopUpType type))
            {
                return;
            }

            OverlayWindow.Visibility = Visibility.Visible;

            if (type == PopUpType.DrawingExplanation)
            {
                DrawingExplanationPanel.Visibility = Visibility.Visible;
                selectedPopUpType = PopUpType.DrawingExplanation;
            }
            else
            {
                AlgorithmExplanationPanel.Visibility = Visibility.Visible;
                selectedPopUpType = PopUpType.AlgorithmExplanation;
            }
        }
Beispiel #30
0
        private void HidePopup(PopUpType type, bool hideSilently = false)
        {
            IPopUpView popUpView = GetCorrectPopUp(type);

            if (popUpView != null)
            {
                if (hideSilently)
                {
                    popUpView.HidePopUpSilently();
                }
                else
                {
                    popUpView.HidePopUp();
                }

                if (App.GetData <PopUpData>().openPopUpsList.Contains(type))
                {
                    App.GetData <PopUpData>().openPopUpsList.Remove(type);
                }
            }
        }
Beispiel #31
0
 public EnterValueForm(string title, PopUpType popUpType)
 {
     InitializeComponent();
     Location = Cursor.Position;
     if (popUpType == PopUpType.Input)
     {
         label1.Visible   = true;
         textBox1.Visible = true;
         label1.Text      = title;
         this.Size        = new Size(label1.Size.Width + textBox1.Size.Width + 50, 110);
     }
     else if (popUpType == PopUpType.Checkbox)
     {
         checkBox1.Visible = true;
         checkBox1.Text    = title;
     }
     else if (popUpType == PopUpType.Text)
     {
         label1.Visible = true;
         label1.Text    = title;
     }
 }
Beispiel #32
0
 public void TransitionTo(PopUpType popUpType, GameTime gameTime)
 {
     Shorewood.popUpManager.CloseDialog(gameTime);
     transitionToPop = popUpType;
 }
 public PopUpData(string title, PopUpType type)
 {
     Title = title;
     Type = type;
 }
Beispiel #34
0
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            if (activePopUp != PopUpType.None)
            {
                if (popUps[activePopUp].IsActive)
                {
                    popUps[activePopUp].Update(gameTime);
                    UpdateRotationMatrix(ref popUps[activePopUp].center, popUps[activePopUp].currentScale * 2 * (float)MathHelper.Pi);
                    if (popUps[activePopUp].IsActive)
                    {
                        base.Update(gameTime);
                        return;
                    }
                }
            }

            Visible = false;
            Enabled = false;
            activePopUp = PopUpType.None;
            base.Update(gameTime);
        }
        public override void OnSet(object data)
        {
            base.OnSet (data);

            PopUpData popupData = (PopUpData)data;

            SetText (text, popupData.Title);
            type = popupData.Type;

            buttonYes.SetActive (type == PopUpType.YesAndNo);
            buttonNo.SetActive (type == PopUpType.YesAndNo);
            buttonOk.SetActive (type == PopUpType.Ok);
        }
Beispiel #36
0
 public void ShowDialog(PopUpType dialogType, GameTime gameTime, PopUpCallback popUpCallback)
 {
     if (!IsActive)
     {
         activePopUp = dialogType;
         popUps[activePopUp].Activate(gameTime);
         popUps[activePopUp].PopUpCallback = popUpCallback;
         Visible = true;
         Enabled = true;
         Shorewood.pop.Play();
         if (popUps[activePopUp].blur)
         {
             Shorewood.bloom.Enabled = true;
             Shorewood.bloom.Visible = true;
         }
     }
 }
Beispiel #37
0
 public PopUpData(string title, PopUpType type)
 {
     Title = title;
     Type  = type;
 }
 /// <summary>
 /// Pops up.
 /// </summary>
 /// <param name="text">Text.</param>
 /// <param name="type">Type.</param>
 /// <param name="finished">Finished.</param>
 public virtual void PopUp(string text, PopUpType type, PopUpController.FinishedDelegate finished = null)
 {
     PopUp (popUpSceneName, new PopUpData (text, type), delegate(SSceneController ctrl) {
         PopUpController popUp = (PopUpController)ctrl;
         popUp.finishedDelegate = finished;
     });
 }
Beispiel #39
0
        private void UpdatePopupBoxContent(PopUpType popUpType)
        {
            switch (popUpType)
            {
                case PopUpType.NewTask:

                    TaskGrid.Visibility = Visibility.Visible;
                    CommentGrid.Visibility = Visibility.Collapsed;
                    newTaskUserControl.Visibility = Visibility.Visible;
                    comboBoxAndButton.Visibility = Visibility.Collapsed;

                    break;
                case PopUpType.StartTask:

                    TaskGrid.Visibility = Visibility.Visible;
                    CommentGrid.Visibility = Visibility.Collapsed;
                    newTaskUserControl.Visibility = Visibility.Collapsed;
                    comboBoxAndButton.Visibility = Visibility.Visible;
                    break;

                //case PopUpType.AddComment:

                //    TaskGrid.Visibility = Visibility.Collapsed;
                //    CommentGrid.Visibility = Visibility.Visible;

                //    break;

                default:
                    throw new ArgumentOutOfRangeException("popUpType");
            }
        }
Beispiel #40
0
 protected override void OnDeactivated(GameTime gameTime)
 {
     if (transitionToPop != PopUpType.None)
     {
         Shorewood.popUpManager.ShowDialog(transitionToPop, gameTime, null);
         transitionToPop = PopUpType.None;
     }
     base.OnDeactivated(gameTime);
 }
Beispiel #41
0
 public Dialog GetPopUp(PopUpType dialogType)
 {
     return popUps[dialogType];
 }