Skip to content

Commit

Permalink
#808 switched to hidden cable
Browse files Browse the repository at this point in the history
added setting to disable placement
  • Loading branch information
Sn1p3rr3c0n committed Dec 28, 2024
1 parent 60ab5ae commit b41efba
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Languages/English/Keyed/AllKeyed_Settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<PRF_Settings_GeneralOptions_Header>General Options</PRF_Settings_GeneralOptions_Header>
<PRF_Settings_GeneralOptions_DSU_UseFuzzySearch_ToolTip>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.</PRF_Settings_GeneralOptions_DSU_UseFuzzySearch_ToolTip>
<PRF_Settings_GeneralOptions_DSU_UseFuzzySearch>Use Fuzzy-Search for the storage item view</PRF_Settings_GeneralOptions_DSU_UseFuzzySearch>

<PRF_Settings_GeneralOptions_PlaceConveyorCable_ToolTip>Toggle the automatic placement of a cable when constructing a conveyor belt.</PRF_Settings_GeneralOptions_PlaceConveyorCable_ToolTip>
<PRF_Settings_GeneralOptions_PlaceConveyorCable>Auto place cable with conveyor belt</PRF_Settings_GeneralOptions_PlaceConveyorCable>

<PRF.Common.ForbidOnPlacingDefault>Forbid items on placement</PRF.Common.ForbidOnPlacingDefault>
<PRF.Common.ForbidOnPlacingDefaultDesc>When enabled machine products will be automatically forbidden on placement.</PRF.Common.ForbidOnPlacingDefaultDesc>
Expand Down
8 changes: 4 additions & 4 deletions Source/ProjectRimFactory/Common/CompTransmitsPower.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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<string> possibleUndergroundTransmitters;
}
}
11 changes: 11 additions & 0 deletions Source/ProjectRimFactory/Common/ProjectRimFactory_ModSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();


}
Expand Down Expand Up @@ -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()
{
Expand All @@ -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;
}

Expand Down

0 comments on commit b41efba

Please sign in to comment.