Skip to content

Commit

Permalink
Update DisplayedTextPatches.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Awbugl committed Dec 24, 2022
1 parent a088575 commit 3ff7aa2
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions src/Patches/DisplayedTextPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,17 @@ public static void RecipeProto_madeFromString(ref RecipeProto __instance, ref st
public static void ItemProto_fuelTypeString(ref ItemProto __instance, ref string __result)
{
var type = __instance.FuelType;
if (type == 5) __result = "裂变能".TranslateFromJson();
if (type == 6) __result = "聚变能".TranslateFromJson();

switch (type)
{
case 5:
__result = "裂变能".TranslateFromJson();
break;

case 6:
__result = "聚变能".TranslateFromJson();
break;
}
}

//发电类型
Expand All @@ -71,11 +80,21 @@ public static void GetPropValuePatch(ref ItemProto __instance, int index, ref st
switch (__instance.DescFields[index])
{
case 4:
if (__instance.prefabDesc.isPowerGen)
if (!__instance.prefabDesc.isPowerGen) return;

switch (__instance.prefabDesc.fuelMask)
{
if (__instance.prefabDesc.fuelMask == 4) __result = "质能转换".TranslateFromJson();
if (__instance.prefabDesc.fuelMask == 5) __result = "裂变能".TranslateFromJson();
if (__instance.prefabDesc.fuelMask == 6) __result = "仿星器".TranslateFromJson();
case 4:
__result = "质能转换".TranslateFromJson();
break;

case 5:
__result = "裂变能".TranslateFromJson();
break;

case 6:
__result = "仿星器".TranslateFromJson();
break;
}

return;
Expand Down

0 comments on commit 3ff7aa2

Please sign in to comment.