/********* ** Public methods *********/ /// <summary>The mod entry point, called after the mod is first loaded.</summary> /// <param name="helper">Provides simplified APIs for writing mods.</param> public override void Entry(IModHelper helper) { // load settings m_globalConfig = helper.ReadConfig <GlobalConfig>(); // check if the mod should be enalbed if (!m_globalConfig.IsEnable) { return; } // initialize components LocalConfig.s_env = this; m_contentHelper = new ContentHelper(this); FarmerMakeup.MaleFaceTypes = m_globalConfig.MaleFaceTypes; FarmerMakeup.MaleNoseTypes = m_globalConfig.MaleNoseTypes; FarmerMakeup.MaleBottomsTypes = m_globalConfig.MaleBottomsTypes; FarmerMakeup.MaleShoeTypes = m_globalConfig.MaleShoeTypes; FarmerMakeup.FemaleFaceTypes = m_globalConfig.MaleFaceTypes; FarmerMakeup.FemaleNoseTypes = m_globalConfig.FemaleNoseTypes; FarmerMakeup.FemaleBottomsTypes = m_globalConfig.FemaleBottomsTypes; FarmerMakeup.FemaleShoeTypes = m_globalConfig.FemaleShoeTypes; FarmerMakeup.HideMaleSkirts = m_globalConfig.HideMaleSkirts; m_farmerPatcher = new FarmerMakeup(this, m_contentHelper); m_dresser = new Dresser(this); m_dresser.m_isVisible = m_globalConfig.ShowDresser; m_dresser.m_stoveInCorner = m_globalConfig.StoveInCorner; m_dresser.init(); m_loadMenuPatcher = new LoadMenuPatcher(this, m_farmerPatcher); m_loadMenuPatcher.init(); // hook events helper.Events.Input.ButtonPressed += Events_ButtonPressed; helper.Events.GameLoop.SaveLoaded += Events_AfterLoad; }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt"))) { return(OptionResult.Failure); } Dresser.ResetSettings(); return(OptionResult.SuccessClose); }
protected override bool Allow(SimDescription sim, ref CASParts.Key outfitKey, ref bool alternate, ref CASParts.Key displayKey) { displayKey = new CASParts.Key(sCategories[outfitKey.GetIndex()], 0); outfitKey = new CASParts.Key(Dresser.GetStoreOutfitKey(sCategories[outfitKey.GetIndex()], sim.IsUsingMaternityOutfits)); alternate = true; if (CASParts.GetOutfit(sim, outfitKey, true) == null) { return(false); } return(true); }
public override bool Test(Sim a, Dresser target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { try { if ((a.CurrentOutfitCategory == OutfitCategories.SkinnyDippingTowel) && (a.BuffManager.HasElement(BuffNames.EmbarrassedClothesHidden))) { greyedOutTooltipCallback = Dresser.ChangeClothes.ClothesHiddenCallback; return(false); } return(Sims.CASBase.PublicAllow(a.SimDescription, ref greyedOutTooltipCallback)); } catch (Exception e) { Common.Exception(a, target, e); return(false); } }
protected static ListenerAction OnNewObject(Event e) { Dresser targetObject = e.TargetObject as Dresser; if (targetObject != null) { RemoveInteraction(targetObject); } else { SculptureFloorClothingRack2x1 rackx = e.TargetObject as SculptureFloorClothingRack2x1; if (rackx != null) { AddInteractions(rackx); } } return(ListenerAction.Keep); }
protected override OptionResult Run(GameHitParameters <Sim> parameters) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt", parameters.mTarget.IsFemale, new object[] { parameters.mTarget }))) { return(OptionResult.Failure); } SimDescription sim = parameters.mTarget.SimDescription; SimOutfit geneOutfit = CASParts.GetOutfit(sim, CASParts.sPrimary, false); foreach (OutfitCategories category in LoadOutfit.sCategories) { CASParts.Key outfitKey = new CASParts.Key(Dresser.GetStoreOutfitKey(category, sim.IsUsingMaternityOutfits)); SimOutfit source = CASParts.GetOutfit(sim, outfitKey, true); if (source == null) { continue; } int index = 0; if (category == OutfitCategories.Career) { index = 1; } using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, new CASParts.Key(category, index), geneOutfit)) { new SavedOutfit(source).Apply(builder, false, null, CASParts.GeneticBodyTypes); } if (category == OutfitCategories.Career) { sim.CareerOutfitIndex = index; } } return(OptionResult.SuccessRetain); }
private void SetDresser(Dresser dresser) { this.dresser = dresser; }
protected override bool Allow(GameHitParameters <Sim> parameters) { if (parameters.mTarget.SimDescription.IsUsingMaternityOutfits) { return(false); } if (CASParts.GetOutfit(parameters.mTarget.SimDescription, new CASParts.Key(Dresser.GetStoreOutfitKey(OutfitCategories.Career, parameters.mTarget.SimDescription.IsUsingMaternityOutfits)), true) == null) { return(false); } return(base.Allow(parameters)); }
public override bool Test(Sim a, Dresser target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { try { if ((a.CurrentOutfitCategory == OutfitCategories.SkinnyDippingTowel) && (a.BuffManager.HasElement(BuffNames.EmbarrassedClothesHidden))) { greyedOutTooltipCallback = Dresser.ChangeClothes.ClothesHiddenCallback; return false; } return Sims.CASBase.PublicAllow(a.SimDescription, ref greyedOutTooltipCallback); } catch (Exception e) { Common.Exception(a, target, e); return false; } }
public override string GetInteractionName(Sim actor, Dresser target, InteractionObjectPair iop) { return base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target)); }
protected override bool Allow(GameHitParameters <Sim> parameters) { if (!parameters.mTarget.SimDescription.IsUsingMaternityOutfits) { return(false); } bool found = false; foreach (OutfitCategories category in LoadOutfit.sCategories) { if (CASParts.GetOutfit(parameters.mTarget.SimDescription, new CASParts.Key(Dresser.GetStoreOutfitKey(category, parameters.mTarget.SimDescription.IsUsingMaternityOutfits)), true) != null) { found = true; break; } } if (!found) { return(false); } return(base.Allow(parameters)); }
public override string GetInteractionName(Sim actor, Dresser target, InteractionObjectPair iop) { return(base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target))); }
protected override void Perform(SimDescription sim, CASParts.Key outfitKey, CASParts.Key displayKey) { SimOutfit source = CASParts.GetOutfit(sim, outfitKey, false); using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, new CASParts.Key(Dresser.GetStoreOutfitKey(outfitKey.mCategory, sim.IsUsingMaternityOutfits)), source, true)) { } }