Add config for max building volume
This commit is contained in:
@@ -111,6 +111,9 @@ namespace InfectionFreeZone {
|
||||
public static ConfigEntry<bool> towerEchoSelection;
|
||||
public static List<WeakReference<StructureDefenceModule>> towerEchoSelectionList;
|
||||
|
||||
public static ConfigEntry<bool> buildingMaxVolumeDebug;
|
||||
public static ConfigEntry<float> buildingMaxVolume;
|
||||
|
||||
// See System.Void UI.InfoPanels.NestedUIElements.SelectWeaponPanel::OnWeaponItemClicked(UI.InfoPanels.NestedUIElements.WeaponItem)
|
||||
|
||||
public void Awake() {
|
||||
@@ -188,6 +191,9 @@ namespace InfectionFreeZone {
|
||||
towerEchoSelection = Config.Bind("General", "Tower Echo Selection", false);
|
||||
towerEchoSelectionList = new List<WeakReference<StructureDefenceModule>>();
|
||||
|
||||
buildingMaxVolumeDebug = Config.Bind("General", "Building Max Volume Debug", false);
|
||||
buildingMaxVolume = Config.Bind("General", "Building Max Volume", 50000f);
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
@@ -707,9 +713,25 @@ namespace InfectionFreeZone {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(WallConstructor), MethodType.Constructor,
|
||||
typeof(Wall.Factory), typeof(WorkersRadio), typeof(WallConfig))]
|
||||
public static void PostfixWallConstructor(Wall.Factory factory, WorkersRadio workersRadio, ref WallConfig wallConfig) {
|
||||
public static void PostfixWallConstructor(Wall.Factory factory, WorkersRadio workersRadio,
|
||||
ref WallConfig wallConfig) {
|
||||
Console.WriteLine($"Wall config created");
|
||||
wallConfig.maxAngel = 2f;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(AdaptController), MethodType.Constructor, typeof(AdaptConfig))]
|
||||
public static void PostfixAdaptConfig(ref AdaptConfig adaptConfig) {
|
||||
var trav = Traverse.Create(adaptConfig);
|
||||
var buildingsMaxVolume = trav.Field<float>("buildingsMaxVolume");
|
||||
|
||||
if (Main.buildingMaxVolumeDebug.Value)
|
||||
Console.WriteLine($"Building max volume is {buildingsMaxVolume.Value}");
|
||||
|
||||
buildingsMaxVolume.Value = Main.buildingMaxVolume.Value;
|
||||
|
||||
if (Main.buildingMaxVolumeDebug.Value)
|
||||
Console.WriteLine($"Building max volume modified to {buildingsMaxVolume.Value}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,9 @@
|
||||
<Reference Include="Sirenix.Serialization">
|
||||
<HintPath>$(GAME_MANAGED)/Sirenix.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="JutsuGamesConfig">
|
||||
<HintPath>$(GAME_MANAGED)/JutsuGamesConfig.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user