コード例 #1
0
ファイル: UiMainMenu.cs プロジェクト: Nexam/NexHud
        /// <summary>
        /// The main menu group (with the button Search, Improve, Trade....)
        /// </summary>
        /// <param name="_menu"></param>
        public UiMainMenu(NxMenu _menu) : base(_menu.frame.NxOverlay)
        {
            /**
             * There is no need to change this code to add a Menu Button
             * Simply add an entry in the enum NxMainPanelMenuButton.MenuButtonType
             *
             * */
            int ButtonY = (_menu.frame.WindowHeight / 2) + (UiMainTopInfos.HEIGHT / 2);
            int _number = Enum.GetNames(typeof(UiMainMenuButton.MenuButtonType)).Length;

            m_buttons = new UiMainMenuButton[_number];
            bool _pair = _number % 2 == 0;

            for (int i = 0; i < _number; i++)
            {
                m_buttons[i] = new UiMainMenuButton(
                    _pair ?
                    (
                        (i - (_number / 2)) * (UiMainMenuButton.WIDTH + Spacing) + _menu.frame.WindowWidth / 2 + (UiMainMenuButton.WIDTH / 2) + (Spacing / 2)
                    )
                    :
                    (
                        (i - (_number / 2)) * (UiMainMenuButton.WIDTH + Spacing) + _menu.frame.WindowWidth / 2
                    )
                    ,
                    ButtonY,
                    (UiMainMenuButton.MenuButtonType)i, Parent
                    );


                Add(m_buttons[i]);
            }

            onSelectChange();
        }
コード例 #2
0
ファイル: UiMainRadio.cs プロジェクト: Nexam/NexHud
        public UiMainRadio(int _x, int _y, NxMenu _menu) : base(_menu.frame.NxOverlay)
        {
            Menu          = _menu;
            x             = _x;
            y             = _y;
            PreviousRadio = new NxButton(x - RadioWidth / 2 - RadioNextPrevWidth - 2, y, RadioNextPrevWidth, Height, "<<", Menu);
            NextRadio     = new NxButton(x + RadioWidth / 2 + 2, y, RadioNextPrevWidth, Height, ">>", Menu);
            Radio         = new NxButton(x - RadioWidth / 2, y, RadioWidth, Height, "[ ] Radio Sidewinder", Menu);

            Add(PreviousRadio);
            Add(NextRadio);
            Add(Radio);

            Volume       = new NxProgressBar(x - RadioWidth / 2 - RadioNextPrevWidth - 2, y + Height + 10, totalWidth, 10, EDColors.YELLOW);
            Volume.Value = (int)(RadioPlayer.Instance.Volume * 100);
            Add(Volume);
        }
コード例 #3
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;
        }
コード例 #4
0
ファイル: UiMainTopInfos.cs プロジェクト: Nexam/NexHud
        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);
        }