using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("GeneralMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GeneralMod")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("96629134-eb8c-4fef-b686-c7f1ca5c70c6")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.reckss.erenshor.bossarrowtracker", "Boss Arrow Tracker", "1.0.35")]
public class BossArrowTracker : BaseUnityPlugin
{
[CompilerGenerated]
private sealed class <ParseCsv>d__36 : IEnumerable<string>, IEnumerable, IEnumerator<string>, IDisposable, IEnumerator
{
private int <>1__state;
private string <>2__current;
private int <>l__initialThreadId;
private string csv;
public string <>3__csv;
private string[] <>s__1;
private int <>s__2;
private string <part>5__3;
private string <t>5__4;
string IEnumerator<string>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ParseCsv>d__36(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>s__1 = null;
<part>5__3 = null;
<t>5__4 = null;
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
if (num != 0)
{
if (num != 1)
{
return false;
}
<>1__state = -1;
goto IL_00ad;
}
<>1__state = -1;
if (string.IsNullOrWhiteSpace(csv))
{
return false;
}
<>s__1 = csv.Split(new char[1] { ',' });
<>s__2 = 0;
goto IL_00ca;
IL_00ad:
<t>5__4 = null;
<part>5__3 = null;
<>s__2++;
goto IL_00ca;
IL_00ca:
if (<>s__2 < <>s__1.Length)
{
<part>5__3 = <>s__1[<>s__2];
<t>5__4 = <part>5__3.Trim();
if (!string.IsNullOrEmpty(<t>5__4))
{
<>2__current = <t>5__4;
<>1__state = 1;
return true;
}
goto IL_00ad;
}
<>s__1 = null;
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<string> IEnumerable<string>.GetEnumerator()
{
<ParseCsv>d__36 <ParseCsv>d__;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
<ParseCsv>d__ = this;
}
else
{
<ParseCsv>d__ = new <ParseCsv>d__36(0);
}
<ParseCsv>d__.csv = <>3__csv;
return <ParseCsv>d__;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<string>)this).GetEnumerator();
}
}
private static readonly string[] DefaultBossNames = new string[159]
{
"Ghost of Wyland Sercher", "Mourning", "Vevillo Polter", "Woe", "Scrubby", "Crypt Keeper", "Failed Cremation", "Priel Lieutenant Bovo", "Priel Lieutenant Lance", "A Skeleton Captain",
"Fearantula", "Ghost of Plaxitheris", "Nightmare", "Plaxitheris", "Shadow of Sleep", "Zashlyn Bloodbane", "An Apparition of Sivakaya", "Dream", "Grizzlepaw", "Kio the Darkbringer",
"Bassalt Vallano", "Greater Vithean Elemental", "Massia the Fallen", "Molorai Brewmistress", "Molorai Captain Sigrid", "Mephallo", "Sagan Ilth", "Tinkles", "Molorai Chef", "Molorai Jailer",
"Old Brackey", "The Lost Sea Giant King", "Spark Royal", "Agsha of the Soil", "Druo the Reborn", "Obba of the Warkind", "Overseer Orlok", "Ragewhip", "Restless Thoughts", "Rosle of the Spirits",
"Tek-Nu Dah", "Ughl of the Skies", "Beady", "Plunkey", "Spark Queen", "Ecclesiarch", "Gruhglor", "Acceptor", "A Deepling Orator", "Spike",
"King Cobra", "Overseer Laseal", "Spectral Torturer", "Boneweaver", "Lurk", "Peon", "Stoneman Diamondine", "Chazza Priel", "Goliath", "Lazalith, Soldier of Sivakaya",
"Spectral King's Guard", "Gloopa", "Ember Acolyte", "Overseer Refleigh", "Ravager, The First Infected", "Slumbering Queen", "Upha, Priest of Brax", "Vizijivi", "Apha, Priest of Brax", "Dusken Giant",
"Xasxi", "Balaste the Fallen", "Oarik the Failure", "Pamia the Coward", "The Crypt Guardian", "Blazefiend", "Invader of Dreams", "Shelled Monstrosity", "Tiallia Priel", "Cinder",
"Dire Huntress", "Evadne the Corrupted", "Lupine Horror", "Pteriaped Matron", "Diva", "Loomingwood Minotaur Hero", "Shivunax", "Thorn", "Pyroclast", "Stoneman Colossus",
"Volcanic Giant", "Addison Priel", "Arcane Headmaster", "Aviak", "Diamond Colossus", "Failed Experiment", "Gherist Morthario", "Julianna Priel", "Morian the Ascended", "Ruby Fiend",
"Sapphire Fiend", "Molorai Dockmaster", "Blight Demon", "Granitus", "Noctua", "The Gardener of Loomingwood", "Abyssal Lord", "Ancient Spectre", "Fenton the Blighted", "Historian of Braxonia",
"Molorai Eldermistress", "Ripples", "Sivakayan Spymaster", "Undertoes", "Braxonian Weapon Master", "Darkwarden Awxa", "Darkwarden Ealdred", "Harbinger of Corruption", "Molorai Mason", "Nipper King",
"Raval, The First Paladin", "Sylvan Giant", "Elwio the Traitor", "Lacy", "Parzgil", "Statue of Brax", "Winkles", "Exalted Firebone", "Hand of the King", "Nazura the Traitor",
"Swamp Wyrm", "Candlekeeper", "Grounds Keeper", "Molorai Acquirer", "Molorai Curator", "Braxonian Planar Guard (Ice)", "Balthom, Soldier of Sivakaya", "Braxonian Planar Guard (Fire)", "Wardwarped Alpha", "Assassin of Sivakaya",
"Grand Arcanist of Sivakaya", "High Paladin of Sivakaya", "High Priestess of Sivakaya", "Hypnic", "Oracle Miress", "Oracle Tretha", "The Abomination", "Vos Ashlyn", "Aeiros, Soldier of Sivakaya", "Apparition of Vitheo",
"Savannah Priel", "Astra, Rogue of the Stars", "Demented Malaroth", "Monarch of the Flame", "Sableheart, Steed of Sivakaya", "Vessel Siraethe", "Eldoth Molorai", "Azynthi, Corruptor of Gods", "Stardust"
};
private HashSet<string> _baseBossNames;
private HashSet<string> _bossNames;
private ConfigEntry<bool> _enableTracking;
private ConfigEntry<bool> _useCustomCoords;
private ConfigEntry<float> _customTargetX;
private ConfigEntry<float> _customTargetY;
private ConfigEntry<float> _customTargetZ;
private ConfigEntry<float> _scanInterval;
private ConfigEntry<float> _rotationSmoothSpeed;
private ConfigEntry<float> _arrowScale;
private ConfigEntry<float> _uiScale;
private ConfigEntry<float> _savedArrowX;
private ConfigEntry<float> _savedArrowY;
private ConfigEntry<int> _labelFontSize;
private ConfigEntry<int> _bossNameFontSize;
private ConfigEntry<Color> _arrowColor;
private ConfigEntry<string> _includeBosses;
private ConfigEntry<string> _excludeBosses;
private float _scanCooldown;
private Camera _mainCam;
private RectTransform _arrowRect;
private RectTransform _labelRect;
private RawImage _arrowImage;
private Text _arrowText;
private Text _labelText;
private Vector2 _arrowBaseSize;
private Vector2 _arrowPos;
private float _currentAngle;
private Transform _nearestBoss;
private bool _dragging;
private string _lastTrackedBossName;
private void Awake()
{
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: Expected O, but got Unknown
//IL_0229: Unknown result type (might be due to invalid IL or missing references)
//IL_03cb: 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_036c: 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)
_baseBossNames = new HashSet<string>(DefaultBossNames, StringComparer.OrdinalIgnoreCase);
_enableTracking = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "EnableBossTracking", true, "Enable boss tracking arrow");
_useCustomCoords = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "UseCustomCoordinates", false, "Point arrow to custom coordinates");
_customTargetX = ((BaseUnityPlugin)this).Config.Bind<float>("CustomTarget", "TargetX", 0f, "Custom X");
_customTargetY = ((BaseUnityPlugin)this).Config.Bind<float>("CustomTarget", "TargetY", 0f, "Custom Y");
_customTargetZ = ((BaseUnityPlugin)this).Config.Bind<float>("CustomTarget", "TargetZ", 0f, "Custom Z");
_scanInterval = ((BaseUnityPlugin)this).Config.Bind<float>("General", "ScanInterval", 5f, "Scan rate (seconds)");
_rotationSmoothSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General", "RotationSmoothSpeed", 5f, "Rotation smoothing");
_arrowScale = ((BaseUnityPlugin)this).Config.Bind<float>("General", "ArrowScale", 1f, "Arrow size multiplier");
_uiScale = ((BaseUnityPlugin)this).Config.Bind<float>("General", "UIScale", 1f, new ConfigDescription("Global UI scale (affects arrow + text)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
_uiScale.SettingChanged += delegate
{
UpdateArrowScale();
UpdateLabelFont();
};
_labelFontSize = ((BaseUnityPlugin)this).Config.Bind<int>("General", "LabelFontSize", 24, "Distance label font size");
_bossNameFontSize = ((BaseUnityPlugin)this).Config.Bind<int>("General", "BossNameFontSize", 17, "Boss name font size (max 17)");
_bossNameFontSize.SettingChanged += delegate
{
if (_bossNameFontSize.Value > 17)
{
_bossNameFontSize.Value = 17;
}
((BaseUnityPlugin)this).Config.Save();
UpdateLabelFont();
};
_arrowScale.SettingChanged += delegate
{
UpdateArrowScale();
};
_labelFontSize.SettingChanged += delegate
{
UpdateLabelFont();
};
_arrowColor = ((BaseUnityPlugin)this).Config.Bind<Color>("General", "ArrowColor", Color.red, "Arrow color");
_arrowColor.SettingChanged += delegate
{
UpdateArrowColor();
};
_savedArrowX = ((BaseUnityPlugin)this).Config.Bind<float>("General", "ArrowPosX", 0f, "Saved arrow X position");
_savedArrowY = ((BaseUnityPlugin)this).Config.Bind<float>("General", "ArrowPosY", 0f, "Saved arrow Y position");
_includeBosses = ((BaseUnityPlugin)this).Config.Bind<string>("General", "IncludeBosses", "", "Extra boss names (csv)");
_excludeBosses = ((BaseUnityPlugin)this).Config.Bind<string>("General", "ExcludeBosses", "", "Exclude boss names (csv)");
ApplyIncludeExclude();
_includeBosses.SettingChanged += delegate
{
ApplyIncludeExclude();
((BaseUnityPlugin)this).Config.Save();
};
_excludeBosses.SettingChanged += delegate
{
ApplyIncludeExclude();
((BaseUnityPlugin)this).Config.Save();
};
BuildUI();
if (_savedArrowX.Value == 0f && _savedArrowY.Value == 0f)
{
_arrowPos = new Vector2((float)Screen.width / 2f, (float)Screen.height / 2f);
_savedArrowX.Value = _arrowPos.x;
_savedArrowY.Value = _arrowPos.y;
((BaseUnityPlugin)this).Config.Save();
}
else
{
_arrowPos = new Vector2(_savedArrowX.Value, _savedArrowY.Value);
}
UpdateArrowScale();
UpdateLabelFont();
UpdateArrowColor();
SceneManager.sceneLoaded += delegate
{
TryResolveMainCamera();
BuildUI();
};
}
private void Update()
{
TryResolveMainCamera();
_scanCooldown -= Time.deltaTime;
if (_scanCooldown <= 0f)
{
_scanCooldown = _scanInterval.Value;
if (_enableTracking.Value && !_useCustomCoords.Value)
{
ScanForBosses();
}
}
HandleDragging();
UpdateArrowUI();
}
private void ScanForBosses()
{
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
List<string> list = new List<string>();
List<NPC> liveNPCs = NPCTable.LiveNPCs;
IEnumerable<MonoBehaviour> enumerable = ((liveNPCs != null && liveNPCs.Count > 0) ? NPCTable.LiveNPCs.Cast<MonoBehaviour>() : Object.FindObjectsOfType<NPC>().Cast<MonoBehaviour>());
foreach (MonoBehaviour item in enumerable)
{
if (!((Object)(object)item == (Object)null))
{
NPC component = ((Component)item).GetComponent<NPC>();
if ((Object)(object)component != (Object)null && _bossNames.Contains(((Object)((Component)component).gameObject).name))
{
list.Add(((Object)((Component)component).gameObject).name);
}
}
}
Transform nearestBoss = null;
float num = float.MaxValue;
foreach (MonoBehaviour item2 in enumerable)
{
if ((Object)(object)item2 == (Object)null)
{
continue;
}
NPC component2 = ((Component)item2).GetComponent<NPC>();
if (!((Object)(object)component2 == (Object)null) && _bossNames.Contains(((Object)((Component)component2).gameObject).name) && !((Object)(object)_mainCam == (Object)null))
{
float num2 = Vector3.Distance(((Component)component2).transform.position, ((Component)_mainCam).transform.position);
if (num2 < num)
{
num = num2;
nearestBoss = ((Component)component2).transform;
}
}
}
_nearestBoss = nearestBoss;
Transform nearestBoss2 = _nearestBoss;
string text = ((nearestBoss2 != null) ? ((Object)nearestBoss2).name : null);
if (!string.IsNullOrEmpty(text) && text != _lastTrackedBossName)
{
_lastTrackedBossName = text;
if (list.Count > 0)
{
UpdateSocialLog.LogAdd("All Currently Spawned Bosses: " + string.Join(", ", list.Distinct()));
}
UpdateSocialLog.LogAdd("Currently Tracking Boss: " + text);
}
}
private void ApplyIncludeExclude()
{
HashSet<string> hashSet = new HashSet<string>(_baseBossNames, StringComparer.OrdinalIgnoreCase);
foreach (string item in ParseCsv(_includeBosses.Value))
{
hashSet.Add(item);
}
foreach (string item2 in ParseCsv(_excludeBosses.Value))
{
hashSet.Remove(item2);
}
_bossNames = hashSet;
}
[IteratorStateMachine(typeof(<ParseCsv>d__36))]
private static IEnumerable<string> ParseCsv(string csv)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ParseCsv>d__36(-2)
{
<>3__csv = csv
};
}
private void BuildUI()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Expected O, but got Unknown
//IL_0095: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Expected O, but got Unknown
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Expected O, but got Unknown
//IL_0208: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: 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_026a: Unknown result type (might be due to invalid IL or missing references)
//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
GameObject val = GameObject.Find("BossArrowCanvas");
if ((Object)(object)val != (Object)null)
{
Object.Destroy((Object)(object)val);
}
GameObject val2 = new GameObject("BossArrowCanvas");
Canvas val3 = val2.AddComponent<Canvas>();
val3.renderMode = (RenderMode)0;
val3.sortingOrder = 9999;
CanvasScaler val4 = val2.AddComponent<CanvasScaler>();
val4.uiScaleMode = (ScaleMode)0;
val2.AddComponent<GraphicRaycaster>();
Object.DontDestroyOnLoad((Object)(object)val2);
GameObject val5 = new GameObject("BossArrow");
val5.transform.SetParent(val2.transform);
_arrowRect = val5.AddComponent<RectTransform>();
_arrowRect.pivot = Vector2.one * 0.5f;
_arrowRect.anchorMin = Vector2.zero;
_arrowRect.anchorMax = Vector2.zero;
_arrowBaseSize = new Vector2(64f, 64f);
_arrowRect.sizeDelta = _arrowBaseSize;
string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "", "HUDArrow.png");
if (File.Exists(path))
{
Texture2D val6 = new Texture2D(2, 2);
if (ImageConversion.LoadImage(val6, File.ReadAllBytes(path)))
{
_arrowImage = val5.AddComponent<RawImage>();
_arrowImage.texture = (Texture)(object)val6;
}
}
if ((Object)(object)_arrowImage == (Object)null)
{
_arrowText = val5.AddComponent<Text>();
_arrowText.text = "↑";
_arrowText.alignment = (TextAnchor)4;
_arrowText.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
((Graphic)_arrowText).color = _arrowColor.Value;
}
GameObject val7 = new GameObject("BossArrowLabel");
val7.transform.SetParent(val2.transform);
_labelRect = val7.AddComponent<RectTransform>();
_labelRect.pivot = new Vector2(0.5f, 1f);
_labelRect.anchorMin = Vector2.zero;
_labelRect.anchorMax = Vector2.zero;
_labelRect.sizeDelta = new Vector2(200f, (float)(_labelFontSize.Value + _bossNameFontSize.Value) * _uiScale.Value + 8f);
_labelText = val7.AddComponent<Text>();
_labelText.font = Resources.GetBuiltinResource<Font>("Arial.ttf");
_labelText.alignment = (TextAnchor)1;
_labelText.supportRichText = true;
((Graphic)_labelText).color = Color.white;
_labelText.horizontalOverflow = (HorizontalWrapMode)1;
_labelText.verticalOverflow = (VerticalWrapMode)1;
UpdateArrowScale();
UpdateLabelFont();
UpdateArrowColor();
}
private void TryResolveMainCamera()
{
if ((Object)(object)_mainCam != (Object)null)
{
return;
}
if ((Object)(object)GameData.PlayerControl?.camera != (Object)null)
{
_mainCam = GameData.PlayerControl.camera;
return;
}
if ((Object)(object)Camera.main != (Object)null)
{
_mainCam = Camera.main;
return;
}
GameObject val = GameObject.Find("Main Camera");
if ((Object)(object)val != (Object)null)
{
_mainCam = val.GetComponent<Camera>();
}
}
private void HandleDragging()
{
//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_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_0043: 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_00b4: 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)
Vector3 mousePosition = Input.mousePosition;
if (Input.GetMouseButtonDown(2))
{
Rect val = new Rect(_arrowPos.x - 32f, _arrowPos.y - 32f, 64f, 64f);
if (((Rect)(ref val)).Contains(mousePosition))
{
_dragging = true;
}
}
if (Input.GetMouseButtonUp(2))
{
_dragging = false;
_savedArrowX.Value = _arrowPos.x;
_savedArrowY.Value = _arrowPos.y;
((BaseUnityPlugin)this).Config.Save();
}
if (_dragging)
{
_arrowPos = Vector2.op_Implicit(mousePosition);
}
}
private void UpdateArrowUI()
{
//IL_004a: 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_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_0107: 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_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: 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_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)_mainCam == (Object)null)
{
return;
}
Vector3 val;
if (_useCustomCoords.Value)
{
val = new Vector3(_customTargetX.Value, _customTargetY.Value, _customTargetZ.Value) - ((Component)_mainCam).transform.position;
}
else
{
if (!_enableTracking.Value || !((Object)(object)_nearestBoss != (Object)null))
{
((Component)_arrowRect).gameObject.SetActive(false);
((Component)_labelRect).gameObject.SetActive(false);
return;
}
val = _nearestBoss.position - ((Component)_mainCam).transform.position;
}
((Component)_arrowRect).gameObject.SetActive(true);
((Component)_labelRect).gameObject.SetActive(true);
Vector3 val2 = default(Vector3);
((Vector3)(ref val2))..ctor(((Component)_mainCam).transform.forward.x, 0f, ((Component)_mainCam).transform.forward.z);
Vector3 val3 = default(Vector3);
((Vector3)(ref val3))..ctor(val.x, 0f, val.z);
float num = Vector3.SignedAngle(val2, val3, Vector3.up);
_currentAngle = Mathf.LerpAngle(_currentAngle, 0f - num, Time.deltaTime * _rotationSmoothSpeed.Value);
_arrowRect.anchoredPosition = _arrowPos;
((Transform)_arrowRect).localEulerAngles = new Vector3(0f, 0f, _currentAngle);
float y = _arrowRect.sizeDelta.y;
_labelRect.anchoredPosition = new Vector2(_arrowPos.x, _arrowPos.y - y / 2f - 4f);
int num2 = (int)((Vector3)(ref val)).magnitude;
int num3 = Mathf.RoundToInt((float)_labelFontSize.Value * _uiScale.Value);
int num4 = Mathf.RoundToInt((float)_bossNameFontSize.Value * _uiScale.Value);
Text labelText = _labelText;
object[] obj = new object[4] { num3, num2, num4, null };
Transform nearestBoss = _nearestBoss;
obj[3] = ((nearestBoss != null) ? ((Object)nearestBoss).name : null);
labelText.text = string.Format("<size={0}>({1}m)</size>\n<size={2}>{3}</size>", obj);
}
private void UpdateArrowScale()
{
//IL_0030: 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)
float num = _arrowScale.Value * _uiScale.Value;
if ((Object)(object)_arrowRect != (Object)null)
{
_arrowRect.sizeDelta = _arrowBaseSize * num;
}
if ((Object)(object)_arrowText != (Object)null)
{
_arrowText.fontSize = Mathf.RoundToInt(64f * num);
}
}
private void UpdateLabelFont()
{
//IL_0087: 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)
if ((Object)(object)_labelText != (Object)null)
{
int fontSize = Mathf.RoundToInt((float)Mathf.Max(_labelFontSize.Value, _bossNameFontSize.Value) * _uiScale.Value);
_labelText.fontSize = fontSize;
float num = (float)(_labelFontSize.Value + _bossNameFontSize.Value) * _uiScale.Value + 8f;
_labelRect.sizeDelta = new Vector2(_labelRect.sizeDelta.x, num);
}
}
private void UpdateArrowColor()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)_arrowImage != (Object)null)
{
((Graphic)_arrowImage).color = _arrowColor.Value;
}
if ((Object)(object)_arrowText != (Object)null)
{
((Graphic)_arrowText).color = _arrowColor.Value;
}
}
}