Example #1
0
 private void Form3_Load(object sender, EventArgs e)
 {
     AcceptButton = btn_ok;
     GetImage(Skin.GetKeyImage(), keyimage, pickeyimage);
     GetImage(Skin.GetKeyImageD(), keyimaged, pickeyimaged);
     GetImage(Skin.GetNoteImage(), noteimage, picnoteimage);
     GetImage(Skin.GetNoteImageH(), noteimageh, picnoteimageh);
     GetImage(Skin.GetNoteImageT(), noteimaget, picnoteimaget);
     GetImage(Skin.GetNoteImageL(), noteimagel, picnoteimagel);
     GetImage(Skin.GetStageLeft(), stageleft, picstageleft);
     GetImage(Skin.GetStageRight(), stageright, picstageright);
     btn_ok.Focus();
 }
Example #2
0
        void GenerateV2()
        {
            int    i;
            string result_ = "nl// Begin Config Key " + Keys.Text + " nlnl[Mania]", numwidth = "", numlinewidth = "";

            foreach (Control control_ in groupBox2.Controls)
            {
                if (control_ is ComboBox)
                {
                    if (control_.Text != "")
                    {
                        ComboBox cm = control_ as ComboBox;
                        result_ += "nl" + cm.Name + ": " + cm.SelectedIndex;
                    }
                }
            }
            foreach (Control control_ in groupBox2.Controls)
            {
                if (control_ is TextBox)
                {
                    if (control_.Text != "")
                    {
                        if (control_.Name == "ColumnWidth")
                        {
                            for (i = 0; i < Convert.ToInt32(Keys.Text); i++)
                            {
                                numwidth += ColumnWidth.Text + ",";
                            }
                            result_ += "nl" + control_.Name + ": " + numwidth.Substring(0, numwidth.Length - 1);
                        }
                        else if (control_.Name == "ColumnLineWidth")
                        {
                            for (i = 0; i < Convert.ToInt32(Keys.Text); i++)
                            {
                                numlinewidth += ColumnLineWidth.Text + ",";
                            }
                            result_ += "nl" + control_.Name + ": " + numlinewidth.Substring(0, numlinewidth.Length - 1);
                        }
                        else if (control_.Name != "KeyImage" && control_.Name != "NoteImage" && control_.Name.Substring(0, 6) != "Colour" && control_.Name != "StageRight" && control_.Name != "StageLeft")
                        {
                            result_ += "nl" + control_.Name + ": " + control_.Text;
                        }
                    }
                }
            }
            result_ += "nlnl//Begin Imagenl";
            buatFolder(KeyImage.Text);
            buatFolder(NoteImage.Text);
            foreach (Control control_ in groupBox2.Controls)
            {
                if (control_ is TextBox)
                {
                    if (control_.Text != "")
                    {
                        if (control_.Name.Substring(0, 5) == "Stage")
                        {
                            result_ += "nl" + control_.Name + ": " + control_.Text;
                        }
                        if (control_.Name == "KeyImage")
                        {
                            for (i = 0; i < Keys.SelectedIndex; i++)
                            {
                                result_ += "nl" + control_.Name + i + ": " + control_.Text + i;
                                result_ += "nl" + control_.Name + i + "D: " + control_.Text + i + "D";
                                CopyFile(Skin.GetKeyImage(), GetDir(KeyImage.Text) + GetFileName(KeyImage.Text) + i + ".png");
                                CopyFile(Skin.GetKeyImageD(), GetDir(KeyImage.Text) + GetFileName(KeyImage.Text) + i + "D.png");
                            }
                        }
                        else if (control_.Name == "NoteImage")
                        {
                            for (i = 0; i < Keys.SelectedIndex; i++)
                            {
                                result_ += "nl" + control_.Name + i + ": " + control_.Text + i;
                                result_ += "nl" + control_.Name + i + "H: " + control_.Text + i + "H";
                                result_ += "nl" + control_.Name + i + "T: " + control_.Text + i + "T";
                                result_ += "nl" + control_.Name + i + "L: " + control_.Text + i + "L";
                                CopyFile(Skin.GetNoteImage(), GetDir(NoteImage.Text) + GetFileName(NoteImage.Text) + i + ".png");
                                CopyFile(Skin.GetNoteImageH(), GetDir(NoteImage.Text) + GetFileName(NoteImage.Text) + i + "H.png");
                                CopyFile(Skin.GetNoteImageT(), GetDir(NoteImage.Text) + GetFileName(NoteImage.Text) + i + "T.png");
                                CopyFile(Skin.GetNoteImageL(), GetDir(NoteImage.Text) + GetFileName(NoteImage.Text) + i + "L.png");
                            }
                        }
                    }
                }
            }
            buatFolder(StageLeft.Text);
            buatFolder(StageRight.Text);
            CopyFile(Skin.GetStageLeft(), GetDir(StageLeft.Text) + GetFileName(StageLeft.Text) + ".png");
            CopyFile(Skin.GetStageRight(), GetDir(StageRight.Text) + GetFileName(StageRight.Text) + ".png");
            result_ += "nlnl//End Imagenl";
            result_ += "nl//Begin Colournl";
            foreach (Control control_ in groupBox2.Controls)
            {
                if (control_ is TextBox)
                {
                    if (control_.Text != "")
                    {
                        if (control_.Name.Substring(0, 6) == "Colour")
                        {
                            if (control_.Name == "Colour")
                            {
                                for (i = 0; i < Keys.SelectedIndex; i++)
                                {
                                    result_ += "nl" + control_.Name + (i + 1) + ": " + control_.Text;
                                }
                            }
                            if (control_.Name == "ColourLight")
                            {
                                for (i = 0; i < Keys.SelectedIndex; i++)
                                {
                                    result_ += "nl" + control_.Name + (i + 1) + ": " + control_.Text;
                                }
                            }
                            else if (control_.Name != "Colour")
                            {
                                result_ += "nl" + control_.Name + ": " + control_.Text;
                            }
                        }
                    }
                }
            }
            result_    += "nlnl//End Colour";
            result_    += "nlnl//End Config Key " + Keys.Text;
            result.Text = result_.Replace("nl", Environment.NewLine);
            buatFileConfig(result.Text);
            MessageBox.Show("Config Berhasil dibuat, File bisa dilihat di Folder Output", "Sukses", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }