/// <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); }
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; }
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); }