using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.UI;
using crecheng.DSPModSave;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("DspFontPatcher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DspFontPatcher")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("81DF3045-8007-4F6A-AAF6-903139D85B6C")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
namespace DSPMarker;
public class UIClickHandler : MonoBehaviour, IPointerClickHandler, IEventSystemHandler
{
public void OnPointerClick(PointerEventData eventData)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Invalid comparison between Unknown and I4
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Invalid comparison between Unknown and I4
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Invalid comparison between Unknown and I4
if ((int)eventData.button != 0)
{
if ((int)eventData.button == 1)
{
MarkerList.OnRightClick(eventData.pointerPress);
}
else if ((int)eventData.button != 2)
{
}
}
}
}
internal class ArrowPool : MonoBehaviour
{
public static GameObject guideArrowBase;
public static GameObject[] guideArrow;
public static void Update()
{
//IL_027a: Unknown result type (might be due to invalid IL or missing references)
//IL_0284: Expected O, but got Unknown
//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
//IL_0304: Unknown result type (might be due to invalid IL or missing references)
//IL_030a: Expected O, but got Unknown
//IL_036d: 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_00d1: 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_0153: 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_0159: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: 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)
int id = GameMain.localPlanet.id;
if (!MarkerPool.markerIdInPlanet.ContainsKey(id))
{
List<int> value = new List<int>();
MarkerPool.markerIdInPlanet.Add(id, value);
}
if (!MarkerList.showList)
{
guideArrowBase.gameObject.SetActive(false);
}
else if (Object.op_Implicit((Object)(object)guideArrowBase))
{
if (!MarkerList.showList || (GameMain.localPlanet != null && !GameMain.data.mainPlayer.sailing))
{
GameObject gameObject = GameMain.data.mainPlayer.gameObject;
if (!gameObject.activeSelf)
{
return;
}
Plane val = default(Plane);
((Plane)(ref val))..ctor(gameObject.transform.up, gameObject.transform.position);
guideArrowBase.gameObject.SetActive(true);
for (int i = 0; i < Main.maxMarker; i++)
{
if (i < MarkerPool.markerIdInPlanet[id].Count)
{
int key = MarkerPool.markerIdInPlanet[id][i];
if (MarkerPool.markerPool[key].ShowArrow)
{
Vector3 pos = MarkerPool.markerPool[key].pos;
Vector3 val2 = ((Plane)(ref val)).ClosestPointOnPlane(pos);
guideArrow[i].transform.LookAt(val2, gameObject.transform.up);
((Renderer)guideArrow[i].GetComponent<MeshRenderer>()).material.color = MarkerPool.markerPool[key].color;
((Renderer)guideArrow[i].GetComponent<MeshRenderer>()).material.SetColor("_EmissionColor", MarkerPool.markerPool[key].color);
guideArrow[i].gameObject.SetActive(true);
}
else
{
guideArrow[i].gameObject.SetActive(false);
}
}
else
{
guideArrow[i].gameObject.SetActive(false);
}
}
}
else
{
guideArrowBase.gameObject.SetActive(false);
}
}
else
{
guideArrow = (GameObject[])(object)new GameObject[Main.maxMarker];
GameObject gameObject2 = GameMain.data.mainPlayer.gameObject;
guideArrowBase = new GameObject("guideArrowBase");
guideArrowBase.transform.parent = gameObject2.transform;
guideArrowBase.transform.localPosition = new Vector3(0f, 0.8f, 0f);
guideArrowBase.transform.localScale = new Vector3(1f, 1f, 1f);
for (int j = 0; j < Main.maxMarker; j++)
{
guideArrow[j] = new GameObject("guideArrow" + j);
guideArrow[j].transform.parent = guideArrowBase.transform;
guideArrow[j].AddComponent<CreateTriangleMesh>();
guideArrow[j].AddComponent<MeshRenderer>();
guideArrow[j].AddComponent<MeshFilter>();
guideArrow[j].transform.localPosition = new Vector3(0f, 0f, 0f);
}
}
}
}
public class CreateTriangleMesh : MonoBehaviour
{
private void Start()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: 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_006d: 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_0137: Unknown result type (might be due to invalid IL or missing references)
Mesh val = new Mesh();
List<Vector3> vertices = new List<Vector3>
{
new Vector3(-0.4f, 0f, 2.4f),
new Vector3(0f, 0f, 3f),
new Vector3(0.4f, 0f, 2.4f),
new Vector3(0f, 0f, 2.6f)
};
val.SetVertices(vertices);
List<int> list = new List<int>
{
0, 1, 3, 1, 2, 3, 3, 2, 1, 3,
1, 0
};
val.SetTriangles(list, 0);
MeshFilter component = ((Component)this).GetComponent<MeshFilter>();
component.mesh = val;
MeshRenderer component2 = ((Component)this).GetComponent<MeshRenderer>();
((Renderer)component2).material.color = Color.blue;
((Renderer)component2).material.EnableKeyword("_EMISSION");
((Renderer)component2).material.SetColor("_EmissionColor", Color.blue);
((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0;
((Renderer)component2).receiveShadows = false;
}
}
[BepInPlugin("Appun.DSP.plugin.Marker", "DSPMarker", "0.0.9")]
[BepInProcess("DSPGAME.exe")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Main : BaseUnityPlugin, IModCanSave
{
public static ConfigEntry<bool> DisableKeyTips;
public static ConfigEntry<int> maxMarkers;
public static bool showList = true;
public static Sprite arrowSprite;
public static Sprite merkerSprite;
public static Sprite roundSprite;
public static Sprite ButtonSprite;
public static int maxMarker;
public static int markerCount = 0;
public void Start()
{
LogManager.Logger = ((BaseUnityPlugin)this).Logger;
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
DisableKeyTips = ((BaseUnityPlugin)this).Config.Bind<bool>("UI", "DisableKeyTips", false, "Disable Key Tips on right side");
maxMarkers = ((BaseUnityPlugin)this).Config.Bind<int>("Marker", "maxMarker", 20, "Maximum number of markers");
maxMarker = maxMarkers.Value;
LoadIcon();
MarkerPrefab.Create();
MarkerEditor.Create();
MarkerList.Create();
MarkerPool.Create();
MarkerPrefab.markerGroup.SetActive(false);
MarkerList.listBase.SetActive(false);
}
public void Update()
{
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Invalid comparison between Unknown and I4
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Invalid comparison between Unknown and I4
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Invalid comparison between Unknown and I4
if (GameMain.data != null && (!((Object)(object)DSPGame.Game != (Object)null) || !DSPGame.Game.isMenuDemo) && GameMain.isRunning)
{
if (GameMain.localPlanet == null || ((ManualBehaviour)UIRoot.instance.uiGame.zScreen).active || ((ManualBehaviour)UIRoot.instance.uiGame.blueprintCopyInspector).active || ((ManualBehaviour)UIRoot.instance.uiGame.blueprintPasteInspector).active || ((ManualBehaviour)UIRoot.instance.uiGame.deathPanel).active || ((ManualBehaviour)UIRoot.instance.uiGame.techTree).active)
{
MarkerList.markerList.SetActive(false);
MarkerPrefab.markerGroup.SetActive(false);
}
else if ((int)UIGame.viewMode == 4 || (int)UIGame.viewMode == 6 || (int)UIGame.viewMode == 5)
{
LogManager.Logger.LogInfo((object)"---------------------------------------------------------deactivate ");
MarkerList.markerList.SetActive(false);
MarkerPrefab.markerGroup.SetActive(false);
}
else
{
MarkerList.markerList.SetActive(true);
MarkerPrefab.markerGroup.SetActive(true);
MarkerPool.Update();
ArrowPool.Update();
}
}
}
public static void LoadIcon()
{
try
{
AssetBundle val = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("DSPMarker.marker"));
if ((Object)(object)val == (Object)null)
{
LogManager.Logger.LogInfo((object)"Icon loaded.");
return;
}
arrowSprite = val.LoadAsset<Sprite>("arrow");
merkerSprite = val.LoadAsset<Sprite>("marker");
roundSprite = val.LoadAsset<Sprite>("round");
ButtonSprite = val.LoadAsset<Sprite>("mapmarker");
val.Unload(false);
}
catch (Exception ex)
{
LogManager.Logger.LogInfo((object)("e.Message " + ex.Message));
LogManager.Logger.LogInfo((object)("e.StackTrace " + ex.StackTrace));
}
}
public void Import(BinaryReader r)
{
LogManager.Logger.LogInfo((object)"---------------------------------------------------------Inport");
MarkerPool.markerPool.Clear();
MarkerPool.markerIdInPlanet.Clear();
if (r.ReadInt32() == 1)
{
MarkerPool.markerCursor = r.ReadInt32();
int num = r.ReadInt32();
for (int i = 0; i < num; i++)
{
int key = r.ReadInt32();
int num2 = r.ReadInt32();
List<int> list = new List<int>();
for (int j = 0; j < num2; j++)
{
list.Add(r.ReadInt32());
}
MarkerPool.markerIdInPlanet.Add(key, list);
}
int num3 = r.ReadInt32();
for (int k = 0; k < num3; k++)
{
int key2 = r.ReadInt32();
MarkerPool.Marker value = default(MarkerPool.Marker);
value.planetID = r.ReadInt32();
value.pos.x = r.ReadSingle();
value.pos.y = r.ReadSingle();
value.pos.z = r.ReadSingle();
value.icon1ID = r.ReadInt32();
value.icon2ID = r.ReadInt32();
value.color.r = r.ReadSingle();
value.color.g = r.ReadSingle();
value.color.b = r.ReadSingle();
value.color.a = r.ReadSingle();
value.desc = r.ReadString();
value.alwaysDisplay = r.ReadBoolean();
value.throughPlanet = r.ReadBoolean();
value.ShowArrow = r.ReadBoolean();
MarkerPool.markerPool.Add(key2, value);
}
MarkerPool.Refresh();
MarkerList.Refresh();
}
else
{
LogManager.Logger.LogInfo((object)"Save data version error");
}
LogManager.Logger.LogInfo((object)"---------------------------------------------------------loaded");
}
public void Export(BinaryWriter w)
{
//IL_011b: 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_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_0189: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
LogManager.Logger.LogInfo((object)"---------------------------------------------------------Export");
w.Write(1);
w.Write(MarkerPool.markerCursor);
w.Write(MarkerPool.markerIdInPlanet.Count);
foreach (KeyValuePair<int, List<int>> item in MarkerPool.markerIdInPlanet)
{
w.Write(item.Key);
w.Write(item.Value.Count);
foreach (int item2 in item.Value)
{
w.Write(item2);
}
}
w.Write(MarkerPool.markerPool.Count);
foreach (KeyValuePair<int, MarkerPool.Marker> item3 in MarkerPool.markerPool)
{
w.Write(item3.Key);
w.Write(item3.Value.planetID);
w.Write(item3.Value.pos.x);
w.Write(item3.Value.pos.y);
w.Write(item3.Value.pos.z);
w.Write(item3.Value.icon1ID);
w.Write(item3.Value.icon2ID);
w.Write(item3.Value.color.r);
w.Write(item3.Value.color.g);
w.Write(item3.Value.color.b);
w.Write(item3.Value.color.a);
w.Write(item3.Value.desc);
w.Write(item3.Value.alwaysDisplay);
w.Write(item3.Value.throughPlanet);
w.Write(item3.Value.ShowArrow);
}
LogManager.Logger.LogInfo((object)"---------------------------------------------------------saved ");
}
public void IntoOtherSave()
{
if (MarkerPool.markerPool.Count > 0)
{
MarkerPool.markerIdInPlanet.Clear();
MarkerPool.markerPool.Clear();
MarkerPool.Refresh();
MarkerList.Refresh();
}
}
}
public class LogManager
{
public static ManualLogSource Logger;
}
internal class Event
{
public static void onClick()
{
Main.showList = !Main.showList;
MarkerList.markerButton.GetComponent<UIButton>().highlighted = Main.showList;
}
}
public class MarkerList : ManualBehaviour
{
public static GameObject markerList = new GameObject();
public static GameObject markerButton = new GameObject();
public static GameObject listBase = new GameObject();
public static GameObject boxBasePrefab = new GameObject();
public static GameObject boxBaseSquare = new GameObject();
public static GameObject boxBaseText = new GameObject();
public static GameObject boxBaseIcon1 = new GameObject();
public static GameObject boxBaseIcon2 = new GameObject();
public static GameObject modeText = new GameObject();
public static GameObject[] boxMarker;
public static GameObject[] boxSquare;
public static GameObject[] boxText;
public static GameObject[] boxIcon1;
public static GameObject[] boxIcon2;
public static Sprite markerIcon;
public static int boxSize = 40;
public static bool showList = true;
public static bool editMode;
public static bool Guiding = false;
public static int UIheight = DSPGame.globalOption.uiLayoutHeight;
public static int UIwidth = UIheight * Screen.width / Screen.height;
public static void Create()
{
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Expected O, but got Unknown
//IL_00aa: 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_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_021c: Expected O, but got Unknown
//IL_021d: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Expected O, but got Unknown
//IL_026a: Unknown result type (might be due to invalid IL or missing references)
//IL_028e: Unknown result type (might be due to invalid IL or missing references)
//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
//IL_030b: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Unknown result type (might be due to invalid IL or missing references)
//IL_034e: Unknown result type (might be due to invalid IL or missing references)
//IL_0353: Unknown result type (might be due to invalid IL or missing references)
//IL_0377: Unknown result type (might be due to invalid IL or missing references)
//IL_039b: Unknown result type (might be due to invalid IL or missing references)
//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0419: Unknown result type (might be due to invalid IL or missing references)
//IL_0438: Unknown result type (might be due to invalid IL or missing references)
//IL_045c: Unknown result type (might be due to invalid IL or missing references)
//IL_0461: Unknown result type (might be due to invalid IL or missing references)
//IL_0485: Unknown result type (might be due to invalid IL or missing references)
//IL_04a9: Unknown result type (might be due to invalid IL or missing references)
//IL_04fe: Unknown result type (might be due to invalid IL or missing references)
//IL_05a2: Unknown result type (might be due to invalid IL or missing references)
//IL_05c1: Unknown result type (might be due to invalid IL or missing references)
//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
//IL_060e: Unknown result type (might be due to invalid IL or missing references)
//IL_0632: Unknown result type (might be due to invalid IL or missing references)
//IL_0690: Unknown result type (might be due to invalid IL or missing references)
//IL_06ce: Unknown result type (might be due to invalid IL or missing references)
//IL_06d3: Unknown result type (might be due to invalid IL or missing references)
//IL_074c: Unknown result type (might be due to invalid IL or missing references)
//IL_076b: Unknown result type (might be due to invalid IL or missing references)
//IL_078a: Unknown result type (might be due to invalid IL or missing references)
//IL_07ae: Unknown result type (might be due to invalid IL or missing references)
//IL_07b3: Unknown result type (might be due to invalid IL or missing references)
//IL_07d7: Unknown result type (might be due to invalid IL or missing references)
//IL_07fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0869: Unknown result type (might be due to invalid IL or missing references)
//IL_088d: Unknown result type (might be due to invalid IL or missing references)
//IL_091c: Unknown result type (might be due to invalid IL or missing references)
//IL_095e: Unknown result type (might be due to invalid IL or missing references)
//IL_09c8: Unknown result type (might be due to invalid IL or missing references)
//IL_0a10: Unknown result type (might be due to invalid IL or missing references)
//IL_0a58: Unknown result type (might be due to invalid IL or missing references)
//IL_0a8f: Unknown result type (might be due to invalid IL or missing references)
//IL_0a99: Expected O, but got Unknown
boxMarker = (GameObject[])(object)new GameObject[Main.maxMarker];
boxSquare = (GameObject[])(object)new GameObject[Main.maxMarker];
boxText = (GameObject[])(object)new GameObject[Main.maxMarker];
boxIcon1 = (GameObject[])(object)new GameObject[Main.maxMarker];
boxIcon2 = (GameObject[])(object)new GameObject[Main.maxMarker];
markerList = new GameObject();
((Object)markerList).name = "MarkerList";
markerList.transform.SetParent(GameObject.Find("UI Root/Overlay Canvas/In Game/Windows").transform);
markerList.transform.localPosition = new Vector3((float)(UIwidth / 2 - 60), (float)(UIheight / 2 - 30), 0f);
markerList.transform.localScale = new Vector3(1f, 1f, 1f);
markerButton = Object.Instantiate<GameObject>(GameObject.Find("UI Root/Overlay Canvas/In Game/Game Menu/detail-func-group/dfunc-1"), markerList.transform);
((Object)markerButton).name = "markerButton";
markerButton.transform.localPosition = new Vector3(0f, 0f, 0f);
markerButton.GetComponent<UIButton>().tips.tipTitle = Localization.Translate("Marker List");
markerButton.GetComponent<UIButton>().tips.tipText = Localization.Translate("Click to show/hide Marker List.\nRight Click to enter/exit Edit mode.");
markerButton.GetComponent<UIButton>().tips.corner = 4;
markerButton.GetComponent<UIButton>().tips.offset = new Vector2(-50f, 20f);
markerButton.GetComponent<UIButton>().tips.width = 215;
((Component)markerButton.transform.Find("icon")).GetComponent<Image>().sprite = Main.ButtonSprite;
markerButton.GetComponent<UIButton>().highlighted = true;
markerButton.AddComponent<UIClickHandler>();
((UnityEvent)markerButton.GetComponent<UIButton>().button.onClick).AddListener(new UnityAction(OnClickMarkerButton));
listBase = new GameObject();
((Object)listBase).name = "listBase";
listBase.transform.SetParent(markerList.transform);
listBase.transform.localPosition = new Vector3(0f, 0f, -1f);
listBase.transform.localScale = new Vector3(1f, 1f, 1f);
boxBasePrefab.transform.SetParent(listBase.transform);
((Object)boxBasePrefab).name = "boxBasePrefab";
((Graphic)boxBasePrefab.AddComponent<Image>()).color = new Color(0.7f, 0.5f, 0f, 1f);
boxBasePrefab.AddComponent<Button>();
boxBasePrefab.GetComponent<RectTransform>().anchorMax = new Vector2(0f, 0f);
boxBasePrefab.GetComponent<RectTransform>().anchorMin = new Vector2(0f, 0f);
boxBasePrefab.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(70f, 70f, 0f));
boxBasePrefab.transform.localPosition = new Vector3(5f, -80f, 0f);
boxBasePrefab.transform.localScale = new Vector3(1f, 1f, 1f);
boxBasePrefab.SetActive(false);
boxBaseSquare.transform.SetParent(boxBasePrefab.transform);
((Object)boxBaseSquare).name = "boxBaseSquare";
((Graphic)boxBaseSquare.AddComponent<Image>()).color = new Color(0.3f, 0.3f, 0f, 1f);
boxBaseSquare.GetComponent<RectTransform>().anchorMax = new Vector2(0f, 0f);
boxBaseSquare.GetComponent<RectTransform>().anchorMin = new Vector2(0f, 0f);
boxBaseSquare.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(60f, 60f, 0f));
boxBaseSquare.transform.localPosition = new Vector3(0f, 0f, 0f);
boxBaseSquare.transform.localScale = new Vector3(1f, 1f, 1f);
boxBaseSquare.SetActive(false);
boxBaseText.transform.SetParent(boxBasePrefab.transform);
((Object)boxBaseText).name = "boxBaseText";
((Shadow)boxBaseText.AddComponent<Outline>()).effectDistance = new Vector2(1f, -1f);
boxBaseText.AddComponent<Text>().text = Localization.Translate("New\nMarker");
boxBaseText.GetComponent<Text>().alignment = (TextAnchor)4;
boxBaseText.GetComponent<Text>().lineSpacing = 0.7f;
boxBaseText.GetComponent<Text>().horizontalOverflow = (HorizontalWrapMode)0;
boxBaseText.GetComponent<Text>().verticalOverflow = (VerticalWrapMode)0;
boxBaseText.GetComponent<Text>().resizeTextForBestFit = true;
boxBaseText.GetComponent<Text>().fontSize = 15;
boxBaseText.GetComponent<RectTransform>().anchorMax = new Vector2(0f, 0f);
boxBaseText.GetComponent<RectTransform>().anchorMin = new Vector2(0f, 0f);
boxBaseText.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(60f, 60f, 0f));
boxBaseText.transform.localPosition = new Vector3(0f, 0f, 0f);
boxBaseText.transform.localScale = new Vector3(1f, 1f, 1f);
boxBaseText.SetActive(true);
modeText = Object.Instantiate<GameObject>(boxBaseText.gameObject, markerList.transform);
((Object)modeText).name = "modeText";
modeText.transform.localPosition = new Vector3(-22f, -21f, 0f);
modeText.GetComponent<Text>().text = Localization.Translate("Guide\nMode");
modeText.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(50f, 40f, 0f));
modeText.SetActive(true);
boxBaseIcon1.AddComponent<Image>().sprite = ((ProtoSet<TechProto>)(object)LDB.techs).Select(1001).iconSprite;
((Object)boxBaseIcon1).name = "boxBaseIcon1";
boxBaseIcon1.transform.SetParent(boxBasePrefab.transform);
((Shadow)boxBaseIcon1.AddComponent<Outline>()).effectDistance = new Vector2(1f, -1f);
boxBaseIcon1.GetComponent<RectTransform>().anchorMax = new Vector2(0f, 0f);
boxBaseIcon1.GetComponent<RectTransform>().anchorMin = new Vector2(0f, 0f);
boxBaseIcon1.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(30f, 30f, 0f));
boxBaseIcon1.transform.localPosition = new Vector3(-15f, 15f, 0f);
boxBaseIcon1.transform.localScale = new Vector3(1f, 1f, 1f);
boxBaseIcon1.SetActive(false);
boxBaseIcon2 = Object.Instantiate<GameObject>(boxBaseIcon1.gameObject);
((Object)boxBaseIcon2).name = "boxBaseIcon2";
boxBaseIcon2.transform.SetParent(boxBasePrefab.transform);
boxBaseIcon2.transform.localPosition = new Vector3(15f, 15f, 0f);
boxBaseIcon2.transform.localScale = new Vector3(1f, 1f, 1f);
int num = (UIheight - 270 - 115 - 40) / boxSize;
float num2 = (float)boxSize / 70f;
for (int i = 0; i < Main.maxMarker; i++)
{
boxMarker[i] = Object.Instantiate<GameObject>(boxBasePrefab.gameObject, listBase.transform);
((Object)boxMarker[i]).name = "boxMarker" + i;
boxMarker[i].transform.localScale = new Vector3(num2, num2, 1f);
int num3 = 20 - (boxSize + 3) * (i / num);
int num4 = -68 - (boxSize + 3) * (i % num);
boxMarker[i].transform.localPosition = new Vector3((float)num3, (float)num4, 0f);
boxSquare[i] = ((Component)boxMarker[i].transform.Find("boxBaseSquare")).gameObject;
boxText[i] = ((Component)boxMarker[i].transform.Find("boxBaseText")).gameObject;
boxText[i].transform.localPosition = new Vector3(0f, 0f, 0f);
boxIcon1[i] = ((Component)boxMarker[i].transform.Find("boxBaseIcon1")).gameObject;
boxIcon1[i].transform.localPosition = new Vector3(-15f, 15f, 0f);
boxIcon2[i] = ((Component)boxMarker[i].transform.Find("boxBaseIcon2")).gameObject;
boxIcon2[i].transform.localPosition = new Vector3(15f, 15f, 0f);
int count = i;
boxMarker[i].AddComponent<UIClickHandler>();
((UnityEvent)boxMarker[i].GetComponent<Button>().onClick).AddListener((UnityAction)delegate
{
OnClickBoxMarker(count);
});
}
boxBasePrefab.SetActive(false);
}
public static void OnClickMarkerButton()
{
showList = !showList;
listBase.gameObject.SetActive(showList);
markerButton.GetComponent<UIButton>().highlighted = showList;
}
public static void Crear()
{
for (int i = 0; i < Main.maxMarker; i++)
{
boxMarker[i].gameObject.SetActive(false);
}
}
public static void OnClickBoxMarker(int i)
{
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Expected O, but got Unknown
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: 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_00f8: 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_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: 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)
if (editMode)
{
if (!MarkerEditor.window.activeSelf)
{
MarkerEditor.Open(i);
}
else
{
MarkerEditor.Close();
}
}
else if (!GameMain.data.mainPlayer.sailing)
{
if (Guiding)
{
GameMain.mainPlayer.ClearOrders();
Guiding = false;
return;
}
int id = GameMain.data.localPlanet.id;
int key = MarkerPool.markerIdInPlanet[id][i];
OrderNode val = new OrderNode();
val.type = (EOrderType)1;
val.target = MarkerPool.markerPool[key].pos;
val.objType = (EObjectType)0;
val.objId = 0;
val.objPos = MarkerPool.markerPool[key].pos;
GameMain.mainPlayer.orders.currentOrder = val;
CircleGizmo val2 = CircleGizmo.Create(0, val.target, 0.27f);
((GizmoBase)val2).relateObject = val;
val2.color = MarkerPool.markerPool[key].color;
val2.fadeInScale = 1.8f;
val2.fadeInTime = 0.15f;
val2.fadeOutScale = 1.8f;
val2.fadeOutTime = 0.15f;
val2.alphaMultiplier = 0.5f;
val2.multiplier = 3f;
((GizmoBase)val2).Open();
GameMain.mainPlayer.gizmo.orderGizmos.Add((GizmoBase)(object)val2);
LineGizmo val3 = LineGizmo.Create(0, val.target, GameMain.mainPlayer.position);
val3.color = MarkerPool.markerPool[key].color;
((GizmoBase)val3).relateObject = val;
val3.autoRefresh = true;
val3.width = 3f;
val3.alphaMultiplier = 0.5f;
val3.multiplier = 3f;
val3.spherical = true;
((GizmoBase)val3).Open();
GameMain.mainPlayer.gizmo.orderGizmos.Add((GizmoBase)(object)val3);
Guiding = true;
}
}
public static void OnRightClick(GameObject obj)
{
if (((Object)obj).name == "markerButton" && !GameMain.data.mainPlayer.sailing)
{
if (editMode)
{
modeText.GetComponent<Text>().text = Localization.Translate("Guide\nMode");
MarkerEditor.Close();
editMode = false;
}
else
{
modeText.GetComponent<Text>().text = Localization.Translate("Edit\nMode");
editMode = true;
}
Refresh();
}
}
public static void Refresh()
{
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
//IL_0440: Unknown result type (might be due to invalid IL or missing references)
//IL_0484: Unknown result type (might be due to invalid IL or missing references)
//IL_0489: 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_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_0329: Unknown result type (might be due to invalid IL or missing references)
//IL_032e: Unknown result type (might be due to invalid IL or missing references)
//IL_0354: Unknown result type (might be due to invalid IL or missing references)
//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
int id = GameMain.localPlanet.id;
if (!MarkerPool.markerIdInPlanet.ContainsKey(id))
{
List<int> value = new List<int>();
MarkerPool.markerIdInPlanet.Add(id, value);
}
for (int i = 0; i < Main.maxMarker; i++)
{
if (i < MarkerPool.markerIdInPlanet[id].Count)
{
int key = MarkerPool.markerIdInPlanet[id][i];
MarkerPool.Marker marker = MarkerPool.markerPool[key];
((Graphic)boxMarker[i].GetComponent<Image>()).color = marker.color;
boxMarker[i].SetActive(true);
((Graphic)boxSquare[i].GetComponent<Image>()).color = new Color(marker.color.r * 0.3f, marker.color.g * 0.3f, marker.color.b * 0.3f, 1f);
boxSquare[i].SetActive(true);
boxText[i].GetComponent<Text>().text = marker.desc;
if (marker.icon1ID == 0 && marker.icon2ID == 0)
{
boxText[i].GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(60f, 60f, 0f));
boxText[i].transform.localPosition = new Vector3(0f, 0f, 0f);
}
else
{
boxText[i].GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(60f, 35f, 0f));
boxText[i].transform.localPosition = new Vector3(0f, -15f, 0f);
}
boxText[i].SetActive(true);
if (marker.icon1ID == 0)
{
boxIcon1[i].SetActive(false);
}
else
{
boxIcon1[i].GetComponent<Image>().sprite = LDB.signals.IconSprite(marker.icon1ID);
boxIcon1[i].SetActive(true);
}
if (marker.icon2ID == 0)
{
boxIcon2[i].SetActive(false);
}
else
{
boxIcon2[i].GetComponent<Image>().sprite = LDB.signals.IconSprite(marker.icon2ID);
boxIcon2[i].SetActive(true);
}
if (marker.icon2ID == 0 && marker.desc == "")
{
boxIcon1[i].GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(60f, 60f, 0f));
boxIcon1[i].transform.localPosition = new Vector3(0f, 0f, 0f);
}
else
{
boxIcon1[i].GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(30f, 30f, 0f));
boxIcon1[i].transform.localPosition = new Vector3(-15f, 15f, 0f);
}
}
else
{
boxMarker[i].SetActive(false);
}
}
if (editMode && MarkerPool.markerIdInPlanet[id].Count < Main.maxMarker)
{
int count = MarkerPool.markerIdInPlanet[id].Count;
((Graphic)boxMarker[count].GetComponent<Image>()).color = new Color(0.7f, 0.5f, 0f, 1f);
boxSquare[count].SetActive(false);
boxIcon1[count].SetActive(false);
boxIcon2[count].SetActive(false);
boxText[count].transform.localPosition = new Vector3(0f, 0f, 0f);
boxText[count].GetComponent<Text>().text = Localization.Translate("New\nMarker");
boxText[count].GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(60f, 60f, 0f));
boxMarker[count].SetActive(true);
}
}
}
public class MarkerPool : MonoBehaviour
{
public struct Marker
{
public int planetID;
public Vector3 pos;
public int icon1ID;
public int icon2ID;
public Color color;
public string desc;
public bool alwaysDisplay;
public bool throughPlanet;
public bool ShowArrow;
}
public static Dictionary<int, List<int>> markerIdInPlanet = new Dictionary<int, List<int>>();
public static Dictionary<int, Marker> markerPool = new Dictionary<int, Marker>();
public static int markerCursor = 0;
public static bool markerEnable = true;
public static GameObject[] markers;
public static Image[] Base;
public static Image[] BaseRound;
public static Image[] icon1s;
public static Image[] icon2s;
public static Text[] decs;
public static bool markerCreated = false;
public static void Create()
{
markers = (GameObject[])(object)new GameObject[Main.maxMarker];
Base = (Image[])(object)new Image[Main.maxMarker];
BaseRound = (Image[])(object)new Image[Main.maxMarker];
icon1s = (Image[])(object)new Image[Main.maxMarker];
icon2s = (Image[])(object)new Image[Main.maxMarker];
decs = (Text[])(object)new Text[Main.maxMarker];
for (int i = 0; i < Main.maxMarker; i++)
{
markers[i] = Object.Instantiate<GameObject>(MarkerPrefab.pinBasePrefab.gameObject, MarkerPrefab.markerGroup.transform);
Base[i] = markers[i].GetComponent<Image>();
BaseRound[i] = ((Component)markers[i].transform.Find("round")).GetComponent<Image>();
icon1s[i] = ((Component)markers[i].transform.Find("round/pinBaseIcon1")).GetComponent<Image>();
icon2s[i] = ((Component)markers[i].transform.Find("round/pinBaseIcon2")).GetComponent<Image>();
decs[i] = ((Component)markers[i].transform.Find("round/pinBaseText")).GetComponent<Text>();
}
markerCreated = true;
}
public static void Refresh()
{
//IL_00c5: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0311: Unknown result type (might be due to invalid IL or missing references)
//IL_028e: Unknown result type (might be due to invalid IL or missing references)
//IL_0293: Unknown result type (might be due to invalid IL or missing references)
//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0371: Unknown result type (might be due to invalid IL or missing references)
//IL_0376: Unknown result type (might be due to invalid IL or missing references)
//IL_039d: Unknown result type (might be due to invalid IL or missing references)
if (GameMain.data == null || GameMain.localPlanet == null)
{
return;
}
int id = GameMain.localPlanet.id;
if (!markerIdInPlanet.ContainsKey(id))
{
List<int> value = new List<int>();
markerIdInPlanet.Add(id, value);
}
if (markerIdInPlanet[id].Count <= 0 || !markerCreated)
{
return;
}
Color color = default(Color);
for (int i = 0; i < markerIdInPlanet[id].Count; i++)
{
int key = markerIdInPlanet[id][i];
if (markerPool.ContainsKey(key))
{
((Graphic)Base[i]).color = markerPool[key].color;
((Color)(ref color))..ctor(markerPool[key].color.r * 0.3f, markerPool[key].color.g * 0.3f, markerPool[key].color.b * 0.3f, 1f);
((Graphic)BaseRound[i]).color = color;
if (markerPool[key].icon1ID == 0)
{
((Component)icon1s[i]).gameObject.SetActive(false);
}
else
{
((Component)icon1s[i]).gameObject.SetActive(true);
icon1s[i].sprite = LDB.signals.IconSprite(markerPool[key].icon1ID);
}
if (markerPool[key].icon2ID == 0)
{
((Component)icon2s[i]).gameObject.SetActive(false);
}
else
{
((Component)icon2s[i]).gameObject.SetActive(true);
icon2s[i].sprite = LDB.signals.IconSprite(markerPool[key].icon2ID);
}
decs[i].text = markerPool[key].desc;
if (markerPool[key].icon1ID == 0 && markerPool[key].icon2ID == 0)
{
((Component)decs[i]).GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(130f, 130f, 0f));
((Component)decs[i]).transform.localPosition = new Vector3(0f, 0f, 0f);
}
else
{
((Component)decs[i]).GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(130f, 70f, 0f));
((Component)decs[i]).transform.localPosition = new Vector3(0f, -28f, 0f);
}
if (markerPool[key].icon2ID == 0 && markerPool[key].desc == "")
{
((Component)icon1s[i]).GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(130f, 130f, 0f));
((Component)icon1s[i]).transform.localPosition = new Vector3(0f, 0f, 0f);
}
else
{
((Component)icon1s[i]).GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(60f, 60f, 0f));
((Component)icon1s[i]).transform.localPosition = new Vector3(-30f, 30f, 0f);
}
}
}
}
public static void Crear()
{
for (int i = 0; i < Main.maxMarker; i++)
{
markers[i].gameObject.SetActive(false);
}
}
public static void Update()
{
if (!MarkerList.showList)
{
MarkerPrefab.markerGroup.SetActive(false);
return;
}
int id = GameMain.data.localPlanet.id;
MarkerPrefab.markerGroup.SetActive(true);
for (int i = 0; i < Main.maxMarker; i++)
{
if (markerIdInPlanet.ContainsKey(id) && i < markerIdInPlanet[id].Count)
{
int num = markerIdInPlanet[id][i];
TransformPosAndDraw(i, num);
}
else
{
markers[i].gameObject.SetActive(false);
}
}
}
public static void TransformPosAndDraw(int i, int num6)
{
//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_001b: 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_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: 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_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: 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_0064: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: 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_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: 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_018b: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_0302: Unknown result type (might be due to invalid IL or missing references)
//IL_01cf: 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_0333: Unknown result type (might be due to invalid IL or missing references)
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
//IL_0389: Unknown result type (might be due to invalid IL or missing references)
//IL_0390: Unknown result type (might be due to invalid IL or missing references)
//IL_022a: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_0262: Unknown result type (might be due to invalid IL or missing references)
//IL_0288: Unknown result type (might be due to invalid IL or missing references)
//IL_0289: Unknown result type (might be due to invalid IL or missing references)
//IL_028d: Unknown result type (might be due to invalid IL or missing references)
//IL_0294: Unknown result type (might be due to invalid IL or missing references)
//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02af: Unknown result type (might be due to invalid IL or missing references)
//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
Vector3 localPosition = ((Component)GameCamera.main).transform.localPosition;
Vector3 forward = ((Component)GameCamera.main).transform.forward;
float realRadius = GameMain.localPlanet.realRadius;
Marker marker = markerPool[num6];
Vector3 val = ((Vector3)(ref marker.pos)).normalized * (realRadius + 15f);
Vector3 val2 = val - localPosition;
float magnitude = ((Vector3)(ref val2)).magnitude;
float num7 = Vector3.Dot(forward, val2);
if (magnitude < 1f || num7 < 1f)
{
markers[i].SetActive(false);
return;
}
Vector2 val3 = default(Vector2);
bool flag = UIRoot.ScreenPointIntoRect(GameCamera.main.WorldToScreenPoint(val), MarkerPrefab.markerGroup.GetComponent<RectTransform>(), ref val3);
if (Mathf.Abs(val3.x) > 8000f)
{
flag = false;
}
if (Mathf.Abs(val3.y) > 8000f)
{
flag = false;
}
RCHCPU val4 = default(RCHCPU);
if (Phys.RayCastSphere(localPosition, val2 / magnitude, magnitude, Vector3.zero, realRadius, ref val4))
{
flag = false;
}
if (flag || markerPool[num6].throughPlanet)
{
UIRoot.ScreenPointIntoRect(GameCamera.main.WorldToScreenPoint(val), MarkerPrefab.markerGroup.GetComponent<RectTransform>(), ref val3);
Vector3 val5 = Vector2.op_Implicit(RectTransformUtility.WorldToScreenPoint(GameCamera.main, markerPool[num6].pos));
Vector3 val6 = Vector2.op_Implicit(RectTransformUtility.WorldToScreenPoint(GameCamera.main, GameMain.mainPlayer.position));
int uiLayoutHeight = DSPGame.globalOption.uiLayoutHeight;
int num8 = uiLayoutHeight * Screen.width / Screen.height;
if (markerPool[num6].alwaysDisplay)
{
val3.x = Mathf.Round(val3.x);
if (val3.x < 30f)
{
val3.x = 30f;
}
else if (val3.x > (float)(num8 - 30))
{
val3.x = num8 - 30;
}
val3.y = Mathf.Round(val3.y);
if (val3.y < 30f)
{
val3.y = 30f;
}
else if (val3.y > (float)(uiLayoutHeight - 30))
{
val3.y = uiLayoutHeight - 30;
}
else if (Phys.RayCastSphere(localPosition, val2 / magnitude, magnitude, Vector3.zero, realRadius, ref val4))
{
float num9 = val3.y / (val3.x - (float)(num8 / 2));
float num10 = uiLayoutHeight / (num8 / 2);
if (num9 > num10 || 0f - num9 > num10)
{
}
float num11 = val3.y / num9;
}
}
markers[i].GetComponent<RectTransform>().anchoredPosition = val3;
if (magnitude < 50f)
{
MarkerPrefab.pinBasePrefab.transform.localScale = new Vector3(0.7f, 0.7f, 0.7f);
}
else if (magnitude < 250f)
{
float num12 = (float)(0.8 - (double)magnitude * 0.002);
markers[i].transform.localScale = new Vector3(1f, 1f, 1f) * num12;
}
else
{
markers[i].transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
}
markers[i].SetActive(true);
}
else
{
markers[i].SetActive(false);
}
}
}
[HarmonyPatch]
internal class Patch
{
[HarmonyPostfix]
[HarmonyPatch(typeof(UIEscMenu), "OnButton5Click")]
public static void UIEscMenu_OnButton5Click_Postfix(UIEscMenu __instance)
{
MarkerPool.markerPool.Clear();
MarkerPool.markerIdInPlanet.Clear();
MarkerPool.markerCursor = 0;
MarkerPool.markerCreated = false;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(UIOptionWindow), "ApplyOptions")]
public static void UIOptionWindowa_ApplyOptions_Postfix(UIOptionWindow __instance)
{
//IL_0037: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
int uiLayoutHeight = DSPGame.globalOption.uiLayoutHeight;
int num = uiLayoutHeight * Screen.width / Screen.height;
MarkerList.markerList.transform.localPosition = new Vector3((float)(num / 2 - 60), (float)(uiLayoutHeight / 2 - 70), 0f);
int num2 = (uiLayoutHeight - 270 - 115) / MarkerList.boxSize;
for (int i = 0; i < Main.maxMarker; i++)
{
float num3 = (float)MarkerList.boxSize / 70f;
MarkerList.boxMarker[i].transform.localScale = new Vector3(num3, num3, 1f);
int num4 = 20 - (MarkerList.boxSize + 3) * (i / num2);
int num5 = -68 - (MarkerList.boxSize + 3) * (i % num2);
MarkerList.boxMarker[i].transform.localPosition = new Vector3((float)num4, (float)num5, 0f);
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(UIKeyTips), "_OnUpdate")]
public static bool UIKeyTips_OnUpdate_Prefix(UIOptionWindow __instance)
{
if (Main.DisableKeyTips.Value)
{
return false;
}
return true;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(GameData), "ArrivePlanet")]
public static void UIStarDetail_ArrivePlanet_Postfix()
{
MarkerPrefab.markerGroup.SetActive(true);
MarkerList.listBase.SetActive(true);
MarkerPool.Update();
ArrowPool.Update();
MarkerList.Refresh();
MarkerPool.Refresh();
}
[HarmonyPostfix]
[HarmonyPatch(typeof(GameData), "LeavePlanet")]
public static void UIStarDetail_LeavePlanet_Postfix()
{
MarkerPrefab.markerGroup.SetActive(false);
MarkerList.listBase.SetActive(false);
}
[HarmonyPostfix]
[HarmonyPatch(typeof(UILoadGameWindow), "OnLoadClick")]
public static void UILoadGameWindow_OnLoadClick_Postfix()
{
MarkerPrefab.markerGroup.SetActive(false);
MarkerList.listBase.SetActive(false);
}
}
internal class MarkerPrefab : MonoBehaviour
{
public static GameObject markerGroup = new GameObject();
public static GameObject pinBasePrefab = new GameObject();
public static GameObject pinBaseRound = new GameObject();
public static GameObject pinBaseText = new GameObject();
public static GameObject pinBaseIcon1 = new GameObject();
public static GameObject pinBaseIcon2 = new GameObject();
public static void Create()
{
//IL_00ad: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: 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_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Unknown result type (might be due to invalid IL or missing references)
//IL_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Unknown result type (might be due to invalid IL or missing references)
//IL_0325: Unknown result type (might be due to invalid IL or missing references)
//IL_0344: Unknown result type (might be due to invalid IL or missing references)
//IL_0363: Unknown result type (might be due to invalid IL or missing references)
//IL_0382: Unknown result type (might be due to invalid IL or missing references)
//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
//IL_0480: Unknown result type (might be due to invalid IL or missing references)
//IL_0509: Unknown result type (might be due to invalid IL or missing references)
//IL_052d: Unknown result type (might be due to invalid IL or missing references)
//IL_0532: Unknown result type (might be due to invalid IL or missing references)
//IL_0556: Unknown result type (might be due to invalid IL or missing references)
//IL_057a: Unknown result type (might be due to invalid IL or missing references)
//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
//IL_0613: Unknown result type (might be due to invalid IL or missing references)
//IL_0618: Unknown result type (might be due to invalid IL or missing references)
//IL_063c: Unknown result type (might be due to invalid IL or missing references)
//IL_0660: Unknown result type (might be due to invalid IL or missing references)
markerGroup = Object.Instantiate<GameObject>(GameObject.Find("UI Root/Overlay Canvas/In Game/Scene UIs/Vein Marks"), GameObject.Find("UI Root/Overlay Canvas/In Game/Scene UIs").transform);
((Object)markerGroup).name = "Marker Group";
Object.Destroy((Object)(object)markerGroup.GetComponent<UIVeinDetail>());
markerGroup.SetActive(true);
pinBasePrefab.transform.SetParent(markerGroup.transform);
((Object)pinBasePrefab).name = "pinBasePrefab";
pinBasePrefab.AddComponent<Image>().sprite = Main.merkerSprite;
((Graphic)pinBasePrefab.GetComponent<Image>()).color = new Color(0f, 1f, 1f, 1f);
pinBasePrefab.GetComponent<RectTransform>().anchorMax = new Vector2(0f, 0f);
pinBasePrefab.GetComponent<RectTransform>().anchorMin = new Vector2(0f, 0f);
pinBasePrefab.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(200f, 200f, 0f));
pinBasePrefab.transform.localPosition = new Vector3(200f, 900f, 0f);
pinBasePrefab.transform.localScale = new Vector3(1f, 1f, 1f);
pinBasePrefab.SetActive(false);
pinBaseRound.transform.SetParent(pinBasePrefab.transform);
((Object)pinBaseRound).name = "round";
pinBaseRound.AddComponent<Image>().sprite = Main.roundSprite;
((Graphic)pinBaseRound.GetComponent<Image>()).color = new Color(0f, 0.4f, 0.4f, 1f);
pinBaseRound.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(155f, 155f, 0f));
pinBaseRound.transform.localPosition = new Vector3(0f, 18f, 0f);
pinBaseRound.transform.localScale = new Vector3(1f, 1f, 1f);
pinBaseRound.SetActive(true);
pinBaseText = Object.Instantiate<GameObject>(((Component)markerGroup.transform.Find("vein-tip-prefab/info-text")).gameObject, pinBaseRound.transform);
pinBaseText.transform.SetParent(pinBaseRound.transform);
((Object)pinBaseText).name = "pinBaseText";
pinBaseText.GetComponent<RectTransform>().anchoredPosition = new Vector2(0.5f, 0.5f);
pinBaseText.GetComponent<RectTransform>().anchoredPosition3D = new Vector3(0.5f, 0.5f, 0f);
pinBaseText.GetComponent<RectTransform>().anchorMax = new Vector2(0.5f, 0.5f);
pinBaseText.GetComponent<RectTransform>().anchorMin = new Vector2(0.5f, 0.5f);
pinBaseText.GetComponent<RectTransform>().offsetMax = new Vector2(65f, 35f);
pinBaseText.GetComponent<RectTransform>().offsetMin = new Vector2(-65f, -35f);
pinBaseText.GetComponent<RectTransform>().pivot = new Vector2(0.5f, 0.5f);
pinBaseText.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(130f, 70f, 0f));
((Shadow)pinBaseText.AddComponent<Outline>()).effectDistance = new Vector2(2f, -2f);
pinBaseText.GetComponent<Text>().text = "!TEST!";
pinBaseText.GetComponent<Text>().alignment = (TextAnchor)4;
pinBaseText.GetComponent<Text>().lineSpacing = 0.6f;
pinBaseText.GetComponent<Text>().horizontalOverflow = (HorizontalWrapMode)0;
pinBaseText.GetComponent<Text>().verticalOverflow = (VerticalWrapMode)0;
pinBaseText.GetComponent<Text>().resizeTextForBestFit = true;
pinBaseText.GetComponent<Text>().resizeTextMaxSize = 60;
pinBaseText.GetComponent<Text>().fontSize = 30;
pinBaseText.transform.localPosition = new Vector3(0f, -28f, 0f);
Object.Destroy((Object)(object)pinBaseText.GetComponent<Shadow>());
pinBaseText.SetActive(true);
pinBaseIcon1.AddComponent<Image>().sprite = ((ProtoSet<TechProto>)(object)LDB.techs).Select(1001).iconSprite;
((Object)pinBaseIcon1).name = "pinBaseIcon1";
pinBaseIcon1.transform.SetParent(pinBaseRound.transform);
((Shadow)pinBaseIcon1.AddComponent<Outline>()).effectDistance = new Vector2(2f, -2f);
pinBaseIcon1.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(60f, 60f, 0f));
pinBaseIcon1.transform.localPosition = new Vector3(-30f, 30f, 0f);
pinBaseIcon1.transform.localScale = new Vector3(1f, 1f, 1f);
pinBaseIcon1.SetActive(true);
pinBaseIcon2.AddComponent<Image>().sprite = ((ProtoSet<RecipeProto>)(object)LDB.recipes).Select(2).iconSprite;
((Object)pinBaseIcon2).name = "pinBaseIcon2";
pinBaseIcon2.transform.SetParent(pinBaseRound.transform);
((Shadow)pinBaseIcon2.AddComponent<Outline>()).effectDistance = new Vector2(2f, -2f);
pinBaseIcon2.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(60f, 60f, 0f));
pinBaseIcon2.transform.localPosition = new Vector3(30f, 30f, 0f);
pinBaseIcon2.transform.localScale = new Vector3(1f, 1f, 1f);
pinBaseIcon2.SetActive(true);
Object.Destroy((Object)(object)((Component)markerGroup.transform.Find("vein-tip-prefab")).gameObject);
Object.Destroy((Object)(object)((Component)markerGroup.transform.Find("vein-tip-cursor")).gameObject);
}
}
internal class MarkerEditor : MonoBehaviour
{
public static GameObject window = new GameObject();
public static GameObject markerPrefab = new GameObject();
public static GameObject textBox = new GameObject();
public static GameObject descBox = new GameObject();
public static GameObject iconBox1 = new GameObject();
public static GameObject iconBox2 = new GameObject();
public static GameObject colorSelecter = new GameObject();
public static GameObject colorTitle = new GameObject();
public static GameObject[] colorBox = (GameObject[])(object)new GameObject[7];
public static GameObject iconTitle = new GameObject();
public static GameObject descTitle = new GameObject();
public static GameObject checkTitle1 = new GameObject();
public static GameObject checkTitle2 = new GameObject();
public static GameObject checkTitle3 = new GameObject();
public static GameObject checkBox1 = new GameObject();
public static GameObject checkBox2 = new GameObject();
public static GameObject checkBox3 = new GameObject();
public static GameObject closeButton = new GameObject();
public static GameObject applyButton = new GameObject();
public static GameObject deleteButton = new GameObject();
public static GameObject crearButton = new GameObject();
public static GameObject previewText = new GameObject();
public static Color[] color = (Color[])(object)new Color[7];
public static int ID;
public static int planetID;
public static Vector3 pos;
public static int iconID1;
public static int iconID2;
public static Color baseColor;
public static string desc;
public static bool alwaysDisplay;
public static bool throughPlanet;
public static bool ShowArrow;
public static Sprite emptySprite;
public static bool newOne;
public static void Open(int num)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: 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_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: 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_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
Vector3 localPosition = MarkerList.boxMarker[num].transform.localPosition;
float num2 = localPosition.y + 530f;
int uiLayoutHeight = DSPGame.globalOption.uiLayoutHeight;
if (num2 < window.GetComponent<RectTransform>().sizeDelta.y - (float)(uiLayoutHeight / 2))
{
num2 = window.GetComponent<RectTransform>().sizeDelta.y - (float)(uiLayoutHeight / 2);
}
window.transform.localPosition = new Vector3(localPosition.x + 637f, num2, 0f);
int id = GameMain.localPlanet.id;
if (num < MarkerPool.markerIdInPlanet[id].Count)
{
int num3 = MarkerPool.markerIdInPlanet[id][num];
MarkerPool.Marker marker = MarkerPool.markerPool[num3];
ID = num3;
planetID = marker.planetID;
pos = marker.pos;
iconID1 = marker.icon1ID;
iconID2 = marker.icon2ID;
if (marker.icon1ID == 0)
{
Sprite val = emptySprite;
}
else
{
Sprite val = LDB.signals.IconSprite(marker.icon1ID);
}
if (marker.icon2ID == 0)
{
Sprite val2 = emptySprite;
}
else
{
Sprite val2 = LDB.signals.IconSprite(marker.icon2ID);
}
baseColor = marker.color;
desc = marker.desc;
alwaysDisplay = marker.alwaysDisplay;
throughPlanet = marker.throughPlanet;
ShowArrow = marker.ShowArrow;
newOne = false;
deleteButton.SetActive(true);
}
else
{
planetID = id;
iconID1 = 0;
iconID2 = 0;
Sprite val = emptySprite;
Sprite val2 = emptySprite;
baseColor = color[0];
desc = "";
alwaysDisplay = true;
throughPlanet = true;
ShowArrow = true;
newOne = true;
deleteButton.SetActive(false);
}
Refresh();
window.SetActive(true);
}
public static void Close()
{
window.SetActive(false);
}
public static void Create()
{
//IL_0016: 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_0035: 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_0054: 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_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: 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_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: 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_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_0296: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
//IL_035a: Unknown result type (might be due to invalid IL or missing references)
//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
//IL_0424: Unknown result type (might be due to invalid IL or missing references)
//IL_0485: Unknown result type (might be due to invalid IL or missing references)
//IL_048a: Unknown result type (might be due to invalid IL or missing references)
//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0522: Unknown result type (might be due to invalid IL or missing references)
//IL_0528: Expected O, but got Unknown
//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0626: Unknown result type (might be due to invalid IL or missing references)
//IL_068b: Unknown result type (might be due to invalid IL or missing references)
//IL_0695: Expected O, but got Unknown
//IL_06ed: Unknown result type (might be due to invalid IL or missing references)
//IL_0768: Unknown result type (might be due to invalid IL or missing references)
//IL_0787: Unknown result type (might be due to invalid IL or missing references)
//IL_07a6: Unknown result type (might be due to invalid IL or missing references)
//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
//IL_07cf: Unknown result type (might be due to invalid IL or missing references)
//IL_07fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0870: Unknown result type (might be due to invalid IL or missing references)
//IL_08bd: Unknown result type (might be due to invalid IL or missing references)
//IL_0924: Unknown result type (might be due to invalid IL or missing references)
//IL_099f: Unknown result type (might be due to invalid IL or missing references)
//IL_09c3: Unknown result type (might be due to invalid IL or missing references)
//IL_09e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0a01: Unknown result type (might be due to invalid IL or missing references)
//IL_0a20: Unknown result type (might be due to invalid IL or missing references)
//IL_0a3f: Unknown result type (might be due to invalid IL or missing references)
//IL_0a5e: Unknown result type (might be due to invalid IL or missing references)
//IL_0a82: Unknown result type (might be due to invalid IL or missing references)
//IL_0a87: Unknown result type (might be due to invalid IL or missing references)
//IL_0aab: Unknown result type (might be due to invalid IL or missing references)
//IL_0acf: Unknown result type (might be due to invalid IL or missing references)
//IL_0c44: Unknown result type (might be due to invalid IL or missing references)
//IL_0c82: Unknown result type (might be due to invalid IL or missing references)
//IL_0c87: Unknown result type (might be due to invalid IL or missing references)
//IL_0ce3: Unknown result type (might be due to invalid IL or missing references)
//IL_0d02: Unknown result type (might be due to invalid IL or missing references)
//IL_0d21: Unknown result type (might be due to invalid IL or missing references)
//IL_0d75: Unknown result type (might be due to invalid IL or missing references)
//IL_0de1: Unknown result type (might be due to invalid IL or missing references)
//IL_0e4d: Unknown result type (might be due to invalid IL or missing references)
//IL_0e9a: Unknown result type (might be due to invalid IL or missing references)
//IL_0f06: Unknown result type (might be due to invalid IL or missing references)
//IL_0f5c: Unknown result type (might be due to invalid IL or missing references)
//IL_0fa5: Unknown result type (might be due to invalid IL or missing references)
//IL_0fce: Unknown result type (might be due to invalid IL or missing references)
//IL_101c: Unknown result type (might be due to invalid IL or missing references)
//IL_106f: Unknown result type (might be due to invalid IL or missing references)
//IL_10bd: Unknown result type (might be due to invalid IL or missing references)
//IL_10ec: Unknown result type (might be due to invalid IL or missing references)
//IL_112f: Unknown result type (might be due to invalid IL or missing references)
//IL_117a: Unknown result type (might be due to invalid IL or missing references)
//IL_1184: Expected O, but got Unknown
//IL_119b: Unknown result type (might be due to invalid IL or missing references)
//IL_11a5: Expected O, but got Unknown
//IL_11bc: Unknown result type (might be due to invalid IL or missing references)
//IL_11c6: Expected O, but got Unknown
//IL_11dd: Unknown result type (might be due to invalid IL or missing references)
//IL_11e7: Expected O, but got Unknown
//IL_11fe: Unknown result type (might be due to invalid IL or missing references)
//IL_1208: Expected O, but got Unknown
//IL_1240: Unknown result type (might be due to invalid IL or missing references)
//IL_124a: Expected O, but got Unknown
//IL_1261: Unknown result type (might be due to invalid IL or missing references)
//IL_126b: Expected O, but got Unknown
//IL_1282: Unknown result type (might be due to invalid IL or missing references)
//IL_128c: Expected O, but got Unknown
//IL_12a3: Unknown result type (might be due to invalid IL or missing references)
//IL_12ad: Expected O, but got Unknown
color[0] = new Color(1f, 0.73f, 0.78f);
color[1] = new Color(0.9f, 0f, 0.5f);
color[2] = new Color(0.92f, 0.34f, 0.06f);
color[3] = new Color(1f, 0.95f, 0f);
color[4] = new Color(0.16f, 0.68f, 0.23f);
color[5] = new Color(0f, 0.63f, 0.92f);
color[6] = new Color(0.39f, 0.12f, 0.53f);
window = Object.Instantiate<GameObject>(GameObject.Find("UI Root/Overlay Canvas/In Game/Windows/Replicator Window").gameObject, GameObject.Find("UI Root/Overlay Canvas/In Game/Windows").transform);
((Object)window).name = "Marker Editer";
Object.Destroy((Object)(object)((Component)window.transform.Find("panel-bg/title-text")).gameObject.GetComponent<Localizer>());
((Component)window.transform.Find("panel-bg/title-text")).GetComponent<Text>().text = Localization.Translate("Marker Editor");
window.GetComponent<RectTransform>().sizeDelta = new Vector2(500f, 500f);
Object.Destroy((Object)(object)window.GetComponent<UIReplicatorWindow>());
Object.Destroy((Object)(object)((Component)window.transform.Find("tree-tweener-1")).gameObject);
Object.Destroy((Object)(object)((Component)window.transform.Find("tree-tweener-2")).gameObject);
Object.Destroy((Object)(object)((Component)window.transform.Find("queue-group")).gameObject);
Object.Destroy((Object)(object)((Component)window.transform.Find("recipe-group")).gameObject);
Object.Destroy((Object)(object)((Component)window.transform.Find("recipe-tree")).gameObject);
window.SetActive(false);
markerPrefab = Object.Instantiate<GameObject>(MarkerPrefab.pinBasePrefab.gameObject, window.transform);
((Object)markerPrefab).name = "markerPrefab";
markerPrefab.GetComponent<RectTransform>().anchorMax = new Vector2(0f, 1f);
markerPrefab.GetComponent<RectTransform>().anchorMin = new Vector2(0f, 1f);
markerPrefab.GetComponent<RectTransform>().pivot = new Vector2(0f, 1f);
markerPrefab.transform.localPosition = new Vector3(-225f, -95f, 0f);
markerPrefab.transform.localScale = new Vector3(1f, 1f, 0f);
((Component)markerPrefab.transform.Find("round/pinBaseIcon1")).gameObject.GetComponent<Image>().sprite = null;
((Component)markerPrefab.transform.Find("round/pinBaseIcon1")).gameObject.transform.localPosition = new Vector3(-30f, 30f, 0f);
((Component)markerPrefab.transform.Find("round/pinBaseIcon2")).gameObject.GetComponent<Image>().sprite = null;
((Component)markerPrefab.transform.Find("round/pinBaseIcon2")).gameObject.transform.localPosition = new Vector3(30f, 30f, 0f);
markerPrefab.SetActive(true);
colorTitle = Object.Instantiate<GameObject>(((Component)window.transform.Find("panel-bg/title-text")).gameObject, window.transform);
((Object)colorTitle).name = "colorTitle";
colorTitle.transform.localPosition = new Vector3(-65f, -70f, 0f);
colorTitle.GetComponent<Text>().alignment = (TextAnchor)5;
colorTitle.GetComponent<Text>().text = Localization.Translate("Color");
colorTitle.GetComponent<Text>().fontSize = 14;
colorTitle.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(100f, 36f, 0f));
colorSelecter = Object.Instantiate<GameObject>(GameObject.Find("UI Root/Overlay Canvas/Mecha Editor UI/Left Panel/scroll-view/Viewport/Left Panel Content/title-group/main-color-cards").gameObject, window.transform);
((Object)colorSelecter).name = "colorSelecter";
colorSelecter.transform.localPosition = new Vector3(200f, -75f, 0f);
colorSelecter.SetActive(true);
int num = colorSelecter.transform.childCount;
foreach (Transform item in colorSelecter.transform)
{
Transform val = item;
if (num == 1)
{
((Component)val).gameObject.SetActive(false);
break;
}
Object.Destroy((Object)(object)((Component)val).gameObject);
num--;
}
for (int i = 0; i < 7; i++)
{
colorBox[i] = Object.Instantiate<GameObject>(((Component)colorSelecter.transform.Find("color")).gameObject, colorSelecter.transform);
((Object)colorBox[i]).name = "color" + i;
colorBox[i].transform.localPosition = new Vector3((float)(-135 + 20 * i), -13f, 0f);
((Behaviour)colorBox[i].GetComponent<Image>()).enabled = true;
((Graphic)colorBox[i].GetComponent<Image>()).color = color[i];
((Behaviour)colorBox[i].GetComponent<Shadow>()).enabled = true;
((Behaviour)colorBox[i].GetComponent<Button>()).enabled = true;
colorBox[i].SetActive(true);
int No = i;
((UnityEvent)colorBox[i].GetComponent<Button>().onClick).AddListener((UnityAction)delegate
{
onClickColor(No);
});
}
iconTitle = Object.Instantiate<GameObject>(colorTitle, window.transform);
((Object)iconTitle).name = "iconTitle";
iconTitle.transform.localPosition = new Vector3(-65f, -125f, 0f);
iconTitle.GetComponent<Text>().text = Localization.Translate("Icons");
iconBox1 = Object.Instantiate<GameObject>(((Component)UIRoot.instance.uiGame.blueprintBrowser.inspector.thumbIconImage1).gameObject, window.transform);
((Object)iconBox1).name = "iconBox1";
iconBox1.GetComponent<RectTransform>().anchorMax = new Vector2(0f, 1f);
iconBox1.GetComponent<RectTransform>().anchorMin = new Vector2(0f, 1f);
iconBox1.GetComponent<RectTransform>().pivot = new Vector2(0f, 1f);
iconBox1.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(50f, 50f, 0f));
iconBox1.AddComponent<Button>();
iconBox1.transform.localPosition = new Vector3(45f, -120f, 0f);
iconBox1.SetActive(true);
emptySprite = iconBox1.GetComponent<Image>().sprite;
iconBox2 = Object.Instantiate<GameObject>(iconBox1.gameObject, window.transform);
((Object)iconBox2).name = "iconBox2";
iconBox2.transform.localPosition = new Vector3(95f, -120f, 0f);
descTitle = Object.Instantiate<GameObject>(colorTitle, window.transform);
((Object)descTitle).name = "descTitle";
descTitle.transform.localPosition = new Vector3(-65f, -185f, 0f);
descTitle.GetComponent<Text>().text = Localization.Translate("Description");
previewText = Object.Instantiate<GameObject>(colorTitle, window.transform);
((Object)previewText).name = "previewText";
previewText.transform.localPosition = new Vector3(-200f, -60f, 0f);
previewText.GetComponent<Text>().text = Localization.Translate("Preview");
descBox = Object.Instantiate<GameObject>(((Component)UIRoot.instance.uiGame.blueprintBrowser.inspector.descTextInput).gameObject, window.transform);
((Object)descBox).name = "descBox";
descBox.GetComponent<RectTransform>().anchoredPosition = new Vector2(0.5f, 0.5f);
descBox.GetComponent<RectTransform>().anchoredPosition3D = new Vector3(0.5f, 0.5f, 0f);
descBox.GetComponent<RectTransform>().anchorMax = new Vector2(0.5f, 0.5f);
descBox.GetComponent<RectTransform>().anchorMin = new Vector2(0.5f, 0.5f);
descBox.GetComponent<RectTransform>().offsetMax = new Vector2(65f, 35f);
descBox.GetComponent<RectTransform>().offsetMin = new Vector2(-65f, -35f);
descBox.GetComponent<RectTransform>().pivot = new Vector2(0.5f, 0.5f);
descBox.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(130f, 70f, 0f));
descBox.transform.localPosition = new Vector3(95f, -205f, 0f);
descBox.transform.localScale = new Vector3(0.7f, 0.7f, 0f);
Object.Destroy((Object)(object)descBox.GetComponent<UIButton>());
((Component)descBox.transform.Find("value-text")).gameObject.GetComponent<Text>().text = "!TEST!";
((Component)descBox.transform.Find("value-text")).gameObject.GetComponent<Text>().alignment = (TextAnchor)4;
((Component)descBox.transform.Find("value-text")).gameObject.GetComponent<Text>().lineSpacing = 0.6f;
((Component)descBox.transform.Find("value-text")).gameObject.GetComponent<Text>().horizontalOverflow = (HorizontalWrapMode)0;
((Component)descBox.transform.Find("value-text")).gameObject.GetComponent<Text>().verticalOverflow = (VerticalWrapMode)0;
((Component)descBox.transform.Find("value-text")).gameObject.GetComponent<Text>().resizeTextForBestFit = true;
((Component)descBox.transform.Find("value-text")).gameObject.GetComponent<Text>().fontSize = 30;
descBox.SetActive(true);
checkTitle1 = Object.Instantiate<GameObject>(colorTitle, window.transform);
((Object)checkTitle1).name = "checkTitle1";
checkTitle1.transform.localPosition = new Vector3(-260f, -250f, 0f);
checkTitle1.GetComponent<Text>().text = Localization.Translate("Always displayed");
checkTitle1.GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(300f, 32f, 0f));
checkBox1 = Object.Instantiate<GameObject>(((Component)UIRoot.instance.uiGame.buildMenu.uxFacilityCheck).gameObject, window.transform);
((Object)checkBox1).name = "checkBox1";
checkBox1.GetComponent<RectTransform>().anchorMax = new Vector2(0f, 1f);
checkBox1.GetComponent<RectTransform>().anchorMin = new Vector2(0f, 1f);
checkBox1.GetComponent<RectTransform>().pivot = new Vector2(0f, 1f);
checkBox1.AddComponent<Button>();
((Behaviour)((Component)checkBox1.transform.Find("checked")).gameObject.GetComponent<Image>()).enabled = true;
checkBox1.transform.localPosition = new Vector3(45f, -250f, 0f);
Object.Destroy((Object)(object)((Component)checkBox1.transform.Find("text")).gameObject);
checkTitle2 = Object.Instantiate<GameObject>(checkTitle1, window.transform);
((Object)checkTitle2).name = "checkTitle2";
checkTitle2.transform.localPosition = new Vector3(-260f, -285f, 0f);
checkTitle2.GetComponent<Text>().text = Localization.Translate("Seen through the planet");
checkBox2 = Object.Instantiate<GameObject>(checkBox1.gameObject, window.transform);
((Object)checkBox2).name = "checkBox2";
checkBox2.transform.localPosition = new Vector3(45f, -285f, 0f);
checkTitle3 = Object.Instantiate<GameObject>(checkTitle1, window.transform);
((Object)checkTitle3).name = "checkTitle3";
checkTitle3.transform.localPosition = new Vector3(-260f, -320f, 0f);
checkTitle3.GetComponent<Text>().text = Localization.Translate("Show the Arrow Guide");
checkBox3 = Object.Instantiate<GameObject>(checkBox1.gameObject, window.transform);
((Object)checkBox3).name = "checkBox3";
checkBox3.transform.localPosition = new Vector3(45f, -320f, 0f);
applyButton = Object.Instantiate<GameObject>(((Component)UIRoot.instance.uiGame.stationWindow.storageUIPrefab.localSdButton).gameObject, window.transform);
applyButton.transform.localPosition = new Vector3(200f, -400f, 0f);
((Object)applyButton).name = "applyButton";
applyButton.GetComponentInChildren<Text>().text = Localization.Translate("Apply");
applyButton.GetComponent<RectTransform>().sizeDelta = new Vector2(100f, 30f);
((Graphic)applyButton.GetComponent<Image>()).color = new Color(0.24f, 0.55f, 0.65f, 0.7f);
applyButton.SetActive(true);
deleteButton = Object.Instantiate<GameObject>(applyButton.gameObject, window.transform);
deleteButton.transform.localPosition = new Vector3(0f, -400f, 0f);
((Object)deleteButton).name = "deleteButton";
deleteButton.GetComponentInChildren<Text>().text = Localization.Translate("Delete");
((Graphic)deleteButton.GetComponent<Image>()).color = new Color(0.7f, 0.5f, 0f, 1f);
deleteButton.SetActive(true);
crearButton = Object.Instantiate<GameObject>(applyButton.gameObject, window.transform);
crearButton.transform.localPosition = new Vector3(200f, -145f, 0f);
((Object)crearButton).name = "crearButton";
crearButton.GetComponent<RectTransform>().sizeDelta = new Vector2(40f, 25f);
crearButton.GetComponentInChildren<Text>().text = Localization.Translate("Clear");
((Graphic)crearButton.GetComponent<Image>()).color = new Color(0.24f, 0.55f, 0.65f, 0.7f);
crearButton.SetActive(true);
closeButton = ((Component)window.transform.Find("panel-bg/btn-box/close-btn")).gameObject;
((UnityEvent)iconBox1.GetComponent<Button>().onClick).AddListener(new UnityAction(onClickIconBox1));
((UnityEvent)iconBox2.GetComponent<Button>().onClick).AddListener(new UnityAction(onClickIconBox2));
((UnityEvent)checkBox1.GetComponent<Button>().onClick).AddListener(new UnityAction(onClickCheckBox1));
((UnityEvent)checkBox2.GetComponent<Button>().onClick).AddListener(new UnityAction(onClickCheckBox2));
((UnityEvent)checkBox3.GetComponent<Button>().onClick).AddListener(new UnityAction(onClickCheckBox3));
((UnityEvent<string>)(object)descBox.GetComponent<InputField>().onEndEdit).AddListener((UnityAction<string>)onEndEditDescBox);
((UnityEvent)closeButton.GetComponent<Button>().onClick).AddListener(new UnityAction(onClickCloseButton));
((UnityEvent)applyButton.GetComponent<Button>().onClick).AddListener(new UnityAction(onClickApplyButton));
((UnityEvent)deleteButton.GetComponent<Button>().onClick).AddListener(new UnityAction(onClickDeleteButton));
((UnityEvent)crearButton.GetComponent<Button>().onClick).AddListener(new UnityAction(onClickCrearButton));
}
public static void Refresh()
{
//IL_0047: 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_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02da: Unknown result type (might be due to invalid IL or missing references)
//IL_030d: Unknown result type (might be due to invalid IL or missing references)
//IL_0266: Unknown result type (might be due to invalid IL or missing references)
//IL_026b: Unknown result type (might be due to invalid IL or missing references)
//IL_029e: Unknown result type (might be due to invalid IL or missing references)
//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
//IL_0408: Unknown result type (might be due to invalid IL or missing references)
//IL_0361: Unknown result type (might be due to invalid IL or missing references)
//IL_0366: Unknown result type (might be due to invalid IL or missing references)
//IL_0399: Unknown result type (might be due to invalid IL or missing references)
Color val = default(Color);
((Color)(ref val))..ctor(baseColor.r * 0.3f, baseColor.g * 0.3f, baseColor.b * 0.3f, 1f);
((Graphic)markerPrefab.GetComponent<Image>()).color = baseColor;
((Graphic)((Component)markerPrefab.transform.Find("round")).gameObject.GetComponent<Image>()).color = val;
if (iconID1 == 0)
{
iconBox1.GetComponent<Image>().sprite = emptySprite;
((Component)markerPrefab.transform.Find("round/pinBaseIcon1")).gameObject.SetActive(false);
}
else
{
iconBox1.GetComponent<Image>().sprite = LDB.signals.IconSprite(iconID1);
((Component)markerPrefab.transform.Find("round/pinBaseIcon1")).gameObject.SetActive(true);
((Component)markerPrefab.transform.Find("round/pinBaseIcon1")).gameObject.GetComponent<Image>().sprite = LDB.signals.IconSprite(iconID1);
}
if (iconID2 == 0)
{
iconBox2.GetComponent<Image>().sprite = emptySprite;
((Component)markerPrefab.transform.Find("round/pinBaseIcon2")).gameObject.SetActive(false);
}
else
{
iconBox2.GetComponent<Image>().sprite = LDB.signals.IconSprite(iconID2);
((Component)markerPrefab.transform.Find("round/pinBaseIcon2")).gameObject.SetActive(true);
((Component)markerPrefab.transform.Find("round/pinBaseIcon2")).gameObject.GetComponent<Image>().sprite = LDB.signals.IconSprite(iconID2);
}
descBox.gameObject.GetComponent<InputField>().text = desc;
((Component)markerPrefab.transform.Find("round/pinBaseText")).GetComponent<Text>().text = desc;
if (iconID1 == 0 && iconID2 == 0)
{
((Component)markerPrefab.transform.Find("round/pinBaseText")).GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(130f, 130f, 0f));
((Component)markerPrefab.transform.Find("round/pinBaseText")).transform.localPosition = new Vector3(0f, 0f, 0f);
}
else
{
((Component)markerPrefab.transform.Find("round/pinBaseText")).GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(130f, 70f, 0f));
((Component)markerPrefab.transform.Find("round/pinBaseText")).transform.localPosition = new Vector3(0f, -28f, 0f);
}
if (iconID2 == 0 && desc == "")
{
((Component)markerPrefab.transform.Find("round/pinBaseIcon1")).GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(130f, 130f, 0f));
((Component)markerPrefab.transform.Find("round/pinBaseIcon1")).transform.localPosition = new Vector3(0f, 0f, 0f);
}
else
{
((Component)markerPrefab.transform.Find("round/pinBaseIcon1")).GetComponent<RectTransform>().sizeDelta = Vector2.op_Implicit(new Vector3(60f, 60f, 0f));
((Component)markerPrefab.transform.Find("round/pinBaseIcon1")).transform.localPosition = new Vector3(-30f, 30f, 0f);
}
((Behaviour)((Component)checkBox1.transform.Find("checked")).gameObject.GetComponent<Image>()).enabled = alwaysDisplay;
((Behaviour)((Component)checkBox2.transform.Find("checked")).gameObject.GetComponent<Image>()).enabled = throughPlanet;
((Behaviour)((Component)checkBox3.transform.Find("checked")).gameObject.GetComponent<Image>()).enabled = ShowArrow;
}
public static void onClickApplyButton()
{
//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_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: 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)
if (!UISignalPicker.isOpened)
{
float realRadius = GameMain.localPlanet.realRadius;
MarkerPool.Marker value = default(MarkerPool.Marker);
value.planetID = GameMain.localPlanet.id;
value.icon1ID = iconID1;
value.icon2ID = iconID2;
value.color = baseColor;
value.desc = desc;
value.alwaysDisplay = alwaysDisplay;
value.throughPlanet = throughPlanet;
value.ShowArrow = ShowArrow;
if (!newOne)
{
value.pos = pos;
MarkerPool.markerPool[ID] = value;
}
else
{
value.pos = GameMain.mainPlayer.position;
MarkerPool.markerPool.Add(MarkerPool.markerCursor + 1, value);
MarkerPool.markerIdInPlanet[value.planetID].Add(MarkerPool.markerCursor + 1);
MarkerPool.markerCursor++;
}
MarkerList.Refresh();
MarkerPool.Refresh();
Close();
}
}
public static void onClickDeleteButton()
{
if (!UISignalPicker.isOpened)
{
MarkerPool.markerPool.Remove(ID);
MarkerPool.markerIdInPlanet[GameMain.localPlanet.id].Remove(ID);
MarkerList.Refresh();
MarkerPool.Refresh();
Close();
}
}
public static void onClickCrearButton()
{
if (!UISignalPicker.isOpened)
{
iconID1 = 0;
iconID2 = 0;
Refresh();
}
}
public static void onClickCloseButton()
{
Close();
}
public static void onClickColor(int i)
{
//IL_0019: 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 (!UISignalPicker.isOpened)
{
baseColor = ((Graphic)colorBox[i].GetComponent<Image>()).color;
Refresh();
}
}
public static void onClickIconBox1()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
if (!UISignalPicker.isOpened)
{
UISignalPicker.Popup(new Vector2(50f, 350f), (Action<int>)onIconBox1Changed);
}
}
public static void onClickIconBox2()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
if (!UISignalPicker.isOpened)
{
UISignalPicker.Popup(new Vector2(50f, 350f), (Action<int>)onIconBox2Changed);
}
}
public static void onIconBox1Changed(int signalId)
{
iconID1 = signalId;
Refresh();
}
public static void onIconBox2Changed(int signalId)
{
iconID2 = signalId;
Refresh();
}
public static void onClickCheckBox1()
{
alwaysDisplay = !alwaysDisplay;
((Behaviour)((Component)checkBox1.transform.Find("checked")).gameObject.GetComponent<Image>()).enabled = alwaysDisplay;
}
public static void onClickCheckBox2()
{
throughPlanet = !throughPlanet;
((Behaviour)((Component)checkBox2.transform.Find("checked")).gameObject.GetComponent<Image>()).enabled = throughPlanet;
}
public static void onClickCheckBox3()
{
ShowArrow = !ShowArrow;
((Behaviour)((Component)checkBox3.transform.Find("checked")).gameObject.GetComponent<Image>()).enabled = ShowArrow;
}
public static void onEndEditDescBox(string str)
{
desc = str;
Refresh();
}
}