Exemplo n.º 1
0
            public AttribRow(AttributeCreation parent, CharAttribute attrib, CharacterCreationOutput output)
            {
                myParent = parent;
                myOutput = output;

                myAttrib = attrib;

                myMinusButton = new UIButton(new Vector2(20, 20), new Vector2(LeftColumn, 0))
                {
                    Text       = "-",
                    CentreText = true
                };

                myPlusButton = new UIButton(new Vector2(20, 20), new Vector2(LeftColumn + RightColumn - 20, 0))
                {
                    Text       = "+",
                    CentreText = true
                };


                myLabel = new UILabel(Font.Large, new Vector2(0, 5))
                {
                    Text = attrib.ToString()
                };
                myValueLabel = new UILabel(Font.Large, new Vector2(LeftColumn + RightColumn / 2 - 10, 5))
                {
                    //Text = value.ToString()
                };

                AddChild(myMinusButton);
                AddChild(myPlusButton);
                AddChild(myLabel);
                AddChild(myValueLabel);

                Value = myOutput.GetAttributePoints(myAttrib);

                myMinusButton.Click += new MouseButtonEventHandler(myMinusButton_Click);
                myPlusButton.Click  += new MouseButtonEventHandler(myPlusButton_Click);
            }
Exemplo n.º 2
0
        public void SendCharacterCreate(CharacterCreationOutput output)
        {
            myClients[GameClient.ID].Nickname = output.PlayerName;

            BinaryWriter writer = GetWriter();

            writer.Write((byte)PacketID.CharacterCreate);
            writer.Write(output.PlayerName);
            writer.Write((ushort)CharAttribute.GetAll().Length);
            foreach (CharAttribute attrib in CharAttribute.GetAll())
            {
                writer.Write(attrib.ID);
                writer.Write((byte)output.GetAttributePoints(attrib));
            }
            writer.Write((ushort)CharSkill.GetAll().Length);
            foreach (CharSkill skill in CharSkill.GetAll())
            {
                writer.Write(skill.ID);
                writer.Write((byte)output.GetBaseSkillPoints(skill));
            }

            SendPacket();
        }