public override void Initialize()
        {
            QuickLogger.Debug("Initialize Formatter", true);

            _slotState = Animator.StringToHash("SlotState");

            if (AnimationManager == null)
            {
                AnimationManager = gameObject.AddComponent <AnimationManager>();
            }

            if (ColorManager == null)
            {
                ColorManager = gameObject.AddComponent <ColorManager>();
                ColorManager.Initialize(gameObject, DSSModelPrefab.BodyMaterial);
            }

            if (DisplayManager == null)
            {
                DisplayManager = gameObject.AddComponent <DSSServerFormattingStationDisplay>();
                DisplayManager.Setup(this);
            }

            if (DumpContainer == null)
            {
                DumpContainer = new DumpContainer();
                DumpContainer.Initialize(transform, AuxPatchers.BaseDumpReceptacle(), AuxPatchers.NotAllowed(), AuxPatchers.CannotBeStored(), this, 1, 1);
            }

            IsInitialized = true;
        }
Пример #2
0
        public override void Initialize()
        {
            if (DumpContainer == null)
            {
                DumpContainer = new DumpContainer();
                DumpContainer.Initialize(transform, "Item Display Receptical", AuxPatchers.NotAllowed(), AuxPatchers.CannotBeStored(), this, 1, 1);
            }

            var icon = GameObjectHelpers.FindGameObject(gameObject, "Icon");

            _icon   = icon?.AddComponent <uGUI_Icon>();
            _button = InterfaceHelpers.CreateButton(icon, "IconClick", InterfaceButtonMode.Background,
                                                    OnButtonClick, Color.white, Color.gray, 5.0f);


            _amount = GameObjectHelpers.FindGameObject(gameObject, "Text")?.GetComponent <Text>();

            var addBTN = GameObjectHelpers.FindGameObject(gameObject, "AddBTN");

            InterfaceHelpers.CreateButton(addBTN, "AddBTN", InterfaceButtonMode.Background,
                                          OnButtonClick, Color.gray, Color.white, 5.0f, AuxPatchers.ColorPage());

            var deleteBTN = GameObjectHelpers.FindGameObject(gameObject, "DeleteBTN");

            InterfaceHelpers.CreateButton(deleteBTN, "DeleteBTN", InterfaceButtonMode.Background,
                                          OnButtonClick, Color.gray, Color.white, 5.0f, AuxPatchers.ColorPage());

            AddToBaseManager();

            InvokeRepeating(nameof(UpdateScreen), 1f, 1f);

            IsInitialized = true;
        }
        public override void Initialize()
        {
            if (NameController == null)
            {
                NameController = new ExStorageDepotNameManager();
                NameController.Initialize(this);
            }

            if (AnimationManager == null)
            {
                AnimationManager = gameObject.AddComponent <ExStorageDepotAnimationManager>();
            }

            if (Storage == null)
            {
                Storage = gameObject.AddComponent <ExStorageDepotStorageManager>();
                Storage.Initialize(this);
            }

            if (DumpContainer == null)
            {
                DumpContainer = gameObject.AddComponent <DumpContainer>();
                DumpContainer.Initialize(transform, ExStorageDepotBuildable.DumpContainerLabel(), ExStorageDepotBuildable.FoodNotAllowed(), ExStorageDepotBuildable.ContainerFullMessage(), Storage);
                DumpContainer.OnDumpContainerClosed += Storage.OnDumpContainerClosed;
            }

            if (Display == null)
            {
                Display = gameObject.AddComponent <ExStorageDepotDisplayManager>();
                Display.Initialize(this);
            }

            var locker = GameObjectHelpers.FindGameObject(gameObject, "Locker", SearchOption.StartsWith);
            var sRoot  = GameObjectHelpers.FindGameObject(gameObject, "StorageRoot");

            if (locker != null)
            {
                Destroy(locker);
            }

            if (sRoot != null)
            {
                Destroy(sRoot);
            }

            if (FCSConnectableDevice == null)
            {
                FCSConnectableDevice = gameObject.AddComponent <FCSConnectableDevice>();
                FCSConnectableDevice.Initialize(this, Storage, new ExStoragePowerManager(), true);
                FCSTechFabricator.FcTechFabricatorService.PublicAPI.RegisterDevice(FCSConnectableDevice, GetPrefabID(), Mod.ExStorageTabID);
            }

            _initialized = true;
        }
Пример #4
0
        public override void Initialize()
        {
            if (PowerManager == null)
            {
                PowerManager = gameObject.AddComponent <AlterraGenPowerManager>();
            }

            if (ColorManager == null)
            {
                ColorManager = gameObject.AddComponent <ColorManager>();
                ColorManager.Initialize(gameObject, AlterraGenBuildable.BodyMaterial);
            }

            if (AnimationManager == null)
            {
                AnimationManager = gameObject.AddComponent <AnimationManager>();
            }

            if (DumpContainer == null)
            {
                DumpContainer = gameObject.AddComponent <DumpContainer>();
                DumpContainer.Initialize(transform, "AlterraGen Receptacle", AlterraGenBuildable.NotAllowedItem(), AlterraGenBuildable.StorageFullMessage(), PowerManager, 3, 3);
            }

            if (_fcsConnectableDevice == null)
            {
                _fcsConnectableDevice = gameObject.AddComponent <FCSConnectableDevice>();
                _fcsConnectableDevice.Initialize(this, PowerManager, PowerManager);
                FCSTechFabricator.FcTechFabricatorService.PublicAPI.RegisterDevice(_fcsConnectableDevice, GetPrefabID(), Mod.ModTabID);
            }


            if (DisplayManager == null)
            {
                DisplayManager = gameObject.AddComponent <AlterraGenDisplayManager>();
                DisplayManager.Setup(this);
            }

            _xBubbles = GameObjectHelpers.FindGameObject(gameObject, "xBubbles");

            IsInitialized = true;
        }
Пример #5
0
        public override void Initialize()
        {
            if (PowerManager == null)
            {
                PowerManager = gameObject.AddComponent <AlterraGenPowerManager>();
            }

            if (ColorManager == null)
            {
                ColorManager = gameObject.AddComponent <ColorManager>();
                ColorManager.Initialize(gameObject, AlterraGenBuildable.BodyMaterial);
            }

            if (AnimationManager == null)
            {
                AnimationManager = gameObject.AddComponent <AnimationManager>();
            }

            if (DumpContainer == null)
            {
                DumpContainer = gameObject.AddComponent <DumpContainer>();
                DumpContainer.Initialize(transform, "AlterraGen Receptacle", "", AlterraGenBuildable.NotAllowedItem(), PowerManager);
            }

            if (_fcsConnectableDevice == null)
            {
                _fcsConnectableDevice = gameObject.AddComponent <FCSConnectableDevice>();
                _fcsConnectableDevice.Initialize(this, PowerManager, PowerManager);
            }


            if (DisplayManager == null)
            {
                DisplayManager = gameObject.AddComponent <AlterraGenDisplayManager>();
                DisplayManager.Setup(this);
            }

            _xBubbles = GameObjectHelpers.FindGameObject(gameObject, "xBubbles");

            IsInitialized = true;
        }
        private void Initialize(SubRoot habitat)
        {
            ReadySaveData();
            FCSConnectableAwake_Patcher.AddEventHandlerIfMissing(AlertedNewFCSConnectablePlaced);
            FCSConnectableDestroy_Patcher.AddEventHandlerIfMissing(AlertedFCSConnectableDestroyed);

            GetFCSConnectables();


            if (NameController == null)
            {
                NameController = new NameController();
                NameController.Initialize(AuxPatchers.Submit(), Mod.AntennaFriendlyName);
                NameController.OnLabelChanged += OnLabelChangedMethod;

                if (string.IsNullOrEmpty(_savedData?.InstanceID))
                {
                    NameController.SetCurrentName(GetDefaultName());
                }
                else
                {
                    NameController.SetCurrentName(_savedData?.BaseName);
                }
            }

            if (DumpContainer == null)
            {
                DumpContainer = habitat.gameObject.AddComponent <DumpContainer>();
                DumpContainer.Initialize(habitat.transform, AuxPatchers.BaseDumpReceptacle(), AuxPatchers.NotAllowed(),
                                         AuxPatchers.CannotBeStored(), this);
            }

            if (DockingManager == null)
            {
                DockingManager = habitat.gameObject.AddComponent <DSSVehicleDockingManager>();
                DockingManager.Initialize(habitat, this);
                DockingManager.ToggleIsEnabled(_savedData?.AllowDocking ?? false);
            }

            _hasBreakerTripped = _savedData?.HasBreakerTripped ?? false;
        }
        public override void Initialize()
        {
            if (NameController == null)
            {
                NameController = new ExStorageDepotNameManager();
                NameController.Initialize(this);
            }

            if (AnimationManager == null)
            {
                AnimationManager = gameObject.AddComponent <ExStorageDepotAnimationManager>();
            }

            if (Storage == null)
            {
                Storage = gameObject.AddComponent <ExStorageDepotStorageManager>();
                Storage.Initialize(this);
            }

            if (DumpContainer == null)
            {
                DumpContainer = gameObject.AddComponent <DumpContainer>();
                DumpContainer.Initialize(transform, ExStorageDepotBuildable.DumpContainerLabel(), ExStorageDepotBuildable.FoodNotAllowed(), ExStorageDepotBuildable.ContainerFullMessage(), Storage);
                DumpContainer.OnDumpContainerClosed += Storage.OnDumpContainerClosed;
            }

            if (Display == null)
            {
                Display = gameObject.AddComponent <ExStorageDepotDisplayManager>();
                Display.Initialize(this);
            }

            if (FCSConnectableDevice == null)
            {
                FCSConnectableDevice = gameObject.AddComponent <FCSConnectableDevice>();
                FCSConnectableDevice.Initialize(this, Storage);
            }

            _initialized = true;
        }
Пример #8
0
        public override void Initialize()
        {
            PageStateHash = Animator.StringToHash("PageState");

            QPatch.Configuration.OnModModeChanged += OnModModeChanged;

            if (PrefabId == null)
            {
                PrefabId = GetComponentInParent <PrefabIdentifier>() ?? GetComponent <PrefabIdentifier>();
            }

            if (PowerManager == null)
            {
                PowerManager = gameObject.AddComponent <ARSolutionsSeaBreezePowerManager>();
                PowerManager.Initialize(this);
                PowerManager.OnBreakerTripped += OnBreakerTripped;
                PowerManager.OnBreakerReset   += OnBreakerReset;
                PowerManager.OnPowerResume    += OnPowerResume;
                PowerManager.OnPowerOutage    += OnPowerOutage;
            }

            if (FridgeComponent == null)
            {
                FridgeComponent = gameObject.AddComponent <Fridge>();
                FridgeComponent.Initialize(this, QPatch.Configuration.StorageLimit);
                FridgeComponent.OnContainerUpdate += OnContainerUpdate;
                FridgeComponent.SetModMode(QPatch.Configuration.ModMode);
            }

            if (ColorManager == null)
            {
                ColorManager = gameObject.AddComponent <ColorManager>();
                ColorManager.Initialize(gameObject, ARSSeaBreezeFCS32Buildable.BodyMaterial);
            }

            if (DumpContainer == null)
            {
                DumpContainer = gameObject.AddComponent <DumpContainer>();
                DumpContainer.Initialize(gameObject.transform, ARSSeaBreezeFCS32Buildable.StorageLabel(),
                                         ARSSeaBreezeFCS32Buildable.ItemNotAllowed(),
                                         ARSSeaBreezeFCS32Buildable.SeaBreezeFull(),
                                         FridgeComponent);
            }

            if (NameController == null)
            {
                NameController = gameObject.EnsureComponent <NameController>();
                NameController.Initialize(ARSSeaBreezeFCS32Buildable.Submit(), Mod.FriendlyName);
                NameController.SetCurrentName(Mod.GetNewSeabreezeName());
                NameController.OnLabelChanged += OnLabelChangedMethod;
            }

            if (AnimationManager == null)
            {
                AnimationManager = gameObject.AddComponent <AnimationManager>();
            }

            if (DisplayManager == null)
            {
                DisplayManager = gameObject.AddComponent <ARSolutionsSeaBreezeDisplay>();
                DisplayManager.Setup(this);
            }

            if (FCSConnectableDevice == null)
            {
                FCSConnectableDevice = gameObject.AddComponent <FCSConnectableDevice>();
                FCSConnectableDevice.Initialize(this, FridgeComponent, PowerManager);
            }

            IsInitialized = true;
        }