public RefitToWindow(ShipListScreenEntry entry, ShipListScreen screen) { this.screen = screen; this.shiptorefit = entry.ship; base.IsPopup = true; base.TransitionOnTime = TimeSpan.FromSeconds(0.25); base.TransitionOffTime = TimeSpan.FromSeconds(0.25); }
public ShipListScreenEntry(Ship s, int x, int y, int width1, int height, ShipListScreen caller) { this.screen = caller; this.ship = s; this.TotalEntrySize = new Rectangle(x, y, width1 - 60, height); this.SysNameRect = new Rectangle(x, y, (int)((float)this.TotalEntrySize.Width * 0.10f), height); this.ShipNameRect = new Rectangle(x + this.SysNameRect.Width, y, (int)((float)this.TotalEntrySize.Width * 0.175f), height); this.RoleRect = new Rectangle(x + this.SysNameRect.Width + this.ShipNameRect.Width, y, (int)((float)this.TotalEntrySize.Width * 0.05f), height); this.OrdersRect = new Rectangle(x + this.SysNameRect.Width + this.ShipNameRect.Width + this.RoleRect.Width, y, (int)((float)this.TotalEntrySize.Width * 0.175f), height); this.RefitRect = new Rectangle(this.OrdersRect.X + this.OrdersRect.Width, y, 125, height); this.STRRect = new Rectangle(this.RefitRect.X + this.RefitRect.Width, y, 60, height); this.MaintRect = new Rectangle(this.STRRect.X + this.STRRect.Width, y, 60, height); this.TroopRect = new Rectangle(this.MaintRect.X + this.MaintRect.Width, y, 60, height); this.FTLRect = new Rectangle(this.TroopRect.X + this.TroopRect.Width, y, 60, height); this.STLRect = new Rectangle(this.FTLRect.X + this.FTLRect.Width, y, 60, height); this.Status_Text = ShipListScreenEntry.GetStatusText(this.ship); this.ShipIconRect = new Rectangle(this.ShipNameRect.X + 5, this.ShipNameRect.Y + 2, 28, 28); string shipName = (!string.IsNullOrEmpty(this.ship.VanityName) ? this.ship.VanityName : this.ship.Name); this.ShipNameEntry.ClickableArea = new Rectangle(this.ShipIconRect.X + this.ShipIconRect.Width + 10, 2 + this.SysNameRect.Y + this.SysNameRect.Height / 2 - Fonts.Arial20Bold.LineSpacing / 2, (int)Fonts.Arial20Bold.MeasureString(shipName).X, Fonts.Arial20Bold.LineSpacing); this.ShipNameEntry.Text = shipName; float width = (float)((int)((float)this.OrdersRect.Width * 0.8f)); while (width % 10f != 0f) { width = width + 1f; } Rectangle refit = new Rectangle(this.RefitRect.X + this.RefitRect.Width / 2 - 5 - ResourceManager.TextureDict["NewUI/icon_queue_rushconstruction_hover1"].Width, this.RefitRect.Y + this.RefitRect.Height / 2 - ResourceManager.TextureDict["NewUI/icon_queue_rushconstruction_hover2"].Height / 2, ResourceManager.TextureDict["NewUI/icon_queue_rushconstruction_hover2"].Width, ResourceManager.TextureDict["NewUI/icon_queue_rushconstruction_hover2"].Height); this.ExploreButton = new TexturedButton(refit, "NewUI/icon_order_explore", "NewUI/icon_order_explore_hover1", "NewUI/icon_order_explore_hover2"); this.PatrolButton = new TexturedButton(refit, "NewUI/icon_order_patrol", "NewUI/icon_order_patrol_hover1", "NewUI/icon_order_patrol_hover2"); this.RefitButton = new TexturedButton(refit, "NewUI/icon_queue_rushconstruction", "NewUI/icon_queue_rushconstruction_hover1", "NewUI/icon_queue_rushconstruction_hover2"); this.ScrapButton = new TexturedButton(refit, "NewUI/icon_queue_delete", "NewUI/icon_queue_delete_hover1", "NewUI/icon_queue_delete_hover2"); if (this.ship.Role == "station" || this.ship.Role == "platform" || this.ship.Thrust <= 0f) { this.isScuttle = true; } }