private void ShowPopup(PopupType pType, Popup popupToShow, PopupData data, bool hidePrev) { if (popupToShow != null) { popupToShow.Show(pType, data); } }
public static void ShowAddVariantWindow(PopupData data) { var w = EditorWindow.GetWindow <AddShaderVariantWindow>(true, "Add shader " + data.shader.name + " variants to collection"); w.Initialize(data); w.m_Parent.window.m_DontSaveToLayout = true; }
public override void SetData(PopupBaseData data) { PopupData popupData = data as PopupData; TutorialType = popupData.TutorialType; for (int i = 0; i < TutorialSlotList.Count; i++) { DestroyImmediate(TutorialSlotList[i].gameObject); } TutorialSlotList.Clear(); if (DataManager.Instance.TutorialDataList.ContainsKey(TutorialType)) { var list = DataManager.Instance.TutorialDataList[TutorialType]; for (int i = 0; i < list.Count; i++) { var temp_data = list[i]; var slotObj = Instantiate(Resources.Load("Prefab/UITutorialSlot"), ListObj.transform) as GameObject; var slot = slotObj.GetComponent <UITutorialSlot>(); slot.SetData(temp_data); TutorialSlotList.Add(slot); } } }
public void OpenPopup(PopupType popupType, BasePopupData data /*,bool isSingleOnScreen = false*/) { _canvas = GameObject.FindGameObjectWithTag("MainCanvas").GetComponent <Canvas>(); PopupData popupData = _popupDataList.popupDataList.Find(x => x.popupType == popupType); if (popupData == null) { Debug.LogError("PopupManager:OpenPopup The popup " + popupType.ToString() + "you are trying to open doesn`t exist."); return; } // if (isSingleOnScreen) //{ // CloseAllMenus(); //} //ifatuTODO - check if this is needed or corect //Destroy(_currentMenu); //_currentMenu = null; _currentPopup = Instantiate(popupData.popupPrefab, transform.position, Quaternion.identity); _currentPopup.Init(data); _currentPopup.transform.SetParent(_canvas.transform, false); // _currentMenu.transform.position = new Vector3(0, 0, 0); // _currentMenu.transform.localScale = new Vector3(1, 1, 1); _popupStack.Add(_currentPopup); }
private void GeneratePopup(Item.Type type, int amount = 1) { PopupData data = new PopupData(sprites, type, amount); foreach (ItemPopupObject ipo in activePopups) { if (ipo.Data.ItemType == type) { ipo.AddAmount(data.Amount); return; } } for (int i = 0; i < popupsToShow.Count; i++) { PopupData pd = popupsToShow[i]; if (pd.ItemType == type) { pd.AddAmount(amount); return; } } if (ViewingLimitReached) { popupsToShow.Add(data); } else { ItemPopupObject po = GetAnInactivePopup; po.Data = data; } }
public virtual void show(PopupData pd, string msg = "") { container.SetActive(true); gameObject.SetActive(true); popupData = pd; if (lbMsg != null) { lbMsg.text = msg; } switch (popupSize) { case PopupSize.Big: SoundData.play("uicm_popup_big"); break; case PopupSize.Middle: SoundData.play("uicm_popup_mid"); break; case PopupSize.Small: SoundData.play("uicm_popup_sml"); break; } if (popupPanel != null && useScaleTween && Time.timeScale >= 1.0f) { if (ani != null) { ani.Play(); } } }
public void SetData(PopupData popupData) { Title.text = popupData.PopupConfig.Title; Message.text = popupData.PopupConfig.Description; Data = popupData; }
/// <summary> /// Display next message in queue. /// </summary> public void pushMessage() { if (messageQueue.Count == 0 || usedSlots == maxDisplaySize || paused) { return; } int id = 0; for (int i = 0; i < maxDisplaySize; i++) { if (activeMessages[i] == null) { id = i; break; } } PopupData data = messageQueue.Pop(); data.index = id; GameObject g = Instantiate(popupPrefab, Vector3.zero, Quaternion.identity) as GameObject; PopUp p = g.GetComponent <PopUp>().Spawn(data); Vector3 at = (Vector3)locationOffset / unitScale; at += ((Vector3)offset / unitScale) * id; //Parent and set notification location g.transform.SetParent(spawnAtParent); g.transform.position = spawnAtParent.position + at; g.transform.localScale = Vector3.one; activeMessages[id] = p; usedSlots += 1; }
public override void show(PopupData pd, string msg) { base.show(pd, ""); scrollView.ResetPosition(); if (string.IsNullOrEmpty(msg) == false && msg.Length > 5 && (msg.Substring(0, 4).ToLower().StartsWith("http"))) { _isImageType = true; photo.gameObject.SetActive(true); lbText.enabled = false; spLoading.gameObject.SetActive(true); StartCoroutine(startDownload(msg)); } else { spLoading.gameObject.SetActive(false); _isImageType = false; photo.gameObject.SetActive(false); lbText.enabled = true; lbText.text = msg; } btnYes.gameObject.SetActive(string.IsNullOrEmpty(pd.closeLink) == false); }
public static void openFirst(PopupType type, string msg = "", PopupData.PopupAction yesAction = null, PopupData.PopupAction closeAction = null, params object[] data) { PopupData pd = getPopupDataFromPool(); pd.setData(type, msg, yesAction, closeAction, data); if (_closePopupData != null && (nowPopupData != null && nowPopupData == _closePopupData)) { nowPopupData = null; } if (nowPopupData != null) { _popups.Insert(0, nowPopupData); if (nowPopupData.popupType != pd.popupType) { UISystemPopupBase p = getPopupByType(nowPopupData.popupType); if (p != null) { p.gameObject.SetActive(false); } } nowPopupData = null; } open(pd); }
public void QueuePopup(EPopupTypes _popupType, PopupData _popupData) { PopupQueueData newQueue = new PopupQueueData(_popupType, _popupData); popupQueue.Enqueue(newQueue); TryShowNext(); }
public override void show(PopupData pd, string msg) { base.show(pd, msg); _data.parse((string)pd.data[0]); lbPrice.text = Util.GetCommaScore(_data.getSellPrice()); }
private void Initialize(PopupData data) { m_Data = data; m_SelectedKeywords = new List <string>(); m_AvailableKeywords = new List <string>(); m_SelectedVariants = new List <int>(); ApplyKeywordFilter(); }
public void ViewPopup(PopupData data) { if (_popupPanelParent == null) { Reset(); } CreatePopup(data); }
public override void show(PopupData pd, string msg) { base.show(pd, msg); if (pd.data != null && pd.data.Length > 0) { lbMsg2.text = pd.data[0].ToString(); } }
public override void show(PopupData pd, string msg = "") { GameManager.setTimeScale = 1.0f; base.show(pd, msg); lbMsg.text = Util.getUIText("MSG_HERO_LEVELUP"); lbLevel.text = msg; effect.Play(); }
public void Push(PopupData data) { popupQueue.Add(data); if (currentPopup == null) { ShowNext(); } }
public void Execute(OpenPopupSignal openPopupSignalParams) { PopupData popupData = new PopupData() { PopupConfig = (PopupConfig)openPopupSignalParams.PopupConfig, OnPopupComplete = openPopupSignalParams.OnPopupComplete }; _popupDialogFactory.Create(popupData); }
private void OpenUIByTag() { PopupData tempData = new PopupData(); tempData.message = currentSlot.message; tempData.sprite = currentSlot.sprite; tempData.inputType = currentSlot.type; OnPopupEvent?.Invoke(tempData); NextSlot(); }
private void ShowNext() { PopupData next = popupQueue[0]; PopupController controller = mapPopup[next.type].GetComponent <PopupController>(); currentPopup = controller; currentPopup.Build(next); currentPopup.Show(delegate { }); popupQueue.RemoveAt(0); }
/// <summary> /// Shows the the popup if it's possible with given data /// </summary> /// <param name="popupData">Data that will be used to display popup</param> public void Show(PopupData popupData) { if (!CanBeShown) { popupData.InvokeCancelCallback(); return; } currentData = popupData; uiText.text = currentData.Text; Show(); }
public void ShowPopup(PopupData data) { popupPanel.SetActive(true); popupGroupOk.SetActive(data.okFlag); popupGroupYesNo.SetActive(!data.okFlag); _popupNotifyText.text = data.text; _popupCallBack = data.callBack; SetAsLastSiblingPopup(); }
/// <summary> /// Raises the GUI event. /// </summary> /// <param name="position">Position.</param> /// <param name="property">Property.</param> /// <param name="label">Label.</param> public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { // initialize the status getter method string key = property.propertyPath; if (!m_PopupData.ContainsKey(key)) { m_PopupData[key] = new PopupData(); } PopupData popupData = m_PopupData[key]; if (!string.IsNullOrEmpty(this.Attribute.StatusGetter)) { popupData.GetStatusCallback = StatusPropertyDrawer.GetStatusCallback(property, this.Attribute.StatusGetter); } Rect iconPosition = new Rect(); ValidationStatus status = ValidationStatus.None; string statusTooltip = null; if (popupData.GetStatusCallback != null || !string.IsNullOrEmpty(this.Attribute.StatusGetter)) { FieldInfo field; object provider = property.GetProvider(out field); if (popupData.GetStatusCallback != null) { status = popupData.GetStatusCallback(provider, property.GetValue(), out statusTooltip); } else { status = ValidationStatus.Warning; statusTooltip = string.Format( "{0} {1}.{2} not found.", typeof(StatusPropertyAttribute.GetStatusCallback), provider.GetType(), this.Attribute.StatusGetter ); } if (status != ValidationStatus.None) { position.width -= EditorGUIUtility.singleLineHeight; iconPosition = position; iconPosition.x += iconPosition.width; iconPosition.width = EditorGUIUtility.singleLineHeight; } } DisplayPopup(position, property, label); if (status != ValidationStatus.None) { EditorGUIX.DisplayValidationStatusIcon(iconPosition, status, statusTooltip); } }
protected override void OnChildAdded(Entity e) { base.OnChildAdded(e); popupDatas[(Control)e] = new PopupData { Control = (Control)e, }; if (Orientation == ProgressOrientation.BottomToTop) { popupDatas[(Control)e].Value.Value = Size.Y; } Invalidate(); }
public override void Show(PopupData _data) { Data data = (Data)_data; if (data != null) { Heading.text = data.Heading; Body.text = data.Body; Option.text = data.Option; } base.Show(_data); }
void HidePreviousPopup(PopupData data, bool hidePrev) { if (hidePrev) { _visiblePopupQueue.Clear(); } else { Popup p = new Popup(); p.pType = _popupInstance.GetComponent <Popup> ().pType; p.p = _popupInstance.GetComponent <Popup> ().p; _visiblePopupQueue.Add(p); } }
public override void Build(PopupData data) { base.Build(data); if ((data is PopupAlertData) == false) { Debug.LogError("Invalid Popup Data!"); return; } Data = data as PopupAlertData; popupTitle.text = Data.Title; popupMessage.text = Data.Message; }
public override void show(PopupData pd, string msg) { base.show(pd, msg); if ((int)pd.data[0] == 0) { goTwoButtonContainer.gameObject.SetActive(false); goOneButtonContainer.gameObject.SetActive(true); } else { goTwoButtonContainer.gameObject.SetActive(true); goOneButtonContainer.gameObject.SetActive(false); } }
public override void show(PopupData pd, string msg) { base.show(pd, ""); _marketUrl = (string)pd.data[0]; scrollView.ResetPosition(); _isImageType = true; photo.gameObject.SetActive(true); lbText.enabled = false; spLoading.gameObject.SetActive(true); StartCoroutine(startDownload(msg)); }
public void RemovePop(PopupData popupData) { if (_createdPopupDialogViews.ContainsKey(popupData)) { PopupDialogView popupDialogView = _createdPopupDialogViews[popupData]; _createdPopupDialogViews.Remove(popupData); // TODO: MS: Return to pool. Destroy(popupDialogView.gameObject); } else { throw new Exception("PopupView.RemovePop: PopupData is not in the Dictionary."); } }
private void ClosePopup(PopupData popupData, UIElement popupElement, bool forceCloseImmediately) { if (popupData.Element == popupElement) { Action onClosed = popupData.OnPopupClosed; ICollection<AnimationInfo> animationsOnClose = popupData.AnimationsOnClose; Popup popup = popupData.Popup; Action close = delegate { popupData.Element = null; popupData.OnPopupClosed = null; popupData.AnimationsOnClose = null; popup.IsOpen = false; if (onClosed != null) onClosed(); }; bool closeImmediately = popupData.CloseImmediately | forceCloseImmediately; AnimatePopup(popup.Child, 0.5, 1, popupData.InitialBackgroundState.Opacity, popupData.InitialBackgroundState.BlurRadious, animationsOnClose, closeImmediately ? null : close); if (closeImmediately) close(); } }
protected override void OnChildAdded(Entity e) { base.OnChildAdded(e); popupDatas[(Control)e] = new PopupData { Control = (Control)e, }; if(Orientation == ProgressOrientation.BottomToTop) popupDatas[(Control)e].Value.Value = Size.Y; Invalidate(); }
private void ShowPopup(PopupData popupData, UIElement element, Rect startRect, Rect endRect, double startOpacity, double endOpacity, double animationDuration, Action onClosed, IEnumerable<AnimationInfo> animations = null) { if (popupData.Element != null) ClosePopup(popupData, popupData.Element, true); var sizedElement = new SizedElement(element, new Size(startRect.Width, startRect.Height)) { Opacity = startOpacity }; Popup popup = popupData.Popup; popup.Child = sizedElement; popup.HorizontalOffset = startRect.X; popup.VerticalOffset = startRect.Y; popup.Width = startRect.Width; popup.Height = startRect.Height; popupData.Element = element; popupData.OnPopupClosed = onClosed; popup.IsOpen = true; popupData.InitialBackgroundState = myCurrentBackgroundState; if (!endRect.Equals(startRect)) { var xAnimation = new AnimationInfo(popup, new PropertyPath(Popup.HorizontalOffsetProperty), startRect.X, endRect.X); var yAnimation = new AnimationInfo(popup, new PropertyPath(Popup.VerticalOffsetProperty), startRect.Y, endRect.Y); var widthAnimation = new AnimationInfo(sizedElement, new PropertyPath(SizedElement.WidthProperty), startRect.Width, endRect.Width); var heightAnimation = new AnimationInfo(sizedElement, new PropertyPath(SizedElement.HeightProperty), startRect.Height, endRect.Height); var additionalAnimations = new[] {xAnimation, yAnimation, widthAnimation, heightAnimation}; animations = animations != null ? animations.Concat(additionalAnimations) : additionalAnimations; } popupData.AnimationsOnClose = animations != null ? (ICollection<AnimationInfo>)animations.Select(info => info.Reverse()).ToList() : new AnimationInfo[0]; AnimatePopup(sizedElement, animationDuration, endOpacity, Math.Min(myCurrentBackgroundState.Opacity, 0.7), 5, animations); }