using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using Ostranauts.Core; using Ostranauts.UI.CrewBar; using Ostranauts.UI.MegaToolTip; using OstranautsSidebar.Core; using OstranautsSidebar.Data; using OstranautsSidebar.UI; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace OstranautsSidebar { [BepInPlugin("com.ostranauts.sidebar", "Character Sidebar", "0.1.2")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Log; internal static Plugin Instance; internal static ConfigEntry PanelWidth; internal static ConfigEntry BottomOffset; internal static ConfigEntry ReferenceHeight; internal static ConfigEntry StartVisible; private void Awake() { //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_00c2: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; PanelWidth = ((BaseUnityPlugin)this).Config.Bind("Layout", "PanelWidth", 195f, "Sidebar width, in 1080p-reference pixels."); BottomOffset = ((BaseUnityPlugin)this).Config.Bind("Layout", "BottomOffset", 88f, "Fallback bottom gap (reference pixels) used only if the vanilla HUD bar can't be measured. Normally the panel pins itself to the actual bar height."); ReferenceHeight = ((BaseUnityPlugin)this).Config.Bind("Layout", "ReferenceHeight", 720f, "Canvas reference height. Lower = larger UI/fonts; raise if the panel feels too big."); StartVisible = ((BaseUnityPlugin)this).Config.Bind("Behaviour", "StartVisible", true, "Whether the panel is shown when a game loads (toggle anytime with the side tab)."); Log.LogInfo((object)"Character Sidebar v0.1.2 loading..."); GameObject val = new GameObject("OstranautsSidebarController"); val.AddComponent(); Object.DontDestroyOnLoad((Object)val); Log.LogInfo((object)"SidebarController bootstrapped."); } private void OnDestroy() { SidebarController.Instance?.Destroy(); } } internal static class PluginInfo { public const string GUID = "com.ostranauts.sidebar"; public const string NAME = "Character Sidebar"; public const string VERSION = "0.1.2"; } } namespace OstranautsSidebar.UI { public class RowTooltip : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler { public string Title = string.Empty; public string Body = string.Empty; public void OnPointerEnter(PointerEventData eventData) { if (!string.IsNullOrEmpty(Title) || !string.IsNullOrEmpty(Body)) { SidebarTooltip.Instance?.Show(Title, Body); } } public void OnPointerExit(PointerEventData eventData) { SidebarTooltip.Instance?.Hide(); } } public class SidebarPanel : MonoBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__41_0; internal void b__41_0() { SidebarController.Instance?.ToggleVisibility(); } } private static readonly Color BgColor = Hex("#121218"); private static readonly Color HeaderBgColor = Hex("#14141e"); private static readonly Color SectionBgColor = Hex("#141420"); private static readonly Color BorderColor = Hex("#1e1e2e"); private static readonly Color TextDefault = Hex("#b0a898"); private static readonly Color TextDim = Hex("#505068"); private static readonly Color TextHeader = Hex("#d0c8b8"); private static readonly Color TextSectionTitle = Hex("#505070"); private static readonly Color SkillLearnedText = Hex("#b0a898"); private static readonly Color SkillTrainingText = Hex("#505068"); private static readonly Color TraitPosBg = Hex("#121e12"); private static readonly Color TraitPosBorder = Hex("#1e2e1e"); private static readonly Color TraitPosText = Hex("#4a7a4a"); private static readonly Color TraitNegBg = Hex("#1e1212"); private static readonly Color TraitNegBorder = Hex("#2e1e1e"); private static readonly Color TraitNegText = Hex("#7a4a4a"); private static readonly Color TraitNeuText = Hex("#505070"); private static readonly Color DotWarning = Hex("#b08028"); private static readonly Color DotCritical = Hex("#a02828"); private static readonly Color CondWarningText = Hex("#907840"); private static readonly Color CondCriticalText = Hex("#905050"); private static readonly Color AliveDot = Hex("#3aaa5a"); private static readonly Color FooterText = Hex("#252535"); private Text? _charNameText; private Transform? _skillsContent; private Transform? _skillTrainingContent; private GameObject? _skillTrainingSection; private Transform? _traitTrainingContent; private GameObject? _traitTrainingSection; private Transform? _traitsContent; private Transform? _conditionsContent; private GameObject? _conditionsSection; private GameObject? _canvasRoot; private Canvas? _canvas; private RectTransform? _rt; private RectTransform? _tabRect; private Text? _tabLabel; private static readonly Vector3[] _corners = (Vector3[])(object)new Vector3[4]; private float _heightFraction = 1f; private string _sigSkills = ""; private string _sigTrainSkills = ""; private string _sigTraits = ""; private string _sigTrainTraits = ""; private string _sigConds = ""; private static Sprite? _gridSprite; private static Sprite? _gradientSprite; private static Sprite? _fadeSprite; public Canvas? Canvas => _canvas; public static SidebarPanel Create() { //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) GameObject val = CreateOwnCanvas(); GameObject val2 = new GameObject("OstranautsSidebarPanel"); val2.transform.SetParent(val.transform, false); SidebarPanel sidebarPanel = val2.AddComponent(); sidebarPanel._canvasRoot = val; sidebarPanel.Build(val.GetComponent()); sidebarPanel.BuildToggleTab(val.transform); SidebarTooltip.Create(val.transform); return sidebarPanel; } private void BuildToggleTab(Transform canvas) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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_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_00e2: Expected O, but got Unknown GameObject val = new GameObject("OstranautsSidebarTab"); val.transform.SetParent(canvas, false); _tabRect = val.AddComponent(); _tabRect.anchorMin = new Vector2(1f, 0f); _tabRect.anchorMax = new Vector2(1f, 0f); _tabRect.pivot = new Vector2(1f, 0.5f); _tabRect.sizeDelta = new Vector2(16f, 64f); _tabRect.anchoredPosition = new Vector2(0f - Plugin.PanelWidth.Value, 0f); AddImage(val, HeaderBgColor); ButtonClickedEvent onClick = val.AddComponent