public NotificationManager(Ship_Game.ScreenManager ScreenManager, UniverseScreen screen) { this.screen = screen; this.ScreenManager = ScreenManager; this.NotificationArea = new Rectangle(ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 70, 70, 70, ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 70 - 275); this.numentriesToDisplay = this.NotificationArea.Height / 70; }
public Submenu(bool Blue, Ship_Game.ScreenManager sm, Rectangle theMenu) { this.blue = Blue; if (sm.GraphicsDevice.PresentationParameters.BackBufferWidth <= 1280) { this.LowRes = true; } if (!this.LowRes) { this.toUse = Fonts.Arial12Bold; } else { this.toUse = Fonts.Arial12Bold; } this.toUse = Fonts.Pirulen12; this.ScreenManager = sm; this.Menu = theMenu; this.UpperLeft = new Rectangle(theMenu.X, theMenu.Y, ResourceManager.TextureDict["ResearchMenu/submenu_header_left"].Width, ResourceManager.TextureDict["ResearchMenu/submenu_header_left"].Height); this.TL = new Rectangle(theMenu.X, theMenu.Y + 25 - 2, ResourceManager.TextureDict["ResearchMenu/submenu_corner_TL"].Width, ResourceManager.TextureDict["ResearchMenu/submenu_corner_TL"].Height); this.TR = new Rectangle(theMenu.X + theMenu.Width - ResourceManager.TextureDict["ResearchMenu/submenu_corner_TR"].Width, theMenu.Y + 25 - 2, ResourceManager.TextureDict["ResearchMenu/submenu_corner_TR"].Width, ResourceManager.TextureDict["ResearchMenu/submenu_corner_TR"].Height); this.BL = new Rectangle(theMenu.X, theMenu.Y + theMenu.Height - ResourceManager.TextureDict["ResearchMenu/submenu_corner_BL"].Height + 2, ResourceManager.TextureDict["ResearchMenu/submenu_corner_BL"].Width, ResourceManager.TextureDict["ResearchMenu/submenu_corner_BL"].Height); this.BR = new Rectangle(theMenu.X + theMenu.Width - ResourceManager.TextureDict["ResearchMenu/submenu_corner_BR"].Width, theMenu.Y + theMenu.Height + 2 - ResourceManager.TextureDict["ResearchMenu/submenu_corner_BR"].Height, ResourceManager.TextureDict["ResearchMenu/submenu_corner_BR"].Width, ResourceManager.TextureDict["ResearchMenu/submenu_corner_BR"].Height); this.topHoriz = new Rectangle(theMenu.X + ResourceManager.TextureDict["ResearchMenu/submenu_corner_TL"].Width, theMenu.Y + 25 - 2, theMenu.Width - this.TR.Width - ResourceManager.TextureDict["ResearchMenu/submenu_corner_TL"].Width, 2); this.botHoriz = new Rectangle(theMenu.X + this.BL.Width, theMenu.Y + theMenu.Height, theMenu.Width - this.BL.Width - this.BR.Width, 2); this.VL = new Rectangle(theMenu.X, theMenu.Y + 25 + this.TR.Height - 2, 2, theMenu.Height - 25 - this.BL.Height - 2); this.VR = new Rectangle(theMenu.X + theMenu.Width - 2, theMenu.Y + 25 + this.TR.Height - 2, 2, theMenu.Height - 25 - this.BR.Height - 2); }
public void Draw(Ship_Game.ScreenManager ScreenManager, Rectangle clickRect) { this.Container = clickRect; this.Portrait = new Rectangle(this.Container.X + 6, this.Container.Y, 128, 128); Vector2 TitlePos = new Vector2((float)(this.Portrait.X + 140), (float)this.Portrait.Y); //added by gremlin Draw Mod Version string title = this.mi.ModName; //if (this.mi.Version != null && this.mi.Version != "" && !this.mi.ModName.Contains(this.mi.Version)) //title=string.Concat(title," - ",this.Version); ScreenManager.SpriteBatch.DrawString(Fonts.Arial20Bold, title, TitlePos, Color.Orange); TitlePos.Y = TitlePos.Y + (float)(Fonts.Arial20Bold.LineSpacing + 2); Vector2 ContactPos = TitlePos; string Author = "Author: " +this.mi.Author; ScreenManager.SpriteBatch.DrawString(Fonts.Arial12Bold, Author, TitlePos, Color.Red); ContactPos.X += Fonts.Arial12Bold.MeasureString(Author).X; string URL = " URL: "+this.mi.URL; ScreenManager.SpriteBatch.DrawString(Fonts.Arial12Bold, URL, ContactPos, Color.CornflowerBlue); TitlePos.Y = TitlePos.Y + (float)(Fonts.Arial12Bold.LineSpacing + 1); string Description = this.mi.ModDescription; // if (this.mi.Version != null && this.mi.Version != "" && !this.mi.ModDescription.Contains(this.mi.Version)) if (this.mi.Version != null && !string.IsNullOrEmpty(this.mi.Version)) Description = string.Concat(Description, "\n----\nVersion - ", this.Version); ScreenManager.SpriteBatch.DrawString(Fonts.Arial12Bold, HelperFunctions.parseText(Fonts.Arial12Bold, Description, 450f), TitlePos, Color.White); ScreenManager.SpriteBatch.Draw(this.PortraitTex, this.Portrait, Color.White); Primitives2D.DrawRectangle(ScreenManager.SpriteBatch, this.Portrait, Color.White); }
public static void CreateTooltip(string intext, Ship_Game.ScreenManager ScreenManager, string Hotkey) { ToolTip.Hotkey = Hotkey; float x = (float)Mouse.GetState().X; MouseState state = Mouse.GetState(); Vector2 Position = new Vector2(x, (float)state.Y); ToolTip.text = HelperFunctions.parseText(Fonts.Arial12Bold, intext, 200f); float width = Fonts.Arial12Bold.MeasureString(ToolTip.text).X; float height = Fonts.Arial12Bold.MeasureString(ToolTip.text).Y + (float)(Fonts.Arial12Bold.LineSpacing * 2); Rectangle tipRect = new Rectangle((int)Position.X + 10, (int)Position.Y + 10, (int)width + 20, (int)height + 10); if (tipRect.X + tipRect.Width > ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth) { tipRect.X = tipRect.X - (tipRect.Width + 10); } while (tipRect.Y + tipRect.Height > ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight) { tipRect.Y = tipRect.Y - 1; } if (ToolTip.textLast != ToolTip.text) { ToolTip.TipTimer = 50; ToolTip.textLast = ToolTip.text; } ToolTip.r = tipRect; ToolTip.ti = ""; }
public void Draw(Ship_Game.ScreenManager ScreenManager) { ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict["OliveUI/header_left"], this.leftRect, Color.White); ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict["OliveUI/header_fill"], this.FillRect, Color.White); ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict["OliveUI/header_right_slant"], this.RightRect, Color.White); ScreenManager.SpriteBatch.DrawString(Fonts.Arial20Bold, this.text, this.TextPos, new Color(198, 189, 180)); }
public void Draw(Ship_Game.ScreenManager ScreenManager) { Microsoft.Xna.Framework.Graphics.SpriteBatch SpriteBatch = ScreenManager.SpriteBatch; Vector2 Cursor = new Vector2((float)(this.ContainerRect.X + 10), (float)this.ContainerRect.Y); SpriteBatch.DrawString(Fonts.Arial12Bold, this.Text, Cursor, new Color(255, 239, 208)); if (this.amount > 0.5f) { float greenamount = 2f * (this.amount - 0.5f); SpriteBatch.Draw(ResourceManager.TextureDict["NewUI/slider_grd_green"], new Rectangle(this.greenRect.X, this.rect.Y, (int)(greenamount * (float)this.greenRect.Width), 6), new Rectangle?(new Rectangle(this.rect.X, this.rect.Y, (int)(greenamount * (float)this.greenRect.Width), 6)), Color.White); } else if (this.amount < 0.5f) { float blackAmount = 2f * this.amount; Primitives2D.FillRectangle(SpriteBatch, this.redRect, Color.Maroon); Primitives2D.FillRectangle(SpriteBatch, new Rectangle(this.redRect.X, this.rect.Y, (int)(blackAmount * (float)this.redRect.Width), 6), Color.Black); } Primitives2D.DrawRectangle(SpriteBatch, this.rect, (this.Hover ? new Color(164, 154, 133) : new Color(72, 61, 38))); Vector2 tickCursor = new Vector2(); for (int i = 0; i < 11; i++) { tickCursor = new Vector2((float)(this.rect.X + this.rect.Width / 10 * i), (float)(this.rect.Y + this.rect.Height + 2)); if (this.Hover) { SpriteBatch.Draw(ResourceManager.TextureDict["NewUI/slider_minute_hover"], tickCursor, Color.White); } else { SpriteBatch.Draw(ResourceManager.TextureDict["NewUI/slider_minute"], tickCursor, Color.White); } } Rectangle drawRect = this.cursor; drawRect.X = drawRect.X - drawRect.Width / 2; if (this.Hover) { SpriteBatch.Draw(ResourceManager.TextureDict["NewUI/slider_crosshair_hover"], drawRect, Color.White); } else { SpriteBatch.Draw(ResourceManager.TextureDict["NewUI/slider_crosshair"], drawRect, Color.White); } Vector2 textPos = new Vector2((float)(this.rect.X + this.rect.Width + 8), (float)(this.rect.Y + this.rect.Height / 2 - Fonts.Arial12Bold.LineSpacing / 2)); string text = ""; if (this.amount > 0.5f) { text = "Bigger"; } if (this.amount < 0.5f) { text = "Smaller"; } if (this.amount == 0.5f) { text = "Similar"; } SpriteBatch.DrawString(Fonts.Arial12Bold, text, textPos, new Color(255, 239, 208)); if (this.Hover && this.Tip_ID != 0) { ToolTip.CreateTooltip(this.Tip_ID, ScreenManager); } }
public UnexploredPlanetScreen(Planet p, Ship_Game.ScreenManager ScreenManager) { this.ScreenManager = ScreenManager; this.p = p; if (ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth <= 1280) { this.LowRes = true; } Rectangle titleRect = new Rectangle(5, 44, 405, 80); if (this.LowRes) { titleRect.Width = 365; } this.TitleBar = new Menu2(ScreenManager, titleRect); this.TitlePos = new Vector2((float)(titleRect.X + titleRect.Width / 2) - Fonts.Laserian14.MeasureString(p.Name).X / 2f, (float)(titleRect.Y + titleRect.Height / 2 - Fonts.Laserian14.LineSpacing / 2)); Rectangle leftRect = new Rectangle(5, titleRect.Y + titleRect.Height + 5, titleRect.Width, ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - (titleRect.Y + titleRect.Height) - (int)(0.4f * (float)ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight)); if (leftRect.Height < 350) { leftRect.Height = 350; } this.PlanetMenu = new Menu1(ScreenManager, leftRect); Rectangle psubRect = new Rectangle(leftRect.X + 20, leftRect.Y + 20, leftRect.Width - 40, leftRect.Height - 40); this.PlanetInfo = new Submenu(ScreenManager, psubRect); this.PlanetInfo.AddTab("Planet Info"); this.PlanetIcon = new Rectangle(psubRect.X + psubRect.Width - 148, leftRect.Y + 55, 128, 128); }
public DeepSpaceBuildingWindow(Ship_Game.ScreenManager ScreenManager, UniverseScreen screen) { this.screen = screen; this.ScreenManager = ScreenManager; int WindowWidth = 320; this.win = new Rectangle(ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 5 - WindowWidth, 260, WindowWidth, 225); Rectangle rectangle = new Rectangle(ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 5 - WindowWidth + 20, 225, WindowWidth - 40, 455); this.ConstructionSubMenu = new Submenu(ScreenManager, this.win, true); this.ConstructionSubMenu.AddTab("Build Menu"); this.SL = new ScrollList(this.ConstructionSubMenu, 40); //The Doctor: Ensure Subspace Projector is always the first entry on the DSBW list so that the player never has to scroll to find it. foreach (string s in EmpireManager.GetEmpireByName(screen.PlayerLoyalty).structuresWeCanBuild) { if (ResourceManager.GetShip(s).Name == "Subspace Projector") { this.SL.AddItem(ResourceManager.ShipsDict[s], 0, 0); break; } else continue; } foreach (string s in EmpireManager.GetEmpireByName(screen.PlayerLoyalty).structuresWeCanBuild) { if (ResourceManager.GetShip(s).Name != "Subspace Projector") { this.SL.AddItem(ResourceManager.ShipsDict[s], 0, 0); } else continue; } this.TextPos = new Vector2((float)(this.win.X + this.win.Width / 2) - Fonts.Arial12Bold.MeasureString("Deep Space Construction").X / 2f, (float)(this.win.Y + 25)); }
private LoadingScreen(Ship_Game.ScreenManager screenManager, bool loadingIsSlow, GameScreen[] screensToLoad) { //GC.Collect(1,GCCollectionMode.Optimized); this.loadingIsSlow = loadingIsSlow; this.screensToLoad = screensToLoad; base.TransitionOnTime = TimeSpan.FromSeconds(0); base.TransitionOffTime = TimeSpan.FromSeconds(0); }
public void Draw(Ship_Game.ScreenManager ScreenManager, float Percent) { ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict["NewUI/Dan_Progress_Housing"], this.rect, Color.White); Primitives2D.FillRectangle(ScreenManager.SpriteBatch, this.progressRect, new Color(24, 81, 91)); int x = this.progressRect.X + (int)(Percent * (float)this.progressRect.Width); Rectangle Mask = new Rectangle(x, this.progressRect.Y, (int)((1f - Percent) * (float)this.progressRect.Width), this.progressRect.Height); Primitives2D.FillRectangle(ScreenManager.SpriteBatch, Mask, Color.Black); }
public void Draw(Ship_Game.ScreenManager ScreenManager) { this.bup.Draw(ScreenManager); this.bdown.Draw(ScreenManager); this.bcancel.Draw(ScreenManager); this.Node.DrawGlow(ScreenManager); this.Node.Draw(ScreenManager); }
public static void Load(Ship_Game.ScreenManager screenManager, bool loadingIsSlow, params GameScreen[] screensToLoad) { GameScreen[] screens = screenManager.GetScreens(); for (int i = 0; i < (int)screens.Length; i++) { screens[i].ExitScreen(); } screenManager.AddScreen(new LoadingScreen(screenManager, loadingIsSlow, screensToLoad)); }
public AutomationWindow(Ship_Game.ScreenManager ScreenManager, UniverseScreen screen) { this.screen = screen; this.ScreenManager = ScreenManager; int WindowWidth = 210; this.win = new Rectangle(ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 115 - WindowWidth, 490, WindowWidth, 300); Rectangle rectangle = new Rectangle(ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 5 - WindowWidth + 20, 225, WindowWidth - 40, 455); this.ConstructionSubMenu = new Submenu(ScreenManager, this.win, true); this.ConstructionSubMenu.AddTab(Localizer.Token(304)); Ref<bool> aeRef = new Ref<bool>(() => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoExplore, (bool x) => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoExplore = x); Checkbox cb = new Checkbox(new Vector2((float)this.win.X, (float)(this.win.Y + 25)), Localizer.Token(305), aeRef, Fonts.Arial12Bold); this.Checkboxes.Add(cb); cb.Tip_Token = 2226; this.ScoutDropDown = new DropOptions(new Rectangle(this.win.X + 12, this.win.Y + 25 + Fonts.Arial12Bold.LineSpacing + 7, 190, 18)); Ref<bool> acRef = new Ref<bool>(() => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoColonize, (bool x) => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoColonize = x); cb = new Checkbox(new Vector2((float)this.win.X, (float)(this.win.Y + 65)), Localizer.Token(306), acRef, Fonts.Arial12Bold); this.Checkboxes.Add(cb); cb.Tip_Token = 2227; this.ColonyShipDropDown = new DropOptions(new Rectangle(this.win.X + 12, this.win.Y + 65 + Fonts.Arial12Bold.LineSpacing + 7, 190, 18)); Ref<bool> afRef = new Ref<bool>(() => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoFreighters, (bool x) => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoFreighters = x); cb = new Checkbox(new Vector2((float)this.win.X, (float)(this.win.Y + 105)), Localizer.Token(308), afRef, Fonts.Arial12Bold); this.Checkboxes.Add(cb); cb.Tip_Token = 2229; this.AutoFreighterDropDown = new DropOptions(new Rectangle(this.win.X + 12, this.win.Y + 105 + Fonts.Arial12Bold.LineSpacing + 7, 190, 18)); this.ConstructorTitle = new Vector2((float)this.win.X + 29, (float)(this.win.Y + 155)); this.ConstructorString = Localizer.Token(6181); this.ConstructorDropDown = new DropOptions(new Rectangle(this.win.X + 12, this.win.Y + 155 + Fonts.Arial12Bold.LineSpacing + 7, 190, 18)); Ref<bool> abRef = new Ref<bool>(() => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoBuild, (bool x) => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoBuild = x); cb = new Checkbox(new Vector2((float)this.win.X, (float)(this.win.Y + 210)), string.Concat(Localizer.Token(307), " Projectors"), abRef, Fonts.Arial12Bold); this.Checkboxes.Add(cb); cb.Tip_Token = 2228; Ref<bool> acomRef = new Ref<bool>(() => GlobalStats.AutoCombat, (bool x) => GlobalStats.AutoCombat = x); cb = new Checkbox(new Vector2((float)this.win.X, (float)(this.win.Y + 210 + Fonts.Arial12Bold.LineSpacing + 3)), Localizer.Token(2207), acomRef, Fonts.Arial12Bold); this.Checkboxes.Add(cb); cb.Tip_Token = 2230; Ref<bool> arRef = new Ref<bool>(() => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoResearch, (bool x) => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoResearch = x); cb = new Checkbox(new Vector2((float)this.win.X, (float)(this.win.Y + 210 + Fonts.Arial12Bold.LineSpacing * 2 + 6)), Localizer.Token(6136), arRef, Fonts.Arial12Bold); this.Checkboxes.Add(cb); cb.Tip_Token = 7039; Ref<bool> atRef = new Ref<bool>(() => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoTaxes, (bool x) => EmpireManager.GetEmpireByName(screen.PlayerLoyalty).AutoTaxes = x); cb = new Checkbox(new Vector2((float)this.win.X, (float)(this.win.Y + 210 + Fonts.Arial12Bold.LineSpacing * 3 + 9)), Localizer.Token(6138), atRef, Fonts.Arial12Bold); this.Checkboxes.Add(cb); cb.Tip_Token = 7040; this.SetDropDowns(); }
public void Draw(Ship_Game.ScreenManager ScreenManager) { ScreenManager.SpriteBatch.End(); ScreenManager.SpriteBatch.Begin(SpriteBlendMode.Additive); ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict["OliveUI/body_grade"], this.BodyRect, Color.White); ScreenManager.SpriteBatch.End(); ScreenManager.SpriteBatch.Begin(); ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict["OliveUI/under_header"], this.underheader, Color.White); }
public void DrawWidth(Ship_Game.ScreenManager ScreenManager, Vector2 Position, int width) { this.r = new Rectangle((int)Position.X, (int)Position.Y, width, 30); (new Selector(ScreenManager, this.r, (this.Hover ? new Color(95, 82, 47) : new Color(32, 30, 18)))).Draw(); Vector2 textPos = new Vector2((float)(this.r.X + 10), (float)(this.r.Y + this.r.Height / 2 - Fonts.Pirulen12.LineSpacing / 2)); ScreenManager.SpriteBatch.DrawString(Fonts.Pirulen12, this.Text, textPos, Color.White); this.ClickRect = new Rectangle(this.r.X + this.r.Width - 15, this.r.Y + 10, 10, 10); textPos = new Vector2((float)this.ClickRect.X - Fonts.Arial20Bold.MeasureString((this.Open ? "-" : "+")).X / 2f, (float)(this.ClickRect.Y + 6 - Fonts.Arial20Bold.LineSpacing / 2)); ScreenManager.SpriteBatch.DrawString(Fonts.Arial20Bold, (this.Open ? "-" : "+"), textPos, Color.White); }
//private ProgressBar pBar; //private ProgressBar sBar; //private ProgressBar oBar; //private SlidingElement sliding_element; //private string fmt = "0"; public VariableUIElement(Rectangle r, Ship_Game.ScreenManager sm, UniverseScreen screen) { this.screen = screen; this.ScreenManager = sm; this.ElementRect = r; base.TransitionOnTime = TimeSpan.FromSeconds(0.25); base.TransitionOffTime = TimeSpan.FromSeconds(0.25); this.Housing = r; this.LeftRect = new Rectangle(r.X, r.Y + 44, 180, r.Height - 44); this.RightRect = new Rectangle(this.LeftRect.X + this.LeftRect.Width, this.LeftRect.Y, 220, this.LeftRect.Height); }
public void Draw(Rectangle container, Ship_Game.ScreenManager ScreenManager) { this.Node = new TreeNode(new Vector2((float)container.X, (float)container.Y) + new Vector2(100f, 20f), this.Node.tech, this.screen); this.bup.r = new Rectangle(container.X + 15, container.Y + container.Height / 2 - 33, 30, 30); this.bdown.r = new Rectangle(container.X + 15, container.Y + container.Height / 2 - 33 + 36, 30, 30); this.bcancel.r = new Rectangle(container.X + 15 + 30 + 12, container.Y + container.Height / 2 - 15, 30, 30); this.bup.Draw(ScreenManager); this.bdown.Draw(ScreenManager); this.bcancel.Draw(ScreenManager); this.Node.DrawGlow(ScreenManager); this.Node.Draw(ScreenManager); }
public SystemInfoUIElement(Rectangle r, Ship_Game.ScreenManager sm, UniverseScreen screen) { this.screen = screen; this.ScreenManager = sm; this.ElementRect = r; this.sel = new Selector(this.ScreenManager, r, Color.Black); base.TransitionOnTime = TimeSpan.FromSeconds(0.25); base.TransitionOffTime = TimeSpan.FromSeconds(0.25); this.SliderRect = new Rectangle(r.X + r.Width - 100, r.Y + r.Height - 40, 500, 40); this.clickRect = new Rectangle(this.ElementRect.X + this.ElementRect.Width - 16, this.ElementRect.Y + this.ElementRect.Height / 2 - 11, 11, 22); this.LeftRect = new Rectangle(r.X, r.Y + 44, 200, r.Height - 44); this.RightRect = new Rectangle(r.X + 200, r.Y + 44, 200, r.Height - 44); }
public CombatAI(Ship_Game.Gameplay.Ship ship) { int Size = ship.Size; if (Size == 0) { return; } else { UpdateCombatAI(ship); } ; }
public void Draw(Ship_Game.ScreenManager ScreenManager) { ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict["OliveUI/header_left"], this.leftRect, Color.White); ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict["OliveUI/header_fill"], this.FillRect, Color.White); ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict["OliveUI/header_right"], this.RightRect, Color.White); ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict["OliveUI/over_header"], this.overheader, Color.White); if (Fonts.Arial20Bold.MeasureString(this.text).X > (float)(this.FillRect.Width - 150)) { ScreenManager.SpriteBatch.DrawString(Fonts.Arial12Bold, this.text, this.TextPos, new Color(198, 189, 180)); return; } ScreenManager.SpriteBatch.DrawString(Fonts.Arial20Bold, this.text, this.TextPos, new Color(198, 189, 180)); }
public void Draw(Ship_Game.ScreenManager ScreenManager) { if (HelperFunctions.CheckIntersection(this.CheckRect, new Vector2((float)Mouse.GetState().X, (float)Mouse.GetState().Y)) && this.Tip_Token != 0) { ToolTip.CreateTooltip(Localizer.Token(this.Tip_Token), ScreenManager); } Primitives2D.DrawRectangle(ScreenManager.SpriteBatch, this.CheckRect, new Color(96, 81, 49)); ScreenManager.SpriteBatch.DrawString(this.Font, this.Text, this.TextPos, Color.White); if (this.connectedTo.Value) { ScreenManager.SpriteBatch.DrawString(Fonts.Arial12Bold, "x", this.CheckPos, Color.White); } }
public Selector(Ship_Game.ScreenManager sm, Rectangle theMenu, bool UseRealRect) { this.ScreenManager = sm; this.Menu = theMenu; this.UpperLeft = new Rectangle(theMenu.X, theMenu.Y, ResourceManager.TextureDict["NewUI/submenu_header_left"].Width, ResourceManager.TextureDict["NewUI/submenu_header_left"].Height); this.TL = new Rectangle(theMenu.X, theMenu.Y - 2, ResourceManager.TextureDict["NewUI/submenu_corner_TL"].Width, ResourceManager.TextureDict["NewUI/submenu_corner_TL"].Height); this.TR = new Rectangle(theMenu.X + theMenu.Width - ResourceManager.TextureDict["NewUI/submenu_corner_TR"].Width, theMenu.Y - 2, ResourceManager.TextureDict["NewUI/submenu_corner_TR"].Width, ResourceManager.TextureDict["NewUI/submenu_corner_TR"].Height); this.BL = new Rectangle(theMenu.X, theMenu.Y + theMenu.Height - ResourceManager.TextureDict["NewUI/submenu_corner_BL"].Height + 2, ResourceManager.TextureDict["NewUI/submenu_corner_BL"].Width, ResourceManager.TextureDict["NewUI/submenu_corner_BL"].Height); this.BR = new Rectangle(theMenu.X + theMenu.Width - ResourceManager.TextureDict["NewUI/submenu_corner_BR"].Width, theMenu.Y + theMenu.Height + 2 - ResourceManager.TextureDict["NewUI/submenu_corner_BR"].Height, ResourceManager.TextureDict["NewUI/submenu_corner_BR"].Width, ResourceManager.TextureDict["NewUI/submenu_corner_BR"].Height); this.topHoriz = new Rectangle(theMenu.X + ResourceManager.TextureDict["NewUI/submenu_corner_TL"].Width, theMenu.Y - 2, theMenu.Width - this.TR.Width - ResourceManager.TextureDict["NewUI/submenu_corner_TL"].Width, 2); this.botHoriz = new Rectangle(theMenu.X + this.BL.Width, theMenu.Y + theMenu.Height, theMenu.Width - this.BL.Width - this.BR.Width, 2); this.VL = new Rectangle(theMenu.X, theMenu.Y + this.TR.Height - 2, 2, theMenu.Height - this.BL.Height - 2); this.VR = new Rectangle(theMenu.X + theMenu.Width - 2, theMenu.Y + this.TR.Height - 2, 2, theMenu.Height - this.BR.Height - 2); }
public Menu1(Ship_Game.ScreenManager sm, Rectangle theMenu) { this.ScreenManager = sm; this.Menu = theMenu; this.corner_TL = new Rectangle(theMenu.X, theMenu.Y, ResourceManager.TextureDict["NewUI/menu_1_corner_TL"].Width, ResourceManager.TextureDict["NewUI/menu_1_corner_TL"].Height); this.corner_TR = new Rectangle(theMenu.X + theMenu.Width - ResourceManager.TextureDict["NewUI/menu_1_corner_TR"].Width, theMenu.Y, ResourceManager.TextureDict["NewUI/menu_1_corner_TR"].Width, ResourceManager.TextureDict["NewUI/menu_1_corner_TR"].Height); this.corner_BL = new Rectangle(theMenu.X, theMenu.Y + theMenu.Height - ResourceManager.TextureDict["NewUI/menu_1_corner_BL"].Height, ResourceManager.TextureDict["NewUI/menu_1_corner_BL"].Width, ResourceManager.TextureDict["NewUI/menu_1_corner_BL"].Height); this.corner_BR = new Rectangle(theMenu.X + theMenu.Width - ResourceManager.TextureDict["NewUI/menu_1_corner_BR"].Width, theMenu.Y + theMenu.Height - ResourceManager.TextureDict["NewUI/menu_1_corner_BR"].Height, ResourceManager.TextureDict["NewUI/menu_1_corner_BR"].Width, ResourceManager.TextureDict["NewUI/menu_1_corner_BR"].Height); this.horizTop = new Rectangle(this.corner_TL.X + this.corner_TL.Width, this.corner_TL.Y, theMenu.Width - this.corner_TL.Width - this.corner_TR.Width, ResourceManager.TextureDict["NewUI/menu_1_horiz_upper"].Height); this.horizBot = new Rectangle(this.corner_BL.X + this.corner_BL.Width, theMenu.Y + theMenu.Height - ResourceManager.TextureDict["NewUI/menu_1_horiz_lower"].Height, theMenu.Width - this.corner_BL.Width - this.corner_BR.Width, ResourceManager.TextureDict["NewUI/menu_1_horiz_lower"].Height); this.vertLeft = new Rectangle(this.corner_TL.X + 1, this.corner_TL.Y + this.corner_TL.Height, ResourceManager.TextureDict["NewUI/menu_1_vert_left"].Width, theMenu.Height - this.corner_TL.Height - this.corner_BL.Height); this.vertRight = new Rectangle(theMenu.X + theMenu.Width - 1 - ResourceManager.TextureDict["NewUI/menu_1_vert_right"].Width, this.corner_TR.Y + this.corner_TR.Height, ResourceManager.TextureDict["NewUI/menu_1_vert_right"].Width, theMenu.Height - this.corner_TR.Height - this.corner_BR.Height); this.fillRect = new Rectangle(this.Menu.X + 8, this.Menu.Y + 8, this.Menu.Width - 16, this.Menu.Height - 16); }
public QueueComponent(Ship_Game.ScreenManager ScreenManager, Rectangle container, ResearchScreenNew screen) { this.container = container; this.screen = screen; this.ScreenManager = ScreenManager; this.Current = new Rectangle(container.X, container.Y, container.Width, 150); this.ShowQueue = new DanButton(new Vector2((float)(container.X + container.Width - 192), (float)(ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 55)), Localizer.Token(2136)); this.TimeLeft = new Rectangle(this.Current.X + this.Current.Width - 119, this.Current.Y + this.Current.Height - 24, 111, 20); this.csub = new Submenu(true, ScreenManager, this.Current); this.csub.AddTab(Localizer.Token(1405)); this.Queue = new Rectangle(this.Current.X, this.Current.Y + 165, container.Width, container.Height - 165); this.qsub = new Submenu(true, ScreenManager, this.Queue); this.qsub.AddTab(Localizer.Token(1404)); this.QSL = new ScrollList(this.qsub, 125); }
public void SetVisibility(bool vis, Ship_Game.ScreenManager ScreenManager, Planet p) { this.planet = p; if (this.InnerSO == null || this.OuterSO == null) { this.LoadContent(ScreenManager); } if (vis) { this.InnerSO.Visibility = ObjectVisibility.RenderedAndCastShadows; this.OuterSO.Visibility = ObjectVisibility.RenderedAndCastShadows; return; } this.InnerSO.Visibility = ObjectVisibility.None; this.OuterSO.Visibility = ObjectVisibility.None; }
public void UpdateCombatAI(Ship_Game.Gameplay.Ship ship) { if (ship.Size > 0 ) { int Size = ship.Size; this.LargeAttackWeight = Size / 100 > 1 ? Size / 200 > 1 ? 3 : 2 : .5f; this.SmallAttackWeight = 30 / Size > 1 ? 3 : 0; this.MediumAttackWeight = Size / 100 < 1 && 30 / Size > 1 ? 3 : .5f; float stlspeed = ship.velocityMaximum; if (stlspeed ==0 || ship.loyalty.isFaction) this.VultureWeight = 2; if (ship.loyalty.isFaction || (this.SmallAttackWeight >=1 && ship.loyalty.canBuildCruisers)) this.PirateWeight = 3; } }
public void Draw(Ship_Game.ScreenManager ScreenManager, SpriteFont font) { Color orange; SpriteBatch spriteBatch = ScreenManager.SpriteBatch; SpriteFont spriteFont = font; string text = this.Text; Vector2 vector2 = new Vector2((float)this.rect.X, (float)this.rect.Y); if (this.Selected) { orange = Color.Orange; } else { orange = (this.Hover ? Color.White : new Color(255, 239, 208)); } spriteBatch.DrawString(spriteFont, text, vector2, orange); }
public void Draw(Ship_Game.ScreenManager ScreenManager) { Color white; SpriteBatch spriteBatch = ScreenManager.SpriteBatch; SpriteFont font = this.Font; string text = this.Text; Vector2 textPos = this.TextPos; if (this.ToggleOn) { white = Color.White; } else { white = (this.Hover ? Color.White : Color.DarkGray); } spriteBatch.DrawString(font, text, textPos, white); }
public void DrawWithShadow(Ship_Game.ScreenManager ScreenManager) { Color white; Ship_Game.ScreenManager screenManager = ScreenManager; string text = this.Text; Vector2 textPos = this.TextPos; SpriteFont font = this.Font; if (this.ToggleOn) { white = Color.White; } else { white = (this.Hover ? Color.White : Color.DarkGray); } HelperFunctions.DrawDropShadowText(screenManager, text, textPos, font, white); }
public void Draw(Ship_Game.ScreenManager ScreenManager) { if (this.Pressed) { ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict[this.PressPath], this.r, Color.White); } else if (this.Hover) { ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict[this.HoverPath], this.r, Color.White); } else if (this.Active) { ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict[this.ActivePath], this.r, Color.White); } else if (!this.Active) { ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict[this.InactivePath], this.r, Color.White); } if (!ResourceManager.TextureDict.ContainsKey(this.IconPath)) { Vector2 wordPos = new Vector2((float)(this.r.X + 12) - Fonts.Arial12Bold.MeasureString(this.IconPath).X / 2f, (float)(this.r.Y + 12 - Fonts.Arial12Bold.LineSpacing / 2)); if (this.Active) { ScreenManager.SpriteBatch.DrawString(Fonts.Arial12Bold, this.IconPath, wordPos, Color.White); return; } if (!this.Active) { ScreenManager.SpriteBatch.DrawString(Fonts.Arial12Bold, this.IconPath, wordPos, Color.Gray); } } else { if (this.Active) { ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict[string.Concat(this.IconPath, "_active")], this.r, Color.White); return; } if (!this.Active) { ScreenManager.SpriteBatch.Draw(ResourceManager.TextureDict[this.IconPath], this.r, Color.White); return; } } }