Пример #1
0
 //Sets the config handler
 public void set_properties_handler(PropertyHandler config)
 {
     this.properties = config;
 }
Пример #2
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;
        }
        //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");
                        }
                    }
                }
            }
        }