Exemplo n.º 1
0
        public NameCreation(CharacterCreation parent, CharacterCreationOutput output)
        {
            myParent = parent;
            myOutput = output;

            var label = new UILabel(Font.Large, new Vector2(4, 24))
            {
                Text = "Name:"
            };

            AddChild(label);

            myTextbox = new UITextBox(new Vector2(200 - 70 - 2, 20), new Vector2(70, 20))
            {
                Text = "Player"
            };
            AddChild(myTextbox);

            var button = new UIButton(new Vector2(100, 20), new Vector2(100 - 4, 80 - 4))
            {
                Text       = "Next",
                CentreText = true
            };

            button.Click += new MouseButtonEventHandler(button_Click);
            AddChild(button);

            CanResize = true;
            SetSize(200, 100);

            myTextbox.Focus();
        }
Exemplo n.º 2
0
 public SkillRow(Vector2 position, CharSkill skill, CharacterCreationOutput output)
     : base(Font.Large, position)
 {
     myOutput = output;
     mySkill  = skill;
     Refresh();
 }
Exemplo n.º 3
0
 public CharacterCreation()
 {
     Title     = "Attributes and Skills";
     CanClose  = false;
     CanResize = true;
     myOutput  = new CharacterCreationOutput(GameClient.CharacterBaseAttribPoints,
                                             GameClient.CharacterBaseSkillPoints);
     NamePage();
 }
Exemplo n.º 4
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.º 5
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();
        }
Exemplo n.º 6
0
 public static void SendCharacterCreationInfo(CharacterCreationOutput output)
 {
     Nickname = output.PlayerName;
     myServer.SendCharacterCreate(output);
 }
Exemplo n.º 7
0
        public AttributeCreation(CharacterCreation parent, CharacterCreationOutput output)
        {
            myParent = parent;
            myOutput = output;



            float y = 4;

            myPointsLabel = new UILabel(Font.Large, new Vector2(4, y));
            AddChild(myPointsLabel);
            UnusedPoints = GameClient.CharacterUnusedAttribPoints;

            y += 30;

            foreach (CharAttribute attrib in CharAttribute.GetAll())
            {
                var row = new AttribRow(this, attrib, myOutput);
                row.Top  = y;
                row.Left = 4;
                y       += 30;
                AddChild(row);
            }

            y += 20;

            var skills = CharSkill.GetAll();

            skillRows = new SkillRow[skills.Length];

            int i = 0;

            foreach (CharSkill skill in skills)
            {
                var row = new SkillRow(new Vector2(4, y), skill, myOutput);
                y           += 25;
                skillRows[i] = row;
                i++;
                AddChild(row);
            }

            var button = new UIButton(new Vector2(150, 20), new Vector2(300 - 150 - 4, y))
            {
                Text       = "Create Character",
                CentreText = true
            };

            AddChild(button);
            button.Click += new MouseButtonEventHandler(button_Click);

            var back = new UIButton(new Vector2(50, 20), new Vector2(4, y))
            {
                Text       = "Back",
                CentreText = true
            };

            back.Click += new MouseButtonEventHandler(back_Click);
            AddChild(back);

            y += 20;

            Width  = 300;
            Height = y + 4 + PaddingTop + PaddingBottom;
        }