-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Awbugl
committed
Jan 17, 2023
1 parent
7752975
commit 11ed5cc
Showing
13 changed files
with
150 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
src/Compatibility/MoreMegaStructureCompatibilityPatch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
using BepInEx; | ||
using HarmonyLib; | ||
using ProjectGenesis.Utils; | ||
using xiaoye97; | ||
|
||
// ReSharper disable InconsistentNaming | ||
// ReSharper disable MemberCanBeInternal | ||
// ReSharper disable MemberCanBePrivate.Global | ||
// ReSharper disable ClassNeverInstantiated.Global | ||
// ReSharper disable LoopCanBePartlyConvertedToQuery | ||
|
||
namespace ProjectGenesis.Compatibility | ||
{ | ||
[BepInPlugin(MODGUID, MODNAME, VERSION)] | ||
[BepInDependency(MoreMegaStructureGUID)] | ||
public class MoreMegaStructureCompatibilityPatch : BaseUnityPlugin | ||
{ | ||
public const string MODGUID = "org.LoShin.GenesisBook.MoreMegaStructureCompatibilityPatch"; | ||
public const string MODNAME = "GenesisBook.MoreMegaStructureCompatibilityPatch"; | ||
public const string VERSION = "1.0.0"; | ||
|
||
private const string MoreMegaStructureGUID = "Gnimaerd.DSP.plugin.MoreMegaStructure"; | ||
|
||
public void Awake() => Harmony.CreateAndPatchAll(typeof(EditDataPatch)); | ||
} | ||
|
||
internal static class EditDataPatch | ||
{ | ||
private static readonly int[] AddedRecipes = new[] | ||
{ | ||
330, 331, 332, 333, 334, 335, 336, 337, 350, 338, 339, 340, 341, 342, 554, 351, 556, 558, | ||
562, 559, 561, 553, 560, 557, 555, 552, 376, 377, 378, 379, 380, 381, 343, 344, 345, 346, | ||
347, 348, 349, 363, 364, 375 | ||
}; | ||
|
||
private static readonly int[] AddedItems = new[] | ||
{ | ||
9480, 9481, 9482, 9483, 9484, 9485, 9486, 9487, 9488, 9489, 9490, 9491, 9492, 9500, 9493, 9494, | ||
9495, 9496, 9497, 9498, 9499, 9501, 9502, 9512 | ||
}; | ||
|
||
[HarmonyPostfix] | ||
[HarmonyAfter(LDBToolPlugin.MODGUID)] | ||
[HarmonyPatch(typeof(VFPreload), "InvokeOnLoadWorkEnded")] | ||
public static void LDBToolOnPostAddDataAction() | ||
{ | ||
foreach (var strings in LDB.strings.dataArray) | ||
{ | ||
switch (strings.Name) | ||
{ | ||
case "引力钻头描述": | ||
strings.ZHCN = "借助黑洞本身的引力,引力钻头能够将物质从黑洞中取出。借助谐振盘,黑洞原质将能够被解压并在星系内输送。"; | ||
strings.ENUS | ||
= "The graviton drill can pull matter out of the black hole using the gravity of the black hole itself. With the help of the resonant disc, the matter from the black hole will be able to be decompressed and transported within the galaxy."; | ||
break; | ||
|
||
case "物质解压器功能文本": | ||
strings.ZHCN = "产出一些基础资源(例如铁块),可被对应的物质重构器接收。"; | ||
break; | ||
|
||
case "单极磁石重构装置": | ||
strings.ZHCN = "钨矿重构装置"; | ||
strings.ENUS = "Tungsten receiver"; | ||
break; | ||
} | ||
} | ||
|
||
foreach (var recipeID in AddedRecipes) | ||
{ | ||
var recipeProto = LDB.recipes.Select(recipeID); | ||
recipeProto.Type = (ERecipeType)10; | ||
recipeProto.name = recipeProto.Name.Translate(); | ||
recipeProto.description = recipeProto.Description.Translate(); | ||
|
||
if (recipeProto.Results.Length > 0) | ||
{ | ||
var recipeProtoResult = recipeProto.Results[0]; | ||
|
||
switch (recipeProtoResult) | ||
{ | ||
case ProtoIDUsedByPatches.I巨型精密组装厂: | ||
case ProtoIDUsedByPatches.I巨型对撞机: | ||
recipeProto.ItemCounts[0] = 60; | ||
continue; | ||
|
||
case ProtoIDUsedByPatches.I人造恒星: | ||
recipeProto.ItemCounts[0] = 30; | ||
continue; | ||
} | ||
} | ||
} | ||
|
||
foreach (var itemID in AddedItems) | ||
{ | ||
var itemProto = LDB.items.Select(itemID); | ||
itemProto.name = itemProto.Name.Translate(); | ||
itemProto.description = itemProto.Description.Translate(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using HarmonyLib; | ||
using ProjectGenesis.Utils; | ||
|
||
// ReSharper disable InconsistentNaming | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters