Ejemplo n.º 1
0
 private void LoadModInfoNM(ModInfoNoMeta data)
 {
     modauthortxtbox.Text    = data.ModAuthor;
     modnametxtbox.Text      = data.ModName;
     modpathtxtbox.Text      = data.Path;
     moddesctxtbox.Text      = data.ModDescription;
     modversioncombobox.Text = data.ModVersion;
     modselectlbl.Text       = data.ModName;
     modselectlbl.ForeColor  = Color.LimeGreen;
 }
Ejemplo n.º 2
0
        private void listBox2_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            string ModFolder   = Path.GetDirectoryName(listBox2.SelectedItem.ToString());
            string modinfopath = File.ReadAllText(StarboundPath + "mods\\" + listBox2.SelectedItem.ToString());

            LoadedModPath = Path.GetDirectoryName(StarboundPath + "mods\\" + listBox2.SelectedItem.ToString());

            String[] allfile = System.IO.Directory.GetFiles(LoadedModPath, "*.*", System.IO.SearchOption.AllDirectories);
            //     String[] items2 = allfile.Select(x => x.Replace(LoadedModPath, string.Empty)).ToArray();
            string[]  exts = { ".wav",         ".png",                 ".lua",              ".animation",   ".frames", ".config", ".ttf",
                               ".augment",      ".configfunctions",     ".spacebiome",       ".parallax",
                               ".surfacebiome", ".undergroundparallax", ".undergroundbiome",
                               ".corebiome",    ".cinematic",           ".disabled",         ".modularstem", ".ogg" };
            ArrayList realitems = new ArrayList();

            foreach (string item in allfile)
            {
                if (!exts.Contains(Path.GetExtension(item)))
                {
                    string s = "\\" + item.Substring(item.LastIndexOf(ModFolder));
                    realitems.Add(s);
                }
            }
            MessageBox.Show("Mod Loaded");
            moditems            = realitems; //here
            modradio.Checked    = true;
            listBox1.DataSource = moditems;



            try
            {
                ModInfo data = JsonConvert.DeserializeObject <ModInfo>(modinfopath);
                LoadModInfo(data);
            }catch (Exception na) {
                try{
                    ModInfoNoMeta data = JsonConvert.DeserializeObject <ModInfoNoMeta>(modinfopath);
                    LoadModInfoNM(data);
                }catch (Exception la) {}
            }
        }