Ejemplo n.º 1
0
        public override void Update()
        {
            base.Update();
            if (EDDatas.Instance.getCurrentSystem().receivedEddbInfos)
            {
                infoCheck += NexHudEngine.deltaTime;
                if (infoCheck > 1)
                {
                    infoCheck           = 0;
                    m_Content.isVisible = true;
                    m_Loading.isVisible = false;

                    EliteAllegiance _allegiance = EDDatas.Instance.getCurrentSystem().allegiance;
                    if (_allegiance != m_lastAllegiance)
                    {
                        m_lastAllegiance = _allegiance;
                        switch (_allegiance)
                        {
                        case EliteAllegiance.Alliance: m_AllegianceLogo.Image = ResHelper.GetResourceImage(Assembly.GetExecutingAssembly(), "Resources.factions.alliance64.png"); break;

                        case EliteAllegiance.Empire: m_AllegianceLogo.Image = ResHelper.GetResourceImage(Assembly.GetExecutingAssembly(), "Resources.factions.empire64.png"); break;

                        case EliteAllegiance.Federation: m_AllegianceLogo.Image = ResHelper.GetResourceImage(Assembly.GetExecutingAssembly(), "Resources.factions.federation64.png"); break;

                        case EliteAllegiance.Independent: m_AllegianceLogo.Image = ResHelper.GetResourceImage(Assembly.GetExecutingAssembly(), "Resources.factions.inde64.png"); break;
                        }
                    }

                    m_SystemName.text         = EDDatas.Instance.getCurrentSystem().name.FirstCharToUpper();
                    m_ControllingFaction.text = EDDatas.Instance.getCurrentSystem().controlling_minor_faction.FirstCharToUpper();
                    m_GovAndPop.text          = EDDatas.Instance.getCurrentSystem().government + ". Population: " + String.Format("{0:#,##0}", EDDatas.Instance.getCurrentSystem().population);
                    string eco = EDDatas.Instance.getCurrentSystem().economy.ToStringFormated();
                    if (EDDatas.Instance.getCurrentSystem().secondEconomy != EliteEconomy.Unknow && EDDatas.Instance.getCurrentSystem().secondEconomy != EDDatas.Instance.getCurrentSystem().economy)
                    {
                        eco += " (" + EDDatas.Instance.getCurrentSystem().secondEconomy.ToStringFormated() + ")";
                    }
                    m_Economy.text = eco;

                    m_Security.Color         = EliteSecurityHelper.getColor(EDDatas.Instance.getCurrentSystem().security);
                    m_Security.text          = EDDatas.Instance.getCurrentSystem().security.ToString();
                    m_Threat.Color           = EliteSystemThreatHelper.getColor(EDDatas.Instance.getCurrentSystem().Threat);
                    m_Threat.text            = EDDatas.Instance.getCurrentSystem().Threat.ToString();
                    m_Reserve.text           = "Reserve: " + EDDatas.Instance.getCurrentSystem().reserve;
                    m_SystemValue.text       = "Est. Value: " + string.Format("{0:#,0}", EDDatas.Instance.getCurrentSystem().value) + " cr";
                    m_SystemValueMapped.text = "Est. Mapped Value: " + string.Format("{0:#,0}", EDDatas.Instance.getCurrentSystem().valueMapped) + " cr";
                    m_traffic.text           = "Traffic (24h): " + EDDatas.Instance.getCurrentSystem().traffic_day;
                }
            }
            else
            {
                m_Content.isVisible = false;
                m_Loading.isVisible = true;
            }
        }
Ejemplo n.º 2
0
        public UiMainPlayerInfos(NxMenu _menu) : base(_menu.frame.NxOverlay)
        {
            x      = 0;
            y      = UiMainTopInfos.HEIGHT + 5;
            m_menu = _menu;

            NexHudMain.EliteApi.Events.RankEvent += onRankEvent;

            m_PlayerRank = new NxImage(x, y, ResHelper.GetResourceImage(Assembly.GetExecutingAssembly(), getImageForRank((int)NexHudMain.EliteApi.Commander.CombatRank, (int)NexHudMain.EliteApi.Commander.TradeRank, (int)NexHudMain.EliteApi.Commander.ExplorationRank)));
            Add(m_PlayerRank);

            m_PlayerName = new NxSimpleText(x + 64, y, "CMDR " + NexHudMain.EliteApi.Commander.Commander, EDColors.WHITE, 22);
            Add(m_PlayerName);

            m_ShipName = new NxSimpleText(x + 64, y + 24, "Unknow ship", EDColors.ORANGE, 22, NxFonts.EuroCapital);
            Add(m_ShipName);
            NexHudMain.EliteApi.Events.SetUserShipNameEvent += Events_SetUserShipNameEvent;

            m_Balance = new NxSimpleText(m_menu.frame.WindowWidth, y, string.Empty, EDColors.YELLOW, 20);
            Add(m_Balance);
            m_Rebuy = new NxSimpleText(m_menu.frame.WindowWidth, y + 24, string.Empty, EDColors.RED, 18);
            Add(m_Rebuy);
            NexHudMain.EliteApi.Events.LoadoutEvent += Events_LoadoutEvent;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// The button is centered on the position;
        /// </summary>
        /// <param name="_parent"></param>
        public UiMainMenuButton(int _x, int _y, MenuButtonType _type, NxOverlay _parent) : base(_parent)
        {
            x      = _x;
            y      = _y;
            m_Type = _type;

            //background
            Color        = EDColors.getColor(EDColors.ORANGE, 0.2f);
            m_originRec  = new Rectangle(x - (WIDTH / 2), y - (HEIGHT / 2), WIDTH, HEIGHT);
            m_background = new NxRectangle(m_originRec.X, m_originRec.Y, m_originRec.Width, m_originRec.Height, Color);
            Add(m_background);

            //Title
            m_TopText = new NxSimpleText(x, m_background.y + 5, getMenuTitle(), EDColors.ORANGE, 34, NxFonts.EuroCapital);
            m_TopText.centerHorizontal = true;
            Add(m_TopText);

            //Icon
            m_Icon = new NxImage(m_background.x + (WIDTH - ICON_SIZE) / 2, m_background.y + 50, ResHelper.GetResourceImage(Assembly.GetExecutingAssembly(), getIconPath()));
            Add(m_Icon);

            //Bottom Text
            int _botHeight = 80;
            int _padding   = 5;

            m_BottomText             = new NxTextbox(m_background.x + _padding, m_background.y + (HEIGHT - _botHeight) - _padding, WIDTH - _padding * 2, _botHeight, getBottomText(), EDColors.ORANGE, 19);
            m_BottomText.showBounds  = true;
            m_BottomText.boundColors = EDColors.getColor(EDColors.ORANGE, .5f);
            Add(m_BottomText);
        }
Ejemplo n.º 4
0
        public UiMainTopInfos(NxMenu _menu) : base(_menu.frame.NxOverlay)
        {
            m_menu = _menu;
            //Loading & Content;
            m_Content = new NxGroup(Parent);
            Add(m_Content);
            m_Content.isVisible = false;
            m_Loading           = new NxLoading(NxMenu.Width / 2, 30);
            Add(m_Loading);

            //Decoration
            Add(new NxImage(0, 0, NxMenu.Width, HEIGHT * 2, ResHelper.GetResourceImage(Assembly.GetExecutingAssembly(), "Resources.GradientOrange15p.png")));
            Add(new NxRectangle(0, HEIGHT, NxMenu.Width, 1, EDColors.YELLOW));

            //* Faction icon *//
            m_AllegianceLogo = new NxImage(0, 0, ResHelper.GetResourceImage(Assembly.GetExecutingAssembly(), "Resources.factions.inde64.png"));
            m_Content.Add(m_AllegianceLogo);
            //* -- Titles **//
            //System Name
            m_SystemName = new NxSimpleText(decal_x, 0, string.Empty, EDColors.ORANGE, 40, NxFonts.EuroCapital);
            m_Content.Add(m_SystemName);
            //Controlling Factions
            m_ControllingFaction = new NxSimpleText(decal_x + 5, 35, string.Empty, EDColors.YELLOW, 20, NxFonts.EuroCapital);
            m_Content.Add(m_ControllingFaction);

            //* -- Descriptions **//
            //Government & Population
            Column1 = 0;

            int infoSize = 18;

            m_GovAndPop = new NxSimpleText(Column1, 2, string.Empty, EDColors.getColor(EDColors.WHITE, 0.5f), infoSize, NxFonts.EuroStile);
            m_Content.Add(m_GovAndPop);
            //Economy
            m_Economy = new NxSimpleText(Column1, 20, string.Empty, EDColors.BLUE, infoSize, NxFonts.EuroStile);
            m_Content.Add(m_Economy);
            //Security
            m_SecurityLabel = new NxSimpleText(Column1, 40, "Security:", EDColors.getColor(EDColors.WHITE, 0.5f), infoSize, NxFonts.EuroStile);
            m_Content.Add(m_SecurityLabel);
            m_Security = new NxSimpleText(Column1, 40, string.Empty, EDColors.BLUE, infoSize, NxFonts.EuroStile);
            m_Content.Add(m_Security);
            //Threat
            m_ThreatLabel = new NxSimpleText(Column1, 40, "Threat:", EDColors.getColor(EDColors.WHITE, 0.5f), infoSize, NxFonts.EuroStile);
            m_Content.Add(m_ThreatLabel);
            m_Threat = new NxSimpleText(Column1, 40, string.Empty, EDColors.BLUE, infoSize, NxFonts.EuroStile);
            m_Content.Add(m_Threat);
            //Traffic
            m_traffic = new NxSimpleText(0, 40, string.Empty, EDColors.getColor(EDColors.WHITE, 0.5f), infoSize, NxFonts.EuroStile);
            m_Content.Add(m_traffic);

            //* -- Column 2 -- *//
            //reserve
            m_Reserve = new NxSimpleText(0, 2, string.Empty, EDColors.getColor(EDColors.WHITE, 0.5f), infoSize, NxFonts.EuroStile);
            m_Content.Add(m_Reserve);
            //System Value
            m_SystemValue = new NxSimpleText(0, 20, string.Empty, EDColors.LIGHTBLUE, infoSize, NxFonts.EuroStile);
            m_Content.Add(m_SystemValue);
            //System Value Mapped
            m_SystemValueMapped = new NxSimpleText(0, 40, string.Empty, EDColors.BLUE, infoSize, NxFonts.EuroStile);
            m_Content.Add(m_SystemValueMapped);
        }
Ejemplo n.º 5
0
 private void onRankEvent(object sender, RankInfo e)
 {
     m_PlayerRank.Image = ResHelper.GetResourceImage(Assembly.GetExecutingAssembly(), getImageForRank((int)NexHudMain.EliteApi.Commander.CombatRank, (int)NexHudMain.EliteApi.Commander.TradeRank, (int)NexHudMain.EliteApi.Commander.ExplorationRank));
 }