public Panel generateItemPanel(int itemNumber) { UserSavedInventoryData temp = (UserSavedInventoryData)usrSavedInventoryData.userInvList[itemNumber]; Console.WriteLine(temp.name); Console.WriteLine(temp.count); //Panel itemPanel = new Panel(); FlowLayoutPanel flp_itemPanel = new FlowLayoutPanel(); SetDoubleBuffered(flp_itemPanel); flp_itemPanel.Size = new Size(100, 300); flp_itemPanel.Margin = new Padding(0, 0, 0, 0); flp_itemPanel.WrapContents = true; //itemPanel.Wrap = true; //itemPanel.AutoSize = true; //commentoutforflowlayoutpanel //itemPanel.Dock = DockStyle.Fill; //itemPanel.Margin.All = 0; //itemPanel.Margin.All = (0, 0, 0, 0); //[PictureBox] PictureBox pctbx = new PictureBox(); pctbx.Size = new Size(50, 50); pctbx.Location = new Point(25, 0); pctbx.SizeMode = PictureBoxSizeMode.Zoom; //Zoom not StretchImage to keep aspect ratio //pctbx.ImageLocation = "https://static.wikia.nocookie.net/gensin-impact/images/a/aa/Item_Cor_Lapis.png/revision/latest/scale-to-width-down/256?cb=20201202043432"; pctbx.ImageLocation = temp.imgURL; //tableLayoutPanel2.Controls.Add(pctbx, r, c); //[ITEM NAME] Label lbl = new Label(); //lbl.Location = new Point(25, 70); lbl.AutoSize = true; lbl.Text = temp.name; //lbl.Text = "ITEM NAME"; //lbl.Text = string.Format("({0}, {1})", r, c); //tableLayoutPanel2.Controls.Add(lbl, r, c); //[ItemCount (Label + TextBox)] Label lblc = new Label(); //lblc.Location = new Point(25, 100); lbl.AutoSize = true; lblc.Text = "[Count]"; //lbl.Text = string.Format("({0}, {1})", r, c); //tableLayoutPanel2.Controls.Add(lbl, r, c); //WRONG //TextBox txtbx = new TextBox(); ////txtbx.Location = new Point(25, 120); ////txtbx.Dock = new DockStyle(fill); //txtbx.Width = 50; //txtbx.Text = temp.count; //Right NumericUpDown numBox = new NumericUpDown(); numBox.Name = temp.itemID.ToString(); //Set name of TextBox numBox.Width = 50; numBox.Value = temp.count; //numBox.ValueChanged += new EventHandler(itemCount_Changed); //EventHandler itemCount_Changed = null; numBox.ValueChanged += delegate { usrSavedInventoryData.updateUserItemCount(User.userID, Int32.Parse(numBox.Name), (int)numBox.Value); //CALL MATH FUNCTIONS LATER HERE ////////// }; /*numBox.Leave += delegate { * usrSavedInventoryData.updateUserItemCount(User.userID, Int32.Parse(numBox.Name), (int)numBox.Value); * };*/ flp_itemPanel.Controls.Add(pctbx); flp_itemPanel.Controls.Add(lbl); flp_itemPanel.Controls.Add(lblc); //flp_itemPanel.Controls.Add(txtbx); flp_itemPanel.Controls.Add(numBox); return(flp_itemPanel); }
//gen char panel public Panel genCharPanel(int rowNum) { UserSavedCharacterData temp = (UserSavedCharacterData)usrSavedCharacterData.userCharList[rowNum]; //[Char Panel] Panel charPanel = new Panel(); charPanel.Size = new Size(947, 253); //882, 253 //947, 253 charPanel.BorderStyle = BorderStyle.FixedSingle; //[Del Char Record Button] Button delCharRecButton = new Button(); delCharRecButton.Font = new Font("Microsoft Sans Serif", 10, FontStyle.Bold); delCharRecButton.ForeColor = System.Drawing.Color.Crimson; delCharRecButton.AutoSize = true; delCharRecButton.Text = "❌"; delCharRecButton.Size = new Size(35, 27); delCharRecButton.Location = new Point(898, 12); //833, 12 delCharRecButton.MouseClick += delegate { DialogResult result = MessageBox.Show("Delete Character Record?", "Confirmation", MessageBoxButtons.YesNoCancel); //YesNoCancel -> YesNo if (result == DialogResult.Yes) { //... usrSavedCharacterData.delCharRecord(User.userID, temp.charID); initializeTable(User.userID); //Refresh } else if (result == DialogResult.No) { //... return; } else { //... return; } }; //[Name Label] Label nameLabel = new Label(); nameLabel.Location = new Point(8, 221); //12, 221 nameLabel.AutoSize = true; //nameLabel.Text = "NAME"; nameLabel.Font = new Font("Impact", 14); nameLabel.Text = temp.Name; //[Large Photo (Char)] PictureBox pctbxChar = new PictureBox(); pctbxChar.Size = new Size(112, 200); //pctbx.SizeMod pctbxChar.Location = new Point(12, 12); pctbxChar.SizeMode = PictureBoxSizeMode.Zoom; //Zoom not StretchImage to keep aspect ratio //pctbx.SizeMode = PictureBoxSizeMode.AutoSize; pctbxChar.ImageLocation = temp.imgURLchar; //[Talent PictureBoxes] PictureBox pctbxT1 = new PictureBox(); PictureBox pctbxT2 = new PictureBox(); PictureBox pctbxT3 = new PictureBox(); pctbxT1.Size = new Size(50, 50); pctbxT2.Size = new Size(50, 50); pctbxT3.Size = new Size(50, 50); pctbxT1.Location = new Point(130, 12); //300, 12 pctbxT2.Location = new Point(130, 68); pctbxT3.Location = new Point(130, 124); pctbxT1.SizeMode = PictureBoxSizeMode.Zoom; pctbxT2.SizeMode = PictureBoxSizeMode.Zoom; pctbxT3.SizeMode = PictureBoxSizeMode.Zoom; pctbxT1.ImageLocation = temp.imgURLt1; pctbxT2.ImageLocation = temp.imgURLt2; pctbxT3.ImageLocation = temp.imgURLt3; //[Talent Labels] Label t1Label = new Label(); Label t2Label = new Label(); Label t3Label = new Label(); t1Label.AutoSize = true; t2Label.AutoSize = true; t3Label.AutoSize = true; t1Label.Font = new Font("Impact", 14); t2Label.Font = new Font("Impact", 14); t3Label.Font = new Font("Impact", 14); t1Label.Location = new Point(182, 12); t2Label.Location = new Point(182, 68); t3Label.Location = new Point(182, 124); t1Label.Text = temp.talent1Name; t2Label.Text = temp.talent2Name; t3Label.Text = temp.talent3Name; //[Weapon Controls Logic] #region [addWeapon Controls + Functionality] //Dropdown (ComboBox) for weapon select ComboBox wpcbbx = new ComboBox(); wpcbbx.Font = new Font("Arial", 11); //set datasource to chars list; //cbbx.DataSource //cbbx.Items.Add([Select Character]"}); //wpcbbx.Text = "Select Weapon"; wpcbbx.Width = 195; //212, 21 wpcbbx.Visible = false; //POSITION NEEDS TO BE SET wpcbbx.Location = new Point(698, 47); //633, 47 wpcbbx.DropDownStyle = ComboBoxStyle.DropDownList; //[Add Weapon Button Logic] Button addWeapon = new Button(); addWeapon.Size = new Size(35, 27); //96, 29 addWeapon.Location = new Point(698, 12); //633, 12 //toggleCalc.Font = new Font("Microsoft Sans Serif", 10, FontStyle.Bold); addWeapon.AutoSize = true; addWeapon.Text = "Add Weapon"; //addWeapon.Visible = false; //Maybe Not Needed?, check visibility section below... addWeapon.Visible = true; //[Add Weapon Save/Cancel Button] Button addWeaponSave = new Button(); Button addWeaponCancel = new Button(); addWeaponSave.Size = new Size(88, 24); addWeaponSave.Location = new Point(698, 74); //633, 74 //addWeaponSave.AutoSize = true; addWeaponSave.Text = "Save"; addWeaponCancel.Size = new Size(88, 24); addWeaponCancel.Location = new Point(791, 74); //735, 74 //726, 74 //addWeaponCancel.AutoSize = true; addWeaponCancel.Text = "Cancel"; addWeaponSave.Visible = false; addWeaponCancel.Visible = false; //[Delete Weapon] Button delWeapon = new Button(); delWeapon.Size = new Size(35, 27); //96, 29 delWeapon.Location = new Point(687, 12); //633, 12 //622, 12 //toggleCalc.Font = new Font("Microsoft Sans Serif", 10, FontStyle.Bold); delWeapon.AutoSize = true; delWeapon.Text = "Delete Weapon"; delWeapon.Visible = false; //Maybe Not Needed?, check visibility section below... //[Weapon Controls Visibility Logic] if (temp.wepID == -1) { addWeapon.Visible = true; delWeapon.Visible = false; } else { addWeapon.Visible = false; delWeapon.Visible = true; //function get wepInfo? dbWeaponsList.getWeaponData(temp.wepID); dbWeapon tempWep = (dbWeapon)dbWeaponsList.userCharWeaponData[0]; //[Weapon Display Items] Label wepNameLabel = new Label(); wepNameLabel.AutoSize = true; wepNameLabel.Font = new Font("Impact", 14); wepNameLabel.Location = new Point(684, 47); //619, 47 wepNameLabel.Text = tempWep.name; //wepNameLabel.Visible = true; PictureBox pctbxWEP = new PictureBox(); pctbxWEP.Size = new Size(100, 100); pctbxWEP.Location = new Point(684, 74); //619, 74 pctbxWEP.SizeMode = PictureBoxSizeMode.Zoom; pctbxWEP.ImageLocation = tempWep.imgURL; charPanel.Controls.Add(wepNameLabel); charPanel.Controls.Add(pctbxWEP); } addWeapon.MouseClick += delegate { wpcbbx.Visible = true; addWeaponSave.Visible = true; addWeaponCancel.Visible = true; //Add Weapons To CBBX wpcbbx.Items.Clear(); string dText = "Select Weapon"; wpcbbx.Items.Insert(0, dText); wpcbbx.SelectedIndex = 0; Console.WriteLine("SELECTEDITEM: " + wpcbbx.SelectedItem); wpcbbx.MouseClick += delegate { if (wpcbbx.SelectedIndex == 0 && wpcbbx.SelectedItem == dText) { wpcbbx.Items.RemoveAt(0); } }; wpcbbx.Leave += delegate { Console.WriteLine("SELECTEDINDEX LEAVE: " + wpcbbx.SelectedIndex); Console.WriteLine("SELECTEDITEM LEAVE: " + wpcbbx.SelectedItem); if (wpcbbx.SelectedIndex == 0 && wpcbbx.SelectedItem == "") { wpcbbx.Items.Insert(0, dText); wpcbbx.SelectedIndex = 0; } }; int listCount = 1; for (int i = 1; i < dbWeaponsList.dbWepList.Count; i++) { dbWeapon tempWep = (dbWeapon)dbWeaponsList.dbWepList[i]; //UserSavedCharacterData temp = (UserSavedCharacterData)usrSavedCharacterData.addNewCharList[i]; //wpcbbx.Items.Add(i + 1 + ". " + tempWep.name); if (temp.weaponType == tempWep.wepType) //List Correct Weapon Types for ea character { wpcbbx.Items.Add(listCount + ". " + tempWep.name); listCount++; } } }; addWeaponSave.MouseClick += delegate { //Visibility addWeapon.Visible = false; wpcbbx.Visible = false; addWeaponSave.Visible = false; addWeaponCancel.Visible = false; delWeapon.Visible = true; //Maybe not needed... //[Function Call] //[Get Actual wepID of wep in DB] //Possibly a better way to do this, char is like this above, in addNewChar string wepName = (string)wpcbbx.SelectedItem; wepName = wepName.Substring(wepName.IndexOf(" ") + 1); Console.WriteLine("wepName: " + wepName); int actualWepID = -1; for (int i = 0; i < dbWeaponsList.dbWepList.Count; i++) { dbWeapon tempWep = (dbWeapon)dbWeaponsList.dbWepList[i]; if (wepName == tempWep.name) //List Correct Weapon Types for ea character { Console.WriteLine("SELECTEDITEM IF STATMENT: " + wpcbbx.SelectedItem); actualWepID = tempWep.wepID; } } //int actualWepID = wpcbbx.SelectedIndex.; Console.WriteLine("actualWepID: " + actualWepID); //Call Function to add charWep to User Records usrSavedCharacterData.addCharWeaponRecord(User.userID, temp.charID, actualWepID); //Refresh initializeTable(User.userID); //Refresh }; addWeaponCancel.MouseClick += delegate { //Visibility addWeapon.Visible = true; wpcbbx.Visible = false; addWeaponSave.Visible = false; addWeaponCancel.Visible = false; //Function Call? }; delWeapon.MouseClick += delegate { /* * //PROBABLY NOT NEEDED * wpcbbx.Visible = true; * addWeaponSave.Visible = true; * addWeaponCancel.Visible = true;*/ //Function Call DialogResult result = MessageBox.Show("Delete Character's Weapon Record?", "Confirmation", MessageBoxButtons.YesNoCancel); //YesNoCancel -> YesNo if (result == DialogResult.Yes) { //... usrSavedCharacterData.delCharWeaponRecord(User.userID, temp.charID); initializeTable(User.userID); //Refresh } else if (result == DialogResult.No) { //... return; } else { //... return; } //call db set back to -1 //Refresh //initializeTable(User.userID); //Refresh }; #endregion //(Enable/Disable) Toggle Calculation Button #region [Toggle Calculation Buttons] Button toggleCalc = new Button(); toggleCalc.Size = new Size(35, 27); toggleCalc.Location = new Point(782, 12); //717, 12 //toggleCalc.Font = new Font("Microsoft Sans Serif", 10, FontStyle.Bold); toggleCalc.AutoSize = true; toggleCalc.Text = "Enable Calculations"; if (temp.toggleCalc == 1) //toggleCalc Enabled { //Move Other Elements //Call Calc Function toggleCalc.Text = "Disable Calculations"; /*toggleCalc.MouseClick += delegate * { * * };*/ //addWeapon.Visible = true; //Probably redundant, look above... //[Controls for Calc] NumericUpDown numBoxCharLevel = new NumericUpDown(); numBoxCharLevel.Name = "charLevel"; numBoxCharLevel.Width = 50; numBoxCharLevel.Location = new Point(186, 221); //130, 192 numBoxCharLevel.Value = temp.charLevel; //INITIAL VALUE NumericUpDown numBoxCharLevelDesired = new NumericUpDown(); numBoxCharLevelDesired.Name = "charDesiredLevel"; numBoxCharLevelDesired.Width = 50; numBoxCharLevelDesired.Location = new Point(242, 221); numBoxCharLevelDesired.Value = temp.charDesiredLevel; //INITIAL VALUE NumericUpDown numBoxT1Level = new NumericUpDown(); numBoxT1Level.Name = "t1Level"; numBoxT1Level.Width = 50; numBoxT1Level.Location = new Point(186, 42); numBoxT1Level.Value = temp.t1Level; //INITIAL VALUE NumericUpDown numBoxT1LevelDesired = new NumericUpDown(); numBoxT1LevelDesired.Name = "t1DesiredLevel"; numBoxT1LevelDesired.Width = 50; numBoxT1LevelDesired.Location = new Point(242, 42); numBoxT1LevelDesired.Value = temp.t1DesiredLevel; //INITIAL VALUE NumericUpDown numBoxT2Level = new NumericUpDown(); numBoxT2Level.Name = "t2Level"; numBoxT2Level.Width = 50; numBoxT2Level.Location = new Point(186, 98); numBoxT2Level.Value = temp.t2Level; //INITIAL VALUE NumericUpDown numBoxT2LevelDesired = new NumericUpDown(); numBoxT2LevelDesired.Name = "t2DesiredLevel"; numBoxT2LevelDesired.Width = 50; numBoxT2LevelDesired.Location = new Point(242, 98); numBoxT2LevelDesired.Value = temp.t2DesiredLevel; //INITIAL VALUE NumericUpDown numBoxT3Level = new NumericUpDown(); numBoxT3Level.Name = "t3Level"; numBoxT3Level.Width = 50; numBoxT3Level.Location = new Point(186, 154); numBoxT3Level.Value = temp.t3Level; //INITIAL VALUE NumericUpDown numBoxT3LevelDesired = new NumericUpDown(); numBoxT3LevelDesired.Name = "t3DesiredLevel"; numBoxT3LevelDesired.Width = 50; numBoxT3LevelDesired.Location = new Point(242, 154); numBoxT3LevelDesired.Value = temp.t3DesiredLevel; //INITIAL VALUE if (temp.wepID != -1) { NumericUpDown numBoxWepLevel = new NumericUpDown(); numBoxWepLevel.Name = "wepLevel"; numBoxWepLevel.Width = 50; numBoxWepLevel.Location = new Point(684, 221); //725, 74 //619, 221 numBoxWepLevel.Value = temp.wepLevel; //INITIAL VALUE NumericUpDown numBoxWepLevelDesired = new NumericUpDown(); numBoxWepLevelDesired.Name = "wepDesiredLevel"; numBoxWepLevelDesired.Width = 50; numBoxWepLevelDesired.Location = new Point(740, 221); //781, 74 //675, 221 numBoxWepLevelDesired.Value = temp.wepDesiredLevel; //INITIAL VALUE numBoxWepLevel.ValueChanged += delegate { int flag = usrSavedCharacterData.updateLevel(User.userID, temp.charID, numBoxWepLevel.Name, numBoxWepLevelDesired.Name, (int)numBoxWepLevel.Value, (int)numBoxWepLevelDesired.Value); if (flag == 0) { numBoxWepLevelDesired.Value += 1; numBoxWepLevel.Value = numBoxWepLevelDesired.Value; } }; numBoxWepLevelDesired.ValueChanged += delegate { int flag = usrSavedCharacterData.updateLevel(User.userID, temp.charID, numBoxWepLevel.Name, numBoxWepLevelDesired.Name, (int)numBoxWepLevel.Value, (int)numBoxWepLevelDesired.Value); if (flag == 0) { numBoxWepLevel.Value = numBoxWepLevelDesired.Value; } }; /*FlowLayoutPanel flp_wepMaterialPanel = new FlowLayoutPanel(); * SetDoubleBuffered(flp_wepMaterialPanel); * flp_wepMaterialPanel.Size = new Size(139, 164); * flp_wepMaterialPanel.Location = new Point(796, 74); //731, 74 * flp_wepMaterialPanel.WrapContents = true;*/ //call function to get contents? //[Set Min/Max Values & Add Controls] numBoxWepLevel.Minimum = 1; numBoxWepLevel.Maximum = 90; numBoxWepLevelDesired.Minimum = 1; numBoxWepLevelDesired.Maximum = 90; charPanel.Controls.Add(numBoxWepLevel); charPanel.Controls.Add(numBoxWepLevelDesired); //charPanel.Controls.Add(flp_wepMaterialPanel); } //[Set Min/Max Values & Add Controls] numBoxCharLevel.Minimum = 1; numBoxCharLevel.Maximum = 90; numBoxCharLevelDesired.Minimum = 1; numBoxCharLevelDesired.Maximum = 90; numBoxT1Level.Minimum = 1; numBoxT1Level.Maximum = 10; numBoxT1LevelDesired.Minimum = 1; numBoxT1LevelDesired.Maximum = 10; numBoxT2Level.Minimum = 1; numBoxT2Level.Maximum = 10; numBoxT2LevelDesired.Minimum = 1; numBoxT2LevelDesired.Maximum = 10; numBoxT3Level.Minimum = 1; numBoxT3Level.Maximum = 10; numBoxT3LevelDesired.Minimum = 1; numBoxT3LevelDesired.Maximum = 10; /*FlowLayoutPanel flp_charMaterialPanel = new FlowLayoutPanel(); * SetDoubleBuffered(flp_charMaterialPanel); * flp_charMaterialPanel.Size = new Size(357, 203); //311, 203 * flp_charMaterialPanel.Location = new Point(322, 35); * flp_charMaterialPanel.WrapContents = true; * flp_charMaterialPanel.AutoScroll = true;*/ //[genCalc Functions] int purplesNeeded = genCalc.calcRangesEXPTablePurples((int)numBoxCharLevel.Value, (int)numBoxCharLevelDesired.Value); usrSavedInventoryData.getUserInvEXPBooks(User.userID); int numPurples = 0; int numBlues = 0; int numGreens = 0; for (int i = 0; i <= 2; i++) { UserSavedInventoryData invBooks = (UserSavedInventoryData)usrSavedInventoryData.userInvEXPBooks[i]; if (i == 0) { numGreens = invBooks.count; } if (i == 1) { numBlues = invBooks.count; } if (i == 2) { numPurples = invBooks.count; } } Console.WriteLine("form1 - BOOKS: purple " + numPurples + " blue " + numBlues + " green " + numGreens); int[] bookArray = genCalc.calcEXPBookDistribution(purplesNeeded, numPurples, numBlues, numGreens); //generateCharMaterialItemPanel(bookArray,); /*flp_charMaterialPanel.Controls.Add(generateItemPanel(2)); * flp_charMaterialPanel.Controls.Add(generateItemPanel(1)); * flp_charMaterialPanel.Controls.Add(generateItemPanel(0)); * flp_charMaterialPanel.Controls.Add(generateItemPanel(temp.ascElementalMat)); * flp_charMaterialPanel.Controls.Add(generateItemPanel(temp.ascElementalBossMat));*/ //[Add onValueChanged Events] numBoxCharLevel.ValueChanged += delegate { int flag = usrSavedCharacterData.updateLevel(User.userID, temp.charID, numBoxCharLevel.Name, numBoxCharLevelDesired.Name, (int)numBoxCharLevel.Value, (int)numBoxCharLevelDesired.Value); if (flag == 0) { numBoxCharLevelDesired.Value += 1; numBoxCharLevel.Value = numBoxCharLevelDesired.Value; } }; numBoxCharLevelDesired.ValueChanged += delegate { int flag = usrSavedCharacterData.updateLevel(User.userID, temp.charID, numBoxCharLevel.Name, numBoxCharLevelDesired.Name, (int)numBoxCharLevel.Value, (int)numBoxCharLevelDesired.Value); if (flag == 0) { numBoxCharLevel.Value = numBoxCharLevelDesired.Value; } }; numBoxT1Level.ValueChanged += delegate { int flag = usrSavedCharacterData.updateLevel(User.userID, temp.charID, numBoxT1Level.Name, numBoxT1LevelDesired.Name, (int)numBoxT1Level.Value, (int)numBoxT1LevelDesired.Value); if (flag == 0) { numBoxT1LevelDesired.Value += 1; numBoxT1Level.Value = numBoxT1LevelDesired.Value; } }; numBoxT1LevelDesired.ValueChanged += delegate { int flag = usrSavedCharacterData.updateLevel(User.userID, temp.charID, numBoxT1Level.Name, numBoxT1LevelDesired.Name, (int)numBoxT1Level.Value, (int)numBoxT1LevelDesired.Value); if (flag == 0) { numBoxT1Level.Value = numBoxT1LevelDesired.Value; } }; numBoxT2Level.ValueChanged += delegate { int flag = usrSavedCharacterData.updateLevel(User.userID, temp.charID, numBoxT2Level.Name, numBoxT2LevelDesired.Name, (int)numBoxT2Level.Value, (int)numBoxT2LevelDesired.Value); if (flag == 0) { numBoxT2LevelDesired.Value += 1; numBoxT2Level.Value = numBoxT2LevelDesired.Value; } }; numBoxT2LevelDesired.ValueChanged += delegate { int flag = usrSavedCharacterData.updateLevel(User.userID, temp.charID, numBoxT2Level.Name, numBoxT2LevelDesired.Name, (int)numBoxT2Level.Value, (int)numBoxT2LevelDesired.Value); if (flag == 0) { numBoxT2Level.Value = numBoxT2LevelDesired.Value; } }; numBoxT3Level.ValueChanged += delegate { int flag = usrSavedCharacterData.updateLevel(User.userID, temp.charID, numBoxT3Level.Name, numBoxT3LevelDesired.Name, (int)numBoxT3Level.Value, (int)numBoxT3LevelDesired.Value); if (flag == 0) { numBoxT3LevelDesired.Value += 1; numBoxT3Level.Value = numBoxT3LevelDesired.Value; } }; numBoxT3LevelDesired.ValueChanged += delegate { int flag = usrSavedCharacterData.updateLevel(User.userID, temp.charID, numBoxT3Level.Name, numBoxT3LevelDesired.Name, (int)numBoxT3Level.Value, (int)numBoxT3LevelDesired.Value); if (flag == 0) { numBoxT3Level.Value = numBoxT3LevelDesired.Value; } }; //[Add Controls] charPanel.Controls.Add(numBoxCharLevel); charPanel.Controls.Add(numBoxCharLevelDesired); charPanel.Controls.Add(numBoxT1Level); charPanel.Controls.Add(numBoxT1LevelDesired); charPanel.Controls.Add(numBoxT2Level); charPanel.Controls.Add(numBoxT2LevelDesired); charPanel.Controls.Add(numBoxT3Level); charPanel.Controls.Add(numBoxT3LevelDesired); //charPanel.Controls.Add(flp_charMaterialPanel); } else //toggleCalc Disabled { //Move Other Elements toggleCalc.Text = "Enable Calculations"; /*toggleCalc.MouseClick += delegate * { * };*/ //addWeapon.Visible = false; //Not redundant... Look above... } int nextValue = temp.toggleCalc; toggleCalc.MouseClick += delegate { Console.WriteLine("NEXTVALUE: " + nextValue); nextValue = updateToggleCalc(User.userID, temp.charID, nextValue); if (nextValue == 1) //Enabled { //toggleCalc.Text = "Disable Calculations"; //addWeapon.Visible = true; //Not redundant... Look above... //Refresh initializeTable(User.userID); //Refresh } else //Disabled { //toggleCalc.Text = "Enable Calculations"; //addWeapon.Visible = false; //Not redundant... Look above... //Refresh initializeTable(User.userID); //Refresh } }; #endregion //[Adding Controls To Panel] #region [charPanel.Controls.Add(...)] //[Add Controls] charPanel.Controls.Add(delCharRecButton); charPanel.Controls.Add(nameLabel); charPanel.Controls.Add(pctbxChar); //[PictureBoxTalents] charPanel.Controls.Add(pctbxT1); charPanel.Controls.Add(pctbxT2); charPanel.Controls.Add(pctbxT3); //[Talent Name Labels] charPanel.Controls.Add(t1Label); charPanel.Controls.Add(t2Label); charPanel.Controls.Add(t3Label); //[Toggle CalcButton] charPanel.Controls.Add(toggleCalc); //[Weapon Controls (addWeapon)] charPanel.Controls.Add(addWeapon); charPanel.Controls.Add(wpcbbx); charPanel.Controls.Add(addWeaponSave); charPanel.Controls.Add(addWeaponCancel); charPanel.Controls.Add(delWeapon); #endregion return(charPanel); }
/*public Panel generateCharMaterialItemPanel(int[] bookArray, ) * { * Panel a = new Panel(); * return a; * }*/ #endregion #region [Dynamically Generated Controls (Generation + Styling)] #endregion #region [TableLayoutPanel Item Inventory => tlp_ItemInv] public void generateItemInventory() { //test usrSavedInventoryData.getUserInventoryData(User.userID); //Clear flp_ItemInv.Controls.Clear(); //flowTableLayout Properties (In-Case) flp_ItemInv.WrapContents = true; flp_ItemInv.AutoScroll = true; flp_ItemInv.AutoSize = true; //add items int itemcount = usrSavedInventoryData.userInvList.Count; int labelRow = 0; int labelType = 1; //bool firstOccurrence = true; for (int i = 0; i < itemcount; i++) { UserSavedInventoryData temp = (UserSavedInventoryData)usrSavedInventoryData.userInvList[i]; Console.WriteLine(temp.name); if (i == labelRow && labelType == temp.itemType) { if (i != 0) { //BREAK AFTER LAST ITEM Label lblhidden = new Label(); lblhidden.Size = new Size(0, 0); lblhidden.Width = 0; lblhidden.Height = 0; lblhidden.Margin = new Padding(0, 0, 0, 0); flp_ItemInv.Controls.Add(lblhidden); flp_ItemInv.SetFlowBreak(lblhidden, true); //flowLayoutPanel1.SetFlowBreak(generateItemPanel(), true); } //ACTUAL LABEL Label lbl = new Label(); //lbl.Text = "TESTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTtttttttttttttttttttttttttTTTT"; lbl.Text = temp.itemTypeString; lbl.Font = new Font("Impact", 70, FontStyle.Underline); //tableLayoutPanel4.Controls.Add(lbl, 0, labelRow); //lbl.Size = new Size(0, 0); lbl.AutoSize = true; lbl.Margin = new Padding(0, 0, 0, 0); flp_ItemInv.Controls.Add(lbl); Label lblhidden2 = new Label(); lblhidden2.Size = new Size(0, 0); lblhidden2.Width = 0; lblhidden2.Height = 0; lblhidden2.Margin = new Padding(0, 0, 0, 0); flp_ItemInv.Controls.Add(lblhidden2); flp_ItemInv.SetFlowBreak(lblhidden2, true); //flp_ItemInv.SetFlowBreak(lbl, true); labelType++; } flp_ItemInv.Controls.Add(generateItemPanel(i)); labelRow++; } }