Пример #1
0
        public void Update(char VALUE = '0', string classText = "0")
        {
            Console.WriteLine("VALUE: " + VALUE);
            if (VALUE == 'M')//update button for creating characters
            {
                //FEATURES
                lblUsernameToPresent.Text = ConnectVariables.GetLoggedInUsernameAs();
                txtCharName.Enabled       = true;
                btnRaceOpt.Enabled        = true;
                cmbGender.Enabled         = true;
                btnClassOpt.Enabled       = true;
                cmbElemental.Enabled      = true;
                btnStrMinus.Enabled       = true;
                btnStrPlus.Enabled        = true;
                btnConMinus.Enabled       = true;
                btnConPlus.Enabled        = true;
                btnDexMinus.Enabled       = true;
                btnDexPlus.Enabled        = true;
                btnWisMinus.Enabled       = true;
                btnWisPlus.Enabled        = true;
                btnIntMinus.Enabled       = true;
                btnIntPlus.Enabled        = true;
                btnLukMin.Enabled         = true;
                btnLukPlus.Enabled        = true;
                cmbTalent1.Enabled        = true;
                cmbTalent2.Enabled        = true;
                cmbTalent3.Enabled        = true;
                cmbQuirk1.Enabled         = true;
                cmbQuirk2.Enabled         = true;
                cmbQuirk3.Enabled         = true;

                //CONTROLLS
                btnClear.Visible  = true;
                btnSave.Visible   = false;
                btnCreate.Visible = true;
                btnSelect.Visible = false;
            }
            else if (VALUE == 'L')//update button for loading characters you own
            {
                //FEATURES
                txtCharName.Enabled  = true;
                btnRaceOpt.Enabled   = true;
                cmbGender.Enabled    = true;
                btnClassOpt.Enabled  = true;
                cmbElemental.Enabled = true;
                btnStrMinus.Enabled  = true;
                btnStrPlus.Enabled   = true;
                btnConMinus.Enabled  = true;
                btnConPlus.Enabled   = true;
                btnDexMinus.Enabled  = true;
                btnDexPlus.Enabled   = true;
                btnWisMinus.Enabled  = true;
                btnWisPlus.Enabled   = true;
                btnIntMinus.Enabled  = true;
                btnIntPlus.Enabled   = true;
                btnLukMin.Enabled    = true;
                btnLukPlus.Enabled   = true;
                cmbTalent1.Enabled   = true;
                cmbTalent2.Enabled   = true;
                cmbTalent3.Enabled   = true;
                cmbQuirk1.Enabled    = true;
                cmbQuirk2.Enabled    = true;
                cmbQuirk3.Enabled    = true;

                //CONTROLLS
                btnClear.Visible  = true;
                btnSave.Visible   = true;
                btnCreate.Visible = false;
                btnSelect.Visible = false;
            }
            else if (VALUE == 'O')//update button for loading characters you dont own
            {
                //FEATURES
                txtCharName.Enabled  = false;
                btnRaceOpt.Enabled   = false;
                cmbGender.Enabled    = false;
                btnClassOpt.Enabled  = false;
                cmbElemental.Enabled = false;
                btnStrMinus.Enabled  = false;
                btnStrPlus.Enabled   = false;
                btnConMinus.Enabled  = false;
                btnConPlus.Enabled   = false;
                btnDexMinus.Enabled  = false;
                btnDexPlus.Enabled   = false;
                btnWisMinus.Enabled  = false;
                btnWisPlus.Enabled   = false;
                btnIntMinus.Enabled  = false;
                btnIntPlus.Enabled   = false;
                btnChaMinus.Enabled  = false;
                btnChaPlus.Enabled   = false;
                btnLukMin.Enabled    = false;
                btnLukPlus.Enabled   = false;
                cmbTalent1.Enabled   = false;
                cmbTalent2.Enabled   = false;
                cmbTalent3.Enabled   = false;
                cmbQuirk1.Enabled    = false;
                cmbQuirk2.Enabled    = false;
                cmbQuirk3.Enabled    = false;


                //CONTROLLS
                btnClear.Visible  = false;
                btnSave.Visible   = false;
                btnCreate.Visible = false;
                btnSelect.Visible = false;
            }
            else if (VALUE == 'R')//update race
            {
                Console.WriteLine("Updated Race");
                lblRace.Text = char_Race;
            }
            else if (VALUE == 'C')
            {
                if (classText == "0")
                {
                    Console.WriteLine("Updated Class");
                    Console.WriteLine("Class: " + char_Class);
                    lblClass.Text = char_Class;
                }
                if (lblClass.Text == "Brute")
                {
                    System.Console.WriteLine("Class Setting Image: " + lblClass.Text);
                    Image image1 = Image.FromFile("BruteIcon.jpg");

                    picClassIcon.BackgroundImage = image1;

                    System.Console.WriteLine("Class Set Image: " + lblClass.Text);
                }
                else if (lblClass.Text == "Guardsman")
                {
                    Image image2 = Image.FromFile("GuardsmanIcon.jpg");
                    picClassIcon.BackgroundImage = image2;
                }
                else if (lblClass.Text == "Oracle")
                {
                    Image image3 = Image.FromFile("OracleIcon.jpg");
                    picClassIcon.BackgroundImage = image3;
                }
                else if (lblClass.Text == "Archon")
                {
                    Image image4 = Image.FromFile("ArchonIcon.jpg");
                    picClassIcon.BackgroundImage = image4;
                }
                else if (lblClass.Text == "Huntsman")
                {
                    Image image5 = Image.FromFile("HuntsmanIcon.jpg");
                    picClassIcon.BackgroundImage = image5;
                }
                else if (lblClass.Text == "Reprobate")
                {
                    Image image6 = Image.FromFile("ReprobateIcon.jpg");
                    picClassIcon.BackgroundImage = image6;
                }
                else if (lblClass.Text == "Reaper")
                {
                    Image image7 = Image.FromFile("ReaperIcon.jpg");
                    picClassIcon.BackgroundImage = image7;
                }
                else if (lblClass.Text == "Caster")
                {
                    Image image8 = Image.FromFile("CasterIcon.jpg");
                    picClassIcon.BackgroundImage = image8;
                }
                else if (lblClass.Text == "Elementalist")
                {
                    Image image9 = Image.FromFile("ElementalistIcon.jpg");
                    picClassIcon.BackgroundImage = image9;
                }
            }//update class
            else if (VALUE == 'F')//Load Pre Existing Info For Characters
            {
                string c = "updateImage";
                lblUsernameToPresent.Text = ConnectVariables.GetUsernameDP();
                txtCharName.Text          = ConnectVariables.GetCharNameDP();
                lblRace.Text      = ConnectVariables.GetCharRaceDP();
                cmbGender.Text    = ConnectVariables.GetCharGenderDP();
                lblClass.Text     = ConnectVariables.GetCharClassDP();
                cmbElemental.Text = ConnectVariables.GetCharElementDP();
                lblStr.Text       = ConnectVariables.GetCharStrengthDP();
                lblCon.Text       = ConnectVariables.GetCharConstDP();
                lblDex.Text       = ConnectVariables.GetCharDexDP();
                lblWis.Text       = ConnectVariables.GetCharWisDP();
                lblInt.Text       = ConnectVariables.GetCharIntelDP();
                lblCha.Text       = ConnectVariables.GetCharCharismaDP();
                lblLuk.Text       = ConnectVariables.GetCharLuckDP();
                lblBrawn.Text     = ConnectVariables.GetCharBrawnDP();
                lblHealth.Text    = ConnectVariables.GetCharHealthDP();
                lblNimble.Text    = ConnectVariables.GetCharNimDP();
                lblMemory.Text    = ConnectVariables.GetCharMemDP();
                lblClever.Text    = ConnectVariables.GetCharCleverDP();
                lblCharm.Text     = ConnectVariables.GetCharCharmDP();
                cmbTalent1.Text   = ConnectVariables.GetCharTalDP1();
                cmbTalent2.Text   = ConnectVariables.GetCharTalDP2();
                cmbTalent3.Text   = ConnectVariables.GetCharTalDP3();
                cmbQuirk1.Text    = ConnectVariables.GetCharQuiDP1();
                cmbQuirk2.Text    = ConnectVariables.GetCharQuiDP2();
                cmbQuirk3.Text    = ConnectVariables.GetCharQuiDP3();
                Update('C', c);
            }
            else if (VALUE == 'X')
            {
                lblUsernameToPresent.Text = "";
                txtCharName.Text          = "";
                lblRace.Text      = "";
                cmbGender.Text    = "";
                lblClass.Text     = "";
                cmbElemental.Text = "";
                lblStr.Text       = "";
                lblCon.Text       = "";
                lblDex.Text       = "";
                lblWis.Text       = "";
                lblInt.Text       = "";
                lblCha.Text       = "";
                lblLuk.Text       = "";
                lblBrawn.Text     = "";
                lblHealth.Text    = "";
                lblNimble.Text    = "";
                lblMemory.Text    = "";
                lblClever.Text    = "";
                lblCharm.Text     = "";
                cmbTalent1.Text   = "";
                cmbTalent2.Text   = "";
                cmbTalent3.Text   = "";
                cmbQuirk1.Text    = "";
                cmbQuirk2.Text    = "";
                cmbQuirk3.Text    = "";
            }


            Console.WriteLine("UPDATED CF FORM!");
        }
Пример #2
0
        public void Update(char VALUE = '0')
        {
            if (VALUE == 'C')//Player Character from character creation/update forms
            {
                Update('L');
                maxPages = maxCharIndex / 10;
                rowIndex = 0;
                // Updates index page
                if (pages < 0)
                {
                    currentCharIndex = 0;
                }
                else if (pages == maxPages)
                {
                    currentCharIndex = rowIndex + pages * 10;
                }
                else
                {
                    currentCharIndex = rowIndex + pages * 10;
                }

                for (int i = currentCharIndex; i < maxCharIndex && rowIndex <= 9; i++)
                {
                    rowIndex = dbListCharList.Rows.Add();
                    ConnectDataBases.GetUsersCharacters(i + 1, searchFor);

                    dbListCharList.Rows[rowIndex].Cells[0].Value = ConnectVariables.GetCharNameDP();
                    dbListCharList.Rows[rowIndex].Cells[1].Value = ConnectVariables.GetCharGenderDP();
                    dbListCharList.Rows[rowIndex].Cells[2].Value = ConnectVariables.GetCharClassDP();
                    dbListCharList.Rows[rowIndex].Cells[3].Value = ConnectVariables.GetCharRaceDP();
                    dbListCharList.Rows[rowIndex].Cells[4].Value = ConnectVariables.GetUsernameDP();
                    dbListCharList.Rows[rowIndex].Cells[5].Value = ConnectVariables.GetCharIDDP();
                    currentCharIndex = i;
                    Console.WriteLine("Current Page Index: " + pages);
                    Console.WriteLine("Max Page Index: " + maxPages);
                    Console.WriteLine("Row Index: " + rowIndex);
                    Console.WriteLine("Current Char Index: " + currentCharIndex);
                    Console.WriteLine("Max Char Index: " + maxCharIndex);
                }
                //Button Updates to page
                Update('O');
            }
            else if (VALUE == 'P')//Last Page
            {
                pages -= 1;
                Update('C');
            }
            else if (VALUE == 'N')//Next Page
            {
                pages += 1;
                Update('C');
            }
            else if (VALUE == 'L')
            {
                dbListCharList.Rows.Clear();
            }
            else if (VALUE == 'M')// Return to menu
            {
                currentCharIndex = 0;
                pages            = 0;
                Update('L');
                returnValue = 'M';
            }
            else if (VALUE == 'B')// Return to char Create form
            {
                currentCharIndex = 0;
                pages            = 0;
                Update('L');
                returnValue = 'B';
            }
            else if (VALUE == 'O')//update buttons
            {
                if (pages <= 0)
                {
                    pages = 0;
                    btnPrevious.Enabled = false;
                    btnNext.Enabled     = true;
                }
                else if (pages == maxPages)
                {
                    btnNext.Enabled     = false;
                    btnPrevious.Enabled = true;
                }
                else
                {
                    btnPrevious.Enabled = true;
                    btnNext.Enabled     = true;
                }
            }
            else if (VALUE == 'A')
            {
                maxCharIndex = ConnectDataBases.GetAllCharacters();
                searchFor    = 'A';
            }
            else if (VALUE == 'Z')
            {
                maxCharIndex = ConnectDataBases.GetUsersCharactersAmount();
                searchFor    = 'Z';
            }
            else if (VALUE == 'S')
            {
                partyCharSelet = true;
            }
        }