Decompiled source of TerrainCustomiserCN v0.1.0
TerrainCustomiserCN.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using ExitGames.Client.Photon; using HarmonyLib; using ImGuiNET; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Peak.Network; using Photon.Pun; using Photon.Realtime; using PhotonCustomPropsUtils; using Sirenix.Serialization; using Steamworks; using TerrainCustomiserCN.Managers; using TerrainCustomiserCN.Map; using TerrainCustomiserCN.Map.Serialization; using TerrainCustomiserCN.Session; using TerrainCustomiserCN.TerrainGeneration; using TerrainCustomiserCN.UI; using TerrainCustomiserCN.UI.Modals; using TerrainCustomiserCN.UI.Windows; using TerrainCustomiserCN.Utils; using UBImGui; using Unity.Burst; using Unity.Collections; using Unity.Jobs; using Unity.Mathematics; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using Zorro.Core; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RegisterFormatter(typeof(GameObjectFormatter), 10)] [assembly: RegisterFormatter(typeof(MaterialFormatter), 10)] [assembly: RegisterFormatter(typeof(TransformFormatter), 10)] [assembly: AssemblyCompany("TerrainCustomiserCN")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0")] [assembly: AssemblyProduct("TerrainCustomiserCN")] [assembly: AssemblyTitle("TerrainCustomiserCN")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public sealed class GameObjectFormatter : MinimalBaseFormatter<GameObject> { protected override void Read(ref GameObject value, IDataReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown string text = default(string); string kv = default(string); while ((int)reader.PeekEntry(ref text) != 8) { reader.ReadString(ref kv); if (text == "name") { GameObject val = TerrainCustomiserCN.Map.ResourceManager.GameObjectResources.Find((GameObject x) => ((Object)x).name == kv); value = val; } else if (text == "targetId") { GameObject val2 = new GameObject(kv); val2.SetActive(false); value = val2; MapSerializer.testgos.Add(val2); } else { reader.SkipEntry(); } } } protected override void Write(ref GameObject value, IDataWriter writer) { GameObject go = value.gameObject; KeyValuePair<string, GameObject> keyValuePair = MapSerializer.GameObjectReferences.FirstOrDefault((KeyValuePair<string, GameObject> x) => (Object)(object)x.Value == (Object)(object)go); if ((Object)(object)keyValuePair.Value == (Object)null) { writer.WriteString("name", ((Object)value).name); } else { writer.WriteString("targetId", keyValuePair.Key); } } } public sealed class MaterialFormatter : MinimalBaseFormatter<Material> { protected override void Read(ref Material value, IDataReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 string text = default(string); string kv = default(string); while ((int)reader.PeekEntry(ref text) != 8) { reader.ReadString(ref kv); if (text == "name") { Material val = TerrainCustomiserCN.Map.ResourceManager.MaterialResources.Find((Material x) => (Object)(object)x != (Object)null && ((Object)x).name == kv); value = val; } else { reader.SkipEntry(); } } } protected override void Write(ref Material value, IDataWriter writer) { writer.WriteString("name", ((Object)value).name); } } public sealed class TransformFormatter : MinimalBaseFormatter<Transform> { protected override void Read(ref Transform value, IDataReader reader) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown string text = default(string); string text2 = default(string); while ((int)reader.PeekEntry(ref text) != 8) { reader.ReadString(ref text2); if (text == "refid") { GameObject val = new GameObject(text2); val.SetActive(false); value = val.transform; MapSerializer.testgos.Add(val); } else if (text == "refpath") { GameObject val2 = GameObject.Find(text2); if ((Object)(object)val2 != (Object)null) { value = val2.transform; } else { value = null; } } else { reader.SkipEntry(); } } } protected override void Write(ref Transform value, IDataWriter writer) { GameObject go = ((Component)value).gameObject; KeyValuePair<string, GameObject> keyValuePair = MapSerializer.GameObjectReferences.FirstOrDefault((KeyValuePair<string, GameObject> x) => (Object)(object)x.Value == (Object)(object)go); if ((Object)(object)keyValuePair.Value == (Object)null) { string pathFromGameObject = MapSerializer.GetPathFromGameObject(go); writer.WriteString("refpath", pathFromGameObject); } else { writer.WriteString("refid", keyValuePair.Key); } } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace TerrainCustomiserCN { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInIncompatibility("com.snosz.terraincustomiser")] [BepInPlugin("com.wuyachiyu.terraincustomisercn", "TerrainCustomiserCN", "0.1.0")] public class Plugin : BaseUnityPlugin { public static Plugin Instance; private static Harmony _harmony; private void Awake() { Instance = this; ConfigManager.Setup(); BundleManager.Setup(); PlayerInfoManager.Setup(); _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); WindowsManager.Setup(); } private void OnDestroy() { _harmony.UnpatchSelf(); BundleManager.UnloadAll(); Object.Destroy((Object)(object)Singleton<EditorManager>.Instance); } public void LoadWilIsland() { AirportCheckInKiosk val = Object.FindFirstObjectByType<AirportCheckInKiosk>(); if ((Object)(object)val == (Object)null) { Debug.LogError((object)"[TCCN] 未找到机场登机台"); return; } int ascentIndex = GUIManager.instance.boardingPass.ascentIndex; ((MonoBehaviourPun)val).photonView.RPC("BeginIslandLoadRPC", (RpcTarget)0, new object[3] { "WilIsland", ascentIndex, RunSettings.GetSerializedRunSettings() }); } } [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resource1 { private static System.Resources.ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static System.Resources.ResourceManager ResourceManager { get { if (resourceMan == null) { resourceMan = new System.Resources.ResourceManager("TerrainCustomiserCN.Resource1", typeof(Resource1).Assembly); } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] selectionoverlay => (byte[])ResourceManager.GetObject("selectionoverlay", resourceCulture); internal static byte[] visibilitycompute => (byte[])ResourceManager.GetObject("visibilitycompute", resourceCulture); internal Resource1() { } } } namespace TerrainCustomiserCN.Utils { internal static class TerrainCustomiserSerialization { public static SerializationContext CreateSerializationContext() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown return new SerializationContext { Binder = (TwoWaySerializationBinder)(object)TerrainCustomiserCompatibilityBinder.Instance }; } public static DeserializationContext CreateDeserializationContext() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown return new DeserializationContext { Binder = (TwoWaySerializationBinder)(object)TerrainCustomiserCompatibilityBinder.Instance }; } } internal sealed class TerrainCustomiserCompatibilityBinder : TwoWaySerializationBinder { public static readonly TerrainCustomiserCompatibilityBinder Instance = new TerrainCustomiserCompatibilityBinder(); private static readonly string[,] TypeNameMappings = new string[8, 2] { { typeof(PlayerInfo).FullName + ", TerrainCustomiserCN", "TerrainCustomiser.Managers.PlayerInfo, TerrainCustomiser" }, { typeof(MapSerializer.ObjectData).FullName + ", TerrainCustomiserCN", "TerrainCustomiser.Map.Serialization.MapSerializer+ObjectData, TerrainCustomiser" }, { typeof(MapSerializer.TransformData).FullName + ", TerrainCustomiserCN", "TerrainCustomiser.Map.Serialization.MapSerializer+TransformData, TerrainCustomiser" }, { typeof(MapSerializer.ComponentData).FullName + ", TerrainCustomiserCN", "TerrainCustomiser.Map.Serialization.MapSerializer+ComponentData, TerrainCustomiser" }, { typeof(MapSerializer.FieldData).FullName + ", TerrainCustomiserCN", "TerrainCustomiser.Map.Serialization.MapSerializer+FieldData, TerrainCustomiser" }, { typeof(MapSerializer.MapSaveData).FullName + ", TerrainCustomiserCN", "TerrainCustomiser.Map.Serialization.MapSerializer+MapSaveData, TerrainCustomiser" }, { typeof(MapSerializer.MapSyncData).FullName + ", TerrainCustomiserCN", "TerrainCustomiser.Map.Serialization.MapSerializer+MapSyncData, TerrainCustomiser" }, { typeof(MapSerializer.SegmentSaveData).FullName + ", TerrainCustomiserCN", "TerrainCustomiser.Map.Serialization.MapSerializer+SegmentSaveData, TerrainCustomiser" } }; private TerrainCustomiserCompatibilityBinder() { } public override string BindToName(Type type, DebugContext debugContext = null) { return ReplaceTypeNames(TwoWaySerializationBinder.Default.BindToName(type, debugContext), useOriginalNames: true); } public override Type BindToType(string typeName, DebugContext debugContext = null) { string text = ReplaceTypeNames(typeName, useOriginalNames: false); if (!string.Equals(text, typeName, StringComparison.Ordinal)) { Type type = TwoWaySerializationBinder.Default.BindToType(text, debugContext); if (type != null) { return type; } } return TwoWaySerializationBinder.Default.BindToType(typeName, debugContext); } public override bool ContainsType(string typeName) { string text = ReplaceTypeNames(typeName, useOriginalNames: false); if (!TwoWaySerializationBinder.Default.ContainsType(typeName)) { return TwoWaySerializationBinder.Default.ContainsType(text); } return true; } private static string ReplaceTypeNames(string typeName, bool useOriginalNames) { string text = typeName; for (int i = 0; i < TypeNameMappings.GetLength(0); i++) { string text2 = TypeNameMappings[i, 0]; string text3 = TypeNameMappings[i, 1]; text = text.Replace(useOriginalNames ? text2 : text3, useOriginalNames ? text3 : text2); } return text; } } public class DebugVisualiser : MonoBehaviour { private abstract class Shape { public Color color; public float duration; public float startTime; private int startFrame; public bool alwaysOnTop; public bool Expired { get { if (!(duration <= 0f)) { return Time.time - startTime > duration; } return Time.frameCount > startFrame; } } protected Shape(Color color, float duration, bool alwaysOnTop) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) this.color = color; this.duration = duration; this.alwaysOnTop = alwaysOnTop; startTime = Time.time; startFrame = Time.frameCount; } public abstract void Draw(); } private class MeshShape : Shape { private Mesh mesh; private Transform transform; public MeshShape(Mesh mesh, Transform transform, Color color, float duration, bool alwaysOnTop) : base(color, duration, alwaysOnTop) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) this.mesh = mesh; this.transform = transform; } public override void Draw() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)mesh == (Object)null) && !((Object)(object)transform == (Object)null)) { Vector3[] vertices = mesh.vertices; int[] triangles = mesh.triangles; for (int i = 0; i < triangles.Length; i += 3) { int num = triangles[i]; int num2 = triangles[i + 1]; int num3 = triangles[i + 2]; Vector3 val = transform.TransformPoint(vertices[num]); Vector3 val2 = transform.TransformPoint(vertices[num2]); Vector3 val3 = transform.TransformPoint(vertices[num3]); GL.Color(color); GL.Vertex(val); GL.Vertex(val2); GL.Vertex(val2); GL.Vertex(val3); GL.Vertex(val3); GL.Vertex(val); } } } } private class BoxShape : Shape { private Vector3 center; private Vector3 size; private Quaternion rotation; public BoxShape(Vector3 center, Vector3 size, Quaternion rotation, Color color, float duration, bool alwaysOnTop) : base(color, duration, alwaysOnTop) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) this.center = center; this.size = size; this.rotation = rotation; } public override void Draw() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) Vector3 val = size * 0.5f; Vector3[] array = (Vector3[])(object)new Vector3[8] { new Vector3(0f - val.x, 0f - val.y, 0f - val.z), new Vector3(val.x, 0f - val.y, 0f - val.z), new Vector3(val.x, 0f - val.y, val.z), new Vector3(0f - val.x, 0f - val.y, val.z), new Vector3(0f - val.x, val.y, 0f - val.z), new Vector3(val.x, val.y, 0f - val.z), new Vector3(val.x, val.y, val.z), new Vector3(0f - val.x, val.y, val.z) }; for (int i = 0; i < array.Length; i++) { array[i] = center + rotation * array[i]; } int[,] array2 = new int[12, 2] { { 0, 1 }, { 1, 2 }, { 2, 3 }, { 3, 0 }, { 4, 5 }, { 5, 6 }, { 6, 7 }, { 7, 4 }, { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 } }; GL.Color(color); for (int j = 0; j < array2.GetLength(0); j++) { GL.Vertex(array[array2[j, 0]]); GL.Vertex(array[array2[j, 1]]); } } } private class RayShape : Shape { private Vector3 from; private Vector3 dir; public RayShape(Vector3 from, Vector3 dir, Color color, float duration, bool alwaysOnTop) : base(color, duration, alwaysOnTop) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) this.from = from; this.dir = dir; } public override void Draw() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) GL.Color(color); GL.Vertex(from); GL.Vertex(from + dir); } } private class LineShape : Shape { private Vector3 from; private Vector3 to; public LineShape(Vector3 from, Vector3 to, Color color, float duration, bool alwaysOnTop) : base(color, duration, alwaysOnTop) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) this.from = from; this.to = to; } public override void Draw() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) GL.Color(color); GL.Vertex(from); GL.Vertex(to); } } private class SphereShape : Shape { private Vector3 pos; private float radius; public SphereShape(Vector3 pos, float radius, Color color, float duration, bool alwaysOnTop) : base(color, duration, alwaysOnTop) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) this.pos = pos; this.radius = radius; } public override void Draw() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) int num = 24; for (int i = 0; i < num; i++) { float num2 = (float)i / (float)num * MathF.PI * 2f; float num3 = (float)(i + 1) / (float)num * MathF.PI * 2f; Vector3 val = pos + new Vector3(Mathf.Cos(num2), 0f, Mathf.Sin(num2)) * radius; Vector3 val2 = pos + new Vector3(Mathf.Cos(num3), 0f, Mathf.Sin(num3)) * radius; GL.Color(color); GL.Vertex(val); GL.Vertex(val2); Vector3 val3 = pos + new Vector3(0f, Mathf.Cos(num2), Mathf.Sin(num2)) * radius; Vector3 val4 = pos + new Vector3(0f, Mathf.Cos(num3), Mathf.Sin(num3)) * radius; GL.Vertex(val3); GL.Vertex(val4); Vector3 val5 = pos + new Vector3(Mathf.Cos(num2), Mathf.Sin(num2), 0f) * radius; Vector3 val6 = pos + new Vector3(Mathf.Cos(num3), Mathf.Sin(num3), 0f) * radius; GL.Vertex(val5); GL.Vertex(val6); } } } private static DebugVisualiser _instance; private List<Shape> _shapes = new List<Shape>(); private Material lineMaterialNormal; private Material lineMaterialOverlay; private void Awake() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown if ((Object)(object)_instance == (Object)null) { _instance = this; } else { Object.Destroy((Object)(object)((Component)this).gameObject); } lineMaterialNormal = new Material(Shader.Find("Hidden/Internal-Colored")); lineMaterialOverlay = new Material(Shader.Find("Hidden/Internal-Colored")); lineMaterialOverlay.SetInt("_ZTest", 8); RenderPipelineManager.endCameraRendering += OnEndCameraRendering; } private void OnDisable() { RenderPipelineManager.endCameraRendering -= OnEndCameraRendering; } private void OnEndCameraRendering(ScriptableRenderContext ctx, Camera cam) { if (_shapes.Count != 0) { DrawShapes(overlay: false, lineMaterialNormal); DrawShapes(overlay: true, lineMaterialOverlay); } } public static void DrawRay(Vector3 from, Vector3 dir, Color color, float duration = 0f, bool alwaysOnTop = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_instance == (Object)null) { CreateInstance(); } _instance._shapes.Add(new RayShape(from, dir, color, duration, alwaysOnTop)); } public static void DrawSphere(Vector3 pos, float radius, Color color, float duration = 0f, bool alwaysOnTop = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_instance == (Object)null) { CreateInstance(); } _instance._shapes.Add(new SphereShape(pos, radius, color, duration, alwaysOnTop)); } public static void DrawLine(Vector3 from, Vector3 to, Color color, float duration = 0f, bool alwaysOnTop = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_instance == (Object)null) { CreateInstance(); } _instance._shapes.Add(new LineShape(from, to, color, duration, alwaysOnTop)); } public static void DrawBox(Vector3 center, Vector3 size, Color color, float duration = 0f, bool alwaysOnTop = false) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) DrawBox(center, size, Quaternion.identity, color, duration, alwaysOnTop); } public static void DrawBox(Vector3 center, Vector3 size, Quaternion rotation, Color color, float duration = 0f, bool alwaysOnTop = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_instance == (Object)null) { CreateInstance(); } _instance._shapes.Add(new BoxShape(center, size, rotation, color, duration, alwaysOnTop)); } public static void DrawMeshCollider(MeshCollider collider, Color color, float duration = 0f, bool alwaysOnTop = false) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)collider == (Object)null) && !((Object)(object)collider.sharedMesh == (Object)null)) { if ((Object)(object)_instance == (Object)null) { CreateInstance(); } _instance._shapes.Add(new MeshShape(collider.sharedMesh, ((Component)collider).transform, color, duration, alwaysOnTop)); } } private static void CreateInstance() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) _instance = new GameObject("TCCN_DebugVisualiser") { hideFlags = (HideFlags)61 }.AddComponent<DebugVisualiser>(); } private void DrawShapes(bool overlay, Material mat) { mat.SetPass(0); GL.Begin(1); for (int num = _shapes.Count - 1; num >= 0; num--) { if (_shapes[num].Expired) { _shapes.RemoveAt(num); } else if (_shapes[num].alwaysOnTop == overlay) { _shapes[num].Draw(); } } GL.End(); } } public static class GizmoUtils { public class RendererMaterialCache { public Renderer Renderer; public Material[] OriginalMaterials; public Material OverlayMaterial; } internal static Shader SelectionOverlayShader; public static void TryDrawGizmos(Transform target, Component component) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) if (component is PropSpawner) { PropSpawner val = (PropSpawner)component; DrawPropSpawnerGizmos(component.transform, val.area, val.rayLength, val.rayNearCutoff); } else if (component is PropSpawner_Line) { PropSpawner_Line val2 = (PropSpawner_Line)component; Vector3 to = ((Component)val2).transform.position + val2.height * 0.5f * ((Component)val2).transform.up; DebugVisualiser.DrawLine(((Component)val2).transform.position - val2.height * 0.5f * ((Component)val2).transform.up, to, Color.white); } else if (component is PropSpawner_Sphere) { PropSpawner_Sphere val3 = (PropSpawner_Sphere)component; DebugVisualiser.DrawSphere(((Component)val3).transform.position, val3.rayLength, Color.white); } else if (component is SpecialDayZone) { SpecialDayZone val4 = (SpecialDayZone)component; DebugVisualiser.DrawBox(((Component)val4).transform.position, ((Bounds)(ref val4.bounds)).size, Color.white); } } public static void TryDrawOverlays(Transform target) { } public static void TryRestoreMaterials() { } public static void DrawPropSpawnerGizmos(Transform target, Vector2 area, float rayLength, float rayNearCutoff) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) Vector3 val = target.position + area.y * 0.5f * target.up; Vector3 val2 = target.position - area.y * 0.5f * target.up; Vector3 val3 = target.position - area.x * 0.5f * target.right; Vector3 val4 = target.position + area.x * 0.5f * target.right; DebugVisualiser.DrawLine(val2, val, Color.white); DebugVisualiser.DrawLine(val3, val4, Color.white); DebugVisualiser.DrawLine(val2, val2 + target.forward * rayLength + target.forward * rayNearCutoff, Color.green); DebugVisualiser.DrawLine(val, val + target.forward * rayLength + target.forward * rayNearCutoff, Color.green); DebugVisualiser.DrawLine(val3, val3 + target.forward * rayLength + target.forward * rayNearCutoff, Color.green); DebugVisualiser.DrawLine(val4, val4 + target.forward * rayLength + target.forward * rayNearCutoff, Color.green); DebugVisualiser.DrawBox(target.position + target.forward * rayLength / 2f, Vector3.one, target.rotation, Color.green); DebugVisualiser.DrawLine(val2, val2 + target.forward * rayNearCutoff, Color.red); DebugVisualiser.DrawLine(val3, val3 + target.forward * rayNearCutoff, Color.red); DebugVisualiser.DrawLine(val, val + target.forward * rayNearCutoff, Color.red); DebugVisualiser.DrawLine(val4, val4 + target.forward * rayNearCutoff, Color.red); } public static List<Renderer> GetRenderersFromObject(GameObject target) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) List<Renderer> list = new List<Renderer>(); LODGroup[] componentsInChildren = target.GetComponentsInChildren<LODGroup>(true); if (componentsInChildren != null && componentsInChildren.Length != 0) { LODGroup[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { LOD[] lODs = array[i].GetLODs(); for (int j = 0; j < lODs.Length; j++) { Renderer[] renderers = lODs[j].renderers; foreach (Renderer val in renderers) { if (!((Object)(object)val == (Object)null)) { list.Add(val); } } } } return list; } return target.GetComponentsInChildren<Renderer>(true).ToList(); } public static List<RendererMaterialCache> ApplyOverlayToRenderers(List<Renderer> renderers) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown List<RendererMaterialCache> list = new List<RendererMaterialCache>(); foreach (Renderer renderer in renderers) { Material[] sharedMaterials = renderer.sharedMaterials; Material val = new Material(SelectionOverlayShader); list.Add(new RendererMaterialCache { Renderer = renderer, OriginalMaterials = sharedMaterials, OverlayMaterial = val }); Material[] array = (Material[])(object)new Material[sharedMaterials.Length + 1]; Array.Copy(sharedMaterials, array, sharedMaterials.Length); array[^1] = val; renderer.sharedMaterials = array; } return list; } public static List<RendererMaterialCache> ApplyOverlayToRenderers(Renderer[] renderers) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown List<RendererMaterialCache> list = new List<RendererMaterialCache>(); foreach (Renderer val in renderers) { Material[] sharedMaterials = val.sharedMaterials; Material val2 = new Material(SelectionOverlayShader); list.Add(new RendererMaterialCache { Renderer = val, OriginalMaterials = sharedMaterials, OverlayMaterial = val2 }); Material[] array = (Material[])(object)new Material[sharedMaterials.Length + 1]; Array.Copy(sharedMaterials, array, sharedMaterials.Length); array[^1] = val2; val.sharedMaterials = array; } return list; } public static void RestoreRendererMaterials(List<RendererMaterialCache> rendererCache) { foreach (RendererMaterialCache item in rendererCache) { if (!((Object)(object)item.Renderer == (Object)null)) { item.Renderer.sharedMaterials = item.OriginalMaterials; if ((Object)(object)item.OverlayMaterial != (Object)null) { Object.Destroy((Object)(object)item.OverlayMaterial); } } } rendererCache.Clear(); } } public static class NetworkUtils { public static byte[] CompressBrotli(byte[] data) { using MemoryStream memoryStream = new MemoryStream(); using (BrotliStream brotliStream = new BrotliStream(memoryStream, CompressionLevel.Optimal)) { brotliStream.Write(data, 0, data.Length); } return memoryStream.ToArray(); } public static byte[] DecompressBrotli(byte[] compressed) { using MemoryStream stream = new MemoryStream(compressed); using BrotliStream brotliStream = new BrotliStream(stream, CompressionMode.Decompress); using MemoryStream memoryStream = new MemoryStream(); brotliStream.CopyTo(memoryStream); return memoryStream.ToArray(); } public static byte[] SerializeMapSyncData(MapSerializer.MapSyncData data) { string s = JsonConvert.SerializeObject((object)data); return Encoding.UTF8.GetBytes(s); } public static MapSerializer.MapSyncData DeserializeMapSyncData(byte[] bytes) { return JsonConvert.DeserializeObject<MapSerializer.MapSyncData>(Encoding.UTF8.GetString(bytes)); } public static byte[] CompressMapSyncData(MapSerializer.MapSyncData data) { return CompressBrotli(SerializeMapSyncData(data)); } public static MapSerializer.MapSyncData DecompressMapSyncData(byte[] compressed) { return DeserializeMapSyncData(DecompressBrotli(compressed)); } public static void SetMapDataRoomProperty(MapSerializer.MapSyncData mapSyncData) { byte[] array = CompressMapSyncData(mapSyncData); double num = (double)array.Length / 1048576.0; Debug.Log((object)$"Compressed MapSyncData Size: {num:F2} MB"); NetworkManager.SetRoomProperty("mapData", array); } } } namespace TerrainCustomiserCN.UI { public static class ContextMenu { private static Type[] types; public static void GetTypes(Type type) { types = GetConcreteDerivedTypes(type); } public static void CreateMenu(IList list, Type type) { if (!ImGui.BeginPopupContextItem("WidgetContextMenu")) { return; } for (int i = 0; i < types.Length; i++) { Type type2 = types[i]; if (ImGui.Selectable(DisplayNameTranslator.TypeName(type2, "ContextMenu") + "##" + type2.FullName)) { object value = Activator.CreateInstance(type2); list.Add(value); types = null; break; } } ImGui.EndPopup(); } private static Type[] GetConcreteDerivedTypes(Type baseType) { return (from t in AppDomain.CurrentDomain.GetAssemblies().SelectMany((Assembly a) => a.GetTypes()) where baseType.IsAssignableFrom(t) && !t.IsAbstract && !t.IsInterface select t).ToArray(); } } public enum TranslationKind { Ui, Field, Type, Enum, Dynamic } public readonly struct MissingTranslation { public TranslationKind Kind { get; } public string Key { get; } public string Source { get; } public MissingTranslation(TranslationKind kind, string key, string source) { Kind = kind; Key = key; Source = source ?? string.Empty; } } public static class DisplayNameTranslator { private static readonly Dictionary<string, string> UiNames = new Dictionary<string, string>(StringComparer.Ordinal) { { "Editor", "编辑器" }, { "Inspector", "检查器" }, { "Resource", "资源" }, { "GodCam Settings", "自由相机设置" }, { "Generate", "生成" }, { "Save", "保存" }, { "Load", "加载" }, { "Cam", "相机" }, { "Gizmo", "辅助线" }, { "Name", "名称" }, { "Value", "值" }, { "Type", "类型" }, { "Buttons", "按钮" }, { "Swap", "切换" }, { "Create", "创建" }, { "Delete", "删除" }, { "Remove", "移除" }, { "Add", "添加" }, { "Change", "更改" }, { "None", "无" }, { "No custom variant.", "没有自定义变体。" }, { "Create Spawner", "创建生成器" }, { "Create Grouper", "创建分组器" }, { "Duplicate", "复制" }, { "Rename", "重命名" }, { "Cancel", "取消" }, { "Apply", "应用" }, { "Select", "选择" }, { "Filter", "筛选" } }; private static readonly Dictionary<string, string> FieldNames = new Dictionary<string, string>(StringComparer.Ordinal) { { "area", "范围" }, { "rayDirectionOffset", "射线偏移" }, { "rayLength", "射线长度" }, { "rayNearCutoff", "近裁" }, { "raycastPosition", "射线位置" }, { "rayCastSpawn", "射线生成" }, { "nrOfSpawns", "数量" }, { "randomSpawns", "随机" }, { "minSpawnCount", "最少" }, { "chanceToUseSpawner", "概率" }, { "spawnChance", "概率" }, { "currentSpawns", "当前" }, { "props", "物件" }, { "syncTransforms", "同步" }, { "layerType", "层类型" }, { "LayerType", "层类型" }, { "modifiers", "修改器" }, { "constraints", "条件" }, { "postConstraints", "后置条件" }, { "postSpawnBehaviors", "生成后行为" }, { "height", "高度" }, { "timing", "时机" }, { "parents", "父级" }, { "mat", "材质" }, { "bounds", "范围" }, { "outerBounds", "外范围" }, { "blendSize", "混合" }, { "inBounds", "范围内" }, { "overrideSun", "覆盖日光" }, { "daylLightIntensity", "日间光强" }, { "nightLightIntensity", "夜间光强" }, { "specialSunColor", "日光色" }, { "useCustomSun", "自定义光源" }, { "specialLight", "光源" }, { "useCustomColorVals", "自定义颜色" }, { "specialTopColor", "顶色" }, { "specialMidColor", "中色" }, { "specialBottomColor", "底色" }, { "globalShaderVals", "着色值" }, { "overrideFog", "改雾" }, { "fogDensity", "雾密度" }, { "treePlatformParent", "树平台" }, { "localStart", "起点" }, { "localEnd", "终点" }, { "bannedMaterial", "禁材质" }, { "circleSize", "圆尺寸" }, { "inverted", "反转" }, { "invert", "反转" }, { "RaycastDistance", "射线距离" }, { "DesiredResult", "期望" }, { "maxHeight", "最高" }, { "minHeight", "最低" }, { "radius", "半径" }, { "objects", "对象" }, { "minAngle", "最小角" }, { "maxAngle", "最大角" }, { "perlinSize", "噪声尺寸" }, { "perlinOffset", "噪声偏移" }, { "minMax", "最小最大" }, { "RequiredMaterial", "需材质" }, { "minDistance", "最小距离" }, { "findAllSpawners", "全生成器" }, { "axisMultipliers", "轴倍率" }, { "effectedLayers", "影响层" }, { "whitelistedTagWords", "白名单词" }, { "blacklistedTagWords", "黑名单词" }, { "onePerPlayer", "每人一个" }, { "destroyAllIfLessThan", "少于销毁" }, { "customColor", "自定义颜色" }, { "color", "颜色" }, { "customIntensity", "自强度" }, { "intensity", "强度" }, { "offset", "偏移" }, { "minEffect", "最小效果" }, { "maxEffect", "最大效果" }, { "randomPow", "随机幂" }, { "minOffset", "最小偏" }, { "maxOffset", "最大偏" }, { "xMult", "X倍" }, { "yMult", "Y倍" }, { "zMult", "Z倍" }, { "maxScaleMult", "最大缩" }, { "minScaleMult", "最小缩" }, { "minRotation", "最小旋" }, { "maxRotation", "最大旋" }, { "snapToIncrement", "吸附步" }, { "increment", "步长" }, { "replaceThis", "替换项" }, { "withThis", "替换为" }, { "childName", "子名" }, { "edits", "编辑" }, { "mats", "材质组" }, { "flipNormal", "翻法线" }, { "objToSpawn", "生成物" }, { "addRotation", "加旋转" }, { "eulerAngles", "欧拉角" }, { "random", "随机" }, { "eulerAnglesRandom", "随机角" }, { "blend", "混合" }, { "minUpLerp", "最小上插" }, { "maxUpLerp", "最大上插" }, { "spawnerTransform", "生成器变换" }, { "pos", "位置" }, { "normal", "法线" }, { "rayDir", "射线方向" }, { "hit", "命中" }, { "placement", "放置" }, { "spawnCount", "生成数" }, { "_deferredSteps", "延迟步骤" }, { "_hm", "高度图" }, { "_madeDummyData", "已创建虚拟数据" }, { "_propSpawnData", "物件生成数据" }, { "_timing", "时机" }, { "<spawnedProps>k__BackingField", "已生成物件" }, { "<ValidationState>k__BackingField", "验证状态" }, { "baseFog", "基础雾效" }, { "blockerObjects", "阻挡对象" }, { "blurIterations", "模糊迭代次数" }, { "blurRadius", "模糊半径" }, { "cellSize", "单元格尺寸" }, { "center", "中心" }, { "clampHeights", "限制高度" }, { "Deadzone", "死区" }, { "drawRayGizmos", "绘制射线辅助线" }, { "drawSamplePoints", "绘制采样点" }, { "enterenceObjects", "入口对象" }, { "enterences", "入口" }, { "heightOffset", "高度偏移" }, { "inside", "内部" }, { "layerMask", "层遮罩" }, { "maxRaycastLength", "最大射线长度" }, { "minBadEffects", "最少负面效果" }, { "minGoodEffects", "最少正面效果" }, { "minMaxSpawn", "最小最大生成数" }, { "mushroomEffects", "蘑菇效果" }, { "mushroomStamAmt", "蘑菇耐力量" }, { "mute", "静音" }, { "outVal", "输出值" }, { "overallSpawnChance", "总生成概率" }, { "perlinAmount", "噪声强度" }, { "perlinScale", "噪声缩放" }, { "postPerlinAmount", "后置噪声强度" }, { "postPerlinScale", "后置噪声缩放" }, { "requiredParents", "所需父级" }, { "resolution", "分辨率" }, { "returnVal", "返回值" }, { "scaleMinMax", "最小最大缩放" }, { "Segment", "区段" }, { "spawnedObjects", "已生成对象" }, { "spawnPoints", "生成点" }, { "triggerInteraction", "触发器交互" }, { "ValidateAfterwards", "随后验证" }, { "validationConstraints", "验证条件" } }; private static readonly Dictionary<string, string> TypeNames = new Dictionary<string, string>(StringComparer.Ordinal) { { "Transform", "变换" }, { "PropSpawner", "生成器" }, { "PropSpawner_Line", "线性生成器" }, { "PropSpawner_Sphere", "球形生成器" }, { "PropGrouper", "分组器" }, { "RockMaterialSwapper", "岩石材质替换器" }, { "SpecialDayZone", "特殊区域" }, { "PropSpawnerMod", "生成修改" }, { "PropSpawnerConstraint", "生成条件" }, { "PropSpawnerConstraintPost", "后置条件" }, { "PostSpawnBehavior", "生成后行为" }, { "PSB_ChildSpawners", "子生成器" }, { "PSC_BannedMaterial", "禁材质" }, { "PSC_CircleMask", "圆遮罩" }, { "PSC_Embedded", "嵌入检测" }, { "PSC_Height", "高度条件" }, { "PSC_LineCheck", "射线检测" }, { "PSC_NearObject", "近对象" }, { "PSC_Normal", "法线条件" }, { "PSC_Perlin", "噪声条件" }, { "PSC_RequiredMaterial", "需材质" }, { "PSC_SameTypeDistance", "同类距离" }, { "PSC_SurfaceRestrictions", "表面限制" }, { "PSC_VolumeLight", "体积光" }, { "PSM_AddPlayerCountBasedDespawner", "人数销毁" }, { "PSM_BakedVolumeLightModiferIntensity", "烘焙光强" }, { "PSM_BlastVine", "爆炸藤" }, { "PSM_ChildSpawners", "子生成器" }, { "PSM_LocalOffset", "本地偏移" }, { "PSM_NormalOffset", "法线偏移" }, { "PSM_PitonNormal", "岩钉法线" }, { "PSM_PlacementOffset", "放置偏移" }, { "PSM_RandomOffset", "随机偏移" }, { "PSM_RandomRotation", "随机旋转" }, { "PSM_RandomScale", "随机缩放" }, { "PSM_RayDirectionOffset", "射向偏移" }, { "PSM_ReplaceMaterial", "替换材质" }, { "PSM_ReplaceMaterialWithRayTargetMaterial", "用命中材质替换" }, { "PSM_SetForwardRotationToNormal", "前向对法线" }, { "PSM_SetMaterial", "设材质" }, { "PSM_SetMaterialOnChild", "设子材质" }, { "PSM_SetMaterialsOnChild", "设子材质组" }, { "PSM_SetRandomMaterial", "随机材质" }, { "PSM_SetSpawnerPlayerCountRequirement", "人数需求" }, { "PSM_SetUpRotationToNormal", "上向对法线" }, { "PSM_SingleItemSpawner", "单物品生成" }, { "PSM_SpecificRotation", "指定旋转" }, { "PSM_UpLerp", "上向插值" }, { "Campfire_Set_Segment", "营火区段设置" }, { "DecorSpawner", "装饰生成器" }, { "DesertRockSpawner", "沙漠岩石生成器" }, { "MushroomManager", "蘑菇管理器" }, { "PropDeleter", "物件删除器" }, { "PSCP_ConnectTreePlatforms", "连接树平台" }, { "PSCP_Custom", "自定义后置条件" }, { "PSCP_LineCheck", "后置射线检测" }, { "SwampMeshGen", "沼泽网格生成器" } }; private static readonly Dictionary<string, string> EnumNames = new Dictionary<string, string>(StringComparer.Ordinal) { { "HelperFunctions+LayerType.AllPhysical", "全实体" }, { "HelperFunctions+LayerType.TerrainMap", "地形图" }, { "HelperFunctions+LayerType.Terrain", "地形" }, { "HelperFunctions+LayerType.Map", "地图" }, { "HelperFunctions+LayerType.Default", "默认" }, { "HelperFunctions+LayerType.AllPhysicalExceptCharacter", "全实体非角色" }, { "HelperFunctions+LayerType.CharacterAndDefault", "角色+默认" }, { "HelperFunctions+LayerType.AllPhysicalExceptDefault", "全实体非默认" }, { "PropGrouper+PropGrouperTiming.Early", "早" }, { "PropGrouper+PropGrouperTiming.Late", "晚" }, { "TerrainCustomiserCN.UI.WidgetFactory+WidgetMode.Default", "默认" }, { "TerrainCustomiserCN.UI.WidgetFactory+WidgetMode.Disabled", "禁用" }, { "TerrainCustomiserCN.UI.WidgetFactory+WidgetMode.Hidden", "隐藏" }, { "TerrainCustomiserCN.UI.WidgetFactory+FieldLayout.Inline", "行内" }, { "TerrainCustomiserCN.UI.WidgetFactory+FieldLayout.Full", "完整" }, { "DeferredStepTiming.None", "无" }, { "DeferredStepTiming.AfterCurrentStep", "当前步骤后" }, { "DeferredStepTiming.AfterCurrentGroupTiming", "当前分组时机后" }, { "DeferredStepTiming.AfterDone", "完成后" }, { "Peak.ProcGen.ValidationState.Unknown", "未知" }, { "Peak.ProcGen.ValidationState.Passed", "通过" }, { "Peak.ProcGen.ValidationState.Failed", "失败" }, { "Segment.Alpine", "雪山" }, { "Segment.Beach", "海滩" }, { "Segment.Caldera", "火山" }, { "Segment.Peak", "顶峰" }, { "Segment.TheKiln", "熔炉" }, { "Segment.Tropics", "雨林" }, { "UnityEngine.QueryTriggerInteraction.UseGlobal", "使用全局设置" }, { "UnityEngine.QueryTriggerInteraction.Ignore", "忽略触发器" }, { "UnityEngine.QueryTriggerInteraction.Collide", "碰撞触发器" } }; private static readonly Dictionary<string, string> DynamicNames = new Dictionary<string, string>(StringComparer.Ordinal) { { "Alpine", "雪山" }, { "Beach", "海滩" }, { "Tropics", "雨林" }, { "Volcano", "火山" }, { "Mesa", "方山" }, { "Roots", "森蕈" }, { "Caldera", "火山" }, { "Peak", "顶峰" }, { "The Kiln", "熔炉" }, { "CULLER", "剔除器" }, { "Edges", "边缘" }, { "Eggs", "蛋" }, { "Mid", "中" }, { "Middle", "中间" }, { "Airplane Food", "飞机餐" }, { "AloeVera", "芦荟" }, { "AncientIdol", "古老玩偶" }, { "Antidote", "解毒剂" }, { "Anti-Rope Spool", "反重绳索" }, { "Apple Berry Green", "绿脆莓" }, { "Apple Berry Red", "红脆莓" }, { "Apple Berry Yellow", "黄脆莓" }, { "Backpack", "背包" }, { "Balloon", "气球" }, { "BalloonBunch", "一束气球" }, { "Bandages", "绷带" }, { "Basketball", "篮球" }, { "Beehive", "蜂巢" }, { "Berrynana Blue", "蓝莓蕉" }, { "Berrynana Brown", "棕莓蕉" }, { "Berrynana Peel Blue Variant", "莓蕉皮" }, { "Berrynana Peel Brown Variant", "莓蕉皮" }, { "Berrynana Peel Pink Variant", "莓蕉皮" }, { "Berrynana Peel Yellow", "莓蕉皮" }, { "Berrynana Pink", "粉莓蕉" }, { "Berrynana Yellow", "黄莓蕉" }, { "BingBong", "宾邦" }, { "BingBong_Prop Variant", "宾邦" }, { "Binoculars", "望远镜" }, { "Binoculars_Prop", "望远镜" }, { "BookOfBones", "骸骨之书" }, { "BounceShroom", "弹力菇" }, { "Bugfix", "蜱虫" }, { "Bugle", "喇叭" }, { "Bugle_Magic", "友谊喇叭" }, { "Bugle_Prop Variant", "喇叭" }, { "Bugle_Scoutmaster Variant", "童军领队的喇叭" }, { "C_Bishop B", "主教" }, { "C_Bishop W", "主教" }, { "C_Bishop_f", "青荔莓" }, { "C_Bishop_f Variant", "主教" }, { "C_Bishop_m", "青荔莓" }, { "C_Bishop_m Variant", "青荔莓" }, { "C_King", "青荔莓" }, { "C_King B", "国王" }, { "C_King Variant", "国王" }, { "C_King W", "国王" }, { "C_Knight", "青荔莓" }, { "C_Knight B", "骑士" }, { "C_Knight Variant", "骑士" }, { "C_Knight W", "骑士" }, { "C_Pawn B", "兵卒" }, { "C_Pawn W", "兵卒" }, { "C_Pawn_f", "青荔莓" }, { "C_Pawn_f Variant", "青荔莓" }, { "C_Pawn_m", "青荔莓" }, { "C_Pawn_m Variant", "兵卒" }, { "C_Queen", "青荔莓" }, { "C_Queen B", "皇后" }, { "C_Queen Variant", "皇后" }, { "C_Queen W", "皇后" }, { "C_Rook B", "战车" }, { "C_Rook W", "战车" }, { "C_Rook_f", "青荔莓" }, { "C_Rook_f Variant", "青荔莓" }, { "C_Rook_m", "青荔莓" }, { "C_Rook_m Variant", "战车" }, { "CactusBall", "仙人球" }, { "ChainShootable", "锁链" }, { "ChainShooter", "锁链发射器" }, { "ClimbingSpike", "岩钉" }, { "ClimbingSpikeHammered", "岩钉" }, { "CloudFungus", "云雾菇" }, { "Clusterberry Black", "黑葚莓" }, { "Clusterberry Red", "红葚莓" }, { "Clusterberry Yellow", "黄葚莓" }, { "Clusterberry_UNUSED", "青葚莓" }, { "Compass", "罗盘" }, { "Cure-All", "万灵药" }, { "Cursed Skull", "诅咒头骨" }, { "Dynamite", "炸药" }, { "Egg", "煎蛋" }, { "EggTurkey", "“鸟”" }, { "Energy Drink", "能量饮料" }, { "FireWood", "棍子" }, { "FirstAidKit", "急救箱" }, { "Flag_Plantable_Checkpoint", "检查点旗标" }, { "Flare", "照明棒" }, { "FortifiedMilk", "奶白金" }, { "FortifiedMilk_TEMP", "青荔莓" }, { "Frisbee", "飞盘" }, { "Glizzy", "热狗肠" }, { "Granola Bar", "燕麦棒" }, { "Guidebook", "旅行指南" }, { "GuidebookPage", "撕下的书页" }, { "GuidebookPage_0_Intro", "撕下的书页" }, { "GuidebookPage_1_Mushrooms", "撕下的书页" }, { "GuidebookPage_2_Campfire", "撕下的书页" }, { "GuidebookPage_3_Revival", "撕下的书页" }, { "GuidebookPage_4_BodyHeat Variant", "撕下的书页" }, { "GuidebookPage_5_Sleepy Variant", "撕下的书页" }, { "GuidebookPage_6_Awake Variant", "撕下的书页" }, { "GuidebookPage_7_Crashout Variant", "撕下的书页" }, { "GuidebookPage_8_FirstTeams", "撕下的书页" }, { "GuidebookPageScroll Variant", "卷轴" }, { "HealingDart Variant", "吹箭筒" }, { "HealingPuffShroom", "灵药菇" }, { "Heat Pack", "暖宝宝" }, { "Item_Coconut", "椰子" }, { "Item_Coconut_half", "半边椰子" }, { "Item_Honeycomb", "蜂巢蜜" }, { "Kingberry Green", "青荔莓" }, { "Kingberry Purple", "紫荔莓" }, { "Kingberry Yellow", "黄荔莓" }, { "Lantern", "提灯" }, { "Lantern_Faerie", "仙子提灯" }, { "Lollipop", "大棒棒糖" }, { "Lollipop_Prop", "大棒棒糖" }, { "MagicBean", "魔豆" }, { "Mandrake", "曼德拉草" }, { "Mandrake_Hidden", "药用根茎" }, { "Marshmallow", "棉花糖" }, { "MedicinalRoot", "药用根茎" }, { "Megaphone", "扩音器" }, { "Mushroom Chubby", "梨鲍菇" }, { "Mushroom Cluster", "银针菇" }, { "Mushroom Cluster Poison", "银针菇" }, { "Mushroom Glow", "诡异菇" }, { "Mushroom Lace", "喇叭菇" }, { "Mushroom Lace Poison", "喇叭菇" }, { "Mushroom Normie", "馒头菇" }, { "Mushroom Normie Poison", "馒头菇" }, { "Napberry", "晚安莓" }, { "NestEgg", "好大蛋" }, { "PandorasBox", "潘多拉餐盒" }, { "Parasol", "太阳伞" }, { "Parasol_Roots Variant", "太阳伞" }, { "Passport", "护照" }, { "Pepper Berry", "火烧莓" }, { "Pirate Compass", "海盗罗盘" }, { "PortableStovetop_Placed", "便携火炉" }, { "PortableStovetopItem", "便携火炉" }, { "Prickleberry_Gold", "金刺莓" }, { "Prickleberry_Red", "红刺莓" }, { "RemoteRopeSegment Variant", "绳索" }, { "RemoteRopeSegmentAntiRope", "反重绳索" }, { "RescueHook", "救援抓钩" }, { "RescueHook_Infinite", "救援抓钩" }, { "RopeSegment", "绳索" }, { "RopeSegmentInverted", "反重绳索" }, { "RopeShooter", "绳索炮" }, { "RopeShooterAnti", "反重绳索炮" }, { "RopeSpool", "绳索" }, { "Scorpion", "蝎子" }, { "ScoutCannonItem", "童子军大炮" }, { "ScoutCookies", "童军饼干" }, { "ScoutCookies_Vanilla", "童军饼干" }, { "ScoutEffigy", "童军雕像" }, { "ShelfShroom", "踏板菇" }, { "Shell Big", "海螺" }, { "Shroomberry_Blue", "蓝菇莓" }, { "Shroomberry_Green", "绿菇莓" }, { "Shroomberry_Purple", "紫菇莓" }, { "Shroomberry_Red", "红菇莓" }, { "Shroomberry_Yellow", "黄菇莓" }, { "Snowball", "雪球" }, { "Sports Drink", "运动饮料" }, { "Stone", "石头" }, { "Strange Gem", "奇怪水晶" }, { "Sunscreen", "防晒喷雾" }, { "Torch", "火炬" }, { "TrailMix", "混合坚果" }, { "Warp Compass", "曲迁罗盘" }, { "Winterberry Orange", "橙雪莓" }, { "Winterberry Yellow", "黄雪莓" }, { "Biome_1", "生物群系 1" }, { "Biome_2", "生物群系 2" }, { "Biome_3", "生物群系 3" }, { "Biome_4", "生物群系 4" }, { "Beach_Segment", "海滩区段" }, { "Caldera_Segment", "火山口区段" }, { "Desert_Segment", "沙漠区段" }, { "Jungle_Segment", "丛林区段" }, { "Roots Segment", "根系区段" }, { "Snow_Segment", "雪地区段" }, { "Volcano_Segment", "火山区段" }, { "Custom", "自定义" }, { "Default", "默认" }, { "Spiky", "尖刺" }, { "NoVariant", "无变体" }, { "BlackSand", "黑沙" }, { "BlueBeach", "蓝色海滩" }, { "Bombs", "炸弹" }, { "CactusForest", "仙人掌森林" }, { "CacusHell", "仙人掌地狱" }, { "DynamiteHell", "炸药地狱" }, { "GeyserHell", "间歇泉地狱" }, { "Ivy", "藤蔓" }, { "JellyHell", "水母地狱" }, { "Lava", "熔岩" }, { "Pillars", "石柱" }, { "RedBeach", "红色海滩" }, { "ScorpionsHell", "蝎子地狱" }, { "SkyJungle", "天空丛林" }, { "SnakeBeach", "蛇海滩" }, { "Thorny", "荆棘" }, { "TornadoHell", "龙卷风地狱" }, { "TumblerHell", "翻滚草地狱" }, { "- Bomb Beetle Variant", "炸弹甲虫变体" }, { "- Cave Mania Variant", "洞穴狂热变体" }, { "- Deep Water variant", "深水变体" }, { "- Redwood Clearcut Variant", "红木清伐变体" }, { "- Redwoods Default Variant", "红木默认变体" }, { "- redwoods deep woods Variant", "红木深林变体" } }; private static readonly Dictionary<string, string> DynamicNameTokens = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) { { "Aid", "急救" }, { "Airplane", "飞机" }, { "Aleo", "芦荟" }, { "All", "全部" }, { "Aloe", "芦荟" }, { "Anchor", "锚点" }, { "Ancient", "远古" }, { "Ant", "蚂蚁" }, { "Anti", "反向" }, { "Antidote", "解毒剂" }, { "Antigrav", "反重力" }, { "Antlion", "蚁狮" }, { "Apple", "苹果" }, { "Awake", "清醒" }, { "Axe", "斧" }, { "B", "黑" }, { "Backpack", "背包" }, { "Badge", "徽章" }, { "Badges", "徽章" }, { "Ball", "球" }, { "Balloon", "气球" }, { "Balls", "球" }, { "Banana", "香蕉" }, { "Bandages", "绷带" }, { "Bar", "棒" }, { "Basalt", "玄武岩" }, { "Bassalt", "玄武岩" }, { "Base", "基础" }, { "Basic", "基础" }, { "Basketball", "篮球" }, { "Beach", "海滩" }, { "Bean", "豆" }, { "Bee", "蜜蜂" }, { "Beehive", "蜂巢" }, { "Beetle", "甲虫" }, { "Beetles", "甲虫" }, { "Behive", "蜂巢" }, { "Berries", "浆果" }, { "Berry", "浆果" }, { "berrybush", "浆果灌木" }, { "Berrynana", "莓蕉" }, { "Big", "大型" }, { "Bing", "宾" }, { "Binoc", "双筒镜" }, { "Binoculars", "双筒望远镜" }, { "Bishop", "主教" }, { "Black", "黑色" }, { "Bl", "黑" }, { "Blind", "致盲" }, { "Blue", "蓝色" }, { "Body", "体温" }, { "Bones", "骨头" }, { "Bong", "邦" }, { "Book", "书" }, { "Bot", "机器人" }, { "Bounce", "弹跳" }, { "Box", "盒子" }, { "Bridge", "桥" }, { "Bridges", "桥" }, { "Brown", "棕色" }, { "Bugfix", "修复" }, { "Bugle", "号角" }, { "Bunch", "束" }, { "Bush", "灌木" }, { "Bushes", "灌木" }, { "C", "棋子" }, { "Cactus", "仙人掌" }, { "Campfire", "营火" }, { "Cannon", "炮" }, { "Canyon", "峡谷" }, { "Cave", "洞穴" }, { "Caves", "洞穴" }, { "Cell", "单元格" }, { "Chain", "链条" }, { "Chalk", "粉笔" }, { "Character", "角色" }, { "Cheat", "作弊" }, { "Checkpoint", "检查点" }, { "Chest", "箱子" }, { "Chubby", "胖" }, { "Cliff", "峭壁" }, { "Climbing", "攀爬" }, { "Cloud", "云" }, { "Cluster", "簇" }, { "Clusterberry", "簇生莓" }, { "Clusters", "簇" }, { "Coconut", "椰子" }, { "Cold", "寒冷" }, { "Collection", "集合" }, { "Column", "柱" }, { "Compass", "指南针" }, { "Conclusion", "结语" }, { "Connecting", "连接" }, { "Console", "控制台" }, { "Cookies", "饼干" }, { "Crashout", "崩溃" }, { "Crook", "弯曲" }, { "Cure", "治疗" }, { "Cursed", "诅咒" }, { "Custom", "自定义" }, { "Dart", "飞镖" }, { "Dead", "枯死" }, { "Dedication", "题献" }, { "Deep", "深" }, { "Default", "默认" }, { "Desert", "沙漠" }, { "Destroyer", "销毁器" }, { "Dolo", "多洛" }, { "Dome", "圆顶" }, { "Driftwood", "浮木" }, { "Drink", "饮料" }, { "DROPDOWN", "下拉框" }, { "Dropper", "投放器" }, { "Dry", "干枯" }, { "Dynamic", "动态" }, { "Dynamite", "炸药" }, { "E", "东" }, { "Edge", "边缘" }, { "Effigy", "雕像" }, { "Egg", "蛋" }, { "Elixir", "药剂" }, { "End", "末端" }, { "Energy", "能量" }, { "ENUM", "枚举" }, { "Epic", "史诗" }, { "Erik", "埃里克" }, { "Eruption", "喷发" }, { "Evil", "邪恶" }, { "Explo", "爆炸" }, { "Explosion", "爆炸" }, { "f", "女" }, { "Fae", "仙灵" }, { "Faerie", "仙灵" }, { "Fake", "假" }, { "Fern", "蕨类" }, { "Ferns", "蕨类" }, { "Final", "最终" }, { "Fire", "火" }, { "First", "初级" }, { "Fixed", "固定" }, { "Flag", "旗帜" }, { "Flare", "信号弹" }, { "Flash", "闪光" }, { "Flat", "平坦" }, { "FLOAT", "浮点数" }, { "flower", "花" }, { "Food", "食物" }, { "Foot", "脚部" }, { "For", "用于" }, { "Forest", "森林" }, { "Fortified", "强化" }, { "Foundation", "基础" }, { "Friend", "队友" }, { "Frisbee", "飞盘" }, { "Fungus", "真菌" }, { "Funky", "奇异" }, { "Gem", "宝石" }, { "Geyser", "间歇泉" }, { "Geysers", "间歇泉" }, { "Giant", "巨型" }, { "Glizzy", "热狗" }, { "Glow", "发光" }, { "Gold", "金色" }, { "Granola", "格兰诺拉" }, { "Grass", "草" }, { "Green", "绿色" }, { "Guidebook", "指南书" }, { "Half", "半个" }, { "Hammered", "已敲入" }, { "Hand", "手" }, { "Hang", "悬挂" }, { "Hanging", "悬挂" }, { "Healing", "治疗" }, { "Heat", "热量" }, { "Helicopter", "直升机" }, { "Helping", "帮助" }, { "Hidden", "隐藏" }, { "High", "高" }, { "Hold", "抓点" }, { "Holow", "中空" }, { "Honeycomb", "蜂巢蜜" }, { "Hook", "钩" }, { "Horsetail", "木贼草" }, { "Hot", "热" }, { "Ice", "冰" }, { "Icicle", "冰锥" }, { "Identity", "标识" }, { "Idol", "神像" }, { "Impact", "冲击" }, { "Infinite", "无限" }, { "Injury", "伤害" }, { "Inner", "内部" }, { "INPUT", "输入" }, { "Inside", "内部" }, { "Internal", "内部" }, { "Intro", "介绍" }, { "Inverted", "反转" }, { "Item", "物品" }, { "Ivy", "藤蔓" }, { "Jellies", "水母" }, { "Jelly", "水母" }, { "Jellyfish", "水母" }, { "Jungle", "丛林" }, { "Kiln", "窑炉" }, { "King", "国王" }, { "Kingberry", "王莓" }, { "Kit", "套件" }, { "Knight", "骑士" }, { "Knockback", "击退" }, { "L", "左" }, { "Lace", "蕾丝" }, { "Lantern", "灯笼" }, { "Lava", "熔岩" }, { "Light", "光源" }, { "Lights", "光源" }, { "Lil", "小" }, { "Lion", "狮" }, { "List", "列表" }, { "Loading", "加载" }, { "Lollipop", "棒棒糖" }, { "Long", "长" }, { "Looker", "观察者" }, { "Low", "低" }, { "Luggage", "行李" }, { "m", "男" }, { "Magic", "魔法" }, { "Magma", "岩浆" }, { "Manager", "管理器" }, { "Mandrake", "曼德拉草" }, { "Marshmallow", "棉花糖" }, { "Massive", "巨大" }, { "Medicinal", "药用" }, { "Medium", "中型" }, { "Mega", "巨型" }, { "Megaphone", "扩音器" }, { "Milk", "牛奶" }, { "mineshaft", "矿井" }, { "Mineshafts", "矿井" }, { "Mini", "迷你" }, { "Mirage", "海市蜃楼" }, { "Mirrage", "海市蜃楼" }, { "Mix", "混合" }, { "Monstera", "龟背竹" }, { "Monsteras", "龟背竹" }, { "Moss", "苔藓" }, { "Movement", "移动" }, { "Mush", "蘑菇" }, { "Mushroom", "蘑菇" }, { "Mushrooms", "蘑菇" }, { "Nap", "睡眠" }, { "Napberry", "睡眠莓" }, { "Nest", "巢" }, { "Nice", "良性" }, { "No", "无" }, { "Normie", "普通" }, { "Oasis", "绿洲" }, { "Of", "的" }, { "Old", "旧" }, { "Only", "仅" }, { "Onsen", "温泉" }, { "Option", "选项" }, { "Orange", "橙色" }, { "Orb", "球体" }, { "Out", "外部" }, { "Outside", "外部" }, { "Overhang", "悬垂" }, { "Pack", "包" }, { "Page", "页面" }, { "Palm", "棕榈" }, { "Palms", "棕榈" }, { "Pandora", "潘多拉" }, { "Pandoras", "潘多拉" }, { "Parasol", "遮阳伞" }, { "Passed", "已通过" }, { "Passport", "护照" }, { "patch", "片" }, { "Pawn", "兵" }, { "Peel", "果皮" }, { "Pepper", "辣椒" }, { "Pick", "镐" }, { "Pile", "堆" }, { "Pillar", "石柱" }, { "Pine", "松树" }, { "Ping", "标记" }, { "Pink", "粉色" }, { "Pip", "状态点" }, { "Pirate", "海盗" }, { "Piton", "岩钉" }, { "Placed", "已放置" }, { "Plane", "飞机" }, { "Plant", "植物" }, { "Plantable", "可插旗" }, { "Planted", "已插旗" }, { "Plartform", "平台" }, { "Plat", "平台" }, { "Plateau", "高原" }, { "Platform", "平台" }, { "Platforms", "平台" }, { "Platteau", "高原" }, { "Player", "玩家" }, { "Point", "点" }, { "Poison", "毒" }, { "Pop", "爆开" }, { "Pops", "弹出物" }, { "Portable", "便携" }, { "Pre", "预置" }, { "Preface", "前言" }, { "Preview", "预览" }, { "Prickleberry", "刺莓" }, { "Prop", "物件" }, { "Props", "物件" }, { "Proxy", "代理" }, { "Puff", "喷雾" }, { "Purple", "紫色" }, { "Queen", "王后" }, { "R", "右" }, { "Red", "红色" }, { "Redwood", "红木" }, { "redwoods", "红木" }, { "Remote", "远程" }, { "Rescue", "救援" }, { "Respawn", "重生" }, { "Revival", "复活" }, { "Revived", "已复活" }, { "Ring", "环" }, { "Rings", "环" }, { "River", "河流" }, { "Rivers", "河流" }, { "Rock", "岩石" }, { "Rocks", "岩石" }, { "Rook", "车" }, { "Root", "根" }, { "Roots", "根系" }, { "Rope", "绳索" }, { "Ropes", "绳索" }, { "Round", "圆形" }, { "Rule", "规则" }, { "Safe", "安全" }, { "Scorpion", "蝎子" }, { "Scorpions", "蝎子" }, { "Scorps", "蝎子" }, { "Scout", "童子军" }, { "Scoutmaster", "童子军队长" }, { "Scream", "尖叫" }, { "Screen", "屏幕" }, { "Scroll", "卷轴" }, { "Sea", "海" }, { "Segment", "区段" }, { "Settings", "设置" }, { "SFX", "音效" }, { "Shaky", "摇晃" }, { "Shape", "形状" }, { "Sharp", "尖锐" }, { "Shelf", "架状" }, { "Shell", "贝壳" }, { "Shells", "贝壳" }, { "Shitty", "劣质" }, { "Shootable", "可射击" }, { "Shooter", "发射器" }, { "Short", "矮" }, { "Shroom", "蘑菇" }, { "Shroomberry", "蘑菇莓" }, { "Shrooms", "蘑菇" }, { "Shrub", "灌木" }, { "Side", "侧面" }, { "Simple", "简单" }, { "Single", "单个" }, { "Skull", "头骨" }, { "Sleepy", "困倦" }, { "Slippery", "湿滑" }, { "Small", "小型" }, { "Smoke", "烟雾" }, { "Snake", "蛇" }, { "Snow", "雪" }, { "Snowball", "雪球" }, { "Some", "部分" }, { "Sound", "声音" }, { "Spawn", "生成" }, { "Spawner", "生成器" }, { "Spawners", "生成器" }, { "Spawns", "生成点" }, { "Spider", "蜘蛛" }, { "Spiders", "蜘蛛" }, { "Spike", "尖刺" }, { "Spire", "尖塔" }, { "Spline", "样条" }, { "Spool", "线轴" }, { "Spore", "孢子" }, { "spores", "孢子" }, { "Sports", "运动" }, { "Stamina", "耐力" }, { "Start", "起点" }, { "Step", "步骤" }, { "Stone", "石头" }, { "Stovetop", "炉具" }, { "Strange", "奇异" }, { "Stumps", "树桩" }, { "Sunscreen", "防晒霜" }, { "Swarm", "蜂群" }, { "Tall", "高" }, { "TCCN", "TCCN" }, { "Teams", "队伍" }, { "TEMP", "临时" }, { "Thick", "粗" }, { "Thin", "细" }, { "Thorns", "荆棘" }, { "Timple", "神庙" }, { "Tiny", "微型" }, { "Title", "标题" }, { "Toggle", "切换" }, { "Torch", "火把" }, { "Tower", "塔" }, { "Tracking", "追踪" }, { "Trail", "混合包" }, { "Transform", "变换" }, { "Tree", "树" }, { "Trees", "树" }, { "Trunk", "树干" }, { "Tumble", "翻滚草" }, { "Tumblers", "翻滚草" }, { "tumbleweed", "翻滚草" }, { "Tunnels", "隧道" }, { "Turkey", "火鸡" }, { "UI", "界面" }, { "UNUSED", "未使用" }, { "Urch", "海胆" }, { "Urchins", "海胆" }, { "Use", "使用" }, { "Vanilla", "原味" }, { "Variant", "变体" }, { "Vera", "芦荟" }, { "VFX", "特效" }, { "Vine", "藤蔓" }, { "Vines", "藤蔓" }, { "W", "白" }, { "Wall", "墙面" }, { "Warp", "传送" }, { "Water", "水" }, { "Waterfall", "瀑布" }, { "Waterfalls", "瀑布" }, { "Web", "蛛网" }, { "Weed", "杂草" }, { "Wildflower", "野花" }, { "Willow", "柳树" }, { "Windows", "窗口" }, { "Winterberry", "冬莓" }, { "With", "带" }, { "Wonderberry", "奇异莓" }, { "Wood", "木头" }, { "Yellow", "黄色" }, { "Zombie", "僵尸" }, { "Atlas", "图集" }, { "Binggrae", "宾格瑞" }, { "Blink", "眨眼" }, { "Blowgun", "吹箭筒" }, { "Board", "面板" }, { "Boarding", "登机" }, { "Bold", "粗体" }, { "Check", "检查" }, { "Clouds", "云" }, { "Columns", "柱" }, { "Costume", "服装" }, { "CRAZK", "CRAZK" }, { "Crown", "王冠" }, { "Dark", "暗" }, { "Daruma", "达摩" }, { "Dear", "Dear" }, { "Decal", "贴花" }, { "Departure", "出发" }, { "Depth", "深度" }, { "Drop", "投放" }, { "Droplet", "水滴" }, { "Drowsy", "困倦" }, { "Extra", "特粗" }, { "Eye", "眼睛" }, { "Fade", "淡出" }, { "Feature", "特性" }, { "Fog", "雾" }, { "Font", "字体" }, { "Glass", "玻璃" }, { "Gothic", "哥特体" }, { "Graphs", "图" }, { "Gui", "界面" }, { "Heli", "直升机" }, { "Im", "Im" }, { "In", "内" }, { "Info", "信息" }, { "Jug", "壶" }, { "Kiosk", "自助终端" }, { "Liberation", "Liberation" }, { "Lit", "受光" }, { "Mask", "遮罩" }, { "Material", "材质" }, { "Member", "成员" }, { "Mesh", "网格" }, { "Mirror", "镜子" }, { "Montserrat", "蒙特塞拉特" }, { "Mountains", "群山" }, { "Nick", "昵称" }, { "Now", "当前" }, { "One", "一" }, { "Outline", "描边" }, { "Pangolin", "穿山甲" }, { "Particle", "粒子" }, { "Particles", "粒子" }, { "Photobooth", "照相亭" }, { "Players", "玩家" }, { "Post", "后处理" }, { "Pro", "Pro" }, { "Rain", "雨" }, { "Regular", "常规" }, { "Rotors", "旋翼" }, { "Sand", "沙" }, { "Sans", "无衬线" }, { "SC", "简中" }, { "Scan", "扫描" }, { "SDF", "SDF" }, { "Semi", "半" }, { "Set", "套装" }, { "Shader", "着色器" }, { "Shadow", "阴影" }, { "Sign", "标志" }, { "Skybox", "天空盒" }, { "Snowflake", "雪花" }, { "Soft", "柔和" }, { "softy", "柔和" }, { "Space", "太空" }, { "Sprite", "精灵" }, { "Sprites", "精灵" }, { "Steam", "蒸汽" }, { "Sun", "太阳" }, { "Tetsubin", "铁瓶" }, { "Text", "文本" }, { "TMP", "TMP" }, { "Tomb", "墓穴" }, { "Unlit", "无光照" }, { "Visor", "面罩" }, { "Volume", "体积" }, { "White", "白色" }, { "Wildflowers", "野花" } }; private static readonly Dictionary<string, string> GeneratedDynamicNames = new Dictionary<string, string>(StringComparer.Ordinal); private static readonly HashSet<string> MissingKeys = new HashSet<string>(StringComparer.Ordinal); private static readonly Regex EnglishRegex = new Regex("[A-Za-z]", RegexOptions.Compiled); private static readonly Regex DynamicNameBoundaryRegex = new Regex("(?<=[a-z])(?=[A-Z])|(?<=[A-Za-z])(?=\\d)|(?<=\\d)(?=[A-Za-z])", RegexOptions.Compiled); private static readonly Regex DynamicNameTokenRegex = new Regex("[A-Za-z]+|\\d+", RegexOptions.Compiled); public static event Action<MissingTranslation> MissingTranslationFound; public static string Ui(string value, string source = null) { return Translate(TranslationKind.Ui, value, UiNames, source); } public static string Field(string value, string source = null) { return Translate(TranslationKind.Field, value, FieldNames, source); } public static string TypeName(Type type, string source = null) { if (type == null) { return string.Empty; } return TypeName(type.Name, source ?? type.FullName); } public static string TypeName(string value, string source = null) { return Translate(TranslationKind.Type, value, TypeNames, source); } public static string EnumName(Type enumType, string value, string source = null) { if (enumType == null) { return Translate(TranslationKind.Enum, value, EnumNames, source); } string text = enumType.FullName + "." + value; if (EnumNames.TryGetValue(text, out var value2)) { return value2; } ReportMissing(TranslationKind.Enum, text, source ?? enumType.FullName); return value; } public static string Dynamic(string value, string source = null) { if (string.IsNullOrEmpty(value)) { return value; } if (DynamicNames.TryGetValue(value, out var value2)) { return value2; } if (GeneratedDynamicNames.TryGetValue(value, out value2)) { return value2; } value2 = TryTranslateDynamicName(value); if (value2 != null) { GeneratedDynamicNames[value] = value2; return value2; } ReportMissing(TranslationKind.Dynamic, value, source); return value; } public static string Context(string value, string source = null) { if (string.IsNullOrEmpty(value)) { return value; } if (UiNames.TryGetValue(value, out var value2)) { return value2; } if (TypeNames.TryGetValue(value, out var value3)) { return value3; } ReportMissing(TranslationKind.Ui, value, source); return value; } public static bool HasTranslation(TranslationKind kind, string value, Type enumType = null) { if (string.IsNullOrEmpty(value)) { return true; } switch (kind) { case TranslationKind.Ui: return UiNames.ContainsKey(value); case TranslationKind.Field: return FieldNames.ContainsKey(value); case TranslationKind.Type: return TypeNames.ContainsKey(value); case TranslationKind.Enum: if (!(enumType != null) || !EnumNames.ContainsKey(enumType.FullName + "." + value)) { return EnumNames.ContainsKey(value); } return true; case TranslationKind.Dynamic: if (!DynamicNames.ContainsKey(value) && !GeneratedDynamicNames.ContainsKey(value)) { return TryTranslateDynamicName(value) != null; } return true; default: return false; } } private static string Translate(TranslationKind kind, string value, Dictionary<string, string> table, string source) { if (string.IsNullOrEmpty(value)) { return value; } if (table.TryGetValue(value, out var value2)) { return value2; } ReportMissing(kind, value, source); return value; } private static void ReportMissing(TranslationKind kind, string value, string source) { string item = kind.ToString() + ":" + value; if (!MissingKeys.Contains(item)) { if (!ShouldReport(value)) { MissingKeys.Add(item); } else if (MissingKeys.Add(item)) { DisplayNameTranslator.MissingTranslationFound?.Invoke(new MissingTranslation(kind, value, source)); } } } private static bool ShouldReport(string value) { if (string.IsNullOrWhiteSpace(value)) { return false; } if (value.StartsWith("##", StringComparison.Ordinal)) { return false; } return EnglishRegex.IsMatch(value); } private static string TryTranslateDynamicName(string value) { string text = DynamicNameBoundaryRegex.Replace(value, " "); MatchCollection matchCollection = DynamicNameTokenRegex.Matches(text); if (matchCollection.Count == 0) { return null; } StringBuilder stringBuilder = new StringBuilder(); int num = 0; bool flag = false; foreach (Match item in matchCollection) { if (item.Index > num) { stringBuilder.Append(NormaliseDynamicSeparator(text.Substring(num, item.Index - num))); } string value2 = item.Value; if (DynamicNameTokens.TryGetValue(value2, out var value3)) { stringBuilder.Append(value3); flag = true; } else { stringBuilder.Append(value2); } num = item.Index + item.Length; } if (num < text.Length) { stringBuilder.Append(NormaliseDynamicSeparator(text.Substring(num))); } if (!flag) { return null; } string text2 = CollapseSpaces(stringBuilder.ToString()).Trim(); if (text2.Length != 0) { return text2; } return null; } private static string NormaliseDynamicSeparator(string separator) { if (string.IsNullOrEmpty(separator)) { return string.Empty; } return separator.Replace('_', ' ').Replace('-', ' ').Replace('.', ' '); } private static string CollapseSpaces(string value) { while (value.IndexOf(" ", StringComparison.Ordinal) >= 0) { value = value.Replace(" ", " "); } return value; } } public static class EditorGizmos { public static bool IsEnabled = false; private static List<GizmoUtils.RendererMaterialCache> rendererMaterialCache = new List<GizmoUtils.RendererMaterialCache>(); private static Transform Target; public static void ToggleGizmos() { IsEnabled = !IsEnabled; if (!IsEnabled) { GizmoUtils.RestoreRendererMaterials(rendererMaterialCache); } else { RefreshGizmos(); } } public static void OnSelectionChanged(Transform selected) { Target = selected; if (IsEnabled) { GizmoUtils.RestoreRendererMaterials(rendererMaterialCache); LevelGenStep component = ((Component)Target).gameObject.GetComponent<LevelGenStep>(); GizmoUtils.TryDrawGizmos(Target, (Component)(object)component); if ((Object)(object)component != (Object)null) { rendererMaterialCache = GizmoUtils.ApplyOverlayToRenderers(((Component)Target).gameObject.GetComponentsInChildren<Renderer>(true)); } } } public static void RefreshGizmos() { if (!IsEnabled) { return; } GizmoUtils.RestoreRendererMaterials(rendererMaterialCache); if (!((Object)(object)Target == (Object)null)) { LevelGenStep component = ((Component)Target).gameObject.GetComponent<LevelGenStep>(); GizmoUtils.TryDrawGizmos(Target, (Component)(object)component); if ((Object)(object)component != (Object)null) { rendererMaterialCache = GizmoUtils.ApplyOverlayToRenderers(((Component)Target).gameObject.GetComponentsInChildren<Renderer>(true)); } } } } public class HierarchyView { public class ContextNode { public string Name; public List<ContextNode> Children = new List<ContextNode>(); public Action<Transform> Action; public Func<Transform, bool> CanUseNode; public string DisplayName => DisplayNameTranslator.Context(Name, "HierarchyContext") + "##" + Name; public void AddContextItem(string label, Action<Transform> action, Func<Transform, bool> canUseNode) { Children.Add(new ContextNode { Name = label, Action = action, CanUseNode = canUseNode }); } } public Action<Transform> OnSelectionChanged; public Func<Transform, bool> ShouldDrawNode; public List<ContextNode> ContextNodes = new List<ContextNode>(); public Transform Selected { get; private set; } public void DrawNode(Transform t) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)t == (Object)null || (ShouldDrawNode != null && !ShouldDrawNode(t))) { return; } ImGuiTreeNodeFlags val = (ImGuiTreeNodeFlags)4288; if ((Object)(object)Selected == (Object)(object)t) { val = (ImGuiTreeNodeFlags)(val | 1); } ImGui.PushID(((Object)t).GetInstanceID()); if (t.childCount == 0) { val = (ImGuiTreeNodeFlags)(val | 0x100); } bool num = ImGui.TreeNodeEx("", val, DisplayNameTranslator.Dynamic(((Object)t).name, "HierarchyNode")); if (ImGui.IsItemClicked() || ImGui.IsItemClicked((ImGuiMouseButton)1)) { SetSelected(t); } if (ImGui.IsItemClicked((ImGuiMouseButton)1)) { ImGui.OpenPopup("HierarchyItemContextMenuPopup"); } if (ImGui.BeginPopup("HierarchyItemContextMenuPopup")) { DrawContextNodes(t); ImGui.EndPopup(); } if (num) { for (int i = 0; i < t.childCount; i++) { DrawNode(t.GetChild(i)); } ImGui.TreePop(); } ImGui.PopID(); } public void SetSelected(Transform t) { if (!((Object)(object)Selected == (Object)(object)t)) { Selected = t; OnSelectionChanged?.Invoke(t); } } public ContextNode AddContextMenu(string label, Func<Transform, bool> canUseNode) { ContextNode contextNode = new ContextNode { Name = label, CanUseNode = canUseNode }; ContextNodes.Add(contextNode); return contextNode; } public void AddContextItem(string label, Action<Transform> action, Func<Transform, bool> canUseNode) { ContextNodes.Add(new ContextNode { Name = label, Action = action, CanUseNode = canUseNode }); } public void DrawContextNodes(Transform t) { foreach (ContextNode contextNode in ContextNodes) { bool flag = true; if (contextNode.CanUseNode != null) { flag = contextNode.CanUseNode(t); } if (!flag) { ImGui.BeginDisabled(); } DrawContextNode(contextNode, t); if (!flag) { ImGui.EndDisabled(); } } } private void DrawContextNode(ContextNode node, Transform t) { if (node.Children.Count > 0) { DrawMenuNode(node, t); } else { DrawMenuItemNode(node, t); } } private void DrawMenuItemNode(ContextNode node, Transform t) { if (ImGui.MenuItem(node.DisplayName)) { node.Action?.Invoke(t); } } private void DrawMenuNode(ContextNode node, Transform t) { if (!ImGui.BeginMenu(node.DisplayName)) { return; } foreach (ContextNode child in node.Children) { DrawContextNode(child, t); } ImGui.EndMenu(); } } public static class ImGuiHelpers { public static void DrawPropertiesTable(string tableName, WidgetFactory.FieldWidgetData[] fieldWidgets) { if (!ImGui.BeginTable("Table_" + tableName, 2)) { return; } ImGui.TableSetupColumn(DisplayNameTranslator.Ui("Name"), (ImGuiTableColumnFlags)16, 100f); ImGui.TableSetupColumn(DisplayNameTranslator.Ui("Value"), (ImGuiTableColumnFlags)8); foreach (WidgetFactory.FieldWidgetData fieldWidgetData in fieldWidgets) { if (!fieldWidgetData.IsHidden) { if (fieldWidgetData.IsDisabled) { ImGui.BeginDisabled(); } ImGui.TableNextColumn(); ImGui.TextUnformatted(DisplayNameTranslator.Field(fieldWidgetData.Name, tableName)); ImGui.TableNextColumn(); ImGui.SetNextItemWidth(-1f); fieldWidgetData.Draw(); ImGui.TableNextRow(); if (fieldWidgetData.IsDisabled) { ImGui.EndDisabled(); } } } ImGui.EndTable(); } public static void DrawFullLayoutField(WidgetFactory.FieldWidgetData fieldWidget) { if (!fieldWidget.IsHidden) { ImGui.SetNextItemWidth(-1f); if (fieldWidget.IsDisabled) { ImGui.BeginDisabled(); } WidgetFactory.DrawField(fieldWidget); if (fieldWidget.IsDisabled) { ImGui.EndDisabled(); } } } public static void DrawButton(string label, Action onClick, bool enabled = true) { if (!enabled) { ImGui.BeginDisabled(); } if (ImGui.Button(label)) { onClick(); } if (!enabled) { ImGui.EndDisabled(); } } public static void DrawSmallButton(string label, Action onClick, bool enabled = true) { if (!enabled) { ImGui.BeginDisabled(); } if (ImGui.SmallButton(label)) { onClick(); } if (!enabled) { ImGui.EndDisabled(); } } } public static class WidgetFactory { public class FieldWidgetData { public string Name; public Type Type; public Func<object> Get; public Action<object> Set; public RangeAttribute RangeAttribute; public bool IsHidden; public bool IsDisabled; public FieldWidgetData(Type type, Func<object> get, Action<object> set, string name, RangeAttribute rangeAttribute = null, bool isHidden = false, bool isDisabled = false) { Type = type; Get = get; Set = set; Name = name; RangeAttribute = rangeAttribute; IsHidden = isHidden; IsDisabled = isDisabled; } public FieldWidgetData() { } public FieldWidgetData(FieldData fieldData, object ownerObject) { Type = fieldData.fieldInfo.FieldType; Get = () => fieldData.fieldInfo.GetValue(ownerObject); Set = delegate(object v) { fieldData.fieldInfo.SetValue(ownerObject, v); }; Name = fieldData.name; RangeAttribute = fieldData.rangeAttribute; IsHidden = fieldData.widgetMode == WidgetMode.Hidden; IsDisabled = fieldData.widgetMode == WidgetMode.Disabled; } public virtual void Draw() { DrawField(Type, Get, Set, Name, RangeAttribute); } } public class ComboWidgetData : FieldWidgetData { public Func<int> GetIndex; public Action<int> SetIndex; public Func<string[]> Get
TerrainCustomiserCNCollector.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using Microsoft.CodeAnalysis; using TerrainCustomiserCN.UI; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("TerrainCustomiserCNCollector")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0+fbb84b7ed077928f27ed9fe61becd6796df38ca2")] [assembly: AssemblyProduct("TerrainCustomiserCNCollector")] [assembly: AssemblyTitle("TerrainCustomiserCNCollector")] [assembly: AssemblyVersion("0.1.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace TerrainCustomiserCNCollector { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.wuyachiyu.terraincustomisercn.collector", "TerrainCustomiserCN Translation Collector", "0.1.0")] public class Plugin : BaseUnityPlugin { private static readonly SortedDictionary<string, SortedSet<string>> Missing = new SortedDictionary<string, SortedSet<string>>(StringComparer.Ordinal); private static readonly object SyncRoot = new object(); private static string outputPath; private static bool dirty; private static float nextWriteTime; private void Awake() { outputPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? Paths.PluginPath, "TerrainCustomiserCN_missing_translations.tsv"); DisplayNameTranslator.MissingTranslationFound += OnMissingTranslationFound; CollectStaticReflectionNames(); WriteOutput(); Debug.Log((object)("[TCCN Collector] Translation collector enabled. Missing output: " + outputPath)); } private void Update() { if (dirty && Time.unscaledTime >= nextWriteTime) { WriteOutput(); dirty = false; } } private void OnDestroy() { DisplayNameTranslator.MissingTranslationFound -= OnMissingTranslationFound; WriteOutput(); } private static void OnMissingTranslationFound(MissingTranslation missing) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) if (Add(((MissingTranslation)(ref missing)).Kind, ((MissingTranslation)(ref missing)).Key, ((MissingTranslation)(ref missing)).Source, "Runtime")) { dirty = true; nextWriteTime = Time.unscaledTime + 1f; } } public static void CollectStaticReflectionNames() { Type[] inspectableTypes = GetInspectableTypes(); foreach (Type type in inspectableTypes) { AddIfMissing((TranslationKind)2, type.Name, type.FullName, "StaticType"); FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { AddIfMissing((TranslationKind)1, fieldInfo.Name, type.FullName, "StaticField"); Type fieldType = fieldInfo.FieldType; if (fieldType.IsEnum) { CollectEnum(fieldType, type.FullName + "." + fieldInfo.Name); } else if (fieldType.IsArray && fieldType.GetElementType() != null && fieldType.GetElementType().IsEnum) { CollectEnum(fieldType.GetElementType(), type.FullName + "." + fieldInfo.Name); } else { if (!fieldType.IsGenericType) { continue; } Type[] genericArguments = fieldType.GetGenericArguments(); foreach (Type type2 in genericArguments) { if (type2.IsEnum) { CollectEnum(type2, type.FullName + "." + fieldInfo.Name); } } } } } } private static Type[] GetInspectableTypes() { Type[] types = typeof(PropSpawner).Assembly.GetTypes(); Type[] source = new Type[5] { typeof(LevelGenStep), typeof(PropSpawnerMod), typeof(PropSpawnerConstraint), typeof(PropSpawnerConstraintPost), typeof(PostSpawnBehavior) }; HashSet<Type> hashSet = new HashSet<Type>(); Type[] array = types; foreach (Type type2 in array) { if (!(type2 == null) && !type2.IsAbstract && !type2.IsInterface && source.Any((Type baseType) => baseType.IsAssignableFrom(type2))) { hashSet.Add(type2); } } hashSet.Add(typeof(PropGrouper)); hashSet.Add(typeof(RockMaterialSwapper)); hashSet.Add(typeof(SpecialDayZone)); return hashSet.OrderBy<Type, string>((Type type) => type.FullName, StringComparer.Ordinal).ToArray(); } private static void CollectEnum(Type enumType, string source) { string[] names = Enum.GetNames(enumType); foreach (string text in names) { if (!DisplayNameTranslator.HasTranslation((TranslationKind)3, text, enumType)) { Add((TranslationKind)3, enumType.FullName + "." + text, source, "StaticEnum"); } } } private static void AddIfMissing(TranslationKind kind, string key, string source, string origin) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (!DisplayNameTranslator.HasTranslation(kind, key, (Type)null)) { Add(kind, key, source, origin); } } private static bool Add(TranslationKind kind, string key, string source, string origin) { if (string.IsNullOrWhiteSpace(key) || !key.Any(IsAsciiLetter)) { return false; } string value = (string.IsNullOrEmpty(source) ? "-" : source); string item = Escape(key) + "\t" + Escape(value) + "\t" + Escape(origin); lock (SyncRoot) { string key2 = ((object)(TranslationKind)(ref kind)).ToString(); if (!Missing.TryGetValue(key2, out var value2)) { value2 = new SortedSet<string>(StringComparer.Ordinal); Missing.Add(key2, value2); } return value2.Add(item); } } private static void WriteOutput() { if (string.IsNullOrEmpty(outputPath)) { return; } lock (SyncRoot) { Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); using StreamWriter streamWriter = new StreamWriter(outputPath, append: false, new UTF8Encoding(encoderShouldEmitUTF8Identifier: true)); streamWriter.WriteLine("kind\tkey\tsource\torigin"); foreach (KeyValuePair<string, SortedSet<string>> item in Missing) { foreach (string item2 in item.Value) { streamWriter.Write(item.Key); streamWriter.Write('\t'); streamWriter.WriteLine(item2); } } } } private static bool IsAsciiLetter(char c) { if (c < 'A' || c > 'Z') { if (c >= 'a') { return c <= 'z'; } return false; } return true; } private static string Escape(string value) { return value.Replace("\t", " ").Replace("\r", " ").Replace("\n", " "); } } }