Decompiled source of SF ChinesePatch v1.3.3

SF_ChinesePatch.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("SF_ChinesePatch")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.2.0")]
[module: UnverifiableCode]
namespace SF_ChinesePatch;

public class BulletTime_Patch
{
	public const string NAME = "BulletTime";

	public const string GUID = "com.starfi5h.plugin.BulletTime";

	public static void OnAwake()
	{
		if (Chainloader.PluginInfos.ContainsKey("com.starfi5h.plugin.BulletTime") && ((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>("Enable", "BulletTime", true, (ConfigDescription)null).Value)
		{
			RegisterStrings();
		}
	}

	private static void RegisterStrings()
	{
		StringManager.RegisterString("Pause", "暂停");
		StringManager.RegisterString("Toggle tactical pause mode", "切换战术暂停模式");
		StringManager.RegisterString("Resume", "恢复");
		StringManager.RegisterString("Reset game speed back to 1x", "将游戏速度重设为1倍");
		StringManager.RegisterString("SpeedUp", "加速");
		StringManager.RegisterString("Increase game speed (max 4x)", "加快游戏速度(最高4倍)");
		StringManager.RegisterString("Background autosave", "后台自动保存");
		StringManager.RegisterString("Read-Only", "只读模式");
		StringManager.RegisterString("Can't interact with game world during auto-save\nPlease wait or press ESC to close the window", "自动保存期间无法与游戏世界交互\n请等待或按ESC关闭窗口");
		StringManager.RegisterString("Saving...", "保存中...");
		StringManager.RegisterString("Dyson sphere is rotating", "点击以停止旋转");
		StringManager.RegisterString("Dyson sphere is stopped", "点击以恢复旋转");
		StringManager.RegisterString("Click to stop rotating", "点击以停止旋转");
		StringManager.RegisterString("Click to resume rotating", "点击以恢复旋转");
		StringManager.RegisterString("Host is saving game...", "主机正在保存游戏...");
		StringManager.RegisterString("{0} arriving {1}", "{0} 即将抵达 {1}");
		StringManager.RegisterString("{0} joining the game", "{0} 正在加入游戏");
	}
}
public class DSPStarMapMemo_Patch
{
	public const string NAME = "DSPStarMapMemo";

	public const string GUID = "Appun.DSP.plugin.StarMapMemo";

	public static void OnAwake()
	{
		if (Chainloader.PluginInfos.ContainsKey("Appun.DSP.plugin.StarMapMemo") && ((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>("Enable", "DSPStarMapMemo", true, (ConfigDescription)null).Value)
		{
			RegisterStrings();
		}
	}

	private static void RegisterStrings()
	{
		StringManager.RegisterString("Memo", "备注");
		StringManager.RegisterString("Press [Enter] to insert a line break.", "按下 [Enter] 插入换行符。");
		StringManager.RegisterString("Press [CTRL] to hide star memo.", "按下 [CTRL] 隐藏星球备注。");
	}
}
public class GalacticScale_Patch
{
	public const string NAME = "GalacticScale";

	public const string GUID = "dsp.galactic-scale.2";

	private static Dictionary<string, string> typeStrings;

	public static void OnAwake(Harmony harmony)
	{
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Expected O, but got Unknown
		if (!Chainloader.PluginInfos.ContainsKey("dsp.galactic-scale.2") || !((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>("Enable", "GalacticScale", true, (ConfigDescription)null).Value)
		{
			return;
		}
		typeStrings = new Dictionary<string, string>();
		RegisterStrings();
		RegisterStrings_VanillaPlusPlusGenerator();
		try
		{
			harmony.PatchAll(typeof(GalacticScale_Patch));
			harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("GalacticScale.SystemDisplay"), "InitHelpText", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(typeof(GalacticScale_Patch).GetMethod("InitHelpText_Postfix")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}
		catch (Exception ex)
		{
			Plugin.Log.LogWarning((object)"Error in patching GalacticScale_Patch!");
			Plugin.Log.LogWarning((object)ex);
		}
	}

	[HarmonyPostfix]
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public static void typeString(ref string __result)
	{
		if (__result != null && typeStrings.ContainsKey(__result))
		{
			__result = typeStrings[__result];
		}
	}

	public static void InitHelpText_Postfix()
	{
		GameObject val = GameObject.Find("UI Root/Overlay Canvas/Galaxy Select/left-group/");
		if (!((Object)(object)val == (Object)null))
		{
			Text componentInChildren = val.GetComponentInChildren<Text>();
			if (!((Object)(object)componentInChildren == (Object)null))
			{
				componentInChildren.text = "点击星球查看详细信息\r\n使用鼠标滚轮进行缩放\r\n使用方向键进行平移\r\n按住Shift键可加快缩放/平移速度\r\n按住Alt键可查看所有星球名称\r\n按下空格键重置视图\r\n右击星球设置生成点";
			}
		}
	}

	public static void RegisterPlanetType(string key, string cnTrans)
	{
		if (!typeStrings.ContainsKey(key))
		{
			typeStrings.Add(key, cnTrans);
			StringManager.RegisterString(key, cnTrans);
		}
	}

	private static void RegisterStrings()
	{
		StringManager.RegisterString("done", "完成");
		StringManager.RegisterString("Loading Planets: ", "正在加载星球:");
		StringManager.RegisterString("a size", "半径");
		StringManager.RegisterString("Moon ", "卫星 ");
		StringManager.RegisterString("Planet ", "行星 ");
		StringManager.RegisterString("Calculating planet {0}/{1}...\r\n", "计算星球 {0}/{1}...\r\n");
		StringManager.RegisterString("How large the planet is. Standard is 200", "星球有多大。标准大小为 200");
		StringManager.RegisterString("Planet Radius", "星球半径");
		StringManager.RegisterString("Planetary Radius", "星球半径");
		StringManager.RegisterString("WARNING - Galactic Scale savegames can be broken by updates. Read the FAQ @ http://customizing.space", "警告 - Galactic Scale 存档可能会因更新而损坏。请阅读常见问题解答 @ http://customizing.space");
		StringManager.RegisterString("WARNING - Galactic Scale savegames can be broken by updates.Read the FAQ @ http://customizing.space\r\n", "警告 - Galactic Scale 存档可能会因更新而损坏。请阅读常见问题解答 @ http://customizing.space\r\n");
		StringManager.RegisterString("BACKUP YOUR SAVES. This version has potentially BREAKING CHANGES.\r\nNote: Settings for this mod are in the settings menu. Make sure to change the Generator to get the full Galactic Scale experience.\r\n", "备份您的存档。此版本可能存在破坏性变更。\r\n注意:此 mod 的设置位于设置菜单中。请确保更改生成器以获得完整的体验。\r\n");
		StringManager.RegisterString("Update Detected. Please do not save over existing saves \r\nuntil you are sure you can load saves saved with this version!\r\nPlease Click GS2 Help and click the link to join our community on discord for preview builds and to help shape the mod going forward", "检测到更新。请不要在现有存档上保存,\r\n直到您确信可以加载使用此版本保存的存档!");
		StringManager.RegisterString("The latest DSP update has added additional planet themes which are yet to be included in GS2. \r\nI'm working on getting them added to the GS2 themeset, as well as implementing their new subtheme system", "最新的游戏更新添加了其他行星种类,但尚未包含在 GS2 中。\r\n");
		RegisterPlanetType("Acid Greenhouse", "酸性温室");
		RegisterPlanetType("Obsidian", "黑曜石");
		RegisterPlanetType("Hot Obsidian", "炙热黑曜石");
		RegisterPlanetType("Ice Malusol", "冰原");
		RegisterPlanetType("Infernal Gas Giant", "地狱气巨星");
		RegisterPlanetType("Dwarf Planet", "矮行星");
		RegisterPlanetType("Barren Satellite", "贫瘠卫星");
		RegisterPlanetType("Sulfurous Sea", "硫酸海");
		RegisterPlanetType("Gigantic Forest", "巨大森林");
		RegisterPlanetType("Red Forest", "红森林");
		RegisterPlanetType("Molten World", "熔岩世界");
		RegisterPlanetType("Beach", "海滩");
		RegisterPlanetType("SpaceWhale Excrement", "太空鲸粪");
		RegisterPlanetType("Mediterranean", "地中海");
		RegisterPlanetType("Oceanic Jungle", "海洋丛林");
		RegisterPlanetType("Sakura Ocean", "樱林海");
		RegisterPlanetType("Ocean World", "水世界");
		RegisterPlanetType("Pandora Swamp", "潘多拉沼泽I");
		RegisterPlanetType("Pandora Swamp II", "潘多拉沼泽II");
		RegisterPlanetType("Red Stone", "红石");
		RegisterPlanetType("Prairie", "草原");
		RegisterPlanetType("Savanna", "热带草原");
		RegisterPlanetType("Lava", "熔岩");
		RegisterPlanetType("Volcanic Ash", "火山灰");
		RegisterPlanetType("Gobi Desert", "戈壁");
		RegisterPlanetType("Barren Desert", "贫瘠荒漠");
		RegisterPlanetType("Arid Desert", "干旱沙漠");
		RegisterPlanetType("Crystal Desert", "橙晶荒漠");
		RegisterPlanetType("Rocky Salt Lake", "黑石盐滩");
		RegisterPlanetType("Hurricane Stone Forest", "飓风石林");
		RegisterPlanetType("Scarlet Ice Lake", "猩红冰湖");
		RegisterPlanetType("Ashen Gelisol", "灰烬冻土");
		RegisterPlanetType("Ice Field Gelisol", "冰原冻土I");
		RegisterPlanetType("Ice Field Gelisol II", "冰原冻土II");
		RegisterPlanetType("Ice Field Gelisol III", "冰原冻土III");
		RegisterPlanetType("Frozen Tundra", "极寒冻土");
		RegisterPlanetType("Gas Giant", "气态巨星I");
		RegisterPlanetType("Gas Giant II", "气态巨星II");
		RegisterPlanetType("Gas Giant III", "气态巨星III");
		RegisterPlanetType("Gas Giant IV", "气态巨星IV");
		RegisterPlanetType("Gas Giant V", "气态巨星V");
		RegisterPlanetType("Ice Giant", "冰巨星I");
		RegisterPlanetType("Ice Giant II", "冰巨星II");
		RegisterPlanetType("Ice Giant III", "冰巨星III");
		RegisterPlanetType("Ice Giant IV", "冰巨星IV");
		RegisterPlanetType("Scorchedia", "干旱荒漠");
		RegisterPlanetType("Geloterra", "灰烬冻土");
		RegisterPlanetType("Desolus", "贫瘠荒漠");
		RegisterPlanetType("Onyxtopia", "橙晶荒漠");
		RegisterPlanetType("Icefrostia", "极寒冻土");
		RegisterPlanetType("Gobi Desert", "戈壁");
		RegisterPlanetType("Cyclonius", "飓风石林");
		RegisterPlanetType("Glacieon", "冰原冻土I");
		RegisterPlanetType("Glacieon II", "冰原冻土II");
		RegisterPlanetType("Glacieon III", "冰原冻土III");
		RegisterPlanetType("Maroonfrost", "猩红冰湖");
		RegisterPlanetType("Lava", "熔岩");
		RegisterPlanetType("Mariterra", "地中海");
		RegisterPlanetType("Aquatica", "水世界");
		RegisterPlanetType("Tropicana", "海洋丛林");
		RegisterPlanetType("Pandora Swamp", "潘多拉沼泽A");
		RegisterPlanetType("Pandora Swamp II", "潘多拉沼泽B");
		RegisterPlanetType("Prairie", "草原");
		RegisterPlanetType("Crimsonis", "红石");
		RegisterPlanetType("Sakura Ocean", "樱林海");
		RegisterPlanetType("Halitum", "黑石盐滩");
		RegisterPlanetType("Savanna", "热带草原");
		RegisterPlanetType("Sulfuria", "火山灰");
		StringManager.RegisterString("Generator", "星系生成器");
		StringManager.RegisterString("Try them all!", "选择自定义星系的生成器(Generator)");
		StringManager.RegisterString("You cannot change the generator while in game.", "您不能在游戏中更改生成器。");
		StringManager.RegisterString("Quality of Life", "便捷功能 (QoL)");
		StringManager.RegisterString("Skip Prologue", "跳过序章");
		StringManager.RegisterString("Skip Tutorials", "跳过教程");
		StringManager.RegisterString("Ignore Load Timeout", "取消载入逾时设定");
		StringManager.RegisterString("Show/Hide Vein Labels", "显示/隐藏矿脉标签");
		StringManager.RegisterString("When show vein markers is enabled", "(当显示矿脉标记启用时)");
		StringManager.RegisterString("Show Iron Vein Labels", "显示铁矿标签");
		StringManager.RegisterString("Show Copper Vein Labels", "显示铜矿标签");
		StringManager.RegisterString("Show Silicon Vein Labels", "显示硅矿标签");
		StringManager.RegisterString("Show Titanium Vein Labels", "显示钛矿标签");
		StringManager.RegisterString("Show Stone Vein Labels", "显示石矿标签");
		StringManager.RegisterString("Show Coal Vein Labels", "显示煤矿标签");
		StringManager.RegisterString("Show Oil Vein Labels", "显示石油标签");
		StringManager.RegisterString("Show Fire Ice Vein Labels", "显示可燃冰标签");
		StringManager.RegisterString("Show Kimberlite Labels", "显示金伯利石标签");
		StringManager.RegisterString("Show Fractal Silicon Vein Labels", "显示分形硅标签");
		StringManager.RegisterString("Show Organic Crystal Vein Labels", "显示有机水晶标签");
		StringManager.RegisterString("Show Optical Grating Vein Labels", "显示光栅石标签");
		StringManager.RegisterString("Show Spiriform Vein Labels", "显示刺笋结晶标签");
		StringManager.RegisterString("Show Unipolar Vein Labels", "显示单极磁石标签");
		StringManager.RegisterString("Debug Options", "调试选项 (Debug)");
		StringManager.RegisterString("Useful for testing galaxies/themes", "用于测试星系的实用功能");
		StringManager.RegisterString("Pause DarkFog", "暂停黑雾");
		StringManager.RegisterString("Skip DF Hive Logic", "跳过黑雾太空巢穴逻辑");
		StringManager.RegisterString("Distance to start Pausing(LY)", "开始暂停的距离(LY)");
		StringManager.RegisterString("Distance (LY) before skipping", "距离(LY)超过此值跳过黑雾太空巢穴逻辑");
		StringManager.RegisterString("Debug Log", "调试日志");
		StringManager.RegisterString("Print extra logs to BepInEx console", "将额外日志打印到BepInEx控制台");
		StringManager.RegisterString("Dev Log", "开发者日志");
		StringManager.RegisterString("Print stupid amount of logs to BepInEx console (SLOW)", "将大量日志打印到BepInEx控制台(较慢)");
		StringManager.RegisterString("Generation Log", "生成日志");
		StringManager.RegisterString("Print generation logs to BepInEx console (SLOW)", "将生成日志打印到BepInEx控制台(较慢)");
		StringManager.RegisterString("New Gravity Mechanics", "新引力机制");
		StringManager.RegisterString("Large planets attract a lot more. Can cause issues with large planets", "大行星吸引力更强。可能会导致大行星的问题");
		StringManager.RegisterString("Force Rare Spawn", "强制稀有矿物生成");
		StringManager.RegisterString("Ignore randomness/distance checks", "忽略稀有矿物的生成检测(随机性/距离)");
		StringManager.RegisterString("Enable Teleport", "启用传送");
		StringManager.RegisterString("Cheat Mode", "作弊模式");
		StringManager.RegisterString("TP by ctrl-click nav arrow in star map", "在星图中通过Ctrl+单击导航箭头进行传送");
		StringManager.RegisterString("Mecha Scale", "机甲比例");
		StringManager.RegisterString("How big Icarus should be. 1 = default", "伊卡洛斯机甲的大小。1 = 默认");
		StringManager.RegisterString("Reset Binary Star Position", "重置双星位置");
		StringManager.RegisterString("Try and move binary stars to new position relative to main star", "尝试将双星移动到相对于主星的新位置");
		StringManager.RegisterString("Ship Speed Multiplier", "飞船曲速倍率");
		StringManager.RegisterString("Multiplier for Warp Speed of Ships", "运输船曲速速度倍率");
		StringManager.RegisterString("GalaxySelect Planet ScaleFactor", "初始界面星球显示倍率");
		StringManager.RegisterString("How big planets should be in the new game system view", "新游戏星系选择界面中行星的大小");
		StringManager.RegisterString("GalaxySelect Star ScaleFactor", "初始界面恒星显示倍率");
		StringManager.RegisterString("How big star should be in the new game system view", "新游戏星系选择界面中恒星的大小");
		StringManager.RegisterString("GalaxySelect Orbit ScaleFactor", "初始界面轨道显示倍率");
		StringManager.RegisterString("How spaced orbits should be in the new game system view", "新游戏星系选择界面中轨道的间距");
		StringManager.RegisterString("GalaxySelect Click Tolerance", "初始界面点击容差");
		StringManager.RegisterString("How close to a star/planet your mouse needs to be to register a click", "鼠标距离星星/行星多近才能注册点击");
		StringManager.RegisterString("Set ResourceMulti Infinite", "使当前存档的资源无限");
		StringManager.RegisterString("Will need to be saved and loaded to apply", "需要保存和加载才能应用");
		StringManager.RegisterString("Dev Mode", "开发者模式");
		StringManager.RegisterString("Enable Keybinds for Refreshing Working Theme", "启用用于刷新工作主题的快捷键");
		StringManager.RegisterString("Revert Scarlet Ice Lake", "重生成猩红冰湖矿物");
		StringManager.RegisterString("2.2.0.23 Had a bug where Ice Lake had no terrain. Enable this to fix issues with saves started prior to .24", "2.2.0.23版本存在冰湖没有地形的错误。启用此选项以解决在24之前开始的存档问题");
		StringManager.RegisterString("Reset Logistic Bot Speed", "重置物流机器人速度");
		StringManager.RegisterString("Custom Galaxy Export/Import", "自定义星系导出/导入");
		StringManager.RegisterString("Export available once in game", "游戏中仅可导出一次");
		StringManager.RegisterString("Export Filename", "导出文件名");
		StringManager.RegisterString("Excluding .json", "不包括 .json");
		StringManager.RegisterString("Minify Exported JSON", "压缩导出的 JSON");
		StringManager.RegisterString("Only save changes", "仅保存更改");
		StringManager.RegisterString("Export Custom Galaxy", "导出自定义星系");
		StringManager.RegisterString("Save Galaxy to File", "保存星系到文件");
		StringManager.RegisterString("Custom Galaxy", "自定义星系");
		StringManager.RegisterString("Enable Dark Fog", "启用黑雾");
		StringManager.RegisterString("Enable Enemies", "启用敌人");
		StringManager.RegisterString("Aggressiveness", "黑雾攻击性");
		StringManager.RegisterString("Initial Level", "初始等级");
		StringManager.RegisterString("Initial Growth", "初始生长情况");
		StringManager.RegisterString("Initial Colonize", "初始占领情况");
		StringManager.RegisterString("Max Density", "最大黑雾密度");
		StringManager.RegisterString("Growth Speed Factor", "黑雾生长速度");
		StringManager.RegisterString("Power Threat Factor", "电力威胁系数");
		StringManager.RegisterString("Battle Threat Factor", "战斗威胁系数");
		StringManager.RegisterString("Battle Exp Factor", "战斗经验系数");
		StringManager.RegisterString("Combat Settings", "战斗设置");
		StringManager.RegisterString("How the AI behaves", "AI 的行为方式");
		StringManager.RegisterString("Load Custom Galaxy", "导入自定义星系");
		StringManager.RegisterString("Will end current game", "将结束当前游戏");
		StringManager.RegisterString("External Themes", "外部星球种类");
		StringManager.RegisterString("Export All Themes", "导出所有星球种类");
		StringManager.RegisterString("Success", "成功");
		StringManager.RegisterString("Themes have been exported to ", "星球种类已导出至");
		StringManager.RegisterString("Galaxy Saved to ", "星系保存至");
		StringManager.RegisterString("Error", "错误");
		StringManager.RegisterString("Please try again after creating a galaxy :)\r\nStart a game, then press ESC and click settings.", "请在创建星系后再试一次:)\r\n开始游戏,然后按 ESC 键并点击设置。");
		StringManager.RegisterString("To use the Custom JSON Generator you must select a file to load.", "要使用自定义 JSON 生成器,必须选择要加载的文件。");
		StringManager.RegisterString("Accurate Stars", "精准星系(按现实生成)");
		StringManager.RegisterString("Start in Sol", "从太阳系开始");
		StringManager.RegisterString("Max planets per system", "星系的最大行星数量");
		StringManager.RegisterString("Sol System Day/Night Multi", "日夜周期倍率");
		StringManager.RegisterString("Change the Sol system planets day/night cycle", "改变太阳系的日夜周期");
		StringManager.RegisterString("Min planet size", "最小行星大小");
		StringManager.RegisterString("Max planet size", "最大行星大小");
		StringManager.RegisterString("Starting planet size", "起始星球大小");
		StringManager.RegisterString("Birth planet Si/Ti", "起始星球解锁硅和钛");
		StringManager.RegisterString("Moons are small", "卫星较小");
		StringManager.RegisterString("Galaxy Settings", "星系设置");
		StringManager.RegisterString("Settings that control Galaxy formation", "控制星系形成的设置");
		StringManager.RegisterString("Birth Planet Settings", "起始星球设置");
		StringManager.RegisterString("Settings that only affect the starting planet", "仅影响出生星球的设置");
		StringManager.RegisterString("System Settings", "行星系设置");
		StringManager.RegisterString("Settings that control how systems are generated", "控制行星系生成的设置");
		StringManager.RegisterString("Planet Settings", "行星设置");
		StringManager.RegisterString("Settings that control how planets are generated", "控制行星生成的设置");
		StringManager.RegisterString("Star Specific Overrides", "特定星体覆盖设置");
		StringManager.RegisterString("Settings that are star specific", "对特定种类的恒星进行设置覆盖");
		StringManager.RegisterString("Reset", "重设");
		StringManager.RegisterString("Galaxy Spread", "星系离散程度");
		StringManager.RegisterString("Lower = Stars are closer to each other. Default is 5", "星系扩散程度越大,星系间就越远。默认值为5");
		StringManager.RegisterString("Default StarCount", "初始界面默认恒星数量");
		StringManager.RegisterString("How many stars should the slider default to", "新游戏滑动条默认恒星数量");
		StringManager.RegisterString("Star Size Multiplier", "恒星大小倍率");
		StringManager.RegisterString("GS2 uses 10x as standard. They just look cooler.", "GS2设为原版10倍。看起来更酷。");
		StringManager.RegisterString("Luminosity Multiplier", "亮度倍率");
		StringManager.RegisterString("Increase the luminosity of all stars by this multiplier", "将所有恒星的亮度倍增此倍率");
		StringManager.RegisterString("Use Vanilla Star Names", "使用原版星体名称");
		StringManager.RegisterString("Use DSP's Name Generator", "使用DSP的名称生成器");
		StringManager.RegisterString("Binary Star Settings", "双星设置");
		StringManager.RegisterString("Settings that control Binary Star formation", "控制双星形成的设置");
		StringManager.RegisterString("Binary Distance Multi", "双星距离倍率");
		StringManager.RegisterString("How close secondary stars should be to primaries", "伴星距离主星的接近程度");
		StringManager.RegisterString("Binary Star Chance %", "双星概率 %");
		StringManager.RegisterString("% Chance of a star having a binary companion", "星体成为双星的概率 %");
		StringManager.RegisterString("Star Relative Frequencies", "星体生成概率");
		StringManager.RegisterString("How often to select a star type", "生成器选择星体类型的概率");
		StringManager.RegisterString("Freq. BlackHole", "黑洞-出现频率");
		StringManager.RegisterString("Minimum BlackHole", "黑洞-最低数量");
		StringManager.RegisterString("Freq. Neutron", "中子星-出现频率");
		StringManager.RegisterString("Minimum Neutron", "中子星-最低数量");
		StringManager.RegisterString("Freq. WhiteDwarf", "白矮星-出现频率");
		StringManager.RegisterString("Minimum WhiteDwarf", "白矮星-最低数量");
		StringManager.RegisterString("Starting Planet Size", "起始星球大小");
		StringManager.RegisterString("How big the starting planet is. Default is 200", "起始星球的大小。默认值为200");
		StringManager.RegisterString("Starting Planet Orbit", "起始星球轨道半径");
		StringManager.RegisterString("How big the starting planet is.", "你的起始行星距离恒星有多远");
		StringManager.RegisterString("Starting Planet Unlock", "解锁其他种类的起始星球");
		StringManager.RegisterString("Allow other habitable themes for starting planet", "允许起始星球使用其他宜居星球种类");
		StringManager.RegisterString("Starting Planet Theme", "起始星球种类");
		StringManager.RegisterString("Starting planet Si/Ti", "起始星球解锁硅和钛");
		StringManager.RegisterString("Force Silicon and Titanium on the starting planet", "在起始星球上强制生成硅和钛");
		StringManager.RegisterString("Allow Rares in Starting System", "起始星系中允许稀有资源");
		StringManager.RegisterString("Allow Rares other than Oil and FireIce", "允许起始星系有除了原油和可燃冰之外的稀有资源");
		StringManager.RegisterString("Starting Planet Star", "起始恒星类型");
		StringManager.RegisterString("Type of Star to Start at", "初始星球所属恒星系的类型");
		StringManager.RegisterString("Tidal Lock Starting Planet", "强制起始星球潮汐锁定");
		StringManager.RegisterString("Force the starting planet to be tidally locked", "将起始星球锁定为潮汐锁定");
		StringManager.RegisterString("Birth Planet is a Moon", "起始星球是一个卫星");
		StringManager.RegisterString("... of a Gas Giant", "起始是气态巨星的卫星");
		StringManager.RegisterString("Starting Planet No Rares", "起始星球上不会有稀有资源");
		StringManager.RegisterString("Disable to allow rare veins on starting planet", "禁用此项后,起始星球上可有稀有矿脉");
		StringManager.RegisterString("Solar Power Falloff", "太阳能衰减计算方法");
		StringManager.RegisterString("InverseSquare", "反比平方");
		StringManager.RegisterString("Linear", "线性");
		StringManager.RegisterString("Linear Damping", "线性阻尼");
		StringManager.RegisterString("How close to 100% the inner and outer planets will be", "内外行星距离100%的接近程度");
		StringManager.RegisterString("None", "无");
		StringManager.RegisterString("Min/Max Solar", "最小/最大光能利用率");
		StringManager.RegisterString("Orbit Spacing", "行星轨道间距");
		StringManager.RegisterString("Minimum gap between planet orbits", "行星轨道间的最小间隔");
		StringManager.RegisterString("Planet Naming Scheme", "行星命名策略");
		StringManager.RegisterString("How to determine planet names", "行星命名的规则");
		StringManager.RegisterString("Default", "原版");
		StringManager.RegisterString("Alpha", "Alpha");
		StringManager.RegisterString("Random", "随机");
		StringManager.RegisterString("Tidal Lock Inner Planets", "潮汐锁定内行星");
		StringManager.RegisterString("Force planets below the orbit threshold to be tidally locked", "强制轨道低于阈值的行星潮汐锁定");
		StringManager.RegisterString("Inner Planet Distance (AU)", "内行星距离(AU)");
		StringManager.RegisterString("Distance forced tidal locking stops acting", "强制潮汐锁定停止作用的距离");
		StringManager.RegisterString("Allow Orbital Harmonics", "允许轨道共振");
		StringManager.RegisterString("Allow Orbital Resonance 1:2 and 1:4", "允许轨道共振 1:2 和 1:4");
		StringManager.RegisterString("Moons Are Small", "卫星较小");
		StringManager.RegisterString("Try to ensure moons are 1/2 their planets size or less", "使卫星的大小为其行星的1/2或更小");
		StringManager.RegisterString("Gas Giants Moon Bias", "气巨生成卫星偏向");
		StringManager.RegisterString("Lower prefers telluric planets, higher gas giants", "较低的偏好岩石行星,较高的偏好气态行星");
		StringManager.RegisterString("Secondary satellites", "二级卫星");
		StringManager.RegisterString("Allow moons to have moons", "允许卫星拥有卫星");
		StringManager.RegisterString("Secondary Satellite Chance", "二级卫星概率");
		StringManager.RegisterString("% Chance for a moon to have a moon", "卫星有卫星的概率%");
		StringManager.RegisterString("Recursive Moons", "递归卫星");
		StringManager.RegisterString("Moons of moons can have moons...", "卫星的卫星可以有卫星...");
		StringManager.RegisterString("Default Settings", "默认设置");
		StringManager.RegisterString("Changing these will reset all star specific overrides", "更改这些设置将重置所有特定星体的覆盖设置");
		StringManager.RegisterString("Planet Count", "行星数量");
		StringManager.RegisterString("The amount of planets per star", "每颗恒星的行星数量");
		StringManager.RegisterString("Planet Count Bias", "行星数量偏向");
		StringManager.RegisterString("Prefer Less (lower) or More (higher) Planets", "随机数会偏向较小或较大的数值");
		StringManager.RegisterString("Huge Gas Giants", "巨大气态行星");
		StringManager.RegisterString("Allow gas giants larger than 800 radius", "允许半径大于800的气态行星");
		StringManager.RegisterString("Chance Gas", "气态行星概率");
		StringManager.RegisterString("% Chance of a planet being a Gas Giant", "行星是气态行星的概率%");
		StringManager.RegisterString("Chance Moon", "卫星概率");
		StringManager.RegisterString("% Chance of a rocky planet being a moon", "岩石行星是卫星的概率%");
		StringManager.RegisterString("Enable Comets", "启用彗星");
		StringManager.RegisterString("Star has a small planetoid with a random rare resource", "恒星附近有一颗带有随机稀有资源的彗星");
		StringManager.RegisterString("Comet Chance", "彗星概率");
		StringManager.RegisterString("% Chance of a star spawning a comet", "恒星生成彗星的几率");
		StringManager.RegisterString("Override Habitable Zone", "覆盖适居带");
		StringManager.RegisterString("Enable the slider below", "启用下方的滑块");
		StringManager.RegisterString("Habitable Zone", "适居带范围");
		StringManager.RegisterString("Force habitable zone between these distances", "在这些距离间强制适居带");
		StringManager.RegisterString("Override Orbits", "覆盖轨道");
		StringManager.RegisterString("Orbit Range", "轨道范围");
		StringManager.RegisterString("Force the distances planets can spawn between", "强制行星生成的距离范围");
		StringManager.RegisterString("Prefer Inner Planets", "偏好内行星");
		StringManager.RegisterString("Day/Night Multiplier", "昼夜时间倍率");
		StringManager.RegisterString("Increase the duration of night/day", "延长夜晚/白昼的持续时间");
		StringManager.RegisterString("Telluric Planet Size", "岩石行星大小");
		StringManager.RegisterString("Min/Max Size of Rocky Planets", "岩石行星的最小/最大大小");
		StringManager.RegisterString("Limit Planet Sizes", "限制行星大小");
		StringManager.RegisterString("Force Planets to these sizes", "将行星强制设定为这些大小");
		StringManager.RegisterString("Gas Planet Size", "气态行星大小");
		StringManager.RegisterString("Min/Max Size of Gas Planets", "气态行星的最小/最大大小");
		StringManager.RegisterString("Limit Gas Giant Sizes", "限制气态行星大小");
		StringManager.RegisterString("Force Gas Giants to these sizes", "将气态行星强制设定为这些大小");
		StringManager.RegisterString("Planet Size Bias", "行星大小偏向");
		StringManager.RegisterString("Prefer Smaller (lower) or Larger (higher) Sizes", "随机数会偏向较小或较大的数值");
		StringManager.RegisterString("Max Inclination", "最大轨道倾角");
		StringManager.RegisterString("Maximum angle of orbit", "轨道的最大倾角");
		StringManager.RegisterString("Random", "随机");
		StringManager.RegisterString("Max Orbit Longitude", "最大轨道经度");
		StringManager.RegisterString("Maximum longitude of the ascending node", "升交点的最大经度");
		StringManager.RegisterString("Rare Vein Chance % Override", "稀有矿脉概率覆盖");
		StringManager.RegisterString("Override the chance of planets spawning rare veins", "覆盖行星生成稀有矿脉的概率%");
		StringManager.RegisterString("Default", "默认");
		StringManager.RegisterString("Will be selected randomly from this range", "将在此范围内随机选择");
		StringManager.RegisterString("Count Bias", "计数偏向");
		StringManager.RegisterString("Prefer Less (lower) or More (higher) Counts", "随机数会偏向较小或较大的数值");
		StringManager.RegisterString("Gas Giant Planet Size", "气巨大小");
		StringManager.RegisterString("Telluric Size Bias", "岩石行星大小偏向");
		StringManager.RegisterString("Chance for Gas giant", "气巨的概率");
		StringManager.RegisterString("Chance for Moon", "卫星的概率");
		StringManager.RegisterString("Luminosity Boost", "亮度提升");
		StringManager.RegisterString("Increase the luminosity of this star type by this amount", "将此星型的亮度增加此数量");
		StringManager.RegisterString("Black Hole Overrides", "黑洞覆盖设置");
		StringManager.RegisterString("Neutron Star Overrides", "中子星覆盖设置");
		StringManager.RegisterString("White Dwarf Overrides", "白矮星覆盖设置");
	}

	private static void RegisterStrings_VanillaPlusPlusGenerator()
	{
		StringManager.RegisterString("Galaxy Density", "星系密度");
		StringManager.RegisterString("Binary and Trinary Star Chance", "双星与三星的概率");
		StringManager.RegisterString("Starting System Star Type", "起始星系的恒星类型");
		StringManager.RegisterString("Disable Rares on Starting Planet", "起始星球不生成珍奇矿物");
		StringManager.RegisterString("Variable Size Gas Giants", "不同大小的气态巨星");
		StringManager.RegisterString("Higher Chance of Gas Giant Moons", "气态巨星的卫星生成率提升");
		StringManager.RegisterString("Blue Stars Luminosity Boost", "蓝巨星亮度提升");
		StringManager.RegisterString("Coefficient", "系数");
		StringManager.RegisterString("Realistic Solar Power Levels", "真实太阳能功率");
		StringManager.RegisterString("Star Types Frequencies", "恒星种类出现频率");
		StringManager.RegisterString("Settings that determine frequencies of various star types in the cluster", "决定宇宙中各种恒星出现的概率");
		StringManager.RegisterString("Number of Planets per System", "星系中行星的数量");
		StringManager.RegisterString("Planet Size Range", "行星大小范围");
		StringManager.RegisterString("Rare Resource Vein Chance %", "珍奇生成概率");
	}
}
public class LSTM_Patch
{
	public const string NAME = "LSTM";

	public const string GUID = "com.hetima.dsp.LSTM";

	public static void OnAwake(Harmony harmony)
	{
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Expected O, but got Unknown
		if (!Chainloader.PluginInfos.ContainsKey("com.hetima.dsp.LSTM") || !((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>("Enable", "LSTM", true, (ConfigDescription)null).Value)
		{
			return;
		}
		RegisterStrings();
		try
		{
			harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("LSTMMod.UIConfigWindow"), "CreateUI", (Type[])null, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(typeof(Plugin).GetMethod("TranslateStrings")), (HarmonyMethod)null, (HarmonyMethod)null);
		}
		catch (Exception ex)
		{
			Plugin.Log.LogWarning((object)("LSTM error!\n" + ex));
		}
	}

	private static void RegisterStrings()
	{
		StringManager.RegisterString("Select Item", "选择物品");
		StringManager.RegisterString("Select item to display", "选择要显示的物品");
		StringManager.RegisterString("Click here to clear navi", "清除导航");
		StringManager.RegisterString("Upgrades Required", "需要升级");
		StringManager.RegisterString("Click: select item\nRight-click: select and update this list", "点击:选择物品\n右键点击:选择并更新列表");
		StringManager.RegisterString("Material Selector", "原料选择器");
		StringManager.RegisterString("ILS Stock Ratio", "星際物流塔库存比例");
		StringManager.RegisterString("Click to show / hide ILS stock ratio\nby LSTM", "点击显示/隐藏LSTM的星際物流塔库存比例");
		StringManager.RegisterString("Locate Station", "定位站点");
		StringManager.RegisterString("Show the star to which the station belongs or navigation to this station", "显示该站点所属的星球或导航至该站点");
		StringManager.RegisterString("Item Filter", "物品筛选");
		StringManager.RegisterString("Filter list with this item", "使用该物品筛选列表");
		StringManager.RegisterString("(All Planets)", "(所有星球)");
		StringManager.RegisterString("Supply", "供应");
		StringManager.RegisterString("Demand", "需求");
		StringManager.RegisterString("Log", "日志");
		StringManager.RegisterString("Open Log with current state", "使用当前状态打开日志");
		StringManager.RegisterString("General", "常规");
		StringManager.RegisterString("Main Hotkey", "快捷键");
		StringManager.RegisterString("Show Material Picker", "显示原料选择器");
		StringManager.RegisterString("Indicates Warper Sign", "以*标记有翘曲器的站点");
		StringManager.RegisterString("Close Panel With E Key", "使用E键关闭面板");
		StringManager.RegisterString("Act As Standard Panel", "单击Esc关闭面板");
		StringManager.RegisterString("Suppress Open Inventory Window", "阻止打开背包窗口");
		StringManager.RegisterString("Show Station Info Icon", "显示站点信息图标");
		StringManager.RegisterString("Only In Planet View", "仅在行星视图中");
		StringManager.RegisterString("Show Stat On Statistics Window", "在统计窗口中显示统计信息");
		StringManager.RegisterString("Show Open LSTM Button On", "在以下介面增加LSTM按钮");
		StringManager.RegisterString("Station Window", "物流站窗口");
		StringManager.RegisterString(" Statistics Window", "统计窗口");
		StringManager.RegisterString("Starmap Detail Panel", "星球详细信息面板");
		StringManager.RegisterString("Set Construction Point To Ground", "将建设点设置到地面");
		StringManager.RegisterString("Double-Click To Navi Everywhere", "双击地面以产生导航线");
		StringManager.RegisterString("On Planet View", "在行星视图中");
		StringManager.RegisterString("Enable Traffic Log (needs restart game)", "启用运输日志(需重启游戏)");
		StringManager.RegisterString("Hide Storaged Slot", "隐藏仓储槽位");
		StringManager.RegisterString("Traffic Logic", "运输逻辑");
		StringManager.RegisterString("One-time demand", "一次性需求");
		StringManager.RegisterString("Ignore Supply Range", "忽略最大距离限制");
		StringManager.RegisterString("Smart Transport", "智能运输");
		StringManager.RegisterString("Consider Opposite Range", "考虑对向站点的距离限制");
		StringManager.RegisterString("Remote Demand Delay (96%)", "远程需求延迟 (96%)");
		StringManager.RegisterString("Local Demand Delay (98%)", "本地需求延迟 (98%)");
		StringManager.RegisterString("Remote Cluster [C:]", "远程群集 [C:]");
		StringManager.RegisterString("Local Cluster [c:]", "本地群集 [c:]");
		StringManager.RegisterString("Remote Distance/Capacity Balance *", "远程距离/容量平衡 *");
		StringManager.RegisterString("Supply 70%-100% Multiplier", "当供应 70%-100% 时, 距离增长倍率");
		StringManager.RegisterString("Demand 0%-30% Multiplier", "当需求 0%-30% 时, 距离增长倍率");
		StringManager.RegisterString("Supply 0%-30% Denominator", "当供应 0%-30% 时, 距离缩减倍率");
		StringManager.RegisterString("* Distance/Capacity Balance will be forced off when Smart Transport is on", "* 当启用智能运输时将强制关闭距离/容量平衡");
	}
}
public class NebulaMultiplayer_Patch
{
	public const string NAME = "NebulaMultiplayerMod";

	public const string GUID = "dsp.nebula-multiplayer";

	public static void OnAwake(Harmony harmony)
	{
		if (Chainloader.PluginInfos.ContainsKey("dsp.nebula-multiplayer") && ((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>("Enable", "NebulaMultiplayerMod", true, (ConfigDescription)null).Value)
		{
			RegisterStrings();
		}
	}

	private static void RegisterStrings()
	{
		StringManager.RegisterString("Multiplayer", "多人游戏");
		StringManager.RegisterString("New Game (Host)", "新游戏 (主机)");
		StringManager.RegisterString("Load Game (Host)", "加载存档 (主机)");
		StringManager.RegisterString("Join Game", "加入游戏");
		StringManager.RegisterString("Back", "返回");
		StringManager.RegisterString("Host IP Address", "主机IP地址");
		StringManager.RegisterString("Password (optional)", "密码 (可选)");
		StringManager.RegisterString("OK", "确认");
		StringManager.RegisterString("Close", "关闭");
		StringManager.RegisterString("Accept", "接受");
		StringManager.RegisterString("Reject", "拒绝");
		StringManager.RegisterString("Reload", "重载");
		StringManager.RegisterString("General", "常规");
		StringManager.RegisterString("Network", "网络");
		StringManager.RegisterString("Chat", "聊天");
		StringManager.RegisterString("Nickname", "玩家名称");
		StringManager.RegisterString("NameTagSize", "玩家名称尺寸");
		StringManager.RegisterString("Show Lobby Hints", "显示大厅说明");
		StringManager.RegisterString("Sync Ups", "同步逻辑帧");
		StringManager.RegisterString("If enabled the UPS of each player is synced. This ensures a similar amount of GameTick() calls.", "启用后,会调整本地的逻辑帧率以和远端主机同步");
		StringManager.RegisterString("Sync Soil", "共享砂土");
		StringManager.RegisterString("If enabled the soil count of each players is added together and used as one big pool for everyone. Note that this is a server side setting applied to all clients.", "启用后,砂土设置将从个人转变为群体共享。此项为主机设置");
		StringManager.RegisterString("Streamer mode", "直播模式");
		StringManager.RegisterString("If enabled specific personal information like your IP address is hidden from the ingame chat and input fields.", "直播模式中,隐私数据(IP地址等)将会用星号隐藏");
		StringManager.RegisterString("Enable Achievement", "启用成就");
		StringManager.RegisterString("Player List Hotkey", "玩家列表热键");
		StringManager.RegisterString("Server Password", "服务器密码");
		StringManager.RegisterString("If provided, this will set a password for your hosted server.", "设置不为空时,玩家需输入密码才能进入服务器");
		StringManager.RegisterString("Host Port", "主机端口");
		StringManager.RegisterString("Enable UPnp/Pmp Support", "启用UPnp/Pmp支持");
		StringManager.RegisterString("If enabled, attempt to automatically create a port mapping using UPnp/Pmp (only works if your router has this feature and it is enabled)", "尝试使用UPnp/Pmp自动创建端口映射(仅当您的路由器具有此功能并且已启用时有效)");
		StringManager.RegisterString("Enable Experimental Ngrok support", "启用Ngrok支持");
		StringManager.RegisterString("If enabled, when hosting a server this will automatically download and install the Ngrok client and set up an Ngrok tunnel that provides an address at which the server can be joined", "创建服务器时,尝试下载并安装Ngrok客户端,并设置一个Ngrok隧道,提供一个可加入服务器的地址");
		StringManager.RegisterString("Ngrok Authtoken", "Ngrok授权令牌");
		StringManager.RegisterString("This is required for Ngrok support and can be obtained by creating a free account at https://ngrok.com/", "授权令牌可在https://ngrok.com/注册免费帐号获取");
		StringManager.RegisterString("Ngrok Region", "Ngrok地区");
		StringManager.RegisterString("Available Regions: us, eu, au, ap, sa, jp, in ", "可选的地区: us, eu, au, ap, sa, jp, in");
		StringManager.RegisterString("Remember Last IP", "记住上次主机地址");
		StringManager.RegisterString("Remember Last Client Password", "记住上次输入的密码");
		StringManager.RegisterString("Enable Discord RPC (requires restart)", "启用Discord RPC(需要重启)");
		StringManager.RegisterString("Auto accept Discord join requests", "自动允许Discord加入请求");
		StringManager.RegisterString("IP Configuration", "Discord IP设置");
		StringManager.RegisterString("Configure which type of IP should be used by Discord RPC", "设置Discord要使用哪种IP");
		StringManager.RegisterString("Cleanup inactive sessions", "清除不活跃的会话");
		StringManager.RegisterString("If disabled the underlying networking library will not cleanup inactive connections. This might solve issues with clients randomly disconnecting and hosts having a 'System.ObjectDisposedException'.", "启用后会自动清除不活跃的会话,可能解决客户端随机断开连接和主机出现“System.ObjectDisposedException”错误的问题");
		StringManager.RegisterString("Chat Hotkey", "聊天窗口热键");
		StringManager.RegisterString("Auto Open Chat", "自动开启聊天窗口");
		StringManager.RegisterString("Auto open chat window when receiving message from other players", "收到其他玩家消息时自动开启聊天窗口");
		StringManager.RegisterString("Show Timestamp", "显示时间戳");
		StringManager.RegisterString("Show system warn message", "显示系统警告消息");
		StringManager.RegisterString("Show system info message", "显示系统通知消息");
		StringManager.RegisterString("Show battle notification message", "显示战斗提示信息");
		StringManager.RegisterString("Default chat position", "聊天窗口位置");
		StringManager.RegisterString("Default chat size", "聊天窗口大小");
		StringManager.RegisterString("Notification duration", "通知停留时间");
		StringManager.RegisterString("Chat Window Opacity", "聊天窗口不透明度");
		StringManager.RegisterString("No UPnp or Pmp compatible/enabled NAT device found", "未找到支持/启用UPnp或Pmp的NAT设备");
		StringManager.RegisterString("Could not create UPnp or Pmp port mapping", "无法创建UPnp或Pmp端口映射");
		StringManager.RegisterString("An error occurred while hosting the game: ", "在创建服务器时发生错误: ");
		StringManager.RegisterString("This setting can only be changed while not in game", "此设置只能在不在游戏中时更改");
		string cnTrans = "当玩家首次进入游戏时会进入大厅,在这里可以预览星球资源和选择起始星球\n点击恒星可以展开其行星系。行星系中点击星球能查看其详细信息。\n在打开行星详细信息面板时,再点击行星一次就可以将其设置为出生星球。\n点击外太空可以回到上一层次。滚轮放大/缩小。长按Alt键可查看星球名称。\n\n在游戏中 Alt + ~ 可以打开聊天窗口。输入/help可以查看所有命令。\n联机mod可能和某些模组不相容。模组NebulaCompatibilityAssist有详细的说明\n当出错或失去同步时可以让客户端重连,或主机保存重开。祝游戏愉快!";
		StringManager.RegisterString("The Lobby", "大厅说明");
		StringManager.RegisterString("Nebula_LobbyMessage", cnTrans);
		StringManager.RegisterString("Welcome to Nebula multiplayer mod! Press {0} to open chat window, type /help to see all commands.", "欢迎! 按 {0} 打开聊天窗口, 输入 /help 查看所有命令");
		StringManager.RegisterString("Mod Mismatch", "模组不匹配");
		StringManager.RegisterString("You are missing mod {0}", "你缺少模组 {0}");
		StringManager.RegisterString("Server is missing mod {0}", "服务器缺少模组 {0}");
		StringManager.RegisterString("Mod Version Mismatch", "模组版本不匹配");
		StringManager.RegisterString("Your mod {0} version is not the same as the Host version.\nYou:{1} - Remote:{2}", "你的模组 {0} 版本与主机版本不同。\n你:{1} - 主机:{2}");
		StringManager.RegisterString("Game Version Mismatch", "游戏版本不匹配");
		StringManager.RegisterString("Your version of the game is not the same as the one used by the Host.\nYou:{0} - Remote:{1}", "你的游戏版本与主机使用的版本不同。\n你:{0} - 主机:{1}");
		StringManager.RegisterString("Server Requires Password", "需要密码");
		StringManager.RegisterString("Server is protected. Please enter the correct password:", "服务器受保护。请输入正确的密码:");
		StringManager.RegisterString("Server Busy", "服务器繁忙");
		StringManager.RegisterString("Server is not ready to join. Please try again later.", "服务器暂时无法加入。请稍后再试。");
		StringManager.RegisterString("Connection Lost", "连接中断");
		StringManager.RegisterString("You have been disconnected from the server.", "你已与服务器断开连接。");
		StringManager.RegisterString("Server Unavailable", "无法使用");
		StringManager.RegisterString("Could not reach the server, please try again later.", "无法连接到服务器,请确认网络状态。");
		StringManager.RegisterString("Connecting", "连接中");
		StringManager.RegisterString("Connecting to server...", "正在连接至服务器...");
		StringManager.RegisterString("Connect failed", "连接失败");
		StringManager.RegisterString("Was not able to connect to server", "无法连接至服务器");
		StringManager.RegisterString("Loading", "加载中");
		StringManager.RegisterString("Loading state from server, please wait", "正在从服务器加载状态,请稍候");
		StringManager.RegisterString("Loading Dyson sphere {0}, please wait", "正在加载戴森球 {0},请稍候");
		StringManager.RegisterString("{0} joining the game, please wait\n(Use BulletTime mod to unfreeze the game)", "{0} 正在加入游戏,请稍候\n(使用BulletTime模组可避免游戏冻结)");
		StringManager.RegisterString("Unavailable", "无法使用");
		StringManager.RegisterString("The host is not ready to let you in, please wait!", "主机尚未准备好让您进入,请稍候!");
		StringManager.RegisterString("Milky Way is disabled in multiplayer game.", "银河系功能在多人游戏中禁用");
		StringManager.RegisterString("Dark Fog Communicator is disabled in multiplayer game.", "黑雾通信器在多人游戏中被禁用");
		StringManager.RegisterString("Desync", "失去同步");
		StringManager.RegisterString("Dyson sphere id[{0}] {1} is desynced.", "戴森球 id[{0}] {1} 不同步。");
		StringManager.RegisterString("Please wait for server respond", "请等待服务器响应");
		StringManager.RegisterString("(Desync) EntityId mismatch {0} != {1} on planet {2}. Clients should reconnect!", "(不同步) EntityId不匹配 {0} != {1} 在星球 {2} 上。请重新连接!");
		StringManager.RegisterString("(Desync) PrebuildId mismatch {0} != {1} on planet {2}. Please reconnect!", "(不同步) PrebuildId不匹配 {0} != {1} 在星球 {2} 上。请重新连接!");
		StringManager.RegisterString("DF seed sent out", "黑雾火种发射");
		StringManager.RegisterString("DF relay landed on", "中继站登陆星球");
		StringManager.RegisterString("DF relay left from", "中继站离开星球");
		StringManager.RegisterString("DF relay killed on", "中继站已被摧毁");
		StringManager.RegisterString("Space hive is attacking", "太空巢穴袭击");
		StringManager.RegisterString("Tell remote server to save/load", "命令远程服务器进行保存/加载");
		StringManager.RegisterString("Remote server access is not enabled", "远程服务器访问(Remote server access)设置未启用");
		StringManager.RegisterString("You need to login first!", "您需要先登录!");
		StringManager.RegisterString("You have already logged in", "您已经登录了");
		StringManager.RegisterString("Cooldown: {0}s", "冷却时间:{0}秒");
		StringManager.RegisterString("Password incorrect!", "密码不正确!");
		StringManager.RegisterString("Login success!", "登录成功!");
		StringManager.RegisterString("Save list on server: ({0}/{1})", "在服务器上存档列表:({0}/{1})");
		StringManager.RegisterString("Save {0} : {1}", "保存 {0}:{1}");
		StringManager.RegisterString("Success", "成功");
		StringManager.RegisterString("Fail", "失败");
		StringManager.RegisterString("{0} doesn't exist", "{0} 不存在");
		StringManager.RegisterString("Copy", "复制");
		StringManager.RegisterString("Click to copy to clipboard", "点击复制到剪贴板");
		StringManager.RegisterString("Navigate", "导航");
		StringManager.RegisterString("Left click to create a navigate line to the target.\nRight click to track the target.", "左键单击:创建到目标的导航线\n右键单击:镜头追踪目标。");
		StringManager.RegisterString("Navigate to ", "导航至 ");
		StringManager.RegisterString("Tracking mode (ESC or click again to exit)", "追踪模式(ESC或再次点击退出)");
		StringManager.RegisterString("Can't find player {0}", "找不到玩家 {0}");
		StringManager.RegisterString("Player {0} is on a different planet", "玩家 {0} 在另一个星球上");
		StringManager.RegisterString("Player {0} is too far away", "玩家 {0} 距离太远");
		StringManager.RegisterString("SYSTEM", "系统");
		StringManager.RegisterString("[{0:HH:mm}] {1} connected ({2})", "[{0:HH:mm}] {1} 加入游戏 ({2})");
		StringManager.RegisterString("[{0:HH:mm}] {1} disconnected", "[{0:HH:mm}] {1} 离开游戏");
		StringManager.RegisterString("User not found {0}", "未找到用户 {0}");
		StringManager.RegisterString("Unknown command", "未知命令");
		StringManager.RegisterString("Clear all chat messages (locally)", "清除所有聊天消息(本地)");
		StringManager.RegisterString("Command {0} was not found! Use /help to get list of known commands.", "找不到命令 {0}!使用 /help 查看已知命令列表。");
		StringManager.RegisterString("Command ", "命令 ");
		StringManager.RegisterString("Usage: ", "用法: ");
		StringManager.RegisterString("Aliases: ", "别名: ");
		StringManager.RegisterString("Known commands:", "已知命令:");
		StringManager.RegisterString("For detailed information about command use /help <command name>", "有关命令的详细信息,请使用 /help <命令名称>");
		StringManager.RegisterString("Get list of existing commands and their usage", "获取现有命令及其用法");
		StringManager.RegisterString("This command can only be used in multiplayer!", "此命令仅适用于多人游戏!");
		StringManager.RegisterString("Pending...", "等待中...");
		StringManager.RegisterString("Server info:", "服务器信息:");
		StringManager.RegisterString("Local IP address: ", "本地 IP 地址: ");
		StringManager.RegisterString("WANv4 IP address: ", "WANv4 IP 地址: ");
		StringManager.RegisterString("WANv6 IP address: ", "WANv6 IP 地址: ");
		StringManager.RegisterString("Ngrok address: ", "Ngrok 地址: ");
		StringManager.RegisterString("Ngrok address: Tunnel Inactive!", "Ngrok 地址: 隧道未激活!");
		StringManager.RegisterString("Port status: ", "端口状态: ");
		StringManager.RegisterString("Data state: ", "数据状态: ");
		StringManager.RegisterString("Uptime: ", "运行时间: ");
		StringManager.RegisterString("Game info:", "游戏信息:");
		StringManager.RegisterString("Game Version: ", "游戏版本: ");
		StringManager.RegisterString("Mod Version: ", "模组版本: ");
		StringManager.RegisterString("Mods installed:", "已安装模组:");
		StringManager.RegisterString("Client info:", "客户端信息:");
		StringManager.RegisterString("Host IP address: ", "主机 IP 地址: ");
		StringManager.RegisterString("Use '/info full' to see mod list.", "使用 '/info full' 查看模组列表。");
		StringManager.RegisterString("Get information about server", "获取服务器信息");
		StringManager.RegisterString("Starting navigation to ", "开始导航至 ");
		StringManager.RegisterString("Failed to start navigation, please check your input.", "导航失败,请检查您的输入。");
		StringManager.RegisterString("navigation cleared", "导航已清除");
		StringManager.RegisterString("Start navigating to a specified destination", "开始导航至指定目的地");
		StringManager.RegisterString("Test command", "测试命令");
		StringManager.RegisterString("This command can only be used in multiplayer and as client!", "此命令仅适用于多人游戏客户端!");
		StringManager.RegisterString("Perform a reconnect.", "重新连接");
		StringManager.RegisterString("Unknown command! Available commands: {login, list, save, load, info}", "未知命令!可用命令: {login, list, save, load, info}");
		StringManager.RegisterString("Not enough arguments!", "参数不足!");
		StringManager.RegisterString("Need to specify a save!", "需要指定一个存档!");
		StringManager.RegisterString(" (moon)", " (卫星)");
		StringManager.RegisterString("Could not find given star '{0}'", "找不到给定的星体 '{0}'");
		StringManager.RegisterString("List planets in a system", "列出星系中的行星");
		StringManager.RegisterString("Player not found: ", "未找到玩家: ");
		StringManager.RegisterString("Not connected, can't send message", "未连接,无法发送消息");
		StringManager.RegisterString("Send direct message to player. Use /who for valid user names", "向玩家发送直接消息。使用 /who 获取有效的用户名");
		StringManager.RegisterString("/who results: ({0} players)\r\n", "/who 结果: {0} 个玩家\r\n");
		StringManager.RegisterString(" (host)", " (主机)");
		StringManager.RegisterString(", in space", ", 在太空");
		StringManager.RegisterString(", at coordinates ", ", 坐标为 ");
		StringManager.RegisterString("List all players and their locations", "列出所有玩家及其位置");
		StringManager.RegisterString(">> Bad command. Use /x -help to get list of known commands.", ">> 错误的命令。使用 /x -help 获取已知命令列表。");
		StringManager.RegisterString("Execute developer console command", "执行开发者控制台命令");
		StringManager.RegisterString("Manage the stored multiplayer player data", "管理玩家数据");
		StringManager.RegisterString("Developer/Sandbox tool commands", "执行沙盒命令");
	}
}
public class PlanetFinder_Patch
{
	public const string NAME = "PlanetFinder";

	public const string GUID = "com.hetima.dsp.PlanetFinder";

	public static void OnAwake(Harmony harmony)
	{
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Expected O, but got Unknown
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Expected O, but got Unknown
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Expected O, but got Unknown
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Expected O, but got Unknown
		if (!Chainloader.PluginInfos.ContainsKey("com.hetima.dsp.PlanetFinder") || !((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>("Enable", "PlanetFinder", true, (ConfigDescription)null).Value)
		{
			return;
		}
		RegisterStrings();
		try
		{
			harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("PlanetFinderMod.PLFN"), "CreateUI", (Type[])null, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(typeof(Plugin).GetMethod("TranslateStrings")), (HarmonyMethod)null, (HarmonyMethod)null);
			harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("PlanetFinderMod.UIConfigWindow"), "CreateUI", (Type[])null, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(typeof(Plugin).GetMethod("TranslateStrings")), (HarmonyMethod)null, (HarmonyMethod)null);
			Type type = AccessTools.TypeByName("PlanetFinderMod.UIPlanetFinderWindow");
			harmony.Patch((MethodBase)AccessTools.Method(type, "_OnCreate", (Type[])null, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(typeof(Plugin).GetMethod("TranslateStrings")), (HarmonyMethod)null, (HarmonyMethod)null);
			harmony.Patch((MethodBase)AccessTools.Method(AccessTools.TypeByName("PlanetFinderMod.UIPlanetFinderListItem"), "CreateListViewPrefab", (Type[])null, (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(typeof(Plugin).GetMethod("TranslateStrings")), (HarmonyMethod)null, (HarmonyMethod)null);
		}
		catch (Exception ex)
		{
			Plugin.Log.LogWarning((object)("PlanetFinder error!\n" + ex));
		}
	}

	private static void RegisterStrings()
	{
		StringManager.RegisterString("open/close Planet Finder Window", "打开/关闭行星搜索器Planet Finder");
		StringManager.RegisterString("Sys", "星系");
		StringManager.RegisterString("All Planet", "行星");
		StringManager.RegisterString("Current Star", "当前星系");
		StringManager.RegisterString("Has Factory", "存在工厂");
		StringManager.RegisterString("★", "★");
		StringManager.RegisterString("Recent", "最近造访");
		StringManager.RegisterString("Locate Planet", "定位行星");
		StringManager.RegisterString("Show the planet on the starmap", "在星图上查看行星");
		StringManager.RegisterString("Main Hotkey", "快捷键");
		StringManager.RegisterString("Show Button In Main Panel", "在主面板中显示模组按钮");
		StringManager.RegisterString("Show Button In Starmap", "在星图中显示按钮");
		StringManager.RegisterString("Window Size", "窗口尺寸");
		StringManager.RegisterString("Show Power State In List", "列表中显示电力状态");
		StringManager.RegisterString("Show [GAS] [TL] Prefix", "显示巨行星[GAS]和潮汐锁定[TL]标志");
		StringManager.RegisterString("Show Fav Button In Starmap", "星图中显示收藏标志★");
		StringManager.RegisterString("Integration With DSPStarMapMemo", "兼容DSPStarMapMemo");
		StringManager.RegisterString("Display Icons / Search Memo", "显示图标/搜索备注");
		StringManager.RegisterString("Integration With LSTM", "兼容LSTM");
		StringManager.RegisterString("Open LSTM From Context Panel", "从关联按钮打开LSTM");
		StringManager.RegisterString("Integration With CruiseAssist", "兼容CruiseAssist");
		StringManager.RegisterString("Set CruiseAssist From Context Panel", "从关联按钮设置CruiseAssist");
	}
}
[BepInPlugin("starfi5h.plugin.SF_ChinesePatch", "SF_ChinesePatch", "1.3.2")]
public class Plugin : BaseUnityPlugin
{
	public const string GUID = "starfi5h.plugin.SF_ChinesePatch";

	public const string NAME = "SF_ChinesePatch";

	public const string VERSION = "1.3.2";

	public static ManualLogSource Log;

	public static Plugin Instance;

	private Harmony harmony;

	public void Awake()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected O, but got Unknown
		Log = ((BaseUnityPlugin)this).Logger;
		Instance = this;
		harmony = new Harmony("starfi5h.plugin.SF_ChinesePatch");
		LoadConfigStrings();
		NebulaMultiplayer_Patch.OnAwake(harmony);
		GalacticScale_Patch.OnAwake(harmony);
		BulletTime_Patch.OnAwake();
		DSPStarMapMemo_Patch.OnAwake();
		LSTM_Patch.OnAwake(harmony);
		PlanetFinder_Patch.OnAwake(harmony);
		harmony.PatchAll(typeof(StringManager));
	}

	public void OnDestroy()
	{
		harmony.UnpatchSelf();
	}

	public void LoadConfigStrings()
	{
		try
		{
			string value = ((BaseUnityPlugin)this).Config.Bind<string>("自定义", "字典", "", "增加或覆盖翻译。格式範例:\n\"Yes\":\"是\",\"No\":\"否\"").Value;
			if (string.IsNullOrEmpty(value))
			{
				return;
			}
			Dictionary<string, string> dictionary = SimpleParser.Parse(value);
			if (dictionary != null)
			{
				Log.LogDebug((object)$"Import {dictionary.Count} strings from config file");
				{
					foreach (KeyValuePair<string, string> item in dictionary)
					{
						StringManager.RegisterString(item.Key, item.Value);
					}
					return;
				}
			}
			Log.LogError((object)"Import strings from config file fail Format is not correct");
		}
		catch (Exception ex)
		{
			Log.LogError((object)"Import strings from config file fail!");
			Log.LogError((object)ex);
		}
	}

	public static IEnumerable<CodeInstruction> TranslateStrings(IEnumerable<CodeInstruction> instructions)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Expected O, but got Unknown
		MethodInfo translateMethod = AccessTools.Method(typeof(Localization), "Translate", (Type[])null, (Type[])null);
		return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
		{
			new CodeMatch((OpCode?)OpCodes.Ldstr, (object)null, (string)null)
		}).Repeat((Action<CodeMatcher>)delegate(CodeMatcher matcher)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			matcher.Advance(1).Insert((CodeInstruction[])(object)new CodeInstruction[1]
			{
				new CodeInstruction(OpCodes.Call, (object)translateMethod)
			});
		}, (Action<string>)null).InstructionEnumeration();
	}
}
public class SimpleParser
{
	public static Dictionary<string, string> Parse(string json)
	{
		Dictionary<string, string> dictionary = new Dictionary<string, string>();
		bool flag = false;
		string text = null;
		StringBuilder stringBuilder = new StringBuilder();
		foreach (char c in json)
		{
			if (c == '"')
			{
				flag = !flag;
				continue;
			}
			if (flag)
			{
				stringBuilder.Append(c);
				continue;
			}
			switch (c)
			{
			case ',':
				if (text != null)
				{
					dictionary.Add(text, stringBuilder.ToString());
					text = null;
					stringBuilder.Length = 0;
				}
				break;
			case ':':
				text = stringBuilder.ToString();
				stringBuilder.Length = 0;
				break;
			}
		}
		return dictionary;
	}
}
public class StringManager
{
	private static bool isInject = false;

	private static readonly Dictionary<string, int> nameIndices = new Dictionary<string, int>();

	private static readonly List<Tuple<int, string, string>> stringTuples = new List<Tuple<int, string, string>>();

	public static void RegisterString(string key, string cnTrans, string enTrans = "")
	{
		if (!isInject)
		{
			if (nameIndices.ContainsKey(key))
			{
				Plugin.Log.LogInfo((object)(key + ":(" + cnTrans + "," + enTrans + ") has already been registered!"));
			}
			else
			{
				nameIndices.Add(key, stringTuples.Count);
				stringTuples.Add(Tuple.Create(-1, string.IsNullOrEmpty(enTrans) ? key : enTrans, cnTrans));
			}
		}
	}

	private static void AddNamesIndexer()
	{
		Dictionary<string, int> namesIndexer = Localization.namesIndexer;
		int num = namesIndexer.Count;
		foreach (KeyValuePair<string, int> nameIndex in nameIndices)
		{
			int item;
			string item2;
			string item3;
			if (namesIndexer.TryGetValue(nameIndex.Key, out var value))
			{
				stringTuples[nameIndex.Value].Deconstruct(out item, out item2, out item3);
				string text = item2;
				string text2 = item3;
				stringTuples[nameIndex.Value] = Tuple.Create(value, text, text2);
				Plugin.Log.LogDebug((object)$"Overwrite {nameIndex.Value} => {text2} {text}");
			}
			else
			{
				stringTuples[nameIndex.Value].Deconstruct(out item, out item3, out item2);
				string item4 = item3;
				string item5 = item2;
				stringTuples[nameIndex.Value] = Tuple.Create(num, item4, item5);
				namesIndexer[nameIndex.Key] = num;
				num++;
			}
		}
	}

	private static void ApplyLanguage(int index)
	{
		string[][] strings = Localization.strings;
		string[] array = ((strings != null) ? strings[index] : null);
		if (array == null)
		{
			Plugin.Log.LogWarning((object)("Can't find Localization.strings " + index));
			return;
		}
		int count = Localization.namesIndexer.Count;
		if (array.Length < count)
		{
			string[] array2 = new string[count];
			Array.Copy(array, array2, array.Length);
			array = array2;
			Localization.strings[index] = array2;
		}
		float[] array3 = Localization.floats[index];
		if (array3 != null && array3.Length < count)
		{
			float[] array4 = new float[count];
			Array.Copy(array3, array4, array3.Length);
			Localization.floats[index] = array4;
		}
		if (Localization.Languages[index].lcId == 2052)
		{
			foreach (Tuple<int, string, string> stringTuple in stringTuples)
			{
				array[stringTuple.Item1] = stringTuple.Item3;
			}
			Plugin.Log.LogInfo((object)$"Add {stringTuples.Count} strings to ZHCN");
		}
		else
		{
			if (index != 1033)
			{
				return;
			}
			foreach (Tuple<int, string, string> stringTuple2 in stringTuples)
			{
				array[stringTuple2.Item1] = stringTuple2.Item2;
			}
			Plugin.Log.LogInfo((object)$"Add {stringTuples.Count} strings to ENUS");
		}
	}

	[HarmonyPostfix]
	[HarmonyAfter(new string[] { "dsp.common-api.CommonAPI" })]
	[HarmonyPatch(typeof(Localization), "LoadSettings")]
	private static void Localization_LoadSettings_Postfix()
	{
		if (!isInject && stringTuples.Count > 0)
		{
			isInject = true;
			AddNamesIndexer();
		}
	}

	[HarmonyPostfix]
	[HarmonyAfter(new string[] { "dsp.common-api.CommonAPI" })]
	[HarmonyPatch(typeof(Localization), "LoadLanguage")]
	private static void Localization_LoadLanguage_Postfix(int index)
	{
		if (isInject)
		{
			ApplyLanguage(index);
		}
	}
}