示例#1
0
 public void InitVariables(ConfigFile config, ManualLogSource logger)
 {
     Config = config;
     Logger = logger;
 }
 internal APISubmoduleHandler(int build, ManualLogSource logger = null)
 {
     _build  = build;
     _logger = logger;
 }
 public Logger5(ManualLogSource logger)
 {
     _logger = logger;
 }
示例#4
0
 private void Awake()
 {
     Logger = base.Logger;
     HarmonyWrapper.PatchAll(typeof(DataCorruptionFixes));
 }
        public void LoadModule(ConfigFile File, ManualLogSource Logger)
        {
            if (IsLoaded)
            {
                UnloadModule();
            }

            Logger.LogWarning("00");

            PlayerLoadoutModule.Logger = Logger;

            Logger.LogWarning("01");

            PlayerLoadoutModule.ReconConfig    = File.BindModel <ReconLoadoutConfig>(Logger);
            PlayerLoadoutModule.RiflemanConfig = File.BindModel <RiflemanLoadoutConfig>(Logger);
            PlayerLoadoutModule.MedicConfig    = File.BindModel <MedicLoadoutConfig>(Logger);
            PlayerLoadoutModule.CommandoConfig = File.BindModel <CommandoLoadoutConfig>(Logger);

            Logger.LogWarning("02");

            for (int i = 0; i < 5; i++)
            {
                LoadoutPatch.ReconLoadout[i]    = new InvItemLoadout();
                LoadoutPatch.RiflemanLoadout[i] = new InvItemLoadout();
                LoadoutPatch.MedicLoadout[i]    = new InvItemLoadout();
                LoadoutPatch.CommandoLoadout[i] = new InvItemLoadout();
            }

            //----Recon Config----//
            //Slot0
            LoadoutPatch.ReconLoadout[0].ItemId   = ReconConfig.InvSlot0Weapon;
            LoadoutPatch.ReconLoadout[0].AmmoBase = ReconConfig.InvSlot0AmmoBase;
            LoadoutPatch.ReconLoadout[0].AmmoDiv  = ReconConfig.InvSlot0AmmoDiv;
            LoadoutPatch.ReconLoadout[0].AmmoMul  = ReconConfig.InvSlot0AmmoMul;
            //Slot1
            LoadoutPatch.ReconLoadout[1].ItemId   = ReconConfig.InvSlot1Weapon;
            LoadoutPatch.ReconLoadout[1].AmmoBase = ReconConfig.InvSlot1AmmoBase;
            LoadoutPatch.ReconLoadout[1].AmmoDiv  = ReconConfig.InvSlot1AmmoDiv;
            LoadoutPatch.ReconLoadout[1].AmmoMul  = ReconConfig.InvSlot1AmmoMul;
            //Slot2
            LoadoutPatch.ReconLoadout[2].ItemId   = ReconConfig.InvSlot2Weapon;
            LoadoutPatch.ReconLoadout[2].AmmoBase = ReconConfig.InvSlot2AmmoBase;
            LoadoutPatch.ReconLoadout[2].AmmoDiv  = ReconConfig.InvSlot2AmmoDiv;
            LoadoutPatch.ReconLoadout[2].AmmoMul  = ReconConfig.InvSlot2AmmoMul;
            //Slot3
            LoadoutPatch.ReconLoadout[3].ItemId   = ReconConfig.InvSlot3Weapon;
            LoadoutPatch.ReconLoadout[3].AmmoBase = ReconConfig.InvSlot3AmmoBase;
            LoadoutPatch.ReconLoadout[3].AmmoDiv  = ReconConfig.InvSlot3AmmoDiv;
            LoadoutPatch.ReconLoadout[3].AmmoMul  = ReconConfig.InvSlot3AmmoMul;
            //Slot4
            LoadoutPatch.ReconLoadout[4].ItemId   = ReconConfig.InvSlot4Weapon;
            LoadoutPatch.ReconLoadout[4].AmmoBase = ReconConfig.InvSlot4AmmoBase;
            LoadoutPatch.ReconLoadout[4].AmmoDiv  = ReconConfig.InvSlot4AmmoDiv;
            LoadoutPatch.ReconLoadout[4].AmmoMul  = ReconConfig.InvSlot4AmmoMul;

            //----Rifleman Config----//
            //Slot0
            LoadoutPatch.RiflemanLoadout[0].ItemId   = RiflemanConfig.InvSlot0Weapon;
            LoadoutPatch.RiflemanLoadout[0].AmmoBase = RiflemanConfig.InvSlot0AmmoBase;
            LoadoutPatch.RiflemanLoadout[0].AmmoDiv  = RiflemanConfig.InvSlot0AmmoDiv;
            LoadoutPatch.RiflemanLoadout[0].AmmoMul  = RiflemanConfig.InvSlot0AmmoMul;
            //Slot1
            LoadoutPatch.RiflemanLoadout[1].ItemId   = RiflemanConfig.InvSlot1Weapon;
            LoadoutPatch.RiflemanLoadout[1].AmmoBase = RiflemanConfig.InvSlot1AmmoBase;
            LoadoutPatch.RiflemanLoadout[1].AmmoDiv  = RiflemanConfig.InvSlot1AmmoDiv;
            LoadoutPatch.RiflemanLoadout[1].AmmoMul  = RiflemanConfig.InvSlot1AmmoMul;
            //Slot2
            LoadoutPatch.RiflemanLoadout[2].ItemId   = RiflemanConfig.InvSlot2Weapon;
            LoadoutPatch.RiflemanLoadout[2].AmmoBase = RiflemanConfig.InvSlot2AmmoBase;
            LoadoutPatch.RiflemanLoadout[2].AmmoDiv  = RiflemanConfig.InvSlot2AmmoDiv;
            LoadoutPatch.RiflemanLoadout[2].AmmoMul  = RiflemanConfig.InvSlot2AmmoMul;
            //Slot3
            LoadoutPatch.RiflemanLoadout[3].ItemId   = RiflemanConfig.InvSlot3Weapon;
            LoadoutPatch.RiflemanLoadout[3].AmmoBase = RiflemanConfig.InvSlot3AmmoBase;
            LoadoutPatch.RiflemanLoadout[3].AmmoDiv  = RiflemanConfig.InvSlot3AmmoDiv;
            LoadoutPatch.RiflemanLoadout[3].AmmoMul  = RiflemanConfig.InvSlot3AmmoMul;
            //Slot4
            LoadoutPatch.RiflemanLoadout[4].ItemId   = RiflemanConfig.InvSlot4Weapon;
            LoadoutPatch.RiflemanLoadout[4].AmmoBase = RiflemanConfig.InvSlot4AmmoBase;
            LoadoutPatch.RiflemanLoadout[4].AmmoDiv  = RiflemanConfig.InvSlot4AmmoDiv;
            LoadoutPatch.RiflemanLoadout[4].AmmoMul  = RiflemanConfig.InvSlot4AmmoMul;

            //----Medic Config----//
            //Slot0
            LoadoutPatch.MedicLoadout[0].ItemId   = MedicConfig.InvSlot0Weapon;
            LoadoutPatch.MedicLoadout[0].AmmoBase = MedicConfig.InvSlot0AmmoBase;
            LoadoutPatch.MedicLoadout[0].AmmoDiv  = MedicConfig.InvSlot0AmmoDiv;
            LoadoutPatch.MedicLoadout[0].AmmoMul  = MedicConfig.InvSlot0AmmoMul;
            //Slot1
            LoadoutPatch.MedicLoadout[1].ItemId   = MedicConfig.InvSlot1Weapon;
            LoadoutPatch.MedicLoadout[1].AmmoBase = MedicConfig.InvSlot1AmmoBase;
            LoadoutPatch.MedicLoadout[1].AmmoDiv  = MedicConfig.InvSlot1AmmoDiv;
            LoadoutPatch.MedicLoadout[1].AmmoMul  = MedicConfig.InvSlot1AmmoMul;
            //Slot2
            LoadoutPatch.MedicLoadout[2].ItemId   = MedicConfig.InvSlot2Weapon;
            LoadoutPatch.MedicLoadout[2].AmmoBase = MedicConfig.InvSlot2AmmoBase;
            LoadoutPatch.MedicLoadout[2].AmmoDiv  = MedicConfig.InvSlot2AmmoDiv;
            LoadoutPatch.MedicLoadout[2].AmmoMul  = MedicConfig.InvSlot2AmmoMul;
            //Slot3
            LoadoutPatch.MedicLoadout[3].ItemId   = MedicConfig.InvSlot3Weapon;
            LoadoutPatch.MedicLoadout[3].AmmoBase = MedicConfig.InvSlot3AmmoBase;
            LoadoutPatch.MedicLoadout[3].AmmoDiv  = MedicConfig.InvSlot3AmmoDiv;
            LoadoutPatch.MedicLoadout[3].AmmoMul  = MedicConfig.InvSlot3AmmoMul;
            //Slot4
            LoadoutPatch.MedicLoadout[4].ItemId   = MedicConfig.InvSlot4Weapon;
            LoadoutPatch.MedicLoadout[4].AmmoBase = MedicConfig.InvSlot4AmmoBase;
            LoadoutPatch.MedicLoadout[4].AmmoDiv  = MedicConfig.InvSlot4AmmoDiv;
            LoadoutPatch.MedicLoadout[4].AmmoMul  = MedicConfig.InvSlot4AmmoMul;

            //----Commando Config----//
            //Slot0
            LoadoutPatch.CommandoLoadout[0].ItemId   = CommandoConfig.InvSlot0Weapon;
            LoadoutPatch.CommandoLoadout[0].AmmoBase = CommandoConfig.InvSlot0AmmoBase;
            LoadoutPatch.CommandoLoadout[0].AmmoDiv  = CommandoConfig.InvSlot0AmmoDiv;
            LoadoutPatch.CommandoLoadout[0].AmmoMul  = CommandoConfig.InvSlot0AmmoMul;
            //Slot1
            LoadoutPatch.CommandoLoadout[1].ItemId   = CommandoConfig.InvSlot1Weapon;
            LoadoutPatch.CommandoLoadout[1].AmmoBase = CommandoConfig.InvSlot1AmmoBase;
            LoadoutPatch.CommandoLoadout[1].AmmoDiv  = CommandoConfig.InvSlot1AmmoDiv;
            LoadoutPatch.CommandoLoadout[1].AmmoMul  = CommandoConfig.InvSlot1AmmoMul;
            //Slot2
            LoadoutPatch.CommandoLoadout[2].ItemId   = CommandoConfig.InvSlot2Weapon;
            LoadoutPatch.CommandoLoadout[2].AmmoBase = CommandoConfig.InvSlot2AmmoBase;
            LoadoutPatch.CommandoLoadout[2].AmmoDiv  = CommandoConfig.InvSlot2AmmoDiv;
            LoadoutPatch.CommandoLoadout[2].AmmoMul  = CommandoConfig.InvSlot2AmmoMul;
            //Slot3
            LoadoutPatch.CommandoLoadout[3].ItemId   = CommandoConfig.InvSlot3Weapon;
            LoadoutPatch.CommandoLoadout[3].AmmoBase = CommandoConfig.InvSlot3AmmoBase;
            LoadoutPatch.CommandoLoadout[3].AmmoDiv  = CommandoConfig.InvSlot3AmmoDiv;
            LoadoutPatch.CommandoLoadout[3].AmmoMul  = CommandoConfig.InvSlot3AmmoMul;
            //Slot4
            LoadoutPatch.CommandoLoadout[4].ItemId   = CommandoConfig.InvSlot4Weapon;
            LoadoutPatch.CommandoLoadout[4].AmmoBase = CommandoConfig.InvSlot4AmmoBase;
            LoadoutPatch.CommandoLoadout[4].AmmoDiv  = CommandoConfig.InvSlot4AmmoDiv;
            LoadoutPatch.CommandoLoadout[4].AmmoMul  = CommandoConfig.InvSlot4AmmoMul;

            Logger.LogWarning("03");

            IsLoaded = true;

            EnableModule();

            Logger.LogInfo("PlayerLoadoutModule Loaded.");
        }
示例#6
0
 public void Start()
 {
     _logger = base.Logger;
     _logger.LogInfo("Loaded!");
 }
 internal void Awake()
 {
     Logger = base.Logger;
     Hooks.InstallHooks();
 }
        public static bool Prefix(ref Dictionary <string, AchievementDef> ___achievementNamesToDefs, ref List <string> ___achievementIdentifiers, ref AchievementDef[] ___achievementDefs, ref AchievementDef[] ___serverAchievementDefs, ref Action ___onAchievementsRegistered, Dictionary <string, AchievementDef> map)
        {
            //Setup logging
            var achievementLogger = new ManualLogSource("AchievementLoader.Achievement");

            BepInEx.Logging.Logger.Sources.Add(achievementLogger);

            achievementLogger.LogMessage("__== Achievement Loader ==__");
            achievementLogger.LogInfo("Searching for overrides");

            //Search and collect overrides
            IEnumerable <Type> achievementOverrides =
                from t in AppDomain.CurrentDomain.GetAssemblies().Where(a => a.GetName().Name != "ConfigurationManager").SelectMany(a => { achievementLogger.LogDebug(String.Format("Scanning assembly {0} for override defs", a.FullName)); try { return(a.GetTypes()); } catch { achievementLogger.LogError(String.Format("Unable to scan {0} for override defs", a.FullName)); return(new Type[0]); } })
                let attributes = t.GetCustomAttributes(typeof(OverrideAchievement), true)
                                 where attributes != null && attributes.Length > 0
                                 select attributes.Cast <OverrideAchievement>().ToArray()[0].achievementType;

            //Convert from IEnum to List since it's way faster to search a list lmao
            List <Type> achievementOverrideTypes = achievementOverrides.ToList();

            achievementLogger.LogInfo(string.Format("Found {0} overrides", achievementOverrides.Count()));

            //Used for building achievement unlock chains?
            List <AchievementDef> list = new List <AchievementDef>();

            //Used for building achievement unlock chains?
            map.Clear();

            //Get all classes that inherit from BaseAchievement

            foreach (Type achievementClass in from type in (AppDomain.CurrentDomain.GetAssemblies()
                                                            .Where(a => !a.IsDynamic)
                                                            .SelectMany(a => { try { return(a.GetTypes()); } catch { achievementLogger.LogError(String.Format("Unable to scan {0} for achievements", a.FullName)); return(new Type[0]); } }))
                     where type.IsSubclassOf(typeof(BaseAchievement))
                     orderby type.Name
                     select type)
            {
                //Check if the achievement has an override defined
                if (achievementOverrideTypes.Contains(achievementClass))
                {
                    //If it does, don't add it
                    continue;
                }

                //Get the achievement attribute
                RegisterAchievementAttribute registerAchievementAttribute = (RegisterAchievementAttribute)Attribute.GetCustomAttribute(achievementClass, typeof(RegisterAchievementAttribute));

                //Get the custom achievement attribute
                CustomAchievementAttribute customAchievementAttribute = (CustomAchievementAttribute)Attribute.GetCustomAttribute(achievementClass, typeof(CustomAchievementAttribute));

                //If it's found, set the vanilla attribute to have the same values so we don't have to change a bunch of stuff
                if (customAchievementAttribute != null)
                {
                    registerAchievementAttribute = customAchievementAttribute;
                }

                //Check if the achievement was registered
                if (registerAchievementAttribute != null)
                {
                    //Make sure each achievement is unique
                    if (map.ContainsKey(registerAchievementAttribute.identifier))
                    {
                        Debug.LogErrorFormat("Class {0} attempted to register as achievement {1}, but class {2} has already registered as that achievement.", new object[]
                        {
                            achievementClass.FullName,
                            registerAchievementAttribute.identifier,
                            ___achievementNamesToDefs[registerAchievementAttribute.identifier].type.FullName
                        });
                    }
                    else
                    {
                        //Create the vanilla resource path
                        string iconPath = "Textures/AchievementIcons/tex" + registerAchievementAttribute.identifier + "Icon";

                        //Create the icon name
                        string iconName = "tex" + registerAchievementAttribute.identifier + "Icon";

                        //If it's a custom achievement, get the path for it
                        if (customAchievementAttribute != null)
                        {
                            iconPath = customAchievementAttribute.GetPath(iconName);
                        }

                        //If  the achievement is unique, build the achievement
                        AchievementDef achievementDef2 = new AchievementDef
                        {
                            identifier = registerAchievementAttribute.identifier,
                            unlockableRewardIdentifier        = registerAchievementAttribute.unlockableRewardIdentifier,
                            prerequisiteAchievementIdentifier = registerAchievementAttribute.prerequisiteAchievementIdentifier,
                            nameToken         = "ACHIEVEMENT_" + registerAchievementAttribute.identifier.ToUpper(CultureInfo.InvariantCulture) + "_NAME",
                            descriptionToken  = "ACHIEVEMENT_" + registerAchievementAttribute.identifier.ToUpper(CultureInfo.InvariantCulture) + "_DESCRIPTION",
                            iconPath          = iconPath,
                            type              = achievementClass,
                            serverTrackerType = registerAchievementAttribute.serverTrackerType
                        };

                        //Add the achievement identifier to the achievement identifier list
                        ___achievementIdentifiers.Add(registerAchievementAttribute.identifier);

                        //Used for building achievement unlock chains?
                        map.Add(registerAchievementAttribute.identifier, achievementDef2);

                        //Used to build achievement defs array?
                        list.Add(achievementDef2);

                        //Get the related unlockable def
                        UnlockableDef unlockableDef = UnlockableCatalog.GetUnlockableDef(achievementDef2.unlockableRewardIdentifier);

                        //If there is an unlockable def, set the how to unlock and unlocked text
                        if (unlockableDef != null)
                        {
                            string achievementName        = Language.GetString(achievementDef2.nameToken);
                            string achievementDescription = Language.GetString(achievementDef2.descriptionToken);
                            unlockableDef.getHowToUnlockString = (() => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[]
                            {
                                achievementName,
                                achievementDescription
                            }));

                            unlockableDef.getUnlockedString = (() => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[]
                            {
                                achievementName,
                                achievementDescription
                            }));
                        }
                    }
                }
                else
                {
                    //Warn that a class inheriting from BaseAchievement doesn't have a AchievementAttribute
                    string msg = string.Format("Class {0} in {1} inherits from BaseAchievement but doesn't have a RegisterAchievement attribute.", new object[] { achievementClass.FullName, achievementClass.Assembly.GetName().Name });
                    achievementLogger.LogWarning(msg);
                }
            }

            ___achievementDefs = list.ToArray();

            //Order achievements
            ___achievementDefs = ___achievementDefs.OrderBy(def => UnlockableCatalog.GetUnlockableSortScore(def.unlockableRewardIdentifier)).ToArray();

            //Get achievements that need to be server tracked
            ___serverAchievementDefs = (from achievementDef in ___achievementDefs
                                        where achievementDef.serverTrackerType != null
                                        select achievementDef).ToArray <AchievementDef>();

            //Build achievements to be tracked by client?
            for (int i = 0; i < ___achievementDefs.Length; i++)
            {
                ___achievementDefs[i].index = new AchievementIndex
                {
                    intValue = i
                };
            }

            //Build achievements to be tracked by server?
            for (int j = 0; j < ___serverAchievementDefs.Length; j++)
            {
                ___serverAchievementDefs[j].serverIndex = new ServerAchievementIndex
                {
                    intValue = j
                };
            }

            //Build achievement requirement chains?
            for (int k = 0; k < ___achievementIdentifiers.Count; k++)
            {
                string currentAchievementIdentifier = ___achievementIdentifiers[k];
                map[currentAchievementIdentifier].childAchievementIdentifiers = (from v in ___achievementIdentifiers
                                                                                 where map[v].prerequisiteAchievementIdentifier == currentAchievementIdentifier
                                                                                 select v).ToArray <string>();
            }

            //Let the system know all achievements have been created
            Action action = ___onAchievementsRegistered;

            if (action == null)
            {
                return(false);
            }
            action();

            //Skip the original code
            return(false);
        }
示例#9
0
 public void Awake()
 {
     _logger = base.Logger;
     GlobalEventManager.onCharacterDeathGlobal += this.GlobalEventManager_onCharacterDeathGlobal;
 }
        private void Awake()
        {
            Log = Logger;

            modEnabled         = Config.Bind("General", "Enabled", true, "Enable this mod");
            pinOverlapDistance = Config.Bind <float>("General", "PinOverlapDistance", 10, "Distance around pins to prevent overlapping of similar pins");
            pinIcons           = Config.Bind("General", "PinIcons", 1, "Use [1] Game sprites(copper for copper, silver for silver, etc.) or [2] Colored pins (must be 1 or 2)");
            pinRange           = Config.Bind("General", "PinRange", 150, "Sets the range that pins will appear on the mini-map. Lower value means you need to be closer to set pin.\nMin 5\nMax 150\nRecommended 50-75");
            if (pinRange.Value < 5)
            {
                pinRange.Value = 5;
            }
            if (pinRange.Value > 150)
            {
                pinRange.Value = 150;
            }
            hideAllNames = Config.Bind("General", "HideAllNames", false, "This option will hide all names for all pins.\n*THIS WILL OVERRIDE THE INDIVIDUAL SETTINGS*");
            //nexusID = Config.Bind<int>("General", "NexusID", 774, "Nexus mod ID for updates");
            //***ORES***//
            pinCopper        = Config.Bind("Ores - Copper", "PinCopper", true, "Show pins for Copper");
            saveCopper       = Config.Bind("Ores - Copper", "SaveCopper", false, "Save pins for Copper");
            showCopperName   = Config.Bind("Ores - Copper", "ShowCopperName", true, "Show name for Copper");
            copperName       = Config.Bind("Ores - Copper", "CopperNameDisplay", "Copper", "Display name for Copper");
            pinCopperSize    = Config.Bind <float>("Ores - Copper", "PinCopperSize", 20, "Size of Copper pin on minimap/main Map (20 is recommended)");
            pinTin           = Config.Bind("Ores - Tin", "PinTin", true, "Show pins for Tin");
            saveTin          = Config.Bind("Ores - Tin", "SaveTin", false, "Save pins for Tin");
            showTinName      = Config.Bind("Ores - Tin", "ShowTinName", true, "Show name for Tin");
            tinName          = Config.Bind <string>("Ores - Tin", "TinNameDisplay", "Tin", "Display name for Tin");
            pinTinSize       = Config.Bind <float>("Ores - Tin", "PinTinSize", 20, "Size of pin Tin on minimap/main Map (20 is recommended)");
            pinObsidian      = Config.Bind("Ores - Obsidian", "PinObsidian", true, "Show pins for Obsidian");
            saveObsidian     = Config.Bind("Ores - Obsidian", "SaveObsidian", false, "Save pins for Obsidian");
            showObsidianName = Config.Bind("Ores - Obsidian", "ShowObsidianName", true, "Show name for Obsidian");
            obsidianName     = Config.Bind <string>("Ores - Obsidian", "ObsidianNameDisplay", "Obsidian", "Display name for Obsidian");
            pinObsidianSize  = Config.Bind <float>("Ores - Obsidian", "PinObsidianSize", 20, "Size of Obsidian pin on minimap/main Map (20 is recommended)");
            pinSilver        = Config.Bind("Ores - Silver", "PinSilver", true, "Show pins for Silver");
            saveSilver       = Config.Bind("Ores - Silver", "SaveSilver", false, "Save pins for Silver");
            showSilverName   = Config.Bind("Ores - Silver", "ShowSilverName", true, "Show name for Silver");
            silverName       = Config.Bind <string>("Ores - Silver", "SilverNameDisplay", "Silver", "Display name for Silver");
            pinSilverSize    = Config.Bind <float>("Ores - Silver", "PinSilverSize", 20, "Size of Silver pin on minimap/main Map (20 is recommended)");
            pinIron          = Config.Bind("Ores - Iron", "PinIron", true, "Show pins for Iron");
            saveIron         = Config.Bind("Ores - Iron", "SaveIron", false, "Save pins for Iron");
            showIronName     = Config.Bind("Ores - Iron", "ShowIronName", true, "Show name for Iron");
            ironName         = Config.Bind <string>("Ores - Iron", "IronNameDisplay", "Iron", "Display name for Iron");
            pinIronSize      = Config.Bind <float>("Ores - Iron", "PinIronSize", 20, "Size of Iron pin on minimap/main Map (20 is recommended)");
            pinFlametal      = Config.Bind("Ores - Flametal", "PinFlametal", true, "Show pins for Flametal");
            saveFlametal     = Config.Bind("Ores - Flametal", "SaveFlametal", false, "Save pins for Flametal");
            showFlametalName = Config.Bind("Ores - Flametal", "ShowFlametalName", true, "Show name for Flametal");
            flametalName     = Config.Bind <string>("Ores - Flametal", "FlametalNameDisplay", "Flametal", "Display name for Flametal");
            pinFlametalSize  = Config.Bind <float>("Ores - Flametal", "PinFlametalSize", 20, "Size of Flametal pin on minimap/main Map (20 is recommended)");
            //***PICKABLES***//
            pinBerries           = Config.Bind("Pickables - Berries", "PinBerries", true, "Show pins for Berries");
            saveBerries          = Config.Bind("Pickables - Berries", "SaveBerries", false, "Save pins for Berries");
            showBerriesName      = Config.Bind("Pickables - Berries", "ShowBerriesName", true, "Show name for Berries");
            berriesName          = Config.Bind <string>("Pickables - Berries", "BerriesNameDisplay", "Berries", "Display name for Berries");
            pinBerriesSize       = Config.Bind <float>("Pickables - Berries", "PinBerriesSize", 20, "Size of Berries pin on minimap/main Map (20 is recommended)");
            pinBlueberries       = Config.Bind("Pickables - Blueberries", "PinBlueberries", true, "Show pins for Blueberries");
            saveBlueberries      = Config.Bind("Pickables - Blueberries", "SaveBlueberries", false, "Save pins for Blueberries");
            showBlueberriesName  = Config.Bind("Pickables - Blueberries", "ShowBlueberriesName", true, "Show name for Blueberries");
            blueberriesName      = Config.Bind <string>("Pickables - Blueberries", "BlueberriesNameDisplay", "Blueberries", "Display name for Blueberries");
            pinBlueberriesSize   = Config.Bind <float>("Pickables - Blueberries", "PinBlueberriesSize", 20, "Size of Blueberries pin on minimap/main Map (20 is recommended)");
            pinCloudberries      = Config.Bind("Pickables - Cloudberries", "PinCloudberries", true, "Show pins for Cloudberries");
            saveCloudberries     = Config.Bind("Pickables - Cloudberries", "SaveCloudberries", false, "Save pins for Cloudberries");
            showCloudberriesName = Config.Bind("Pickables - Cloudberries", "ShowCloudberriesName", true, "Show name for Cloudberries");
            cloudberriesName     = Config.Bind <string>("Pickables - Cloudberries", "CloudberriesNameDisplay", "Cloudberries", "Display name for Cloudberries");
            pinCloudberriesSize  = Config.Bind <float>("Pickables - Cloudberries", "PinCloudberriesSize", 20, "Size of Cloudberries pin on minimap/main Map (20 is recommended)");
            pinThistle           = Config.Bind("Pickables - Thistle", "PinThistle", true, "Show pins for Thistle");
            saveThistle          = Config.Bind("Pickables - Thistle", "SaveThistle", false, "Save pins for Thistle");
            showThistleName      = Config.Bind("Pickables - Thistle", "ShowThistleName", true, "Show name for Thistle");
            thistleName          = Config.Bind <string>("Pickables - Thistle", "ThistleNameDisplay", "Thistle", "Display name for Thistle");
            pinThistleSize       = Config.Bind <float>("Pickables - Thistle", "PinThistleSize", 20, "Size of Thistle pin on minimap/main Map (20 is recommended)");
            pinMushroom          = Config.Bind("Pickables - Mushroom", "PinMushroom", true, "Show pins for Mushroom");
            saveMushroom         = Config.Bind("Pickables - Mushroom", "SaveMushroom", false, "Save pins for Mushroom");
            showMushroomName     = Config.Bind("Pickables - Mushroom", "ShowMushroomName", true, "Show name for Mushroom");
            mushroomName         = Config.Bind <string>("Pickables - Mushroom", "MushroomNameDisplay", "Mushroom", "Display name for Mushroom");
            pinMushroomSize      = Config.Bind <float>("Pickables - Mushroom", "PinMushroomSize", 20, "Size of Mushroom pin on minimap/main Map (20 is recommended)");
            pinCarrot            = Config.Bind("Pickables - Carrot", "PinCarrot", true, "Show pins for Carrot");
            saveCarrot           = Config.Bind("Pickables - Carrot", "SaveCarrot", false, "Save pins for Carrot");
            showCarrotName       = Config.Bind("Pickables - Carrot", "ShowCarrotName", true, "Show name for Carrot");
            carrotName           = Config.Bind <string>("Pickables - Carrot", "CarrotNameDisplay", "Carrot", "Display name for Carrot");
            pinCarrotSize        = Config.Bind <float>("Pickables - Carrot", "PinCarrotSize", 25, "Size of Carrot pin on minimap/main Map (25 is recommended)");
            pinTurnip            = Config.Bind("Pickables - Turnip", "PinTurnip", true, "Show pins for Turnip");
            saveTurnip           = Config.Bind("Pickables - Turnip", "SaveTurnip", false, "Save pins for Turnip");
            showTurnipName       = Config.Bind("Pickables - Turnip", "ShowTurnipName", true, "Show name for Turnip");
            turnipName           = Config.Bind <string>("Pickables - Turnip", "TurnipNameDisplay", "Turnip", "Display name for Turnip");
            pinTurnipSize        = Config.Bind <float>("Pickables - Turnip", "PinTurnipSize", 25, "Size of Turnip pin on minimap/main Map (25 is recommended)");
            pinDragonEgg         = Config.Bind("Misc - Dragon Eggs", "PinDragonEgg", true, "Show pins for Dragon Eggs");
            saveDragonEgg        = Config.Bind("Misc - Dragon Eggs", "SaveDragonEgg", false, "Save pins for Dragon Eggs");
            showDragonEggName    = Config.Bind("Misc - Dragon Eggs", "ShowDragonEggName", true, "Show name for Dragon Eggs");
            dragonEggName        = Config.Bind <string>("Misc - Dragon Eggs", "DragonEggNameDisplay", "DragonEgg", "Display name for Dragon Eggs");
            pinDragonEggSize     = Config.Bind <float>("Misc - Dragon Eggs", "PinDragonEggSize", 20, "Size of Dragon Eggs pin on minimap/main Map (20 is recommended)");
            //***LOCATIONS***//
            pinCrypt            = Config.Bind("Locations - Crypt", "PinCrypt", true, "Show pins for Crypts");
            saveCrypt           = Config.Bind("Locations - Crypt", "SaveCrypt", false, "Save pins for Crypts");
            showCryptName       = Config.Bind("Locations - Crypt", "ShowCryptName", true, "Show name for Crypts");
            cryptName           = Config.Bind <string>("Locations - Crypt", "CryptNameDisplay", "Crypt", "Display name for Crypts");
            pinCryptSize        = Config.Bind <float>("Locations - Crypt", "PinCryptSize", 25, "Size of Crypts pin on minimap/main Map (25 is recommended)");
            pinSunkenCrypt      = Config.Bind("Locations - SunkenCrypt", "PinSunkenCrypt", true, "Show pins for SunkenCrypts");
            saveSunkenCrypt     = Config.Bind("Locations - SunkenCrypt", "SaveSunkenCrypt", false, "Save pins for SunkenCrypts");
            showSunkenCryptName = Config.Bind("Locations - SunkenCrypt", "ShowSunkenCryptName", true, "Show name for SunkenCrypts");
            sunkenCryptName     = Config.Bind <string>("Locations - SunkenCrypt", "SunkenCryptNameDisplay", "SunkenCrypt", "Display name for SunkenCrypts");
            pinSunkenCryptSize  = Config.Bind <float>("Locations - SunkenCrypt", "PinSunkenCryptSize", 25, "Size of SunkenCrypts pin on minimap/main Map (25 is recommended)");
            pinTrollCave        = Config.Bind("Locations - TrollCave", "PinTrollCave", true, "Show pins for TrollCaves");
            saveTrollCave       = Config.Bind("Locations - TrollCave", "SaveTrollCave", false, "Save pins for TrollCaves");
            showTrollCaveName   = Config.Bind("Locations - TrollCave", "ShowTrollCaveName", true, "Show name for TrollCaves");
            trollCaveName       = Config.Bind <string>("Locations - TrollCave", "TrollCaveNameDisplay", "TrollCave", "Display name for TrollCaves");
            pinTrollCaveSize    = Config.Bind <float>("Locations - TrollCave", "PinTrollCaveSize", 25, "Size of TrollCaves pin on minimap/main Map (25 is recommended)");
            //***SPAWNERS***//
            pinSkeleton       = Config.Bind("Spawners - Skeleton", "PinSkeleton", true, "Show pins for Skeleton");
            saveSkeleton      = Config.Bind("Spawners - Skeleton", "SaveSkeleton", false, "Save pins for Skeleton");
            showSkeletonName  = Config.Bind("Spawners - Skeleton", "ShowSkeletonName", true, "Show name for Skeleton");
            skeletonName      = Config.Bind <string>("Spawners - Skeleton", "SkeletonNameDisplay", "Skeleton", "Display name for Skeleton");
            pinSkeletonSize   = Config.Bind <float>("Spawners - Skeleton", "PinSkeletonSize", 25, "Size of Skeleton pin on minimap/main Map (25 is recommended)");
            pinDraugr         = Config.Bind("Spawners - Draugr", "PinDraugr", true, "Show pins for Draugr");
            saveDraugr        = Config.Bind("Spawners - Draugr", "SaveDraugr", false, "Save pins for Draugr");
            showDraugrName    = Config.Bind("Spawners - Draugr", "ShowDraugrName", true, "Show name for Draugr");
            draugrName        = Config.Bind <string>("Spawners - Draugr", "DraugrNameDisplay", "Draugr", "Display name for Draugr");
            pinDraugrSize     = Config.Bind <float>("Spawners - Draugr", "PinDraugrSize", 25, "Size of Draugr pin on minimap/main Map (25 is recommended)");
            pinSurtling       = Config.Bind("Spawners - Surtling", "PinSurtling", true, "Show pins for Surtling");
            saveSurtling      = Config.Bind("Spawners - Surtling", "SaveSurtling", false, "Save pins for Surtling");
            showSurtlingName  = Config.Bind("Spawners - Surtling", "ShowSurtlingName", true, "Show name for Surtling");
            surtlingName      = Config.Bind <string>("Spawners - Surtling", "SurtlingNameDisplay", "Surtling", "Display name for Surtling");
            pinSurtlingSize   = Config.Bind <float>("Spawners - Surtling", "PinSurtlingSize", 25, "Size of Surtling pin on minimap/main Map (25 is recommended)");
            pinGreydwarf      = Config.Bind("Spawners - Greydwarf", "PinGreydwarf", true, "Show pins for Greydwarf");
            saveGreydwarf     = Config.Bind("Spawners - Greydwarf", "SaveGreydwarf", false, "Save pins for Greydwarf");
            showGreydwarfName = Config.Bind("Spawners - Greydwarf", "ShowGreydwarfName", true, "Show name for Greydwarf");
            greydwarfName     = Config.Bind <string>("Spawners - Greydwarf", "GreydwarfNameDisplay", "Greydwarf", "Display name for Greydwarf");
            pinGreydwarfSize  = Config.Bind <float>("Spawners - Greydwarf", "PinGreydwarfSize", 25, "Size of Greydwarf pin on minimap/main Map (25 is recommended)");
            pinSerpent        = Config.Bind("Spawners - Serpent", "PinSerpent", true, "Show pins for Serpent");
            saveSerpent       = Config.Bind("Spawners - Serpent", "SaveSerpent", false, "Save pins for Serpent");
            showSerpentName   = Config.Bind("Spawners - Serpent", "ShowSerpentName", true, "Show name for Serpent");
            serpentName       = Config.Bind <string>("Spawners - Serpent", "SerpentNameDisplay", "Serpent", "Display name for Serpent");
            pinSerpentSize    = Config.Bind <float>("Spawners - Serpent", "PinSerpentSize", 25, "Size of Serpent pin on minimap/main Map (25 is recommended)");
            //***LEVIATHANS***//
            pinLeviathan      = Config.Bind("Spawners - Leviathan", "PinLeviathan", true, "Show pins for Leviathan");
            saveLeviathan     = Config.Bind("Spawners - Leviathan", "SaveLeviathan", false, "Save pins for Leviathan");
            showLeviathanName = Config.Bind("Spawners - Leviathan", "ShowLeviathanName", true, "Show name for Leviathan");
            leviathanName     = Config.Bind <string>("Spawners - Leviathan", "LeviathanNameDisplay", "Leviathan", "Display name for Leviathan");
            pinLeviathanSize  = Config.Bind <float>("Spawners - Leviathan", "PinLeviathanSize", 25, "Size of Leviathan pin on minimap/main Map (25 is recommended)");

            if (!modEnabled.Value)
            {
                enabled = false;
            }
            else
            {
                new Harmony("materousapps.mods.automappins_configurable").PatchAll();

                Harmony.CreateAndPatchAll(typeof(Minimap_Patch), "materousapps.mods.automappins_configurable");
                Harmony.CreateAndPatchAll(typeof(DestructiblePatchSpawn), "materousapps.mods.automappins_configurable");
                Harmony.CreateAndPatchAll(typeof(PickablePatchSpawn), "materousapps.mods.automappins_configurable");
                Harmony.CreateAndPatchAll(typeof(LocationPatchSpawn), "materousapps.mods.automappins_configurable");
                Harmony.CreateAndPatchAll(typeof(SpawnAreaPatchSpawn), "materousapps.mods.automappins_configurable");
                Harmony.CreateAndPatchAll(typeof(MineRockPatchSpawn), "materousapps.mods.automappins_configurable");
                Harmony.CreateAndPatchAll(typeof(Player_Patches), "materousapps.mods.automappins_configurable");
                Harmony.CreateAndPatchAll(typeof(AMPCommandPatcher), "materousapps.mods.automappins_configurable");

                addedPinLocs = new List <Vector3>();
                dupPinLocs   = new List <Vector3>();
                autoPins     = new List <Minimap.PinData>();
                pinRemList   = new List <Minimap.PinData>();
                savedPins    = new List <Minimap.PinData>();
                filteredPins = new List <string>();

                Assets.Init(pinIcons.Value);
                Commands.AMPLoader.Init();
            }
        }
示例#11
0
 static Log()
 {
     manualLogSource = Logger.CreateLogSource("mm");
 }
示例#12
0
 public TweakLogger(ManualLogSource logger)
 {
     Logger = logger;
     LogInfo(typeof(TweakLogger).Name, $"Loglevel = {DebugConvar.value}");//We use typeof() here to let refactoring find this name.
 }
示例#13
0
 private void Awake()
 {
     _logger = Logger;
     CharacterApi.RegisterExtraBehaviour <KoiClothesOverlayController>(GUID);
     KoiClothesOverlayController.Hooks.Init(GUID);
 }
示例#14
0
        private void Start()
        {
            Logger = base.Logger;

            #if KK
            PregnancyProgressionSpeed = Config.Bind("General", "Pregnancy progression speed", 4,
                                                    new ConfigDescription("How much faster does the in-game pregnancy progresses than the standard 40 weeks. " +
                                                                          "It also reduces the time characters leave school for after birth.\n\n" +
                                                                          "x1 is 40 weeks, x2 is 20 weeks, x4 is 10 weeks, x10 is 4 weeks.",
                                                                          new AcceptableValueList <int>(1, 2, 4, 10)));
            #elif AI
            PregnancyProgressionSpeed = Config.Bind("General", "Pregnancy progression speed", 4,
                                                    new ConfigDescription("How much faster does the in-game pregnancy progresses than the standard 4 weeks. \n\n" +
                                                                          "x1 is 4 weeks, x2 is 2 weeks, x4 is 1 week, x10 is ~4 days.",
                                                                          new AcceptableValueList <int>(1, 2, 4, 10)));
            #endif

            ConceptionEnabled = Config.Bind("General", "Enable conception", true,
                                            "Allows characters to get pregnant from vaginal sex. Doesn't affect already pregnant characters.");

            FertilityOverride = Config.Bind("General", "Minimum fertility level", 0f,
                                            new ConfigDescription("If a character has a lower fertility level than this set, this level will be used instead. \n\n" +
                                                                  "0 - The value saved in the character card is used (30% by default)\n" +
                                                                  "30%, 50%, 75%, 100% - If the character card's saved value is lower, it will be raised to this level in HScenes.",
                                                                  new AcceptableValueList <float>(0f, 0.3f, 0.5f, 0.75f, 1f)));

            AnalConceptionEnabled = Config.Bind("General", "Enable anal conception", false,
                                                "Allows characters to get pregnant from anal sex. Doesn't affect already pregnant characters.");

            ShowPregnancyIconEarly = Config.Bind("General", "Show pregnancy icon early", false,
                                                 "By default pregnancy status icon in class roster is shown after a few days or weeks (the character had a chance to do the test or noticed something is wrong).\n" +
                                                 "Turning this on will always make the icon show up at the end of the current day.");

            HSceneMenstrIconOverride = Config.Bind("General", "Use custom safe/risky icons in H Scenes", true,
                                                   "Replaces the standard safe/risky indicators with custom indicators that can also show pregnancy and unknown status. " +
                                                   "If the status is unknown you will have to listen for the voice cues instead.\nChanges take effect after game restart.");

            InflationEnable = Config.Bind("Inflation", "Enable inflation", true, "Turn on the inflation effect.");

            InflationSpeed = Config.Bind("Inflation", "Inflation speed modifier", 1,
                                         new ConfigDescription("How quickly the belly will inflate/deflate compared to normal (1x, 2x, 3x as fast).", new AcceptableValueList <int>(1, 2, 3)));

            InflationOpenClothAtMax = Config.Bind("Inflation", "Open clothes at max inflation", true,
                                                  "If clothes are fully on, open them when inflation reaches the max value (they 'burst' open).");

            InflationMaxCount = Config.Bind("Inflation", "Cum count until full", 8,
                                            new ConfigDescription("How many times you have to let out inside to reach the maximum belly size.", new AcceptableValueRange <int>(2, 15)));

            #if KK
            LactationEnabled = Config.Bind("Lactation", "Enable lactation", true,
                                           "Enable the lactation effect. For the effect to work the character has to be pregnant, or the override setting has to be enabled.");

            LactationFillTime = Config.Bind("Lactation", "Time to fully refill", 5,
                                            new ConfigDescription("How many minutes it takes to fully refill the milk. 0 is always fully refilled.", new AcceptableValueRange <int>(0, 10)));

            LactationForceMaxCapacity = Config.Bind("Lactation", "Force max milk capacity", false,
                                                    "If enabled, all characters will lactate and have full capacity. If off, capacity depends on the pregnancy progress.");
            #endif

            CharacterApi.RegisterExtraBehaviour <PregnancyCharaController>(GUID);
            GameAPI.RegisterExtraBehaviour <PregnancyGameController>(GUID);

            var hi = new Harmony(GUID);
            Hooks.InitHooks(hi);
            PregnancyGui.Init(hi, this);
        }
示例#15
0
 public BepInExLogger(ManualLogSource logger)
 {
     this.logger = logger;
 }
示例#16
0
 public static void SetLogger(ManualLogSource logger)
 {
     IVRLog.logger = logger;
 }
示例#17
0
 public static void SetLogSource(ManualLogSource logSource)
 {
     _logSource = logSource;
 }
示例#18
0
        void Awake()
        {
            logger = Logger;
            logger.LogInfo($"Initializing {pluginName} {pluginVersion}");

            minForce = Config.Bind(
                pluginName,
                nameof(minForce),
                2f,
                "The minimum force a player will have applied to them if the harpooned character attempts to pull them.");

            maxForceOnAttacker = Config.Bind(
                pluginName,
                nameof(maxForceOnAttacker),
                50f,
                "The max force that will be applied to the harpoon thrower.");

            maxForceOnHarpoon = Config.Bind(
                pluginName,
                nameof(maxForceOnHarpoon),
                20f,
                "The max force that will be applied to the harpoon thrower.");

            minHealthLimit = Config.Bind(
                pluginName,
                nameof(minHealthLimit),
                0.33f,
                new ConfigDescription("The force an enemy applies to you scales with how much health they have. This value represents the percent of health they should stop applying any force at.",
                                      new AcceptableValueRange <float>(0f, 1f)));

            minDistance = Config.Bind(
                pluginName,
                nameof(minDistance),
                5f,
                "If a character is this distance from the attacker they will not apply a force on them.");

            maxDistance = Config.Bind(
                pluginName,
                nameof(maxDistance),
                100f,
                "Max distance a character will attempt to pull the attacker. Used to smooth out applied force.");

            scalingFactorForceOnAttacker = Config.Bind(
                pluginName,
                nameof(scalingFactorForceOnAttacker),
                1.0f,
                "overall scaling factor to apply to end force applied to character");

            scalingFactorForceOnHarpoon = Config.Bind(
                pluginName,
                nameof(scalingFactorForceOnHarpoon),
                1.0f,
                "overall scaling factor to apply to end force applied to target");

            pullStaminaCost = Config.Bind(
                pluginName,
                nameof(pullStaminaCost),
                0 * 2f,
                "Stamina cost of blocking.");

            forceBaseline = Config.Bind(
                pluginName,
                nameof(forceBaseline),
                2f,
                "Baseline force applied.");

            maxMassRatioDiff = Config.Bind(
                pluginName,
                nameof(maxMassRatioDiff),
                0.9f,
                "Max difference in mass calculation for target and source");

            maxMass = Config.Bind(
                pluginName,
                nameof(maxMass),
                50f,
                "maxMass");

            forceMode = Config.Bind(
                pluginName,
                nameof(forceMode),
                ForceMode.VelocityChange,
                "Force Mode to apply");

            onShipFactor = Config.Bind(
                pluginName,
                nameof(onShipFactor),
                1f,
                new ConfigDescription(
                    "Additional force applied if attacker is on a ship",
                    new AcceptableValueRange <float>(0f, 5f))
                );

            inWaterFactor = Config.Bind(
                pluginName,
                nameof(inWaterFactor),
                1f,
                new ConfigDescription(
                    "Additional force applied if harpooned is in water",
                    new AcceptableValueRange <float>(0f, 5f))
                );

            harmony.PatchAll();
        }
示例#19
0
 internal static void SetCurrentLogger(ManualLogSource logger)
 {
     _currentLogger = logger;
 }
示例#20
0
 public BepInExLoader() : base()
 {
     log = Log;
 }
        private void Awake()
        {
            Logger = base.Logger;

            Harmony.CreateAndPatchAll(typeof(Hooks), GUID);
        }
示例#22
0
        internal void Start()
        {
            Logger = base.Logger;

            ConfigEnablePushup = Config.Bind("Config", "Enable Pushup By Default", false, new ConfigDescription("Whether the pushup effect is enabled by default when a bra is worn.", null, new ConfigurationManagerAttributes {
                Order = 10
            }));
            ConfigFirmnessDefault = Config.Bind("Config", "Firmness Default Value", 0.9f, new ConfigDescription("Firmness of the breasts. More firm means less bounce.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 9
            }));
            ConfigLiftDefault = Config.Bind("Config", "Lift Default Value", 0.6f, new ConfigDescription("Lift of the breasts. Lift is the minimum height position of the breasts when a bra is worn.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 8
            }));
            ConfigPushTogetherDefault = Config.Bind("Config", "Push Together Default Value", 0.55f, new ConfigDescription("How much the breasts will be pushed together when a bra is worn, if they are set far apart.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 7
            }));
            ConfigSqueezeDefault = Config.Bind("Config", "Squeeze Default Value", 0.6f, new ConfigDescription("Long breasts will be flattened by this amount.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 6
            }));
            ConfigNippleCenteringDefault = Config.Bind("Config", "Nipple Centering Default Value", 0.5f, new ConfigDescription("If the nipples point up or down, wearing a bra will make them point forwards.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 5
            }));
            ConfigFlattenNipplesDefault = Config.Bind("Config", "Flatten Nipples Default", true, new ConfigDescription("Flatten nipples while a bra is worn.", null, new ConfigurationManagerAttributes {
                Order = 4
            }));
            ConfigSliderMin = Config.Bind("Config", "Advanced Mode Slider Minimum", -100, new ConfigDescription("Minimum value of advanced mode sliders.", new AcceptableValueRange <int>(-500, 0), new ConfigurationManagerAttributes {
                Order = 3
            }));
            ConfigSliderMax = Config.Bind("Config", "Advanced Mode Slider Maximum", 200, new ConfigDescription("Maximum value of advanced mode sliders.", new AcceptableValueRange <int>(100, 500), new ConfigurationManagerAttributes {
                Order = 2
            }));

            CharacterApi.RegisterExtraBehaviour <PushupController>(GUID);
            MakerAPI.RegisterCustomSubCategories += RegisterCustomSubCategories;
            MakerAPI.ReloadCustomInterface       += ReloadCustomInterface;
            MakerAPI.MakerExiting         += MakerExiting;
            MakerAPI.MakerFinishedLoading += MakerFinishedLoading;
            RegisterStudioControls();

            var harmony = HarmonyWrapper.PatchAll(typeof(Hooks));

            //Patch all the slider onValueChanged events to return false and cancel original code
            //Pushup adds its own onValueChanged event that manages this stuff
            foreach (var anonType in typeof(ChaCustom.CvsBreast).GetNestedTypes(AccessTools.all).Where(x => x.Name.Contains("<Start>")))
            {
                foreach (var anonTypeMethod in anonType.GetMethods(AccessTools.all).Where(x => x.Name.Contains("<>m")))
                {
                    if (anonTypeMethod.GetParameters().Any(x => x.ParameterType == typeof(float)))
                    {
                        harmony.Patch(anonTypeMethod, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.SliderHook), AccessTools.all)));
                    }
                }
            }

            var sliders = typeof(ChaCustom.CvsBreast).GetMethods(AccessTools.all).Where(x => x.Name.Contains("<Start>") && x.GetParameters().Any(y => y.ParameterType == typeof(float))).ToList();

            //Don't patch areola size or nipple gloss since they are not managed by this plugin
            foreach (var slider in sliders)
            {
                if (Application.productName == Constants.MainGameProcessName)
                {
                    if (slider.Name == "<Start>m__E")
                    {
                    }                                    //areola size
                    else if (slider.Name == "<Start>m__14")
                    {
                    }                                          //nipple gloss
                    else
                    {
                        harmony.Patch(slider, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.SliderHook), AccessTools.all)));
                    }
                }
                else if (Application.productName == Constants.MainGameProcessNameSteam)
                {
                    if (slider.Name == "<Start>m__10")
                    {
                    }                                     //areola size
                    else if (slider.Name == "<Start>m__17")
                    {
                    }                                          //nipple gloss
                    else
                    {
                        harmony.Patch(slider, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.SliderHook), AccessTools.all)));
                    }
                }
            }
        }
示例#23
0
 public Sorter(ManualLogSource logger)
 {
     _logger = logger;
 }
 /// <summary>
 /// コンストラクタではフックをインストールするだけ
 /// </summary>
 private void Awake()
 {
     Logger = base.Logger;
     Hooks.InstallHooks();
 }
示例#25
0
        internal void Main()
        {
            Logger = base.Logger;

            StartCoroutine(LoadJuice());
        }
示例#26
0
 protected virtual void Awake()
 {
     Logger = base.Logger;
 }
示例#27
0
 public void Awake()
 {
     Logger = base.Logger;
     Extension.Logger.logger = Logger;
     Harmony.CreateAndPatchAll(typeof(Patches));
 }
示例#28
0
 public ClientListenerEvents(TClient client, ManualLogSource log, IClientEvents <TClient> events)
 {
     _client = client;
     _log    = log;
     _events = events;
 }
示例#29
0
 protected virtual void Awake()
 {
     Harmony    = new Harmony($"{GUID}.harmony");
     Logger     = base.Logger;
     HideHotkey = Config.Bind("Keyboard shortcuts", "Hide UI", new KeyboardShortcut(KeyCode.Space));
 }
示例#30
0
 public PreloadLogger(string name)
 {
     _logger = Logger.CreateLogSource(name);
 }