Ejemplo n.º 1
0
        public void ShowDialog(Dialog dialog, CommonSettings.IntCallBack callback = null, bool isBattle = false)
        {
            showDialogFlagNew = false;
            List <Dialog> dialogs = new List <Dialog>();

            dialogs.Add(dialog);
            this.ShowDialogs(dialogs, callback);
        }
Ejemplo n.º 2
0
 public void ShowDialogs(List <Dialog> dialogs, CommonSettings.IntCallBack callback = null, bool isBattle = false)
 {
     this.Focus();
     showDialogFlagNew = false;
     this.CallBack     = callback;
     currentDialogs    = dialogs;
     currentIndex      = -1;
     this.Dispatcher.BeginInvoke(() => { this.NextDialog(isBattle); });
 }
Ejemplo n.º 3
0
    public void ShowDialog(string role, string info, CommonSettings.IntCallBack callback)
    {
        this.HeadPic.mainTexture = RoleManager.GetRole(role).Head.Source;
        this.infoLabel.text      = info;
        //if (role == "女主")
        //	this.nameLabel.text = RuntimeData.Instance.femaleName + ":";
        //else if (role == "主角")
        //	this.nameLabel.text = RuntimeData.Instance.maleName + ":";
        //else
        this.nameLabel.text = RoleManager.GetRole(role).Name + ":";

        Show();
    }
        public void Bind(Item item, string title, CommonSettings.IntCallBack callback, int max = -1)
        {
            ItemImage.Source   = item.Pic;
            ItemDetail.Content = item.GenerateTooltip();
            NumberText.Text    = "1";
            this.callback      = callback;
            this.MaxLimit      = max;

            if (max > 0)
            {
                this.NumberLimitText.Text = max.ToString();
            }
        }
Ejemplo n.º 5
0
        public void LoadTrail(Battle battle, int friend, CommonSettings.IntCallBack callback)
        {
            CurrentScrollDirection = ScrollDirection.NONE;
            List <int> friends = new List <int>();

            friends.Add(friend);

            this.Visibility = System.Windows.Visibility.Visible;
            field.Load(battle, callback, friends);
            this.BattleFieldScrollable = true;
            //uiHost.Chat("test_ARENA");

            this.IsEnabled = false;
            this.FadeOut.Stop();
            this.FadeIn.Begin();
        }
Ejemplo n.º 6
0
        void gm_GameOver(object sender, EventArgs e)
        {
            dm.DisableDragableElement();
            gm.Pause();
            //resultBtn.Visibility = Visibility.Visible;
            double s  = (DateTime.Now - this.startTime).TotalSeconds;
            double s2 = (double)gm.PassedTimeInMs / 1000.0;

            if (s > s2 * 4)
            {
                IsCheat = true;
            }
            //string info = string.Format("s={0} , s2={1}", s, s2);
            //MessageBox.Show(info);
            //resultBtn.Content = "你坚持了" + s.ToString() + "秒";
            if (callBack != null)
            {
                callBack((int)s);
                callBack = null;
            }
        }
Ejemplo n.º 7
0
        public void ShowDialog(string role, string info, CommonSettings.IntCallBack callback)
        {
            this.Focus();
            showDialogFlagNew = true;
            this.Head.Source  = RoleManager.GetRole(role).Head;

            this.Text.Text = info;
            //if (this.Text.Text.Contains("$FEMALE$"))
            //    this.Text.Text.Replace("$FEMALE$", RuntimeData.Instance.femaleName);

            if (role == "女主")
            {
                this.RoleName.Text = RuntimeData.Instance.femaleName + ":";
            }
            else if (role == "主角")
            {
                this.RoleName.Text = RuntimeData.Instance.maleName + ":";
                this.Head.Source   = RuntimeData.Instance.Team[0].Head;
            }
            else
            {
                this.RoleName.Text = RoleManager.GetRole(role).Name + ":";
            }

            this.CallBack   = callback;
            this.Visibility = System.Windows.Visibility.Visible;

            foreach (SceneHead head in uihost.scence.heads)
            {
                if (head.roleKey == role)
                {
                    uihost.dialogIndicator.Margin     = new Thickness(head.Margin.Left + CommonSettings.MAPUI_ROLEHEAD_WIDTH + 20, head.Margin.Top, 0, 0);
                    uihost.dialogIndicator.Visibility = Visibility.Visible;
                    uihost.dialogIndicator.start_tick();
                    break;
                }
            }
        }
Ejemplo n.º 8
0
        public void Load(string battleKey, CommonSettings.IntCallBack callback)
        {
            CurrentScrollDirection = ScrollDirection.NONE;
            //战斗开始前先选择我方角色
            UIHost uihost = RuntimeData.Instance.gameEngine.uihost;

            uihost.mapUI.resetHead();
            uihost.scence.HideHeads();
            uihost.arenaSelectRole.confirmBack = () =>
            {
                //初始化战场
                uihost.Dispatcher.BeginInvoke(() =>
                {
                    this.Visibility = System.Windows.Visibility.Visible;
                    field.Load(battleKey, callback);
                    this.BattleFieldScrollable = true;
                    //uiHost.Chat(storyScenario);

                    this.IsEnabled = false;
                    this.FadeOut.Stop();
                    this.FadeIn.Begin();
                });
            };
            uihost.arenaSelectRole.cancel.Visibility = Visibility.Collapsed;

            int    maxFriendsNo = 0;
            Battle battle       = BattleManager.GetBattle(battleKey);

            foreach (BattleRole role in battle.battleRoles)
            {
                if (role.team == 1 && role.roleKey == null)
                {
                    maxFriendsNo += 1;
                }
            }

            uihost.arenaSelectRole.load(maxFriendsNo, battle.GetBattleMusts());
        }
Ejemplo n.º 9
0
    public void Show(string title, List <string> options, CommonSettings.IntCallBack cb)
    {
        Show();
        //UIPanel uiObject = this.GetComponent<UIPanel>();
        //uiObject.alpha = 1;

        callback = cb;

        //清空
        foreach (var item in currentItems)
        {
            Destroy(item.gameObject);
        }
        currentItems.Clear();
        selectPanel.repositionNow = true;
        titleLabel.text           = title;
        int index = 0;

        foreach (var o in options)
        {
            //MultiSelectBoxItem item = new MultiSelectBoxItem(o, index++, Callback);
            //this.selectPanel.Children.Add(item);
            UISelectItem newItem = (UISelectItem)Instantiate(selectItemInstance);
            currentItems.Add(newItem);
            newItem.Index = index++;
            newItem.SetText(o);
            newItem.gameObject.SetActive(true);

            newItem.transform.parent        = selectPanel.transform;
            newItem.transform.localScale    = new Vector3(1, 1, 1);
            newItem.transform.localPosition = new Vector3(0, 0, 0);
        }
        selectPanel.repositionNow = true;

        //gameObject.SetActive (true);
    }