예제 #1
0
        private void AddTeamMate_Click(object sender, RoutedEventArgs e)
        {
            if (teamList.Count >= 9)
            {
                MessageBox.Show("队伍已满", "提示");
                return;
            }
            AddSomeThing addTeammate = new AddSomeThing(1);

            addTeammate.Top  = this.Top + this.Height / 3;
            addTeammate.Left = this.Left + this.Width / 3;
            addTeammate.ShowDialog();
            if (String.IsNullOrEmpty(addTeammate.ResultStr))
            {
                return;
            }
            String TeamMateID = ConverID(addTeammate.ResultStr, 1);

            foreach (JToken teamMate in teamList)
            {
                if (teamMate.ToString() == TeamMateID)
                {
                    MessageBox.Show("此人已经在队伍里!", "错误");
                    return;
                }
            }
            teamList.Add(TeamMateID);
            this.Initial();
        }
예제 #2
0
        private void AddItemButton_Click(object sender, RoutedEventArgs e)
        {
            AddSomeThing addTeammate = new AddSomeThing(4);

            addTeammate.Top  = this.Top + this.Height / 3;
            addTeammate.Left = this.Left + this.Width / 3;
            addTeammate.ShowDialog();
            if (String.IsNullOrEmpty(addTeammate.ResultStr))
            {
                return;
            }
            String ItemID = SaveFix.ConverID(addTeammate.ResultStr, 4);

            foreach (JToken item in ItemJarray)
            {
                if (item["m_ItemID"].ToString() == ItemID)
                {
                    MessageBox.Show("该物品已经存在!", "错误");
                    return;
                }
            }

            JToken newItem = new JObject();

            newItem["m_iAmount"] = "1";
            newItem["m_ItemID"]  = ItemID;
            newItem["m_bNew"]    = "True";
            ItemJarray.Add(newItem);
            this.Initial();
        }
예제 #3
0
        private void AddNeiGongButton_Click(object sender, RoutedEventArgs e)
        {
            if (NeigongJArray.Count >= 6)
            {
                MessageBox.Show("内功已满", "提示");
                return;
            }
            AddSomeThing addTeammate = new AddSomeThing(2);

            addTeammate.Top  = this.Top + this.Height / 3;
            addTeammate.Left = this.Left + this.Width / 3;
            addTeammate.ShowDialog();
            if (String.IsNullOrEmpty(addTeammate.ResultStr))
            {
                return;
            }
            String NeiGongID = SaveFix.ConverID(addTeammate.ResultStr, 2);

            foreach (JToken neigong in NeigongJArray)
            {
                if (neigong["iSkillID"].ToString() == NeiGongID)
                {
                    MessageBox.Show("已存在该内功!", "错误");
                    return;
                }
            }
            JToken newNeigong = new JObject();

            newNeigong["bUse"] = "false";
            newNeigong["m_iAccumulationExp"] = "0";
            newNeigong["iSkillID"]           = NeiGongID;
            newNeigong["iLevel"]             = "1";
            NeigongJArray.Add(newNeigong);
            this.Initial();
        }
예제 #4
0
        private void AddTalentButton_Click(object sender, RoutedEventArgs e)
        {
            if (TalentJArray.Count >= 4)
            {
                MessageBox.Show("天赋已满", "提示");
                return;
            }
            AddSomeThing addTeammate = new AddSomeThing(3);

            addTeammate.Top  = this.Top + this.Height / 3;
            addTeammate.Left = this.Left + this.Width / 3;
            addTeammate.ShowDialog();
            if (String.IsNullOrEmpty(addTeammate.ResultStr))
            {
                return;
            }
            String TalentID = SaveFix.ConverID(addTeammate.ResultStr, 3);

            TalentJArray.Add(TalentID);
            this.Initial();
        }