Skip to content

Commit

Permalink
1.1.4 for game version 1.16.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
algernon-A committed Mar 22, 2023
1 parent 3ed2673 commit 5816469
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
- Add additional null checks to API
Version 1.1.4 -

- Support game version 1.16.1 and associated DLC
- Add additional null checks to API


Version 1.1.3
Expand Down
16 changes: 16 additions & 0 deletions Code/Loading/AssetLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,22 @@ public IEnumerator LoadCustomContent()
}
}

if (LevelLoader.DLC(2224691u))
{
Package.Asset asset5 = PackageManager.FindAssetByName("System." + DistrictStyle.kModderPack16StyleName);
if (asset5 != null && asset5.isEnabled)
{
DistrictStyle districtStyle = new DistrictStyle(DistrictStyle.kModderPack16StyleName, builtIn: true);
Util.InvokeVoid(Singleton<LoadingManager>.instance, "AddChildrenToBuiltinStyle", GameObject.Find("Modder Pack 16"), districtStyle, false);
if (LSMRSettings.SkipPrefabs)
{
PrefabLoader.RemoveSkippedFromStyle(districtStyle);
}

districtStyles.Add(districtStyle);
}
}

// LSM insert.
// Unload any skipped assets.
if (LSMRSettings.SkipPrefabs)
Expand Down
21 changes: 18 additions & 3 deletions Code/Loading/CustomDeserializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ internal object CustomDeserialize(Package package, Type type, PackageReader read
return ReadMessageInfo(reader);

case TypeVehicleInfoEffect:
return ReadVehicleInfoEffect(reader);
return ReadVehicleInfoEffect(package, reader);

case TypeTransportInfo:
return ReadTransportInfo(reader);
Expand Down Expand Up @@ -1056,18 +1056,33 @@ private MessageInfo ReadMessageInfo(PackageReader reader)
/// <summary>
/// Deserializes a VehicleInfo.Effect.
/// </summary>
/// <param name="package">Package to deserialize.</param>
/// <param name="reader">PackageReader instance.</param>
/// <returns>New VehicleInfo.Effect.</returns>
private VehicleInfo.Effect ReadVehicleInfoEffect(PackageReader reader)
private VehicleInfo.Effect ReadVehicleInfoEffect(Package package, PackageReader reader)
{
return new VehicleInfo.Effect
VehicleInfo.Effect effect = new VehicleInfo.Effect
{
m_effect = EffectCollection.FindEffect(reader.ReadString()),
m_parkedFlagsForbidden = (VehicleParked.Flags)reader.ReadInt32(),
m_parkedFlagsRequired = (VehicleParked.Flags)reader.ReadInt32(),
m_vehicleFlagsForbidden = (Vehicle.Flags)reader.ReadInt32(),
m_vehicleFlagsRequired = (Vehicle.Flags)reader.ReadInt32(),
};

// 1.16.1.
if (package.version >= 10)
{
effect.m_vehicleFlagsForbidden2 = (Vehicle.Flags2)reader.ReadInt32();
effect.m_vehicleFlagsRequired2 = (Vehicle.Flags2)reader.ReadInt32();
}
else
{
effect.m_vehicleFlagsForbidden2 = 0;
effect.m_vehicleFlagsRequired2 = 0;
}

return effect;
}

/// <summary>
Expand Down
30 changes: 30 additions & 0 deletions Code/Loading/LevelLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,21 @@ private static List<KeyValuePair<string, float>> SetLevels()
prefabScenes.Add(new KeyValuePair<string, float>("Station18Prefabs", 0.01f));
}

if (DLC(2148902u))
{
prefabScenes.Add(new KeyValuePair<string, float>("Station19Prefabs", 0.01f));
}

if (DLC(2225940u))
{
prefabScenes.Add(new KeyValuePair<string, float>("Station20Prefabs", 0.01f));
}

if (DLC(2225941u))
{
prefabScenes.Add(new KeyValuePair<string, float>("Station21Prefabs", 0.01f));
}

if (DLC(563850u))
{
prefabScenes.Add(new KeyValuePair<string, float>("ChinaPackPrefabs", 0.02f));
Expand Down Expand Up @@ -1207,6 +1222,21 @@ private static List<KeyValuePair<string, float>> SetLevels()
prefabScenes.Add(new KeyValuePair<string, float>("ModderPack14Prefabs", 0.03f));
}

if (DLC(2224691u))
{
prefabScenes.Add(new KeyValuePair<string, float>("ModderPack16Prefabs", 0.03f));
}

if (DLC(2224690u))
{
prefabScenes.Add(new KeyValuePair<string, float>("ModderPack17Prefabs", 0.03f));
}

if (DLC(2148900u))
{
prefabScenes.Add(new KeyValuePair<string, float>("ModderPack18Prefabs", 0.03f));
}

Package.Asset europeanStyles = PackageManager.FindAssetByName("System." + DistrictStyle.kEuropeanStyleName);
if (europeanStyles != null && europeanStyles.isEnabled)
{
Expand Down
2 changes: 1 addition & 1 deletion LoadingScreenModRevisited.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Authors>algernon,thale5</Authors>
<Copyright>Copyright © 2016-2023 algernon, thale5</Copyright>
<Product>$(Title)</Product>
<Version>1.1.3</Version>
<Version>1.1.4</Version>
<ManagedDLLPath>$(MSBuildProgramFiles32)/Steam/steamapps/common/Cities_Skylines/Cities_Data/Managed</ManagedDLLPath>
<AssemblySearchPaths>
$(AssemblySearchPaths);
Expand Down

0 comments on commit 5816469

Please sign in to comment.