Esempio n. 1
0
        public void RefreshSolarSystem(StarSystemEntity location)
        {
            SolarSystem = location.Clone() as StarSystemEntity;

            txtSolarSystemName.Text          = Global.Pilots.Selected.Location.System;
            txtSolarSystemClass.Text         = Global.Pilots.Selected.Location.Class;
            txtSolarSystemEffect.Text        = Global.Pilots.Selected.Location.Effect.Trim();
            txtSolarSystemRegion.Text        = Global.Pilots.Selected.Location.Region.Replace(" Unknown (", "").Replace(")", "");
            txtSolarSystemConstellation.Text = Global.Pilots.Selected.Location.Constelation.Replace(" Unknown (", "").Replace(")", "");

            txtSolarSystemStaticI.Text  = "";
            txtSolarSystemStaticII.Text = "";

            txtSolarSystemStaticIData.Text  = "";
            txtSolarSystemStaticIIData.Text = "";

            txtSolarSystemStaticI.Visible      = false;
            txtSolarSystemStaticII.Visible     = false;
            txtSolarSystemStaticIData.Visible  = false;
            txtSolarSystemStaticIIData.Visible = false;

            if (string.IsNullOrEmpty(Global.Pilots.Selected.Location.Static) == false)
            {
                var wormholeI = Global.Space.Wormholes[Global.Pilots.Selected.Location.Static.Trim()];

                txtSolarSystemStaticI.Text        = wormholeI.Name;
                txtSolarSystemStaticI.Visible     = true;
                txtSolarSystemStaticI.ForeColor   = Tools.GetColorBySolarSystem(wormholeI.LeadsTo);
                txtSolarSystemStaticIData.Text    = wormholeI.LeadsTo;
                txtSolarSystemStaticIData.Visible = true;

                toolTip1.SetToolTip(txtSolarSystemStaticI, "Max Stable Mass=" + wormholeI.TotalMass + "\r\nMax Jump  Mass=" + wormholeI.SingleMass);
            }

            if (string.IsNullOrEmpty(Global.Pilots.Selected.Location.Static2) == false)
            {
                var wormholeII = Global.Space.Wormholes[Global.Pilots.Selected.Location.Static2.Trim()];


                txtSolarSystemStaticII.Text        = wormholeII.Name;
                txtSolarSystemStaticII.Visible     = true;
                txtSolarSystemStaticII.ForeColor   = Tools.GetColorBySolarSystem(wormholeII.LeadsTo);
                txtSolarSystemStaticIIData.Text    = wormholeII.LeadsTo;
                txtSolarSystemStaticIIData.Visible = true;

                toolTip2.SetToolTip(txtSolarSystemStaticII, "Max Stable Mass=" + wormholeII.TotalMass + "\r\nMax Jump  Mass=" + wormholeII.SingleMass);
            }
        }
Esempio n. 2
0
        public void RefreshSolarSystem(StarSystemEntity location)
        {
            if (location == null)
            {
                return;
            }

            SolarSystem = location.Clone() as StarSystemEntity;

            if (Global.Pilots.Selected.Location.System == "unknown")
            {
                return;
            }

            txtSolarSystemName.Text          = Global.Pilots.Selected.Location.System;
            txtSolarSystemClass.Text         = Global.Pilots.Selected.Location.Class;
            txtSolarSystemEffect.Text        = Global.Pilots.Selected.Location.Effect.Trim();
            txtSolarSystemRegion.Text        = Global.Pilots.Selected.Location.Region.Replace(" Unknown (", "").Replace(")", "");
            txtSolarSystemConstellation.Text = Global.Pilots.Selected.Location.Constelation.Replace(" Unknown (", "").Replace(")", "");

            txtSolarSystemStaticI.Text  = "";
            txtSolarSystemStaticII.Text = "";

            txtSolarSystemStaticIData.Text  = "";
            txtSolarSystemStaticIIData.Text = "";

            txtSolarSystemStaticI.Visible      = false;
            txtSolarSystemStaticII.Visible     = false;
            txtSolarSystemStaticIData.Visible  = false;
            txtSolarSystemStaticIIData.Visible = false;

            var title = Global.Pilots.Selected.Location.System + "";

            if (string.IsNullOrEmpty(Global.Pilots.Selected.Location.Class) == false)
            {
                title = title + "[C" + Global.Pilots.Selected.Location.Class + "]";
            }

            if (string.IsNullOrEmpty(Global.Pilots.Selected.Location.Static) == false)
            {
                var wormholeI = Global.Space.Wormholes[Global.Pilots.Selected.Location.Static.Trim()];

                txtSolarSystemStaticI.Text        = wormholeI.Name;
                txtSolarSystemStaticI.Visible     = true;
                txtSolarSystemStaticI.ForeColor   = Tools.GetColorBySolarSystem(wormholeI.LeadsTo);
                txtSolarSystemStaticIData.Text    = wormholeI.LeadsTo;
                txtSolarSystemStaticIData.Visible = true;

                toolTip1.SetToolTip(txtSolarSystemStaticI, "Max Stable Mass=" + wormholeI.TotalMass + "\r\nMax Jump  Mass=" + wormholeI.SingleMass + "\r\nMax Life time =" + wormholeI.Lifetime);

                title = title + " " + wormholeI.Name + "[" + wormholeI.LeadsTo + "]";
            }

            if (string.IsNullOrEmpty(Global.Pilots.Selected.Location.Static2) == false)
            {
                var wormholeII = Global.Space.Wormholes[Global.Pilots.Selected.Location.Static2.Trim()];


                txtSolarSystemStaticII.Text        = wormholeII.Name;
                txtSolarSystemStaticII.Visible     = true;
                txtSolarSystemStaticII.ForeColor   = Tools.GetColorBySolarSystem(wormholeII.LeadsTo);
                txtSolarSystemStaticIIData.Text    = wormholeII.LeadsTo;
                txtSolarSystemStaticIIData.Visible = true;

                toolTip2.SetToolTip(txtSolarSystemStaticII, "Max Stable Mass=" + wormholeII.TotalMass + "\r\nMax Jump  Mass=" + wormholeII.SingleMass + "\r\nMax Life time =" + wormholeII.Lifetime);

                title = title + " " + wormholeII.Name + "[" + wormholeII.LeadsTo + "]";
            }

            if (_changeSolarSystemInfo == null)
            {
                return;
            }

            try
            {
                _changeSolarSystemInfo(title);
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("[whlSolarSystem.RefreshSolarSystem] Critical error = {0}", ex);
            }
        }