Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using BepInEx;
- using HarmonyLib;
- using BepInEx.Logging;
- using BepInEx.Configuration;
- using UnityEngine;
- using System.Reflection;
- namespace %YOUR_MOD_NAME%
- {
- [BepInPlugin(modGUID, modName, modVersion)]
- [BepInProcess("Lethal Company.exe")]
- [BepInDependency("ImoutoSama.PersonalBoombox", "1.1.0")]
- public class %YOUR_MOD_NAME_PLUGIN% : BaseUnityPlugin
- {
- private const string modGUID = YOUR_UNIQUE_GUID;
- private const string modName = YOUR_MOD_NAME;
- private const string modVersion = YOUR_VERSION;
- private readonly Harmony harmony = new Harmony(modGUID);
- internal ManualLogSource logger;
- public ConfigEntry<bool> overridePriceFlagConfig;
- public ConfigEntry<int> overridePriceValueConfig;
- void Awake(){
- logger = BepInEx.Logging.Logger.CreateLogSource(modGUID);
- logger.LogInfo($"Plugin {modName} has been added!");
- overridePriceFlagConfig = Config.Bind("General", "Override Price Flag", false, "If you want to override price of the boomboxes, you MUST set this to true.");
- overridePriceValueConfig = ConfigBindClamp("General", "Override Price Value", 30, "Overrides the price of the boomboxes by this value. Clamped from 0 to 1000.", 0, 1000);
- var request = PersonalBoombox.PersonalBoomboxPlugin.AddFromAssemblyDll(Assembly.GetExecutingAssembly().Location);
- request.overridePriceFlag = overridePriceFlagConfig.Value;
- request.overridePriceValue = overridePriceValueConfig.Value;
- }
- public ConfigEntry<int> ConfigBindClamp(string section, string key, int defaultValue, string description, int min, int max){
- var config = Config.Bind(section, key, defaultValue, description);
- config.Value = Mathf.Clamp(config.Value, min, max);
- return config;
- }
- }
- }
Advertisement
Comments
-
- I suppose the version in (line 12) [BepInDependency("ImoutoSama.PersonalBoombox", "1.1.0")] should be updated to the last version of the mod each time right ?
Add Comment
Please, Sign In to add comment
Advertisement