YATA.Sett.Sett C# (CSharp) Method

Sett() public method

public Sett ( ) : System
return System
        public Sett()
        {
            InitializeComponent();
            try {
            #region language
            if (Form1.APP_LNG.Trim().ToLower() != "english" && File.Exists(@"languages\" + Form1.APP_LNG + @"\sett.txt"))
            {
                messages.Clear();
                string[] lng = File.ReadAllLines(@"languages\" + Form1.APP_LNG + @"\sett.txt");
                foreach (string line in lng)
                {
                    if (!line.StartsWith(";"))
                    {
                        string[] tmp = line.Replace(@"\r\n", Environment.NewLine).Split(Convert.ToChar("="));
                        if (line.StartsWith("btn")) { ((Button)this.Controls.Find(tmp[0], true)[0]).Text = tmp[1]; }
                        else if (line.StartsWith("label")) { ((Label)this.Controls.Find(tmp[0], true)[0]).Text = tmp[1]; }
                        else if (line.StartsWith("CHK")) { ((CheckBox)this.Controls.Find(tmp[0], true)[0]).Text = tmp[1]; }
                        else if (line.StartsWith("grp")) { ((GroupBox)this.Controls.Find(tmp[0], true)[0]).Text = tmp[1]; }
                        else if (line.StartsWith("@")) { messages.Add(line.Replace(@"\r\n", Environment.NewLine).Remove(0, 1)); }
                    }
                }
            }
                toolTip1.SetToolTip(label5, messages[0]);
                toolTip1.SetToolTip(label6, messages[1]);
                toolTip1.SetToolTip(label18, messages[2]);
                toolTip1.SetToolTip(label7, messages[3]);
                toolTip1.SetToolTip(label8, messages[4]);
                toolTip1.SetToolTip(label9, messages[5]);
                toolTip1.SetToolTip(label19, messages[6]);
                toolTip1.SetToolTip(label10, messages[7]);
                toolTip1.SetToolTip(label11, messages[8]);
                toolTip1.SetToolTip(label12, messages[9]);
                toolTip1.SetToolTip(label13, messages[10]);
                toolTip1.SetToolTip(label14, messages[11]);
                toolTip1.SetToolTip(label15, messages[12]);
                toolTip1.SetToolTip(label16, messages[13]);
                toolTip1.SetToolTip(label17, messages[14]);
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show("There was an error initializing the language data for this window, try to set the language to english, if you can't because the settings windows crashes too, delete the languages folder");
                MessageBox.Show("for translators: 'Lbl_something' is diffrent from 'lbl_something', follow the template");
                MessageBox.Show("Exception details: " + ex.Message);
                this.Close();
            }
            getColors();
            Button[] col1 = AddButtons(4, 0 , colCursor, Form1.enableSec[0] == 1 ? true : false,0,-Form1.APP_Move_buttons_colors);
            Button[] col2 = AddButtons(2, 1, col3DFolder, Form1.enableSec[1] == 1 ? true : false,1, -Form1.APP_Move_buttons_colors);
            Button[] col3 = AddButtons(3, 2, colFiles, Form1.enableSec[3] == 1 ? true : false,2, -Form1.APP_Move_buttons_colors);
            Button[] col4 = AddButtons(3, 3, colArrowBut, Form1.enableSec[5] == 1 ? true : false,3, -Form1.APP_Move_buttons_colors);
            Button[] col5 = AddButtons(3, 4, colArrow, Form1.enableSec[6] == 1 ? true : false,4, -Form1.APP_Move_buttons_colors);
            Button[] col6 = AddButtons(6, 5, colBotBut, Form1.enableSec[7] == 1 ? true : false,5, -Form1.APP_Move_buttons_colors);
            Button[] col7 = AddButtons(6, 6, colClose, Form1.enableSec[7] == 1 ? true : false,6, -Form1.APP_Move_buttons_colors);
            Button[] col8 = AddButtons(2, 7, colGameTxt, Form1.enableSec[8] == 1 ? true : false,7, -Form1.APP_Move_buttons_colors);
            Button[] col9 = AddButtons(4, 8, colBotSolid, Form1.enableSec[9] == 1 ? true : false,8, -Form1.APP_Move_buttons_colors);
            Button[] col10 = AddButtons(3, 9, colBotOuter, Form1.enableSec[10] == 1 ? true : false,9, -Form1.APP_Move_buttons_colors);
            Button[] col11 = AddButtons(4, 10, colFolderBG, Form1.enableSec[11] == 1 ? true : false,10, -Form1.APP_Move_buttons_colors);
            Button[] col12 = AddButtons(8, 11, colFolderArrow, Form1.enableSec[12] == 1 ? true : false,11, -Form1.APP_Move_buttons_colors);
            Button[] col13 = AddButtons(7, 13, colIconResize, Form1.enableSec[13] == 1 ? true : false,12, -Form1.APP_Move_buttons_colors);
            Button[] col14 = AddButtons(4, 14, colTopOverlay, Form1.enableSec[14] == 1 ? true : false,13, -Form1.APP_Move_buttons_colors);
            Button[] col15 = AddButtons(2, 15, colDemoMsg, Form1.enableSec[15] == 1 ? true : false,14, -Form1.APP_Move_buttons_colors);
            Button[] col16 = AddButtons(1, 0, ColTopScreen,true,15,15 -Form1.APP_Move_buttons_colors); //the last two parametrers are for spoofing the group and for remove tot from the x value
            ArrowNum1.Enabled = Form1.enableSec[12] == 1 ? true : false;
            ArrowNum2.Enabled = Form1.enableSec[12] == 1 ? true : false;
            ArrowNum3.Enabled = Form1.enableSec[12] == 1 ? true : false;
            foreach (Button b in col1) this.grp_colors.Controls.Add(b);
            foreach (Button b in col2) this.grp_colors.Controls.Add(b);
            foreach (Button b in col3) this.grp_colors.Controls.Add(b);
            foreach (Button b in col4) this.grp_colors.Controls.Add(b);
            foreach (Button b in col5) this.grp_colors.Controls.Add(b);
            foreach (Button b in col6) this.grp_colors.Controls.Add(b);
            foreach (Button b in col7) this.grp_colors.Controls.Add(b);
            foreach (Button b in col8) this.grp_colors.Controls.Add(b);
            foreach (Button b in col9) this.grp_colors.Controls.Add(b);
            foreach (Button b in col10) this.grp_colors.Controls.Add(b);
            foreach (Button b in col11) this.grp_colors.Controls.Add(b);
            foreach (Button b in col12) this.grp_colors.Controls.Add(b);
            foreach (Button b in col13) this.grp_colors.Controls.Add(b);
            foreach (Button b in col14) this.grp_colors.Controls.Add(b);
            foreach (Button b in col15) this.grp_colors.Controls.Add(b);
            this.grp_topSIMPLE.Controls.Add(col16[0]);
            flags = Form1.enableSec.ToArray();
            CB_topDraw.SelectedIndex = (int)Form1.topDraw;
            CB_topFrame.SelectedIndex = (int)Form1.topFrame;
            CB_botDraw.SelectedIndex = (int)Form1.bottomDraw;
            CB_botFrame.SelectedIndex = (int)Form1.bottomFrame;
            CHK0.Checked = flags[0] == 1 ? true : false;
            CHK1.Checked = flags[1] == 1 ? true : false;
            CHK2.Checked = flags[2] == 1 ? true : false;
            CHK3.Checked = flags[3] == 1 ? true : false;
            CHK4.Checked = flags[4] == 1 ? true : false;
            CHK5.Checked = flags[5] == 1 ? true : false;
            CHK6.Checked = flags[6] == 1 ? true : false;
            CHK7.Checked = flags[7] == 1 ? true : false;
            CHK8.Checked = flags[8] == 1 ? true : false;
            CHK9.Checked = flags[9] == 1 ? true : false;
            CHK10.Checked = flags[10] == 1 ? true : false;
            CHK11.Checked = flags[11] == 1 ? true : false;
            CHK12.Checked = flags[12] == 1 ? true : false;
            CHK13.Checked = flags[13] == 1 ? true : false;
            CHK14.Checked = flags[14] == 1 ? true : false;
            CHK15.Checked = flags[15] == 1 ? true : false;
            CHK16.Checked = flags[16] == 1 ? true : false;
            CHK17.Checked = Form1.useBGM == 1 ? true : false;
            if (Form1.topDraw == 1 || Form1.topDraw == 2) grp_topSIMPLE.Enabled = true; else grp_topSIMPLE.Enabled = false;
            if (Form1.topDraw == 2) CHK_bg.Enabled = true;
            CHK_scndtex.Checked = Form1.UseSecondTOPIMG;
        }