public static void UpdateExosuitStorageSize(ref Exosuit exosuit)
        {
            var      allModules      = exosuit.GetSlotBinding();
            TechType storageTechType = TechType.None;

            for (int i = 0; i < allModules.Length; i++)
            {
                if (!IsStorageModule(allModules[i]))
                {
                    continue;
                }
                storageTechType = allModules[i];
                break;
            }

            if (storageTechType == TechType.None)
            {
                exosuit.storageContainer.Resize(4, 4);
                return;
            }

            ;
            var module = Modules.ContainsKey(storageTechType) ? Modules[storageTechType] : null;

            exosuit.storageContainer.Resize(module?.StorageWidth ?? 6, module?.StorageHeight ?? 4);
        }
Пример #2
0
 public void onToggle(int slotID, bool state)
 {
     if (exosuit.GetSlotBinding(slotID) == PrawnSonarModule.TechType)
     {
         setActive(state);
         activeSlotID = state? slotID: -1;
     }
 }
        private void OnToggle(int slotID, bool state)
        {
            if (exosuit.GetSlotBinding(slotID) == ScannerModule.TechTypeID)
            {
                toggle = state;

                if (state)
                {
                    OnEnable();
                }
                else
                {
                    OnDisable();
                }
            }
        }