public void generateSlot(BinderSkill binderSkill)
        {
            BackColor = System.Drawing.Color.DeepSkyBlue;
            Width = 250;
            Height = 80;

            Label name = new Label();
            name.BackColor = System.Drawing.Color.DarkRed;
            name.Text = binderSkill.name;
            name.AutoSize = true;

            Controls.Add(name);

            int min = 1;

            if (binderSkill.type == SkillType.Perk)
            {
                min = 0;
            }

            TextBoxLevel levelBox = new TextBoxLevel(binderSkill.level, min, binderSkill.maxLevelUnlocked, binderSkill);
            LabeledBox labeledLevelBox = new LabeledBox("Level", levelBox);

            Controls.Add(labeledLevelBox);

            if (binderSkill.requirements != null)
            {
                string skill;
                int level;

                if (binderSkill.getNextRequirement(out skill, out level))
                {
                    Label requirement = new Label();
                    requirement.Text = "Required for next level: " + skill + " level " + level;
                    requirement.AutoSize = true;

                    Controls.Add(requirement);
                }

                else
                {
                    Label placeholder = new Label();
                    Controls.Add(placeholder);
                }
            }

            else if (binderSkill.type != SkillType.Perk)
            {
                TextBoxInt expToNextLevelBox = new TextBoxInt(binderSkill.expToNextLevel, 0, binderSkill.expToLevel);
                LabeledBox labeledExpToNextLevelBox = new LabeledBox("Exp to next level", expToNextLevelBox);

                Controls.Add(labeledExpToNextLevelBox);
            }
        }
        public TabSkills(PlayerDataFile playerDataFile)
            : base()
        {
            this.playerDataFile = playerDataFile;
            Text = "Skills";

            skillList = new SkillCollection(playerDataFile.skills.skillDictionary, playerDataFile.level, playerListeners);

            panel = new TableLayoutPanel();

            panel.Dock = DockStyle.Fill;

            TableLayoutPanel general = new TableLayoutPanel();
            general.Dock = DockStyle.Fill;

            TextBoxPlayerLevel playerLevelBox = new TextBoxPlayerLevel(playerDataFile.level, 1, DataSkill.maxPlayerLevel, playerListeners);
            LabeledBox labeledPlayerLevelBox = new LabeledBox("Player level", playerLevelBox);
            general.Controls.Add(labeledPlayerLevelBox);

            TextBoxInt skillPointsBox = new TextBoxInt(playerDataFile.skillPoints, 0, 10000);
            LabeledBox labeledSkillPointsBox = new LabeledBox("Skill points", skillPointsBox);
            general.Controls.Add(labeledSkillPointsBox);

            panel.Controls.Add(general);

            TableLayoutPanel skillsPanel = new TableLayoutPanel();
            skillsPanel.Dock = DockStyle.Fill;
            skillsPanel.AutoScroll = true;

            List<SlotSkill> skillSlotList = new List<SlotSkill>();

            foreach (BinderSkill binderSkill in skillList.skillList)
            {
                SlotSkill skillSlot = new SlotSkill(binderSkill);

                skillSlotList.Add(skillSlot);
            }

            int count = skillSlotList.Count;
            int perColumn = count / 7;
            int extraColumns = count % 7;
            int done = 0;

            for (int i = 0; i < 7; i++)
            {
                int thisColumn = perColumn;

                if (extraColumns > 0)
                {
                    thisColumn++;
                    extraColumns--;
                }

                for (int j = 0; j < thisColumn; j++)
                {
                    skillsPanel.Controls.Add(skillSlotList[done], i, j);
                    done++;
                }
            }

            panel.Controls.Add(skillsPanel, 0, 1);

            Controls.Add(panel);
        }
        private void generateSlot()
        {
            if (!itemBinder.name.Equals("air"))
            {
                if (itemBinder.stackNumber > 1)
                {
                    TextBoxInt countBox = new TextBoxInt(itemBinder.count, 1, itemBinder.stackNumber);
                    labeledCountBox = new LabeledBox("Count", countBox);

                    Controls.Add(labeledCountBox);
                }

                if (itemBinder.hasQuality)
                {
                    int degradation = itemBinder.getDegradation();

                    degradationBox = new TextBoxDegradation(itemBinder.useTimes, 1, degradation, itemBinder);
                    labeledDegradationBox = new LabeledBox("Durability", degradationBox);

                    qualityBox = new TextBoxQuality(itemBinder.quality, 0, DataItem.MAX_QUALITY, degradationBox);
                    labeledQualityBox = new LabeledBox("Quality", qualityBox);

                    if (itemBinder.parts.Length > 0)
                    {
                        qualityBox.Enabled = false;
                        degradationBox.Enabled = false;

                        if (itemBinder.hasAllParts())
                        {
                            degradationBox.Text = "";
                        }

                        else
                        {
                            qualityBox.Text = 0.ToString();
                            degradationBox.Text = 0.ToString();
                        }
                    }

                    Controls.Add(labeledQualityBox);
                    Controls.Add(labeledDegradationBox);

                    if (itemBinder.magazineSize > 0)
                    {
                        TextBoxInt magazineBox = new TextBoxInt(itemBinder.meta, 0, itemBinder.magazineSize);
                        labeledMagazineBox = new LabeledBox("Magazine", magazineBox);

                        Controls.Add(labeledMagazineBox);
                    }

                    if (itemBinder.magazineItems != null && itemBinder.magazineItems.Length > 1)
                    {
                        magazineItems = new ComboBox();
                        magazineItems.DropDownStyle = ComboBoxStyle.DropDownList;
                        magazineItems.DataSource = new string[] { itemBinder.magazineItems[itemBinder.selectedAmmoTypeIndex.get()] };

                        EventHandler handler = null;
                        handler = (sender, e) => populateComboBox(sender, e, itemBinder.magazineItems, itemBinder.magazineItems[itemBinder.selectedAmmoTypeIndex.get()], handler);

                        magazineItems.DropDown += handler;
                        magazineItems.DropDownClosed += (sender, e) =>
                        {
                            itemBinder.itemValue.selectedAmmoTypeIndex.set((byte)magazineItems.SelectedIndex);
                        };

                        labeledMagazineComboBox = new LabeledBox("Selected ammo", magazineItems);

                        Controls.Add(labeledMagazineComboBox);
                    }

                    if (itemBinder.itemValue.parts.Length > 0)
                    {
                        parts = new Button();
                        parts.Text = "Parts";

                        parts.Click += (sender, e) =>
                        {
                            new WindowParts(itemBinder, this);
                        };

                        Controls.Add(parts);
                    }
                }
            }
        }
        public TabGeneral(PlayerDataFile playerDataFile)
        {
            this.playerDataFile = playerDataFile;
            Text = "General";

            panel = new TableLayoutPanel();
            panel.Dock = DockStyle.Fill;
            panel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
            panel.AutoScroll = true;
            panel.AutoSize = true;

            TextBoxInt score = new TextBoxInt(playerDataFile.score, 0, int.MaxValue);
            LabeledBox scoreBox = new LabeledBox("Score", score);
            panel.Controls.Add(scoreBox);

            TextBoxInt playerKills = new TextBoxInt(playerDataFile.playerKills, 0, int.MaxValue);
            LabeledBox playerK = new LabeledBox("Player kills", playerKills);
            panel.Controls.Add(playerK);

            TextBoxInt zombieKills = new TextBoxInt(playerDataFile.zombieKills, 0, int.MaxValue);
            LabeledBox zombieK = new LabeledBox("Zombie kills", zombieKills);
            panel.Controls.Add(zombieK);

            TextBoxInt deaths = new TextBoxInt(playerDataFile.deaths, 0, int.MaxValue);
            LabeledBox deathsBox = new LabeledBox("Deaths", deaths);
            panel.Controls.Add(deathsBox);

            TextBoxFloat positionX = new TextBoxFloat(playerDataFile.ecd.pos.x, float.MinValue, float.MaxValue);
            LabeledBox posX = new LabeledBox("Position x", positionX);
            panel.Controls.Add(posX);

            TextBoxFloat positionY = new TextBoxFloat(playerDataFile.ecd.pos.y, float.MinValue, float.MaxValue);
            LabeledBox posY = new LabeledBox("Position y", positionY);
            panel.Controls.Add(posY);

            TextBoxFloat positionZ = new TextBoxFloat(playerDataFile.ecd.pos.z, float.MinValue, float.MaxValue);
            LabeledBox posZ = new LabeledBox("Position z", positionZ);
            panel.Controls.Add(posZ);

            TextBoxFloat rotationX = new TextBoxFloat(playerDataFile.ecd.rot.x, float.MinValue, float.MaxValue);
            LabeledBox rotX = new LabeledBox("Rotation x", rotationX);
            panel.Controls.Add(rotX);

            TextBoxFloat rotationY = new TextBoxFloat(playerDataFile.ecd.rot.y, float.MinValue, float.MaxValue);
            LabeledBox rotY = new LabeledBox("Rotation y", rotationY);
            panel.Controls.Add(rotY);

            TextBoxFloat rotationZ = new TextBoxFloat(playerDataFile.ecd.rot.z, float.MinValue, float.MaxValue);
            LabeledBox rotZ = new LabeledBox("Rotation z", rotationZ);
            panel.Controls.Add(rotZ);

            TextBoxInt homeX = new TextBoxInt(playerDataFile.ecd.homePosition.x, int.MinValue, int.MaxValue);
            LabeledBox hX = new LabeledBox("Home x", homeX);
            panel.Controls.Add(hX);

            TextBoxInt homeY = new TextBoxInt(playerDataFile.ecd.homePosition.y, int.MinValue, int.MaxValue);
            LabeledBox hY = new LabeledBox("Home y", homeY);
            panel.Controls.Add(hY);

            TextBoxInt homeZ = new TextBoxInt(playerDataFile.ecd.homePosition.z, int.MinValue, int.MaxValue);
            LabeledBox hZ = new LabeledBox("Home z", homeZ);
            panel.Controls.Add(hZ);

            TextBoxInt backpackX = new TextBoxInt(playerDataFile.droppedBackpackPosition.x, int.MinValue, int.MaxValue);
            LabeledBox bX = new LabeledBox("Backpack position x", backpackX);
            panel.Controls.Add(bX);

            TextBoxInt backpackY = new TextBoxInt(playerDataFile.droppedBackpackPosition.y, int.MinValue, int.MaxValue);
            LabeledBox bY = new LabeledBox("Backpack position y", backpackY);
            panel.Controls.Add(bY);

            TextBoxInt backpackZ = new TextBoxInt(playerDataFile.droppedBackpackPosition.z, int.MinValue, int.MaxValue);
            LabeledBox bZ = new LabeledBox("Backpack position z", backpackZ);
            panel.Controls.Add(bZ);

            Controls.Add(panel);
        }