Added repair fires feature - v1.2.2

This commit is contained in:
2026-09-13 21:39:38 +02:00
parent c12dcceaf7
commit 0c58db1f62
11 changed files with 247 additions and 61 deletions
+14 -4
View File
@@ -1,4 +1,4 @@
using BepInEx.Configuration;
using BepInEx.Configuration;
using UnityEngine;
namespace AutoRefillFires
@@ -28,13 +28,18 @@ namespace AutoRefillFires
public ConfigEntry<FuelSourcePriority> FuelSourcePriority { get; }
public ConfigEntry<bool> OnlyRefillOwnPieces { get; }
public ConfigEntry<bool> AutoRepair { get; }
public ConfigEntry<float> RepairBelowPercent { get; }
public ConfigEntry<bool> OnlyRepairOwnPieces { get; }
public ConfigEntry<KeyboardShortcut> ToggleHotkey { get; }
public ConfigEntry<ModLogLevel> LogLevel { get; }
public ModConfig(ConfigFile config)
{
Radius = config.Bind("General", "Radius", 20f, "Refill fireplaces within this radius around the player.");
CheckInterval = config.Bind("General", "CheckInterval", 3f, "How often fireplaces are checked, in seconds.");
Radius = config.Bind("General", "Radius", 20f, "Refill and repair supported objects within this radius around the player.");
CheckInterval = config.Bind("General", "CheckInterval", 3f, "How often supported objects are checked, in seconds.");
RefillBelowPercent = config.Bind("General", "RefillBelowPercent", 0.75f, "Refill when fuel drops below this percentage.");
RefillToMax = config.Bind("General", "RefillToMax", true, "If true, refill fireplaces to maximum fuel. If false, add only RefillAmount fuel.");
RefillAmount = config.Bind("General", "RefillAmount", 5, "Amount of fuel to add when RefillToMax is false.");
@@ -51,10 +56,15 @@ namespace AutoRefillFires
FillHotTubs = config.Bind("Fireplace Types", "FillHotTubs", true, "Automatically refill hot tubs.");
FillOtherFireplaces = config.Bind("Fireplace Types", "FillOtherFireplaces", true, "Automatically refill unknown or modded Fireplace-based objects.");
ToggleHotkey = config.Bind("General", "ToggleHotkey", new KeyboardShortcut(KeyCode.F7), "Hotkey used to enable or disable automatic refilling.");
ToggleHotkey = config.Bind("General", "ToggleHotkey", new KeyboardShortcut(KeyCode.F7), "Hotkey used to enable or disable automatic refilling and repair.");
KeepFuelReserve = config.Bind("Fuel", "KeepFuelReserve", 0, "Minimum amount of fuel to keep in the source inventory. 10 means the last 10 Wood/Resin will not be used.");
FuelSourcePriority = config.Bind("Fuel", "FuelSourcePriority", AutoRefillFires.FuelSourcePriority.PlayerFirst, "Select whether player inventory or nearby containers should be used first.");
OnlyRefillOwnPieces = config.Bind("General", "OnlyRefillOwnPieces", false, "If enabled, only refill fireplaces and torches built by the local player.");
AutoRepair = config.Bind("Repair", "AutoRepair", false, "Automatically repair supported objects whose corresponding Fill* option is enabled.");
RepairBelowPercent = config.Bind("Repair", "RepairBelowPercent", 0.75f, "Repair supported objects when their health drops below this percentage. Example: 0.75 = 75%.");
OnlyRepairOwnPieces = config.Bind("Repair", "OnlyRepairOwnPieces", false, "If enabled, only automatically repair supported objects built by the local player.");
LogLevel = config.Bind("Logging", "LogLevel", ModLogLevel.Info, "Logging verbosity. Available values: None, Error, Warning, Info, Debug.");
}
}