Skip to content

Commit

Permalink
v2.0 (Quarantine Zone)
Browse files Browse the repository at this point in the history
Quarantine Zones now work in arcade
  • Loading branch information
Tribow committed Nov 17, 2022
1 parent ec349e3 commit 3a0a38f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Distance.LittleThings/ConfigLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ public bool EnableGPSInArcade
get { return Get<bool>("EnableGPSInArcade"); }
set { Set("EnableGPSInArcade", value); }
}

public bool EnableQuarantineInArcade
{
get { return Get<bool>("EnableQuarantineInArcade"); }
set { Set("EnableQuarantineInArcade", value); }
}
#endregion

internal Settings Config;
Expand All @@ -28,7 +34,8 @@ public void Awake()
{
Load();
//Setting Defaults
Get("EnableGPSInArcade", false);
Get("EnableGPSInArcade", true);
Get("EnableQuarantineInArcade", true);
//Save settings to Config.json
Save();
}
Expand Down
4 changes: 4 additions & 0 deletions Distance.LittleThings/Distance.LittleThings.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
<Reference Include="Assembly-CSharp, Version=9.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Centrifuge.GameSupport.Distance.3.0.7868.41513\lib\net35\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>D:\Games\Steam2\steamapps\common\Distance\Distance_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Centrifuge.Distance, Version=3.0.7868.41513, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Centrifuge.GameSupport.Distance.3.0.7868.41513\lib\net35\Centrifuge.Distance.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -90,6 +93,7 @@
<Compile Include="ConfigLogic.cs" />
<Compile Include="Harmony\Assembly-CSharp\GPSTrigger\Start.cs" />
<Compile Include="Harmony\Assembly-CSharp\LocalPlayerControlledCar\CheckInput.cs" />
<Compile Include="Harmony\Assembly-CSharp\QuarantineTrigger\Start.cs" />
<Compile Include="Mod.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using HarmonyLib;

namespace Distance.LittleThings.Harmony
{
[HarmonyPatch(typeof(QuarantineTrigger), "Start")]
internal class Start
{
[HarmonyPrefix]
internal static bool StartRewrite(QuarantineTrigger __instance)
{
//Get rid of the Campaign mod check in the Start function for QuarantineZones
if (Mod.Instance.Config.EnableQuarantineInArcade)
{
UnityStandardAssets.ImageEffects.Bloom componentInChildren = __instance.cameraPrefab_.GetComponentInChildren<UnityStandardAssets.ImageEffects.Bloom>();
if (componentInChildren == null)
return false;
__instance.originalBloomIntensity_ = componentInChildren.bloomIntensity;
return false;
}
return true;
}
}
}
5 changes: 5 additions & 0 deletions Distance.LittleThings/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ private void CreateSettingsMenu()
.WithGetter(() => Config.EnableGPSInArcade)
.WithSetter((x) => Config.EnableGPSInArcade = x)
.WithDescription("Toggles whether Minimap will become available to use in Arcade Mode. (GPS Triggers will also activate in arcade)"),

new CheckBox(MenuDisplayMode.Both, "settings::quarantine_arcade", "ENABLE QUARANTINE ZONES IN ARCADE")
.WithGetter(() => Config.EnableQuarantineInArcade)
.WithSetter((x) => Config.EnableQuarantineInArcade = x)
.WithDescription("Toggles whether Quarantine zones will activate in arcade mode"),
};

Menus.AddNew(MenuDisplayMode.Both, settingsMenu, "LITTLE THINGS", "Settings for the LittleThings mod");
Expand Down

0 comments on commit 3a0a38f

Please sign in to comment.