From b41efba9b49eb0e40a66fe208b80be89caf377ed Mon Sep 17 00:00:00 2001 From: Sn1p3rr3c0n Date: Sat, 28 Dec 2024 20:29:40 +0100 Subject: [PATCH 1/2] #808 switched to hidden cable added setting to disable placement --- Languages/English/Keyed/AllKeyed_Settings.xml | 3 +++ Source/ProjectRimFactory/Common/CompTransmitsPower.cs | 8 ++++---- .../Common/ProjectRimFactory_ModSettings.cs | 11 +++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Languages/English/Keyed/AllKeyed_Settings.xml b/Languages/English/Keyed/AllKeyed_Settings.xml index a87b3ba22..fd21b3eaa 100644 --- a/Languages/English/Keyed/AllKeyed_Settings.xml +++ b/Languages/English/Keyed/AllKeyed_Settings.xml @@ -11,6 +11,9 @@ General Options Toggle the use of the Fuzzy Search algorithm for the storage item view\nIf Active Fuzzy Search will be used, otherwise it will use exact matches. Use Fuzzy-Search for the storage item view + + Toggle the automatic placement of a cable when constructing a conveyor belt. + Auto place cable with conveyor belt Forbid items on placement When enabled machine products will be automatically forbidden on placement. diff --git a/Source/ProjectRimFactory/Common/CompTransmitsPower.cs b/Source/ProjectRimFactory/Common/CompTransmitsPower.cs index e66151636..686101c8c 100644 --- a/Source/ProjectRimFactory/Common/CompTransmitsPower.cs +++ b/Source/ProjectRimFactory/Common/CompTransmitsPower.cs @@ -44,11 +44,11 @@ public ThingDef TransmitterDef } } } - if (undergroundCable == null) undergroundCable = ThingDefOf.PowerConduit; + if (undergroundCable == null) undergroundCable = ThingDefOf.HiddenConduit; } return undergroundCable; } - return p.transmitter ?? ThingDefOf.PowerConduit; + return p.transmitter ?? ThingDefOf.HiddenConduit; } } public override void PostSpawnSetup(bool respawningAfterLoad) @@ -66,7 +66,7 @@ public override void PostSpawnSetup(bool respawningAfterLoad) break; } } - if (!isTransmitterHere) + if (!isTransmitterHere && Common.ProjectRimFactory_ModSettings.PRF_PlaceConveyorCable) { var conduit = GenSpawn.Spawn(TransmitterDef, parent.Position, parent.Map); conduit.SetFaction(Faction.OfPlayer); // heh; don't forget @@ -104,7 +104,7 @@ public CompProperties_TransmitsPower() { this.compClass = typeof(CompTransmitsPower); } - public ThingDef transmitter = null; //ThingDefOf.PowerConduit; + public ThingDef transmitter = null; //ThingDefOf.HiddenConduit; static public List possibleUndergroundTransmitters; } } diff --git a/Source/ProjectRimFactory/Common/ProjectRimFactory_ModSettings.cs b/Source/ProjectRimFactory/Common/ProjectRimFactory_ModSettings.cs index e0f4ca30a..f645a45ab 100644 --- a/Source/ProjectRimFactory/Common/ProjectRimFactory_ModSettings.cs +++ b/Source/ProjectRimFactory/Common/ProjectRimFactory_ModSettings.cs @@ -86,6 +86,15 @@ private static void CSharpSettings(Listing_Standard list) TooltipHandler.TipRegion(rect, "PRF_Settings_GeneralOptions_DSU_UseFuzzySearch_ToolTip".Translate()); Widgets.CheckboxLabeled(rect, "PRF_Settings_GeneralOptions_DSU_UseFuzzySearch".Translate(), ref PRF_UseFuzzySearch); list.Gap(); + + rect = list.GetRect(20); + if (Mouse.IsOver(rect)) + { + Widgets.DrawHighlight(rect); + } + TooltipHandler.TipRegion(rect, "PRF_Settings_GeneralOptions_PlaceConveyorCable_ToolTip".Translate()); + Widgets.CheckboxLabeled(rect, "PRF_Settings_GeneralOptions_PlaceConveyorCable".Translate(), ref PRF_PlaceConveyorCable); + list.Gap(); } @@ -113,6 +122,7 @@ private static ContainerRow ParseSettingRows(ModContentPack content) private static bool PRF_LiteMode_last = false; public static bool PRF_Patch_Reachability_CanReach = false; public static bool PRF_UseFuzzySearch = true; + public static bool PRF_PlaceConveyorCable = true; public override void ExposeData() { @@ -122,6 +132,7 @@ public override void ExposeData() Scribe_Values.Look(ref PRF_LiteMode, "PRF_LiteMode", false); Scribe_Values.Look(ref PRF_Patch_Reachability_CanReach, "PRF_Patch_Reachability_CanReach", false); Scribe_Values.Look(ref PRF_UseFuzzySearch, "PRF_UseFuzzySearch", true); + Scribe_Values.Look(ref PRF_PlaceConveyorCable, "PRF_UseFuzzySearch", true); PRF_LiteMode_last = PRF_LiteMode; } From 8dea9f1784c50d32fc49ec56f72e841fc5066f6c Mon Sep 17 00:00:00 2001 From: Sn1p3rr3c0n Date: Sat, 28 Dec 2024 20:36:44 +0100 Subject: [PATCH 2/2] fix copy paste error --- .../ProjectRimFactory/Common/ProjectRimFactory_ModSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ProjectRimFactory/Common/ProjectRimFactory_ModSettings.cs b/Source/ProjectRimFactory/Common/ProjectRimFactory_ModSettings.cs index f645a45ab..202329eb5 100644 --- a/Source/ProjectRimFactory/Common/ProjectRimFactory_ModSettings.cs +++ b/Source/ProjectRimFactory/Common/ProjectRimFactory_ModSettings.cs @@ -132,7 +132,7 @@ public override void ExposeData() Scribe_Values.Look(ref PRF_LiteMode, "PRF_LiteMode", false); Scribe_Values.Look(ref PRF_Patch_Reachability_CanReach, "PRF_Patch_Reachability_CanReach", false); Scribe_Values.Look(ref PRF_UseFuzzySearch, "PRF_UseFuzzySearch", true); - Scribe_Values.Look(ref PRF_PlaceConveyorCable, "PRF_UseFuzzySearch", true); + Scribe_Values.Look(ref PRF_PlaceConveyorCable, "PRF_PlaceConveyorCable", true); PRF_LiteMode_last = PRF_LiteMode; }