Esempio n. 1
0
        public override void OnUpdate()
        {
            if (isChargingField.guiActive)
            {
                accumulatedChargeStr = PluginHelper.GetFormattedPowerString(accumulatedElectricChargeInMW) + " / " + PluginHelper.GetFormattedPowerString(StartupPower);
            }
            else if (part.vessel.geeForce > startupMaximumGeforce)
            {
                accumulatedChargeStr = part.vessel.geeForce.ToString("F2") + "g > " + startupMaximumGeforce.ToString("F2") + "g";
            }
            else
            {
                accumulatedChargeStr = string.Empty;
            }

            accumulatedChargeStrField.guiActive = plasma_ratio < 1;

            electricPowerMaintenance = PluginHelper.GetFormattedPowerString(_powerConsumed) + " / " + PluginHelper.GetFormattedPowerString(LaserPowerRequirements);

            if (StartupAnimation != null && !Initialized)
            {
                if (IsEnabled)
                {
                    if (AnimationStarted == 0)
                    {
                        StartupAnimation.ToggleAction(new KSPActionParam(KSPActionGroup.Custom01, KSPActionType.Activate));
                        AnimationStarted = Planetarium.GetUniversalTime();
                    }
                    else if (!StartupAnimation.IsMoving())
                    {
                        StartupAnimation.ToggleAction(new KSPActionParam(KSPActionGroup.Custom01, KSPActionType.Deactivate));
                        AnimationStarted = 0;
                        Initialized      = true;
                        isDeployed       = true;
                    }
                }
                else // Not Enabled
                {
                    // continuously start
                    StartupAnimation.ToggleAction(new KSPActionParam(KSPActionGroup.Custom01, KSPActionType.Activate));
                    StartupAnimation.ToggleAction(new KSPActionParam(KSPActionGroup.Custom01, KSPActionType.Deactivate));
                }
            }
            else if (StartupAnimation == null)
            {
                isDeployed = true;
            }

            // call base class
            base.OnUpdate();
        }
Esempio n. 2
0
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            StartupAnimation.Begin();
            if (shownOnce == false)
            {
                shownOnce = true;
                AddToLog("<NO>");
                bool lr = InteropSvc.InteropLib.Initialize();
                if (InteropSvc.InteropLib.Instance == null || InteropSvc.InteropLib.Instance.HasRootAccess() == false)
                {
                    MessageBox.Show(LocalizedResources.NoRootAccess, LocalizedResources.Error, MessageBoxButton.OK);
                    throw new Exception("Quit");
                }

                ViewModel.RefreshState();
                ViewModel.RefreshDebuggerState();
            }
        }
Esempio n. 3
0
 public void Start() =>
 StartupAnimation.Begin();