Ejemplo n.º 1
0
        internal override void Display()
        {
            if (IsActive)
            {
                if (ImGui.Begin(_displayText, ref IsActive, _flags))
                {
                    //put calcs that needs refreshing each frame in here. (ie calculations from mouse cursor position)
                    if (_orbitWidget == null)
                    {
                        _orbitWidget = new OrbitOrderWiget(_orderEntityOrbit.Parent);
                        _uiState.SelectedSysMapRender.UIWidgets.Add(nameof(OrbitOrderWiget), _orbitWidget);
                    }


                    if (_newtonUI.Display())
                    {
                        Calcs();
                    }



                    if (ImGui.Button("Action Command"))
                    {
                        ActionCmd();
                    }


                    //ImGui.SetTooltip(_tooltipText);
                }
            }
        }
Ejemplo n.º 2
0
        internal override void Display()
        {
            if (IsActive)
            {
                if (ImGui.Begin(_displayText, ref IsActive, _flags))
                {
                    //put calcs that needs refreshing each frame in here. (ie calculations from mouse cursor position)
                    if (_orbitWidget == null)
                    {
                        _orbitWidget = new OrbitOrderWiget(_orderEntityOrbit.Parent);
                        _state.SelectedSysMapRender.UIWidgets.Add(nameof(OrbitOrderWiget), _orbitWidget);
                    }

                    var maxprogradeDV = _maxDV - Math.Abs(_radialDV);
                    var maxradialDV   = _maxDV - Math.Abs(_progradeDV);
                    if (ImGui.SliderFloat("Prograde DV", ref _progradeDV, -maxprogradeDV, maxprogradeDV))
                    {
                        Calcs();
                    }
                    if (ImGui.SliderFloat("Radial DV", ref _radialDV, -maxradialDV, maxradialDV))
                    {
                        Calcs();
                    }

                    if (ImGui.Button("Action Command"))
                    {
                        ActionCmd();
                    }


                    //ImGui.SetTooltip(_tooltipText);
                }
            }
        }
Ejemplo n.º 3
0
 internal void CloseWindow()
 {
     IsActive = false;
     if (_orbitWidget != null)
     {
         _uiState.SelectedSysMapRender.UIWidgets.Remove(nameof(OrbitOrderWiget));
         _orbitWidget = null;
     }
 }
Ejemplo n.º 4
0
        internal void CloseWindow()
        {
            IsActive = false;
            _state.SelectedSystem.ManagerSubpulses.SystemDateChangedEvent -= OnSystemDateTimeChange;

            if (_orbitWidget != null)
            {
                _state.SelectedSysMapRender.UIWidgets.Remove(nameof(OrbitOrderWiget));
                _orbitWidget = null;
            }
        }
Ejemplo n.º 5
0
        void TargetSelected()
        {
            TargetEntity = _uiState.LastClickedEntity;

            _uiState.Camera.PinToEntity(TargetEntity.Entity);
            _targetRadiusAU = TargetEntity.Entity.GetDataBlob <MassVolumeDB>().RadiusInAU;
            _targetRadius_m = TargetEntity.Entity.GetDataBlob <MassVolumeDB>().RadiusInM;

            var soiWorldRad_AU = OrbitProcessor.GetSOI_AU(TargetEntity.Entity);

            _apMax = soiWorldRad_AU;

            float soiViewUnits = _uiState.Camera.ViewDistance(soiWorldRad_AU);


            _massTargetBody           = TargetEntity.Entity.GetDataBlob <MassVolumeDB>().MassDry;
            _stdGravParamTargetBody_m = OrbitMath.CalculateStandardGravityParameterInM3S2(_massOrderingEntity, _massTargetBody);

            InsertionCalcs();


            System.Numerics.Vector2 viewPortSize = _uiState.Camera.ViewPortSize;
            float windowLen = Math.Min(viewPortSize.X, viewPortSize.Y);

            if (soiViewUnits < windowLen * 0.5)
            {
                //zoom so soi fills ~3/4 screen.
                var soilenwanted = windowLen * 0.375;
                _uiState.Camera.ZoomLevel = (float)(soilenwanted / _apMax);
            }


            if (_orbitWidget != null)
            {
                _orbitWidget = new OrbitOrderWiget(TargetEntity.Entity);
                _uiState.SelectedSysMapRender.UIWidgets[nameof(_orbitWidget)] = _orbitWidget;
            }
            else
            {
                _orbitWidget = new OrbitOrderWiget(TargetEntity.Entity);
                _uiState.SelectedSysMapRender.UIWidgets.Add(nameof(_orbitWidget), _orbitWidget);
            }


            OrderingEntityState.DebugOrbitOrder = _orbitWidget;
            _moveWidget.SetArrivalTarget(TargetEntity.Entity);


            _tooltipText = "Select Insertion Point";
            CurrentState = States.NeedsInsertionPoint;
        }
Ejemplo n.º 6
0
 void CloseWindow()
 {
     this.SetActive(false);
     CurrentState = States.NeedsEntity;
     _progradeDV  = 0;
     _radialDV    = 0;
     if (_orbitWidget != null)
     {
         _uiState.SelectedSysMapRender.UIWidgets.Remove(nameof(_orbitWidget));
         _orbitWidget = null;
     }
     if (_moveWidget != null)
     {
         _uiState.SelectedSysMapRender.UIWidgets.Remove(nameof(_moveWidget));
         _moveWidget = null;
     }
 }
Ejemplo n.º 7
0
        void CloseWindow()
        {
            IsActive     = false;
            CurrentState = States.NeedsEntity;
            _state.SelectedSystem.ManagerSubpulses.SystemDateChangedEvent -= OnSystemDateTimeChange;

            if (_orbitWidget != null)
            {
                _state.SelectedSysMapRender.UIWidgets.Remove(nameof(_orbitWidget));
                _orbitWidget = null;
            }
            if (_moveWidget != null)
            {
                _state.SelectedSysMapRender.UIWidgets.Remove(nameof(_moveWidget));
                _moveWidget = null;
            }
        }