public static bool Prefix(ClothingSlot __instance) { ModClothingComponent clothingComponent = ModUtils.GetComponent <ModClothingComponent>(__instance.m_GearItem); if (clothingComponent == null) { return(true); } int actualDrawLayer = Mathf.Max(40, clothingComponent.DrawLayer); ModUtils.ExecuteMethod(__instance, "UpdatePaperDollTextureLayer", actualDrawLayer); return(false); }
public static bool Prefix(SkillsManager __instance, ref string __result) { Dictionary <string, string> skillsData = new Dictionary <string, string>(); for (int i = 0; i < __instance.GetNumSkills(); i++) { Skill skill = __instance.GetSkillFromIndex(i); string data = ModUtils.ExecuteMethod <string>(skill, "Serialize"); skillsData.Add(SerializableSkill.GetSkillSaveKey(skill), data); } __result = Utils.SerializeObject(skillsData); return(false); }
internal static void MapSkill(ModSkill modSkill) { SerializableSkill skill = new GameObject().AddComponent <SerializableSkill>(); skill.name = modSkill.name; skill.m_LocalizedDisplayName = CreateLocalizedString(modSkill.DisplayName); skill.m_SkillType = (SkillType)GameManager.GetSkillsManager().GetNumSkills(); skill.m_SkillIcon = modSkill.Icon; skill.m_SkillIconBackground = modSkill.Image; skill.m_SkillImage = modSkill.Image; skill.m_TierPoints = new int[] { 0, modSkill.PointsLevel2, modSkill.PointsLevel3, modSkill.PointsLevel4, modSkill.PointsLevel5 }; skill.m_TierLocalizedBenefits = CreateLocalizedStrings(modSkill.EffectsLevel1, modSkill.EffectsLevel2, modSkill.EffectsLevel3, modSkill.EffectsLevel4, modSkill.EffectsLevel5); skill.m_TierLocalizedDescriptions = CreateLocalizedStrings(modSkill.DescriptionLevel1, modSkill.DescriptionLevel2, modSkill.DescriptionLevel3, modSkill.DescriptionLevel4, modSkill.DescriptionLevel5); ModUtils.ExecuteMethod(GameManager.GetSkillsManager(), "InstantiateSkillPrefab", skill.gameObject); }
public static bool Prefix(SkillsManager __instance, string text) { Dictionary <string, string> skillsData = Utils.DeserializeObject <Dictionary <string, string> >(text); foreach (var eachEntry in skillsData) { for (int i = 0; i < __instance.GetNumSkills(); i++) { Skill skill = __instance.GetSkillFromIndex(i); if (SerializableSkill.GetSkillSaveKey(skill) == eachEntry.Key) { ModUtils.ExecuteMethod(skill, "Deserialize", eachEntry.Value); break; } } } return(false); }
internal static void ShowItemIcons(EquipItemPopup equipItemPopup, String primaryAction, String secondaryAction, bool showAmmo) { ModUtils.ExecuteMethod(equipItemPopup, "ShowItemIcons", new object[] { primaryAction, secondaryAction, showAmmo }); }
internal static void MaybeRepositionFireButtonPrompt(EquipItemPopup equipItemPopup, String otherAction) { ModUtils.ExecuteMethod(equipItemPopup, "MaybeRepositionFireButtonPrompt", otherAction); }
internal static void MaybeRepositionAltFireButtonPrompt(EquipItemPopup __instance, String otherAction) { ModUtils.ExecuteMethod(__instance, "MaybeRepositionAltFireButtonPrompt", otherAction); }