private void AddVariantReferences(Patch patch, List <OutfitDetail> outfits) { //Add the new variant references to player components var pcCore = patch.AddFile(IoC.Get <OutfitConfig>().PlayerComponentsFile); var variants = OutfitsGenerator.GetPlayerModels(pcCore); var refs = variants.Select(x => x.GUID).ToHashSet(); foreach (var outfit in outfits.Where(x => x.Modified)) { if (!refs.Add(outfit.VariantId)) { continue; } var sRef = new StreamingRef <HumanoidBodyVariant> { ExternalFile = new BaseString(outfit.Model.Source), Type = BaseRef.Types.StreamingRef, GUID = BaseGGUUID.FromOther(outfit.VariantId) }; variants.Add(sRef); pcCore.Save(); } }
public OutfitsControl() { _loading = true; AllOutfitStub = new List <Outfit> { new Outfit() { LocalName = "All Outfits" } }.AsReadOnly(); IoC.Bind(Configs.LoadModuleConfig <OutfitConfig>(PluginName)); OutfitGen = new OutfitsGenerator(); CharacterGen = new CharacterGenerator(); Patcher = new OutfitPatcher(); Outfits = new List <Outfit>().AsReadOnly(); InitializeComponent(); Filters = OutfitModelFilter.All.ToList().AsReadOnly(); LoadSettings(); _loading = false; }