Skip to content

Commit

Permalink
Version 2.2.2; game version 1.16 (Financial Districts).
Browse files Browse the repository at this point in the history
  • Loading branch information
algernon-A committed Dec 13, 2022
1 parent 63c8758 commit dc22aaa
Show file tree
Hide file tree
Showing 28 changed files with 125 additions and 18 deletions.
5 changes: 5 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 2.2.2 -

- Add separate calculations for Financial Office buildings


Version 2.2.1.1 -

- Fix infinite loop in notification panel in some Chinese systems
Expand Down
4 changes: 4 additions & 0 deletions Code/DataStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public class DataStore
new int[] { 36, 5, 0, 0, -1, 1, 5, 14, 80, 13, 5, 5, 3, 1125, 0, 1, 10, 37 },
new int[] { 38, 5, 0, 0, -1, 1, 3, 6, 90, 14, 5, 5, 2, 1250, 0, 1, 10, 50 }, };

public static int[][] officeFinancial = { new int[] { 34, 5, 0, 0, -1, 2, 8, 20, 70, 12, 4, 4, 3, 1000, 0, 1, 10, 25 },
new int[] { 36, 5, 0, 0, -1, 1, 5, 14, 80, 13, 5, 5, 3, 1125, 0, 1, 10, 37 },
new int[] { 38, 5, 0, 0, -1, 1, 3, 6, 90, 14, 5, 5, 2, 1250, 0, 1, 10, 50 }, };

public static int[][] officeHighTech = { new int[] { 74, 5, 0, 0, -1, 1, 2, 3, 94, 22, 5, 5, 3, 4000, 0, 1, 10, 10 } };

// Very high floor level because chimney stacks count to height level
Expand Down
10 changes: 10 additions & 0 deletions Code/GUI/BuildingPanelFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ internal class BuildingPanelFilter : UIPanel
ItemClass.Service.Office,
ItemClass.Service.Office,
ItemClass.Service.Office,
ItemClass.Service.Office,
ItemClass.Service.Industrial,
ItemClass.Service.Commercial,
ItemClass.Service.Commercial,
Expand All @@ -60,6 +61,7 @@ internal class BuildingPanelFilter : UIPanel
ItemClass.SubService.CommercialWallToWall,
ItemClass.SubService.OfficeGeneric,
ItemClass.SubService.OfficeWallToWall,
ItemClass.SubService.OfficeFinancial,
ItemClass.SubService.OfficeHightech,
ItemClass.SubService.None,
ItemClass.SubService.CommercialTourist,
Expand All @@ -86,6 +88,7 @@ internal class BuildingPanelFilter : UIPanel
"Thumbnails",
"Thumbnails",
"Thumbnails",
"Thumbnails",
"Ingame",
};

Expand All @@ -100,6 +103,7 @@ internal class BuildingPanelFilter : UIPanel
"DistrictSpecializationCommercialWallToWall",
"ZoningOffice",
"DistrictSpecializationOfficeWallToWall",
"DistrictSpecializationOfficeFinancial",
"DistrictSpecializationHightech",
"ZoningIndustrial",
"DistrictSpecializationTourist",
Expand All @@ -120,6 +124,7 @@ internal class BuildingPanelFilter : UIPanel
"RPR_CAT_CW2",
"RPR_CAT_OFF",
"RPR_CAT_OW2",
"RPR_CAT_FIN",
"RPR_CAT_ITC",
"RPR_CAT_IND",
"RPR_CAT_TOU",
Expand Down Expand Up @@ -318,6 +323,11 @@ internal enum BuildingCategories
/// </summary>
OfficeWallToWall,

/// <summary>
/// Financial office buildings.
/// </summary>
OfficeFinancial,

/// <summary>
/// IT cluster (hightech office) buildings.
/// </summary>
Expand Down
15 changes: 14 additions & 1 deletion Code/Patches/Production/OfficeProduction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static class OfficeProduction
// Settings per subservice.
private static int genericOfficeProdMult = DefaultProdMult;
private static int w2wOfficeProdMult = DefaultProdMult;
private static int financialOfficeProdMult = DefaultProdMult;
private static int highTechOfficeProdMult = DefaultProdMult;

/// <summary>
Expand Down Expand Up @@ -64,7 +65,7 @@ public static bool Prefix(ref int __result, OfficeBuildingAI __instance, ItemCla
}
else
{
// Hew settings - multiply total workers by overall multiplier (from settings) to get result; divisor is 1,000 to match original mod 1/10th when at 100% production.
// New settings - multiply total workers by overall multiplier (from settings) to get result; divisor is 1,000 to match original mod 1/10th when at 100% production.
__result = totalWorkers * (subService == ItemClass.SubService.OfficeHightech ? highTechOfficeProdMult : genericOfficeProdMult) / 1000;
}

Expand Down Expand Up @@ -93,6 +94,9 @@ internal static int GetProdMult(ItemClass.SubService subService)
case ItemClass.SubService.OfficeWallToWall:
return w2wOfficeProdMult;

case ItemClass.SubService.OfficeFinancial:
return financialOfficeProdMult;

// Default is generic office.
default:
case ItemClass.SubService.OfficeGeneric:
Expand All @@ -119,6 +123,10 @@ internal static void SetProdMult(ItemClass.SubService subService, int value)
w2wOfficeProdMult = cleanValue;
break;

case ItemClass.SubService.OfficeFinancial:
financialOfficeProdMult = cleanValue;
break;

case ItemClass.SubService.OfficeHightech:
highTechOfficeProdMult = cleanValue;
break;
Expand Down Expand Up @@ -148,6 +156,11 @@ internal static void SetProdMult(ItemClass.SubService subService, int value)
Value = w2wOfficeProdMult,
},
new Configuration.SubServiceValue
{
SubService = ItemClass.SubService.OfficeFinancial,
Value = financialOfficeProdMult,
},
new Configuration.SubServiceValue
{
SubService = ItemClass.SubService.OfficeHightech,
Value = highTechOfficeProdMult,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ internal class OffConsumptionPanel : ConsumptionPanelBase
// Array reference constants.
private const int Office = 0;
private const int Wall2Wall = 1;
private const int HighTech = 2;
private const int NumSubServices = 3;
private const int Financial = 2;
private const int HighTech = 3;
private const int NumSubServices = 4;
private const int NumLevels = 3;

// Label constants.
private readonly string[] _subServiceLables =
{
"RPR_CAT_OFF",
"RPR_CAT_OW2",
"RPR_CAT_FIN",
"RPR_CAT_ITC",
};

Expand Down Expand Up @@ -71,6 +73,8 @@ internal override void Setup()
AddSubService(m_panel, Office);
PanelUtils.RowHeaderIcon(m_panel, ref m_currentY, Translations.Translate(_subServiceLables[Wall2Wall]), "DistrictSpecializationOfficeWallToWall", "Thumbnails");
AddSubService(m_panel, Wall2Wall);
PanelUtils.RowHeaderIcon(m_panel, ref m_currentY, Translations.Translate(_subServiceLables[Financial]), "DistrictSpecializationOfficeFinancial", "Thumbnails");
AddSubService(m_panel, Financial);
PanelUtils.RowHeaderIcon(m_panel, ref m_currentY, Translations.Translate(_subServiceLables[HighTech]), "IconPolicyHightech", "Ingame");
AddSubService(m_panel, HighTech, label: Translations.Translate(_subServiceLables[HighTech]));

Expand All @@ -90,6 +94,7 @@ protected override void PopulateFields()
// Populate each subservice.
PopulateSubService(DataStore.office, Office);
PopulateSubService(DataStore.officeW2W, Wall2Wall);
PopulateSubService(DataStore.officeFinancial, Financial);
PopulateSubService(DataStore.officeHighTech, HighTech);
}

Expand All @@ -101,6 +106,7 @@ protected override void ApplyFields()
// Apply each subservice.
ApplySubService(DataStore.office, Office);
ApplySubService(DataStore.officeW2W, Wall2Wall);
ApplySubService(DataStore.officeFinancial, Financial);
ApplySubService(DataStore.officeHighTech, HighTech);

// Clear cached values.
Expand Down Expand Up @@ -133,6 +139,13 @@ protected override void ResetToDefaults()
new int[] { 38, 5, 0, 0, -1, 1, 3, 6, 90, 14, 5, 5, 2, 1250, 0, 1, 10, 50 },
};

int[][] officeFinancial =
{
new int[] { 34, 5, 0, 0, -1, 2, 8, 20, 70, 12, 4, 4, 3, 1000, 0, 1, 10, 25 },
new int[] { 36, 5, 0, 0, -1, 1, 5, 14, 80, 13, 5, 5, 3, 1125, 0, 1, 10, 37 },
new int[] { 38, 5, 0, 0, -1, 1, 3, 6, 90, 14, 5, 5, 2, 1250, 0, 1, 10, 50 },
};

int[][] officeHighTech =
{
new int[] { 74, 5, 0, 0, -1, 1, 2, 3, 94, 22, 5, 5, 3, 4000, 0, 1, 10, 10 },
Expand All @@ -141,6 +154,7 @@ protected override void ResetToDefaults()
// Populate text fields with these.
PopulateSubService(office, Office);
PopulateSubService(officeW2W, Wall2Wall);
PopulateSubService(officeFinancial, Financial);
PopulateSubService(officeHighTech, HighTech);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ internal class OffDefaultsPanel : EmpDefaultsPanel
{
Translations.Translate("RPR_CAT_OFF"),
Translations.Translate("RPR_CAT_OW2"),
Translations.Translate("RPR_CAT_FIN"),
Translations.Translate("RPR_CAT_ITC"),
};

Expand All @@ -26,24 +27,28 @@ internal class OffDefaultsPanel : EmpDefaultsPanel
ItemClass.Service.Office,
ItemClass.Service.Office,
ItemClass.Service.Office,
ItemClass.Service.Office,
};

private readonly ItemClass.SubService[] _subServices =
{
ItemClass.SubService.OfficeGeneric,
ItemClass.SubService.OfficeWallToWall,
ItemClass.SubService.OfficeFinancial,
ItemClass.SubService.OfficeHightech,
};

private readonly string[] _iconNames =
{
"ZoningOffice",
"DistrictSpecializationOfficeWallToWall",
"DistrictSpecializationOfficeFinancial",
"IconPolicyHightech",
};

private readonly string[] _atlasNames =
{
"Thumbnails",
"Thumbnails",
"Thumbnails",
"Ingame",
Expand Down
5 changes: 5 additions & 0 deletions Code/Settings/CalculationTabs/GoodsTabs/OffGoodsPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal class OffGoodsPanel : GoodsPanelBase
{
Translations.Translate("RPR_CAT_OFF"),
Translations.Translate("RPR_CAT_OW2"),
Translations.Translate("RPR_CAT_FIN"),
Translations.Translate("RPR_CAT_ITC"),
};

Expand All @@ -27,24 +28,28 @@ internal class OffGoodsPanel : GoodsPanelBase
ItemClass.Service.Office,
ItemClass.Service.Office,
ItemClass.Service.Office,
ItemClass.Service.Office,
};

private readonly ItemClass.SubService[] _subServices =
{
ItemClass.SubService.OfficeGeneric,
ItemClass.SubService.OfficeWallToWall,
ItemClass.SubService.OfficeFinancial,
ItemClass.SubService.OfficeHightech,
};

private readonly string[] _iconNames =
{
"ZoningOffice",
"DistrictSpecializationOfficeWallToWall",
"DistrictSpecializationOfficeFinancial",
"IconPolicyHightech",
};

private readonly string[] _atlasNames =
{
"Thumbnails",
"Thumbnails",
"Thumbnails",
"Ingame",
Expand Down
6 changes: 3 additions & 3 deletions Code/Settings/XMLSettingsFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ public bool DefaultLegacy
public bool UnlockZoning { get => UnlockedZonePatch.UnlockZoning; set => UnlockedZonePatch.UnlockZoning = value; }

/// <summary>
/// Gets or sets a value indicating whether detailed logging is in effect.
/// Sets a value indicating whether detailed logging is in effect (legacy option).
/// </summary>
[XmlElement("DetailedLogging")]
public bool DetailLogging { get => Logging.DetailLogging; set => Logging.DetailLogging = value; }
[XmlElement("DetailLogging")]
public bool DetailLogging { set => Logging.DetailLogging = value; }

/// <summary>
/// Load settings from XML file.
Expand Down
4 changes: 4 additions & 0 deletions Code/Utils/LegacyAIUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ internal static int[] GetOfficeArray(BuildingInfo item, int level)
array = DataStore.officeW2W;
break;

case ItemClass.SubService.OfficeFinancial:
array = DataStore.officeFinancial;
break;

case ItemClass.SubService.OfficeGeneric:
default:
break;
Expand Down
5 changes: 4 additions & 1 deletion Code/VolumetricData/DataMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class DataMapping
/// <summary>
/// Number of data structures (service/subservice combinations) to map.
/// </summary>
internal const int NumData = 19;
internal const int NumData = 20;

/// <summary>
/// Service reference array.
Expand Down Expand Up @@ -53,6 +53,7 @@ internal DataMapping()
ItemClass.Service.Office,
ItemClass.Service.Office,
ItemClass.Service.Office,
ItemClass.Service.Office,
ItemClass.Service.Industrial,
ItemClass.Service.Industrial,
ItemClass.Service.Industrial,
Expand All @@ -75,6 +76,7 @@ internal DataMapping()
ItemClass.SubService.CommercialLeisure,
ItemClass.SubService.CommercialTourist,
ItemClass.SubService.OfficeGeneric,
ItemClass.SubService.OfficeFinancial,
ItemClass.SubService.OfficeWallToWall,
ItemClass.SubService.OfficeHightech,
ItemClass.SubService.IndustrialGeneric,
Expand All @@ -100,6 +102,7 @@ internal DataMapping()
DataStore.commercialTourist,
DataStore.office,
DataStore.officeW2W,
DataStore.officeFinancial,
DataStore.officeHighTech,
DataStore.industry,
DataStore.industry_farm,
Expand Down
9 changes: 8 additions & 1 deletion Code/VolumetricData/PopData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,14 @@ internal override DataPack BaseDefaultPack(ItemClass.Service service, ItemClass.
break;
default:
// Default is volumetric.
defaultName = "offcorp";
if (subService == ItemClass.SubService.OfficeFinancial)
{
defaultName = "offfin";
}
else
{
defaultName = "offcorp";
}
break;
}

Expand Down
9 changes: 9 additions & 0 deletions Code/WhatsNewMessageListing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ internal class WhatsNewMessageListing
/// </summary>
internal WhatsNewMessage[] Messages => new WhatsNewMessage[]
{
new WhatsNewMessage
{
Version = new Version("2.2.2.0"),
MessagesAreKeys = true,
Messages = new string[]
{
"RPR_222_0",
},
},
new WhatsNewMessage
{
Version = new Version("2.2.1.0"),
Expand Down
1 change: 1 addition & 0 deletions Code/XML/XML_VersionFive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ private void ReadPollutionNode(XmlNode pollutionNode)
case "Office":
SetPollutionRates(DataStore.office[level], ground, noise);
SetPollutionRates(DataStore.officeW2W[level], ground, noise);
SetPollutionRates(DataStore.officeFinancial[level], ground, noise);
break;

case "Industry":
Expand Down
1 change: 1 addition & 0 deletions Code/XML/XML_VersionSix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ private void ReadPollutionNode(XmlNode pollutionNode)
case "Office":
SetPollutionRates(DataStore.office[level], ground, noise);
SetPollutionRates(DataStore.officeW2W[level], ground, noise);
SetPollutionRates(DataStore.officeFinancial[level], ground, noise);
break;

case "Industry":
Expand Down
2 changes: 1 addition & 1 deletion Realistic Population Revisited.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Authors>algernon,Whitefang Greytail</Authors>
<Copyright>Copyright © 2015-2022 algernon, Whitefang Greytail</Copyright>
<Product>$(Title)</Product>
<Version>2.2.1.1</Version>
<Version>2.2.2</Version>
<ManagedDLLPath>$(MSBuildProgramFiles32)/Steam/steamapps/common/Cities_Skylines/Cities_Data/Managed</ManagedDLLPath>
<AssemblySearchPaths>
$(AssemblySearchPaths);
Expand Down
Loading

0 comments on commit dc22aaa

Please sign in to comment.