Example #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        internal BOBNetInfoPanel()
        {
            try
            {
                // Add pack button.
                UIButton packButton = AddIconButton(this, PackButtonX, ToggleY, ToggleSize, "BOB_PNL_PKB", TextureUtils.LoadSpriteAtlas("BOB-PropPack"));
                packButton.eventClicked += (component, clickEvent) => PackPanelManager.Create();

                // Populate loaded list.
                LoadedList();
            }
            catch (Exception e)
            {
                // Log and report any exception.
                Logging.LogException(e, "exception creating network panel");
            }
        }
Example #2
0
        /// <summary>
        /// Performs initial setup
        /// </summary>
        /// <param name="parentTransform">Parent transform</param>
        /// <param name="targetPrefabInfo">Currently selected target prefab</param>
        internal override void Setup(Transform parentTransform, PrefabInfo targetPrefabInfo)
        {
            // Set target reference.
            currentNet = targetPrefabInfo as NetInfo;

            // Base setup.
            base.Setup(parentTransform, targetPrefabInfo);

            // Add pack button.
            UIButton packButton = UIControls.EvenSmallerButton(this, RightX - 200f, TitleHeight + (Margin / 2f), Translations.Translate("BOB_PNL_PKB"));

            packButton.eventClicked += (component, clickEvent) => PackPanelManager.Create();

            // Populate target list and select target item.
            TargetList();

            // Apply Harmony rendering patches.
            Patcher.PatchNetworkOverlays(true);
        }