Esempio n. 1
0
        public override void OnStart(StartState state)
        {
            if (HighLogic.LoadedSceneIsFlight && WorkshopSettings.IsKISAvailable)
            {
                WorkshopUtils.Log("KIS is available - Initialize Workshop");
                SetupAnimations();
                LoadMaxVolume();
                LoadFilters();
                GameEvents.onVesselChange.Add(OnVesselChange);
            }

            base.OnStart(state);
        }
Esempio n. 2
0
        public override void OnStart(StartState state)
        {
            //Init the KAC Wrapper. KAC Wrapper courtey of TriggerAu
            KACWrapper.InitKACWrapper();
            if (KACWrapper.APIReady)
            {
                KACWrapper.KAC.onAlarmStateChanged += KAC_onAlarmStateChanged;
            }

            if (HighLogic.LoadedSceneIsFlight && WorkshopSettings.IsKISAvailable)
            {
                WorkshopUtils.Log("KIS is available - Initialize Workshop");
                SetupAnimations();
                LoadMaxVolume();
                LoadFilters();
                if (lastUpdateTime == 0)
                {
                    lastUpdateTime = Planetarium.GetUniversalTime();
                }
                GameEvents.onVesselChange.Add(OnVesselChange);
            }

            foreach (PartModule p in this.part.Modules)
            {
                if (p.moduleName == "WorkshopAnimateGeneric")
                {
                    wag = p as WorkshopAnimateGeneric;
                }
                if (p.moduleName == "WorkshopDamageController")
                {
                    wdc = p as WorkshopDamageController;
                }
            }
            if (wag != null && wag.packed)
            {
                Status = "Packed";
            }

            //this.part.GetComponent<WorkshopAnimateGeneric>()

            base.OnStart(state);
        }
Esempio n. 3
0
 private void LoadMaxVolume()
 {
     try
     {
         var inventories = KISWrapper.GetInventories(vessel);
         if (inventories.Count == 0)
         {
             WorkshopUtils.LogError("No Inventories found on this vessel!");
         }
         else
         {
             WorkshopUtils.Log(inventories.Count + " inventories found on this vessel!");
             _maxVolume = inventories.Max(i => i.maxVolume);
         }
     }
     catch (Exception ex)
     {
         WorkshopUtils.LogError("Error while determing maximum volume of available inventories!", ex);
     }
     WorkshopUtils.Log($"Max volume is: {_maxVolume} liters");
 }
Esempio n. 4
0
        public override void OnStart(StartState state)
        {
            //Init the KAC Wrapper. KAC Wrapper courtey of TriggerAu
            KACWrapper.InitKACWrapper();
            if (KACWrapper.APIReady)
            {
                KACWrapper.KAC.onAlarmStateChanged += KAC_onAlarmStateChanged;
            }

            if (HighLogic.LoadedSceneIsFlight && WorkshopSettings.IsKISAvailable)
            {
                WorkshopUtils.Log("KIS is available - Initialize Workshop");
                SetupAnimations();
                LoadMaxVolume();
                LoadFilters();
                if (lastUpdateTime == 0)
                {
                    lastUpdateTime = Planetarium.GetUniversalTime();
                }
                GameEvents.onVesselChange.Add(OnVesselChange);
            }

            base.OnStart(state);
        }