-
Notifications
You must be signed in to change notification settings - Fork 8
/
Patch.cs
72 lines (61 loc) · 2.27 KB
/
Patch.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using HarmonyLib;
using RomenH.Common;
namespace Fans
{
[HarmonyPatch(typeof(Db))]
[HarmonyPatch(nameof(Db.Initialize))]
public class Db_Initialize_Patch
{
private static void Prefix()
{
Debug.Log("FanTiles: Adding strings...");
StringUtils.AddBuildingStrings(
FanConfig.ID,
FanConfig.Name,
FanConfig.Desc,
FanConfig.Effect);
StringUtils.AddBuildingStrings(
HighPressureFanConfig.ID,
HighPressureFanConfig.Name,
HighPressureFanConfig.Desc,
HighPressureFanConfig.Effect);
StringUtils.AddBuildingStrings(
CompressorFanConfig.ID,
CompressorFanConfig.Name,
CompressorFanConfig.Desc,
CompressorFanConfig.Effect);
StringUtils.AddBuildingStrings(
LiquidTurbineConfig.ID,
LiquidTurbineConfig.Name,
LiquidTurbineConfig.Desc,
LiquidTurbineConfig.Effect);
StringUtils.AddBuildingStrings(
CompressorTurbineConfig.ID,
CompressorTurbineConfig.Name,
CompressorTurbineConfig.Desc,
CompressorTurbineConfig.Effect);
StringUtils.ExportTranslationTemplates();
}
private static void Postfix()
{
BuildingUtils.AddBuildingToPlanScreen(FanConfig.ID, GameStrings.PlanMenuCategory.Ventilation);
BuildingUtils.AddBuildingToPlanScreen(HighPressureFanConfig.ID, GameStrings.PlanMenuCategory.Ventilation);
BuildingUtils.AddBuildingToPlanScreen(CompressorFanConfig.ID, GameStrings.PlanMenuCategory.Ventilation);
BuildingUtils.AddBuildingToPlanScreen(LiquidTurbineConfig.ID, GameStrings.PlanMenuCategory.Plumbing);
BuildingUtils.AddBuildingToPlanScreen(CompressorTurbineConfig.ID, GameStrings.PlanMenuCategory.Plumbing);
BuildingUtils.AddBuildingToTech(FanConfig.ID, GameStrings.Technology.Gases.Ventilation);
BuildingUtils.AddBuildingToTech(HighPressureFanConfig.ID, GameStrings.Technology.Gases.ImprovedVentilation);
BuildingUtils.AddBuildingToTech(CompressorFanConfig.ID, GameStrings.Technology.Gases.HVAC);
BuildingUtils.AddBuildingToTech(LiquidTurbineConfig.ID, GameStrings.Technology.Liquids.Plumbing);
BuildingUtils.AddBuildingToTech(CompressorTurbineConfig.ID, GameStrings.Technology.Liquids.LiquidTuning);
}
}
[HarmonyPatch(typeof(Localization), "Initialize")]
public class Localization_Initialize_Patch
{
public static void Postfix()
{
StringUtils.LoadTranslations();
}
}
}