Beispiel #1
0
    public void ShowDialog(DialogIndex index, DialogParam param = null, Action callBack = null)
    {
        BaseDialog baseDialog = dicDialog[index];

        baseDialog.ShowDialog(param, callBack);
        lsShow.Add(baseDialog);
    }
Beispiel #2
0
    public void OnStartButton()
    {
        if (first)
        {
            return;
        }
        // 检查这个 picId 是否已经有存档,如果有则提示
        var picId = int.Parse(this.param as string);

        var info = PlayerStatus.TryGetUncompleteOfPicId(picId);

        if (info != null)
        {
            var param = new DialogParam();
            param.des    = "会覆盖已存在的游戏,是否继续?";
            param.button = "确定";
            var admin  = new Admission_PopupNewPage();
            var dialog = UIEngine.Forward <DialogPage>(param, admin);
            dialog.Complete = result => {
                if (result == DialogResult.Conform)
                {
                    GameController.EnterCore(picId, selectItem.dataRow.Get <int>("id"));
                }
            };
        }
        else
        {
            GameController.EnterCore(picId, selectItem.dataRow.Get <int>("id"));
        }
        AudioManager.PlaySe("button");
        RadioStation.Brodcast("NEW_GAME");
    }
Beispiel #3
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            if (_mode == Operation.Search)
            {
                if (listView1.SelectedItems.Count == 0)
                {
                    MessageBox.Show("Please select " + _entityText + " from the list",
                                    "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    _isClosed = false;
                    this.Close();
                }
            }
            else
            {
                DialogParam param = MakeParameter(Operation.Add);
                SupplierOrCustomerDialog sDialog = new SupplierOrCustomerDialog(param);
                sDialog.ShowDialog();

                LoadSupplierOrCustomer();
                Search();
            }
        }
Beispiel #4
0
    public void ShowDialog(DialogParam param, Action callback)
    {
        Setup(param);
        dialogAnimation.OnShowAnim(() =>
        {
            OnShowDialog();

            callback?.Invoke();
        });
    }
Beispiel #5
0
    public void OnShowDialog(DialogIndex index, DialogParam param = null, Action <BaseDialog> callback = null)
    {
        BaseDialog dialog = dicDialog[index];

        dialog.gameObject.SetActive(true);
        dialog.transform.SetAsLastSibling();
        dialog.ShowDialog(param, () => {
            callback?.Invoke(dialog);
        });
        lsdialogShow.Add(dialog);
    }
Beispiel #6
0
    public override void Setup(DialogParam param)
    {
        MissionResultDialogParam p = (MissionResultDialogParam)param;

        txtGoldEarned.text = p.goldEarned.NumberNormalize() + " Collect";
        if (p.isWin)
        {
            txtResult.text = "WIN";
        }
        else
        {
            txtResult.text = "LOSE";
        }
    }
Beispiel #7
0
 public void ShowDialog(DialogParam param = null, Action callBack = null)
 {
     gameObject.SetActive(true);
     rect.SetAsLastSibling();
     OnSetup(param);
     baseDialogAnimation.ShowAnimation(() =>
     {
         OnShow();
         if (callBack != null)
         {
             callBack();
         }
     });
 }
Beispiel #8
0
    public void OnGetButton()
    {
        if (SDKManager.IsAdLoaded)
        {
            SDKManager.ShowInterAd(clicked => {
                if (clicked)
                {
                    Helper.AddGold(40);
                    if (sources == AdPageOpenSources.Shop)
                    {
                        PlayerStatus.lastUseAtGiftTime = TimestampUtil.Now;
                    }
                    PlayerStatus.Save();

                    Log.Scrren("AdPage: clicked: " + clicked);
                    var admission = new Admission_PopdownOldPage();
                    UIEngine.Back(null, admission);
                    Compelte?.Invoke();
                    Compelte = null;
                }
                else
                {
                    var param       = new DialogParam();
                    param.des       = "您没有点击广告,需要点击广告才能获得金币";
                    param.button    = "确认";
                    var popup       = new Admission_PopupNewPage();
                    var dialog      = UIEngine.Forward <DialogPage>(param, popup);
                    dialog.Complete = result => {
                        Log.Scrren("AdPage: clicked: " + clicked);
                        UIEngineHelper.WateAdmissionComplete(() => {
                            var admission = new Admission_PopdownOldPage();
                            UIEngine.Back(null, admission);
                            Compelte?.Invoke();
                            Compelte = null;
                        });
                    };
                }
            });
        }
        else
        {
            var admission = new Admission_PopdownOldPage();
            UIEngine.Back(null, admission);
            Compelte?.Invoke();
            Compelte = null;
        }

        AudioManager.PlaySe("button");
    }
Beispiel #9
0
        private DialogParam MakeParameter(Operation operation)
        {
            DialogParam p = new DialogParam();

            p.SupplierService = _supplierService;
            p.CustomerService = _customerService;

            p.SC   = _sc;
            p.Mode = operation;

            p.Supplier = _selectedSupplier;
            p.Customer = _selectedCustomer;

            return(p);
        }
Beispiel #10
0
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select " + _entityText + " from the list",
                                "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            DialogParam param = MakeParameter(Operation.Edit);
            SupplierOrCustomerDialog sDialog = new SupplierOrCustomerDialog(param);

            sDialog.ShowDialog();
            Search();
        }
Beispiel #11
0
    public void OnBackButton()
    {
        var completeCount = PlayerStatus.completeCount;

        if (completeCount == 2 || completeCount == 3)
        {
            var text  = MsgList.Get("comment");
            var param = new DialogParam();
            param.des    = text;
            param.button = "确定";
            var admin  = new Admission_PopupNewPage();
            var dialog = UIEngine.Forward <DialogPage>(param, admin);
            dialog.Complete = result => {
                if (result == DialogResult.Conform)
                {
                    SDKManager.Comment();
                }
                DoBack();
            };
        }
        else if (completeCount >= 4)
        {
            if (SDKManager.IsAdLoaded)
            {
                AdPage.sources = AdPageOpenSources.LevelComplete;
                var admin  = new Admission_PopupNewPage();
                var adPage = UIEngine.Forward <AdPage>(null, admin);
                adPage.Compelte = () => {
                    DoBack();
                };
            }
            else
            {
                DoBack();
            }
        }
        else
        {
            DoBack();
        }
    }
Beispiel #12
0
    void OnItemUnlockButton(PictruePage_Item item)
    {
        var data = item.data;
        var cost = data.picRow.Get <int>("cost");
        var gold = PlayerStatus.gold;

        if (gold >= cost)
        {
            Debug.Log("can unlock");
            gold -= cost;
            PlayerStatus.gold = gold;
            var pictureId = data.picRow.Get <string>("id");
            LevelStorage.SetPictureUnlocked(pictureId);
            PlayerStatus.Save();

            // 单独处理需要修改显示状态的 item
            data.status = PicturePage_ItemStatus.Unlocked;
            SetItem(item, data);
            item.Flash();
            AudioManager.PlaySe("button");
            AudioManager.PlaySe("unlock-pic");
        }
        else
        {
            var param = new DialogParam();
            param.des    = MsgList.Get("lack_of_gold");
            param.button = "商城";
            var popup  = new Admission_PopupNewPage();
            var dialog = UIEngine.Forward <DialogPage>(param, popup);
            dialog.Complete = result => {
                if (result == DialogResult.Conform)
                {
                    UIEngineHelper.WateAdmissionComplete(() => {
                        UIEngine.Forward <ShopPage>();
                    });
                }
            };
            AudioManager.PlaySe("lack-of-gold");
        }
    }
Beispiel #13
0
 public virtual void OnSetup(DialogParam param = null)
 {
 }
Beispiel #14
0
 public override void OnSetup(DialogParam param = null)
 {
     baseDialogAnimation.GetComponent <RectTransform>().localScale = Vector3.zero;
     base.OnSetup(param);
 }
Beispiel #15
0
 public virtual void Setup(DialogParam param)
 {
 }
Beispiel #16
0
 public SupplierOrCustomerDialog(DialogParam param)
 {
     _param = param;
     InitializeComponent();
 }
Beispiel #17
0
    public override void OnSetup(DialogParam param = null)
    {
        ResetDialog();

        cf = (MessageDialogParam)param;
        if (cf != null)
        {
            if (cf.messageType == DialogMessageType.Start)
            {
                levelText.gameObject.SetActive(true);
                levelText.text = "level " + Global.currentLevel;
                startButton.gameObject.SetActive(true);
                homeButton.gameObject.SetActive(false);
                replayButton.gameObject.SetActive(false);

                ShowScoreMessage(cf.scoreGoal);
                if (cf.levelCounter == LevelCounter.Timer)
                {
                    ShowTimedGoal(cf.timeGoal);
                }
                else
                {
                    ShowMovesGoal(cf.moveGoal);
                }
            }
            else if (cf.messageType == DialogMessageType.Win)
            {
                levelText.gameObject.SetActive(false);
                startButton.gameObject.SetActive(false);
                homeButton.gameObject.SetActive(true);
                replayButton.gameObject.SetActive(true);
                replayButtonText.text = "next";
                ShowWinMessage();
                if (ScoreManager.Instance != null)
                {
                    string scoreStr = "you scored\n" + ScoreManager.Instance.CurrentScore.ToString() + " points!";
                    ShowGoalCaption(scoreStr);
                    ShowGoalImage(goalCompleteIcon);
                    SoundManager.Instance?.PlayWinSound();
                }
                Global.currentLevel++;
            }
            else if (cf.messageType == DialogMessageType.Lose)
            {
                levelText.gameObject.SetActive(false);
                startButton.gameObject.SetActive(false);
                homeButton.gameObject.SetActive(true);
                replayButton.gameObject.SetActive(true);
                replayButtonText.text = "replay";
                ShowLoseMessage();
                string caption = "";

                if (GameManager.Instance.LevelGoal.levelCounter == LevelCounter.Timer)
                {
                    caption = "Out of time!";
                }
                else
                {
                    caption = "Out of moves!";
                }

                ShowGoalCaption(caption);
                ShowGoalImage(goalFailedIcon);
                SoundManager.Instance?.PlayLoseSound();
            }
        }
        base.OnSetup(param);
    }
Beispiel #18
0
 public void OnBackButton()
 {
     if (UIEngine.PagesCount > 1)
     {
         var top = UIEngine.Top;
         if (top is LevelCompletePage)
         {
             // do nothing
         }
         else if (top is DisplayPage)
         {
             // do nothing
         }
         else if (top is DialogPage)
         {
             // do nothing
             var dialog = top as DialogPage;
             dialog.OnCloseButton();
         }
         else if (top is AdPage)
         {
             // do nothing
             var adPage = top as AdPage;
             adPage.OnCloseButton();
         }
         if (top is LevelSettingsPage)
         {
             var admin = new Admission_PopdownOldPage();
             UIEngine.Back(null, admin);
         }
         else if (top is ShopPage)
         {
             var admin = new Admission_OldDownNewUp();
             UIEngine.Back(null, admin);
         }
         else if (top is CorePage)
         {
             var param = new DialogParam();
             param.des    = "退出会存储已进行的拼图,确定要退出吗?";
             param.button = "确定";
             var popup  = new Admission_PopupNewPage();
             var dialog = UIEngine.Forward <DialogPage>(param, popup);
             dialog.Complete = DialogResult =>
             {
                 if (DialogResult == DialogResult.Conform)
                 {
                     GameController.SaveUncompletePuzzle();
                     //UIEngine.BackTo<PicturePage>();
                     CoroutineManager.Create(WaitAndReturn());
                 }
             };
         }
         else
         {
             UIEngine.Back(null, admission);
         }
         AudioManager.PlaySe("button");
         SDKManager.OnHeadBarBackbutton();
     }
     else
     {
         Debug.Log("this is the only one page, can't call UIEngine.Back()");
     }
 }