private void OnEnable()
        {
            if (_runStartUpOnEnable)
            {
                if (!IsInitialized)
                {
                    Initialize();
                }

                if (DisplayManager != null)
                {
                    var numberOfItems = FridgeComponent.NumberOfItems;
                    DisplayManager.OnContainerUpdate(numberOfItems, QPatch.Configuration.StorageLimit);
                    DisplayManager.UpdateScreenLabel(NameController.GetCurrentName(), NameController);
                }

                if (_fromSave)
                {
                    if (_savedData == null)
                    {
                        ReadySaveData();
                    }

                    PowerManager.LoadSave(_savedData.PowercellData);
                    FridgeComponent.LoadSave(_savedData.FridgeContainer);
                    NameController.SetCurrentName(_savedData.UnitName);
                    ColorManager.SetColorFromSave(_savedData.BodyColor.Vector4ToColor());
                    QuickLogger.Info($"Loaded {Mod.FriendlyName}");
                }

                _runStartUpOnEnable = false;
            }
        }
Exemplo n.º 2
0
        internal void Save(ExStorageDepotSaveData saveDataList)
        {
            var prefabIdentifier = GetComponent <PrefabIdentifier>();
            var id = prefabIdentifier.Id;

            if (_saveData == null)
            {
                _saveData = new ExStorageDepotSaveDataEntry();
            }
            _saveData.Id       = id;
            _saveData.UnitName = NameController.GetCurrentName();
            //_saveData.StorageItems = Storage.GetTrackedItems();
            _saveData.Multiplier = BulkMultiplier;
            saveDataList.Entries.Add(_saveData);
        }
        internal void Save(ExStorageDepotSaveData saveDataList)
        {
            var prefabIdentifier = GetComponent <PrefabIdentifier>();
            var id = prefabIdentifier.Id;

            if (_saveData == null)
            {
                _saveData = new ExStorageDepotSaveDataEntry();
            }
            _saveData.Id           = id;
            _saveData.UnitName     = NameController.GetCurrentName();
            _saveData.StorageItems = Storage.ContainerItems;
            _saveData.Multiplier   = BulkMultiplier;
            _saveData.IsVisible    = FCSConnectableDevice.IsVisible;
            saveDataList.Entries.Add(_saveData);
        }
        internal void Save(SaveData saveData)
        {
            var id = PrefabId.Id;

            if (_savedData == null)
            {
                _savedData = new SaveDataEntry();
            }

            _savedData.ID              = id;
            _savedData.BodyColor       = ColorManager.GetColor().ColorToVector4();
            _savedData.UnitName        = NameController.GetCurrentName();
            _savedData.FridgeContainer = FridgeComponent.Save();
            _savedData.PowercellData   = PowerManager.Save();
            saveData.Entries.Add(_savedData);
        }
Exemplo n.º 5
0
        internal void Save(SaveData saveData)
        {
            var prefabIdentifier = GetComponent <PrefabIdentifier>();
            var id = prefabIdentifier.Id;

            if (_data == null)
            {
                _data = new SaveDataEntry();
            }
            _data.ID          = id;
            _data.BodyColor   = ColorManager.GetColor().ColorToVector4();
            _data.UnitName    = NameController.GetCurrentName();
            _data.IsGlobal    = _isGlobal;
            _data.SelectedTab = DisplayManager.GetSelectedTab();
            saveData.Entries.Add(_data);
        }
Exemplo n.º 6
0
 public override string GetName()
 {
     return(NameController.GetCurrentName());
 }