Exemple #1
0
        // basic Constructor
        public Skin(String fullname, int slot, String libraryname, String origin, LibraryHandler global_library, PropertyHandler global_properties, Logger global_log)
        {
            //Gathering parameters into class variables
            this.fullname    = fullname;
            this.slot        = slot;
            this.modelslot   = slot - 1;
            this.libraryname = libraryname;
            this.origin      = origin;

            logger = global_log;

            //Creating lists
            csps   = new ArrayList();
            models = new ArrayList();

            //Instanciating handlers to get info
            Library    = global_library;
            Properties = global_properties;

            check_skin();

            //Getting the info I talked about earlier
            this.dlc         = Library.get_dlc_status(this.fullname);
            this.modelfolder = Library.get_modelfolder_fullname(this.fullname);
            this.cspfolder   = Library.get_cspfolder_fullname(this.fullname);
            this.datafolder  = Properties.property_get("datafolder");

            //Now setting folders, easy ones
            this.modelpath = Application.StartupPath + "/mmsl_workspace/data/fighter/" + modelfolder + "/model/";
            this.csppath   = Application.StartupPath + "/mmsl_workspace/data/ui/replace/chr/";
            if (dlc)
            {
                this.dlc_csppath = Application.StartupPath + "/mmsl_workspace/" + datafolder + "/ui/replace/append/chr/";
                if (Properties.property_get("unlocalised") == "1")
                {
                    this.dlc_csppath = Application.StartupPath + "/mmsl_workspace/data/ui/replace/append/chr/";
                }
            }
            //Config meta
            this.metapath = Application.StartupPath + "/mmsl_config/meta/" + this.modelfolder + "/slot_" + slot + "/";

            loadMeta();
            load_models();
            load_csp();

            //setting slot texts
            this.modelslotstring = (this.modelslot < 10 ? "0" + this.modelslot.ToString() : this.modelslot.ToString());
            this.slotstring      = (this.slot < 10 ? "0" + this.slot.ToString() : this.slot.ToString());
            temped = false;
        }
        //Sets up selected config when the window opens
        public void retrieve_config()
        {
            textBox1.Text = properties.property_get("explorer_workspace");

            if (properties.property_check("datafolder"))
            {
                String locale   = properties.property_get("datafolder");
                String language = "";
                if (locale != "data")
                {
                    locale         = locale.Split('(')[1].Split(')')[0];
                    regionbox.Text = locale.Split('_')[0].ToUpper();

                    switch (locale.Split('_')[1])
                    {
                    case "en":
                        language = "English";
                        break;

                    case "fr":
                        language = "French";
                        break;

                    case "gr":
                        language = "German";
                        break;

                    case "it":
                        language = "Italian";
                        break;

                    case "ne":
                        language = "Nederlands";
                        break;

                    case "po":
                        language = "Portugal";
                        break;

                    case "ru":
                        language = "Russian";
                        break;

                    case "sp":
                        language = "Spanish";
                        break;

                    default:
                        language = "";
                        break;
                    }
                }
                else
                {
                    language = "English";
                }


                localisationbox.Text = language;
            }
            checkBox1.Checked = Library.get_moved_dlc_status("Mewtwo");
            checkBox2.Checked = Library.get_moved_dlc_status("Lucas");
            checkBox3.Checked = Library.get_moved_dlc_status("Roy");
            checkBox4.Checked = Library.get_moved_dlc_status("Ryu");
            checkBox5.Checked = Library.get_moved_dlc_status("Cloud");
            checkBox6.Checked = Library.get_moved_dlc_status("Corrin");
            checkBox7.Checked = Library.get_moved_dlc_status("Bayonetta");

            message.Text      = "";
            message.ForeColor = Color.Green;

            unlocalised_checkbox.Checked = properties.property_get("unlocalised") == "1" ? true : false;
            checkBox9.Checked            = properties.property_get("logging") == "1" ? true : false;
            checkBox10.Checked           = properties.property_get("beta") == "1" ? true : false;
            checkBox11.Checked           = properties.property_get("dev") == "1" ? true : false;
        }
        //Basic Constructor
        public UICharDBHandler(String uipath, String datafolder)
        {
            PropertyHandler properties = new PropertyHandler();

            properties.set_config_path(Application.StartupPath + "/mmsl_config/Config.xml");
            imported      = false;
            sourcepresent = false;

            if (uipath != "" && datafolder != "")
            {
                if (datafolder == "data")
                {
                    datafolder = "data(us_en)";
                }
                if (properties.property_get("unlocalised") == "1")
                {
                    datafolder = "data";
                }
                //Source definition
                ui_file_path_source = uipath + "/content/patch/" + datafolder + "/param/ui/ui_character_db.bin";
                //Destination definition
                this.ui_file_path_destination = Application.StartupPath + "/mmsl_workspace/" + datafolder + "/param/ui/ui_character_db.bin";

                //Checks if the param/ui folder exists so it knows if a backup may be here
                if (!Directory.Exists(Application.StartupPath + "/mmsl_workspace/" + datafolder + "/param/ui/"))
                {
                    Directory.CreateDirectory(Application.StartupPath + "/mmsl_workspace/" + datafolder + "/param/ui/");
                    //If source exists
                    if (File.Exists(ui_file_path_source))
                    {
                        File.Copy(ui_file_path_source, ui_file_path_destination);
                        Console.WriteLine("Copied ui_char_db");
                        sourcepresent = true;
                        imported      = true;
                    }
                    else
                    {
                        Console.WriteLine("No source ui_char_db");
                    }
                }
                else
                {
                    //There is a copy
                    if (File.Exists(ui_file_path_destination))
                    {
                        Console.WriteLine("current ui_char_db was found");
                        imported = true;
                    }
                    else
                    {
                        //If source exists
                        if (File.Exists(ui_file_path_source))
                        {
                            File.Copy(ui_file_path_source, ui_file_path_destination);
                            Console.WriteLine("Copied ui_char_db");
                            imported = true;
                        }
                        else
                        {
                            Console.WriteLine("No source ui_char_db");
                        }
                    }
                }
            }
        }