public static void ShowPopup(string title, string message)
        {
            var popup = new MNPopup(title, message);

            popup.AddAction("OK", () => {});
            popup.Show();
        }
Beispiel #2
0
 public void changeNickNameConfirm()
 {
     if (changeNickName.text.Length == 0)
     {
         MNPopup mNPopup = new MNPopup("Error", "Please Input Correct!");
         mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
         mNPopup.Show();
     }
     else
     {
         ParseUser.CurrentUser["nickName"] = changeNickName.text;
         //MNP.ShowPreloader("", "");
         ParseUser.CurrentUser.SaveAsync().ContinueWith(t => {
             MNP.HidePreloader();
             if (t.IsFaulted)
             {
                 // Errors from Parse Cloud and network interactions
                 using (IEnumerator <System.Exception> enumerator = t.Exception.InnerExceptions.GetEnumerator())
                 {
                     if (enumerator.MoveNext())
                     {
                         ParseException error = (ParseException)enumerator.Current;
                         // error.Message will contain an error message
                         // error.Code will return "OtherCause"
                         UnityMainThreadDispatcher.Instance().Enqueue(showErrorWithMessage(error.Message));
                     }
                 }
             }
             else
             {
                 UnityMainThreadDispatcher.Instance().Enqueue(changedNickname());
             }
         });
     }
 }
Beispiel #3
0
    /*********** FIN BOUTONS ***********/

    public void Error(string msg)
    {
        MNPopup p = new MNPopup("Erreur", msg);

        p.AddAction("Ok", () => { });
        p.Show();
    }
Beispiel #4
0
    private static void ShowAlert(string title, string message)
    {
        var popup = new MNPopup(title, message);

        popup.AddAction("OK", () => {});
        popup.Show();
    }
Beispiel #5
0
 public void forgetSendEmail()
 {
     if (forgetEmail.text.Length == 0)
     {
         MNPopup mNPopup = new MNPopup("Error", "Please Input Correct!");
         mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
         mNPopup.Show();
     }
     else
     {
         //MNP.ShowPreloader("", "");
         ParseUser.RequestPasswordResetAsync(forgetEmail.text).ContinueWith(t => {
             MNP.HidePreloader();
             if (t.IsFaulted)
             {
                 // Errors from Parse Cloud and network interactions
                 using (IEnumerator <System.Exception> enumerator = t.Exception.InnerExceptions.GetEnumerator())
                 {
                     if (enumerator.MoveNext())
                     {
                         ParseException error = (ParseException)enumerator.Current;
                         // error.Message will contain an error message
                         // error.Code will return "OtherCause"
                         UnityMainThreadDispatcher.Instance().Enqueue(showErrorWithMessage(error.Message));
                     }
                 }
             }
             else
             {
                 UnityMainThreadDispatcher.Instance().Enqueue(showSuccessWithMessage("Send Email Successful!"));
             }
         });
     }
 }
Beispiel #6
0
    public void ShowSuccessMessage()
    {
        MNPopup popup = new MNPopup("Success", "Skin Changed");

        popup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
        popup.Show();
    }
 private void OnUserAvatarClicked(User publicUser)
 {
     if (GetSocial.GetCurrentUser().Id.Equals(publicUser.Id))
     {
         var popup = new MNPopup("Action", "Choose Action");
         popup.AddAction("Show My Feed", () => OpenUserGlobalFeed(publicUser));
         popup.AddAction("Cancel", () => { });
         popup.Show();
     }
     else
     {
         Communities.IsFriend(UserId.Create(publicUser.Id), isFriend =>
         {
             if (isFriend)
             {
                 var popup = new MNPopup("Action", "Choose Action");
                 popup.AddAction("Show " + publicUser.DisplayName + " Feed", () => OpenUserGlobalFeed(publicUser));
                 popup.AddAction("Remove from Friends", () => RemoveFriend(publicUser));
                 popup.AddAction("Cancel", () => { });
                 popup.Show();
             }
             else
             {
                 var popup = new MNPopup("Action", "Choose Action");
                 popup.AddAction("Show " + publicUser.DisplayName + " Feed", () => OpenUserGlobalFeed(publicUser));
                 popup.AddAction("Add to Friends", () => AddFriend(publicUser));
                 popup.AddAction("Cancel", () => { });
                 popup.Show();
             }
         }, error => _console.LogE("Failed to check if friends with " + publicUser.DisplayName + ", error:" + error.Message));
     }
 }
    public void GetStrategyBySearchId()
    {
        if (searchNumberId.text.Length == 0)
        {
            MNPopup mNPopup = new MNPopup("Error", "Please Input Correct!");
            mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
            mNPopup.Show();
            return;
        }
        //MNP.ShowPreloader("", "...");
        amountNow = 0;
        var query = ParseObject.GetQuery("Strategy").WhereEqualTo("numberId", searchNumberId.text).WhereEqualTo("mapName", mapName);

        amountNow += 10;
        query      = query.Limit(10);
        Debug.Log("searchClicked");
        query.FindAsync().ContinueWith(t =>
        {
            Debug.Log("searchDone");
            results = t.Result.ToList();
            getData = true;
            Debug.Log(results);
            //MNP.HidePreloader();
            //AddButtonList(results);
            //Debug.Log(results);
            AggregateException ex = t.Exception as AggregateException;
            if (ex != null)
            {
                ParseException inner = ex.InnerExceptions[0] as ParseException;
                Debug.Log(inner.Code + "///////" + inner.Message);
            }
        });
        searchNumberId.text = "";
    }
    void buttonClicked()
    {
        CommonData storeData = _common.gameObject.GetComponent <CommonData>();

        if (DataObj.isScan == false || DataObj.isUserOwn == true)
        {
            if (detailIntro.text.Length == 0)
            {
                MNPopup mNPopup = new MNPopup("Info", "Add some information about this step");
                mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
                mNPopup.Show();
                //EditorUtility.DisplayDialog("Error", "Add some information about this step", "OK");
                return;
            }


            StepDetail detail = storeData.newStrategy.steps[storeData.chosenStepIndex];
            detail.stepDetailInfo = detailIntro.text;

            foreach (GameObject item in storeData.Operators)
            {
                Destroy(item);
            }
        }
        _common.cancelDetailBtn.SetActive(false);
        storeData.finishClicked = true;
        _common.IndetailActions = false;
        Destroy(gameObject);
    }
Beispiel #10
0
    private static void ShowFullInfoWithoutActions(PromoCode promoCode, string title)
    {
        var code  = promoCode.Code;
        var popup = new MNPopup(title, FormatInfo(promoCode));

        popup.AddAction("OK", () => { });
        popup.Show();
    }
Beispiel #11
0
    public static void InfoBox(string title, string message)
    {
        MNPopup popup = new MNPopup(title, message);

        popup.AddAction("Continue", () => { Debug.Log("Ok action callback"); });
        popup.AddDismissListener(() => { Debug.Log("dismiss listener"); });
        popup.Show();
    }
    IEnumerator showSuccessWithMessage(string message)
    {
        MNPopup mNPopup = new MNPopup("Succeed!", message);

        mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
        mNPopup.Show();
        yield return(null);
    }
Beispiel #13
0
    private void OnApplicationPause(bool pauseStatus)
    {
        if (!pauseStatus)
        {
            GetSocial.WhenInitialized(() => {
                if (_latestChatId != null)
                {
                    ShowChat();
                }
                else
                {
                    GetSocial.GetReferralData(
                        data => {
                        var referralToken = "";
                        var message       = "Referral data: " + data;
                        string promoCode  = null;
                        if (data == null)
                        {
                            message = "No referral data";
                        }
                        else
                        {
                            promoCode     = data.ReferralLinkParams.ContainsKey(LinkParams.KeyPromoCode) ? data.ReferralLinkParams[LinkParams.KeyPromoCode] : null;
                            referralToken = data.Token;
                        }

                        if (!referralToken.Equals(_latestReferralData))
                        {
                            // show popup only if chat is not shown
                            if (_latestChatId == null)
                            {
                                if (promoCode != null)
                                {
                                    message += "\n\nPROMO CODE: " + promoCode;
                                }
                                var popup = new MNPopup("Referral Data", message);
                                popup.AddAction("OK", () => { });
                                if (promoCode != null)
                                {
                                    popup.AddAction("Claim Promo Code", () => PromoCodesSection.ClaimPromoCode(promoCode));
                                }
                                popup.Show();
                            }
                            _console.LogD(message);
                            _latestReferralData = referralToken;
                        }
                    },
                        error => _console.LogE("Failed to get referral data: " + error.Message)
                        );
                }
            });
        }
        else
        {
            GetSocialUi.CloseView(false);
        }
    }
Beispiel #14
0
    private void ShowPromoCode(string promoCode)
    {
        var popup = new MNPopup("Promo Code Info", promoCode);

        popup.AddAction("Share", () => SharePromoCode(promoCode));
        popup.AddAction("Info", () => LoadInfoAndShow(promoCode));
        popup.AddAction("Cancel", () => { });
        popup.Show();
    }
Beispiel #15
0
    public static void TransitionalPopUp(string title, string message)
    {
        // Always transitions to world!
        MNPopup popup = new MNPopup(title, message);

        popup.AddAction("Continue", () => { GameController.SwitchToWorld(); });
        popup.AddDismissListener(() => { GameController.SwitchToWorld(); });
        popup.Show();
    }
    void ReportActivityById()
    {
        var popup = new MNPopup("Report Activity", "What's wrong ?");

        popup.AddAction("Spam", _ReportActivityById(ReportingReason.Spam));
        popup.AddAction("Inappropriate Content", _ReportActivityById(ReportingReason.InappropriateContent));
        popup.AddAction("Cancel", () => { });
        popup.Show();
    }
    void OnActivityActionClicked(string actionId, ActivityPost post)
    {
        var message = string.Format("Activity feed button clicked, action type: {0}", actionId);
        var popup   = new MNPopup("Info", message);

        popup.AddAction("OK", () => {});
        popup.Show();
        _console.LogD(message);
    }
Beispiel #18
0
    private static void ShowFullInfo(PromoCode promoCode)
    {
        var code  = promoCode.Code;
        var popup = new MNPopup("Promo Code Info", FormatInfo(promoCode));

        popup.AddAction("Share", () => SharePromoCode(code));
        popup.AddAction("Copy", () => GUIUtility.systemCopyBuffer = code);
        popup.AddAction("Cancel", () => { });
        popup.Show();
    }
Beispiel #19
0
    IEnumerator createSuccess()
    {
        MNPopup mNPopup = new MNPopup("Succeed!", "Create Successful!");

        mNPopup.AddAction("Ok", () => {
            createSuccessConfirm();
        });
        mNPopup.Show();
        yield return(null);
    }
Beispiel #20
0
 // BackToMap
 public void AskBackToMap()
 {
     if (!cancelWindowOpen)
     {
         cancelWindowOpen = true;
         MNPopup p = new MNPopup("Retour", "Voulez-vous retourner à la carte ?");
         p.AddAction("Oui", () => { leavingWindowOpen = false; BackToMap(); });
         p.AddAction("Non", () => { leavingWindowOpen = false; });
         p.AddDismissListener(() => { leavingWindowOpen = false; });
         p.Show();
     }
 }
Beispiel #21
0
 //////////////// Pop-up windows
 // Leave
 public void AskLeave()
 {
     if (!leavingWindowOpen)
     {
         leavingWindowOpen = true;
         MNPopup p = new MNPopup("Quitter", "Voulez-vous quitter l'application ?");
         p.AddAction("Oui", () => { Leave(); });
         p.AddAction("Non", () => { leavingWindowOpen = false; });
         p.AddDismissListener(() => { leavingWindowOpen = false; });
         p.Show();
     }
 }
Beispiel #22
0
    void OnGUI()
    {
        UpdateToStartPos();

        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Native Pop Ups", style);
        StartY += YLableStep;

        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Rate PopUp with events"))
        {
            MNRateUsPopup rateUs = new MNRateUsPopup("rate us", "rate us, please", "Rate Us", "No, Thanks", "Later");
            rateUs.SetAppleId(appleId);
            rateUs.SetAndroidAppUrl(androidAppUrl);
            rateUs.AddDeclineListener(() => { Debug.Log("rate us declined"); });
            rateUs.AddRemindListener(() => { Debug.Log("remind me later"); });
            rateUs.AddRateUsListener(() => { Debug.Log("rate us!!!"); });
            rateUs.AddDismissListener(() => { Debug.Log("rate us dialog dismissed :("); });
            rateUs.Show();
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Dialog PopUp"))
        {
            MNPopup popup = new MNPopup("title", "dialog message");
            popup.AddAction("action1", () => { Debug.Log("action 1 action callback"); });
            popup.AddAction("action2", () => { Debug.Log("action 2 action callback"); });
            popup.AddDismissListener(() => { Debug.Log("dismiss listener"); });
            popup.Show();
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Message PopUp"))
        {
            MNPopup popup = new MNPopup("title", "dialog message");
            popup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
            popup.AddDismissListener(() => { Debug.Log("dismiss listener"); });
            popup.Show();
        }

        StartY += YButtonStep;
        StartX  = XStartPos;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Prealoder"))
        {
            MNP.ShowPreloader("Title", "Message");
            Invoke("OnPreloaderTimeOut", 3f);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Hide Prealoder"))
        {
            MNP.HidePreloader();
        }
    }
 private void OnPushIdLoaded(UM_PushRegistrationResult res)
 {
     if (res.IsSucceeded)
     {
         MNPopup popup = new MNPopup("Succeeded", "Device Id: " + res.deviceId);
         popup.AddAction("Ok", () => {});
         popup.Show();
     }
     else
     {
         MNPopup popup = new MNPopup("Failed", "No device id");
         popup.AddAction("Ok", () => {});
         popup.Show();
     }
 }
Beispiel #24
0
    public void ShowDialog(string title, string message)
    {
        //MNPopup popup = new MNPopup("title", "dialog message");
        MNPopup popup = new MNPopup(title, message);

        popup.AddAction("Ok", () => {
            Debug.Log("OK action callback");
        });
        popup.AddAction("Cancel", () => {
            Debug.Log("Cancel action callback");
        });
        popup.AddDismissListener(() => {
            Debug.Log("dismiss listener");
        });
        popup.Show();
    }
Beispiel #25
0
 protected void Update()
 {
     deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f;
     HandleAndroidBackButton();
     if (_notification != null)
     {
         var notification = _notification;
         _notification = null;
         var popup = new MNPopup(notification.Title, notification.Text);
         notification.ActionButtons.ForEach(button => {
             popup.AddAction(button.Title, () => { ProcessAction(button.ActionId, notification); });
         });
         popup.AddAction("Dismiss", () => { });
         popup.Show();
     }
 }
Beispiel #26
0
 public void JoinNow()
 {
     if (roomName.text.Length > 0)
     {
         DataObj.isJoin         = true;
         DataObj.roomNameString = roomName.text;
         DataObj.lbc.AddCallbackTarget(contentPanel.GetComponent <MapListScrollview>());
         DataObj.lbc.ConnectToRegionMaster(DataObj.regionCode);
     }
     else
     {
         MNPopup mNPopup = new MNPopup("Error", "Please Input Correct!");
         mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
         mNPopup.Show();
     }
 }
Beispiel #27
0
 void OnImageSaved(UM_ImageSaveResult result)
 {
     UM_Camera.Instance.OnImageSaved -= OnImageSaved;
     if (result.IsSucceeded)
     {
         //no image path for IOS
         MNPopup popup = new MNPopup("Image Saved", result.imagePath);
         popup.AddAction("Ok", () => {});
         popup.Show();
     }
     else
     {
         MNPopup popup = new MNPopup("Failed", "Image Save Failed");
         popup.AddAction("Ok", () => {});
         popup.Show();
     }
 }
    public void confirmAction()
    {
        if (ControlObj.GetComponent <CommonControl>().canDrawLine || ControlObj.GetComponent <PaintOnMap>().isModify)
        {
            descriptionText.text = textField.text;
            gameObject.SetActive(false);
            ControlObj.GetComponent <PaintOnMap>().isModify = false;
        }
        else
        {
            if (textField.text.Length == 0)
            {
                MNPopup mNPopup = new MNPopup("Info", "Add some information about this step");
                mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
                mNPopup.Show();
                //EditorUtility.DisplayDialog("Error", "Add some information about this step", "OK", "Cancel");
                return;
            }

            OperatorData objdata   = operatorObj.GetComponent <OperatorData>();
            CommonData   storeData = ControlObj.GetComponent <CommonData>();
            StepDetail   detail    = storeData.newStrategy.steps[storeData.chosenStepIndex];
            Debug.Log(JsonUtility.ToJson(objdata));

            //Text infotext = textCanvas.GetComponentInChildren<Text>();
            //infotext.text = "Detail";
            //int stepIndex = objdata.actionNumber;
            foreach (StepDetailAction step in detail.detailActions)
            {
                if (step.createTime.Equals(objdata.createTime))
                {
                    step.actionInfo = textField.text;
                }
            }



            objdata.actionInfo = textField.text;
            Debug.Log(JsonUtility.ToJson(storeData));
            textField.text      = "";
            storeData.isUpdated = true;

            gameObject.SetActive(false);
        }
    }
Beispiel #29
0
    public void createUserClicked()
    {
        if (createEmail.text.Length == 0 || createPassword.text.Length == 0 || createUsername.text.Length == 0)
        {
            MNPopup mNPopup = new MNPopup("Error", "Please Input Correct!");
            mNPopup.AddAction("Ok", () => { Debug.Log("Ok action callback"); });
            mNPopup.Show();
        }
        else
        {
            var user = new ParseUser();
            user.Username = createUsername.text;
            user.Password = createPassword.text;
            user.Email    = createEmail.text;


            // other fields can be set just like with ParseObject
            user["nickName"] = createUsername.text;
            //MNP.ShowPreloader("", "Creating...");
            user.SignUpAsync().ContinueWith(t => {
                MNP.HidePreloader();
                if (t.IsFaulted)
                {
                    // Errors from Parse Cloud and network interactions
                    using (IEnumerator <System.Exception> enumerator = t.Exception.InnerExceptions.GetEnumerator())
                    {
                        if (enumerator.MoveNext())
                        {
                            ParseException error = (ParseException)enumerator.Current;
                            // error.Message will contain an error message
                            // error.Code will return "OtherCause"
                            UnityMainThreadDispatcher.Instance().Enqueue(showErrorWithMessage(error.Message));
                        }
                    }
                }
                else
                {
                    UnityMainThreadDispatcher.Instance().Enqueue(createSuccess());
                }
            });
        }
    }
    void OnImageSaved(UM_ImageSaveResult result)
    {
        if (result.IsSucceeded)
        {
            //no image path for IOS
            MNPopup popup = new MNPopup("Image Saved", result.imagePath);
            popup.AddAction("Ok", () => {});
            popup.Show();

            activeSomeButtons();
        }
        else
        {
            MNPopup popup = new MNPopup("Failed", "Image Save Failed");
            popup.AddAction("Ok", () => {});
            popup.Show();

            activeSomeButtons();
        }
    }