public ReplayElement(Rectangle r)
 {
     this.ElementRect = r;
     this.TextRect = new Rectangle(r.X, r.Y + r.Height, r.Width, 128);
     this.ShipCount = new GenericButton(new Vector2((float)(this.ElementRect.X - 10), (float)(this.ElementRect.Y + 40)), "Ship Count", Fonts.Pirulen16, Fonts.Pirulen12);
     this.Buttons.Add(this.ShipCount);
     this.MilStrength = new GenericButton(new Vector2((float)(this.ElementRect.X - 10), (float)(this.ShipCount.R.Y + Fonts.Pirulen16.LineSpacing + 4)), "Military Strength", Fonts.Pirulen16, Fonts.Pirulen12);
     this.Buttons.Add(this.MilStrength);
     this.Population = new GenericButton(new Vector2((float)(this.ElementRect.X - 10), (float)(this.MilStrength.R.Y + Fonts.Pirulen16.LineSpacing + 4)), "Population", Fonts.Pirulen16, Fonts.Pirulen12);
     this.Buttons.Add(this.Population);
     this.TurnsRepresented = StatTracker.SnapshotsDict.Count;
     foreach (KeyValuePair<string, SerializableDictionary<int, Snapshot>> Entry in StatTracker.SnapshotsDict)
     {
         foreach (KeyValuePair<int, Snapshot> shot in Entry.Value)
         {
             if (shot.Value.ShipCount > this.MaxShips)
             {
                 this.MaxShips = shot.Value.ShipCount;
             }
             if (shot.Value.MilitaryStrength > this.MaxStrength)
             {
                 this.MaxStrength = shot.Value.MilitaryStrength;
             }
             if (shot.Value.Population <= this.MaxPop)
             {
                 continue;
             }
             this.MaxPop = shot.Value.Population;
         }
     }
 }
        public override void LoadContent()
        {
            LightRig rig = base.ScreenManager.Content.Load<LightRig>("example/ShipyardLightrig");
            lock (GlobalStats.ObjectManagerLocker)
            {
                base.ScreenManager.inter.LightManager.Clear();
                base.ScreenManager.inter.LightManager.Submit(rig);
            }
            if (base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth <= 1280 || base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight <= 768)
            {
                this.LowRes = true;
            }
            Rectangle leftRect = new Rectangle(5, 45, 405, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 45 - (int)(0.4f * (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight) + 10);
            this.ModuleSelectionMenu = new Menu1(base.ScreenManager, leftRect);
            Rectangle modSelR = new Rectangle(0, (this.LowRes ? 45 : 100), 305, (this.LowRes ? 350 : 400));
            this.modSel = new Submenu(base.ScreenManager, modSelR, true);
            this.modSel.AddTab("Wpn");
            this.modSel.AddTab("Pwr");
            this.modSel.AddTab("Def");
            this.modSel.AddTab("Spc");
            this.weaponSL = new ScrollList(this.modSel);
            Vector2 Cursor = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 175), 80f);
            Rectangle active = new Rectangle(modSelR.X, modSelR.Y + modSelR.Height + 15, modSelR.Width, 300);
            this.activeModWindow = new Menu1(base.ScreenManager, active);
            Rectangle acsub = new Rectangle(active.X, modSelR.Y + modSelR.Height + 15, 305, 320);
            if (base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight > 760)
            {
                acsub.Height = acsub.Height + 120;
            }
            this.activeModSubMenu = new Submenu(base.ScreenManager, acsub);
            this.activeModSubMenu.AddTab("Active Module");
            this.choosefighterrect = new Rectangle(acsub.X + acsub.Width + 5, acsub.Y, 240, 270);
            if (this.choosefighterrect.Y + this.choosefighterrect.Height > base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight)
            {
                int diff = this.choosefighterrect.Y + this.choosefighterrect.Height - base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight;
                this.choosefighterrect.Height = this.choosefighterrect.Height - (diff + 10);
            }
            this.choosefighterrect.Height = acsub.Height;
            this.ChooseFighterSub = new Submenu(base.ScreenManager, this.choosefighterrect);
            this.ChooseFighterSub.AddTab("Choose Fighter");
            this.ChooseFighterSL = new ScrollList(this.ChooseFighterSub, 40);
            foreach (KeyValuePair<string, bool> hull in EmpireManager.GetEmpireByName(this.EmpireUI.screen.PlayerLoyalty).GetHDict())
            {
                if (!hull.Value)
                {
                    continue;
                }
                this.AvailableHulls.Add(Ship_Game.ResourceManager.HullsDict[hull.Key]);
            }
            PrimitiveQuad.graphicsDevice = base.ScreenManager.GraphicsDevice;
            float width = (float)base.ScreenManager.GraphicsDevice.Viewport.Width;
            Viewport viewport = base.ScreenManager.GraphicsDevice.Viewport;
            float aspectRatio = width / (float)viewport.Height;
            this.offset = new Vector2();
            Viewport viewport1 = base.ScreenManager.GraphicsDevice.Viewport;
            this.offset.X = (float)(viewport1.Width / 2 - 256);
            Viewport viewport2 = base.ScreenManager.GraphicsDevice.Viewport;
            this.offset.Y = (float)(viewport2.Height / 2 - 256);
            this.camera = new Camera2d();
            Camera2d vector2 = this.camera;
            Viewport viewport3 = base.ScreenManager.GraphicsDevice.Viewport;
            float single = (float)viewport3.Width / 2f;
            Viewport viewport4 = base.ScreenManager.GraphicsDevice.Viewport;
            vector2.Pos = new Vector2(single, (float)viewport4.Height / 2f);
            Vector3 camPos = this.cameraPosition * new Vector3(-1f, 1f, 1f);
            this.view = ((Matrix.CreateTranslation(0f, 0f, 0f) * Matrix.CreateRotationY(MathHelper.ToRadians(180f))) * Matrix.CreateRotationX(MathHelper.ToRadians(0f))) * Matrix.CreateLookAt(camPos, new Vector3(camPos.X, camPos.Y, 0f), new Vector3(0f, -1f, 0f));
            this.projection = Matrix.CreatePerspectiveFieldOfView(0.7853982f, aspectRatio, 1f, 20000f);
            this.ChangeHull(this.AvailableHulls[0]);
            lock (GlobalStats.ObjectManagerLocker)
            {
                if (!this.ActiveHull.Animated)
                {
                    this.ActiveModel = base.ScreenManager.Content.Load<Model>(this.ActiveHull.ModelPath);
                    this.CreateSOFromHull();
                }
                else
                {
                    base.ScreenManager.inter.ObjectManager.Remove(this.shipSO);
                    SkinnedModel sm = Ship_Game.ResourceManager.GetSkinnedModel(this.ActiveHull.ModelPath);
                    this.shipSO = new SceneObject(sm.Model)
                    {
                        ObjectType = ObjectType.Dynamic,
                        World = this.worldMatrix
                    };
                    base.ScreenManager.inter.ObjectManager.Submit(this.shipSO);
                    this.SetupSlots();
                }
            }
            foreach (ModuleSlotData slot in this.ActiveHull.ModuleSlotList)
            {
                if (slot.Position.X < this.LowestX)
                {
                    this.LowestX = slot.Position.X;
                }
                if (slot.Position.X <= this.HighestX)
                {
                    continue;
                }
                this.HighestX = slot.Position.X;
            }
            float xDistance = this.HighestX - this.LowestX;
            BoundingSphere bs = this.shipSO.WorldBoundingSphere;
            Viewport viewport5 = base.ScreenManager.GraphicsDevice.Viewport;
            Vector3 pScreenSpace = viewport5.Project(Vector3.Zero, this.projection, this.view, Matrix.Identity);
            Vector2 pPos = new Vector2(pScreenSpace.X, pScreenSpace.Y);
            Vector2 radialPos = this.GeneratePointOnCircle(90f, Vector2.Zero, xDistance);
            Viewport viewport6 = base.ScreenManager.GraphicsDevice.Viewport;
            Vector3 insetRadialPos = viewport6.Project(new Vector3(radialPos, 0f), this.projection, this.view, Matrix.Identity);
            Vector2 insetRadialSS = new Vector2(insetRadialPos.X, insetRadialPos.Y);
            float Radius = Vector2.Distance(insetRadialSS, pPos) + 10f;
            if (Radius >= xDistance)
            {
                while (Radius > xDistance)
                {
                    camPos = this.cameraPosition * new Vector3(-1f, 1f, 1f);
                    this.view = ((Matrix.CreateTranslation(0f, 0f, 0f) * Matrix.CreateRotationY(MathHelper.ToRadians(180f))) * Matrix.CreateRotationX(MathHelper.ToRadians(0f))) * Matrix.CreateLookAt(camPos, new Vector3(camPos.X, camPos.Y, 0f), new Vector3(0f, -1f, 0f));
                    bs = this.shipSO.WorldBoundingSphere;
                    Viewport viewport7 = base.ScreenManager.GraphicsDevice.Viewport;
                    pScreenSpace = viewport7.Project(Vector3.Zero, this.projection, this.view, Matrix.Identity);
                    pPos = new Vector2(pScreenSpace.X, pScreenSpace.Y);
                    radialPos = this.GeneratePointOnCircle(90f, Vector2.Zero, xDistance);
                    Viewport viewport8 = base.ScreenManager.GraphicsDevice.Viewport;
                    insetRadialPos = viewport8.Project(new Vector3(radialPos, 0f), this.projection, this.view, Matrix.Identity);
                    insetRadialSS = new Vector2(insetRadialPos.X, insetRadialPos.Y);
                    Radius = Vector2.Distance(insetRadialSS, pPos) + 10f;
                    this.cameraPosition.Z = this.cameraPosition.Z + 1f;
                }
            }
            else
            {
                while (Radius < xDistance)
                {
                    camPos = this.cameraPosition * new Vector3(-1f, 1f, 1f);
                    this.view = ((Matrix.CreateTranslation(0f, 0f, 0f) * Matrix.CreateRotationY(MathHelper.ToRadians(180f))) * Matrix.CreateRotationX(MathHelper.ToRadians(0f))) * Matrix.CreateLookAt(camPos, new Vector3(camPos.X, camPos.Y, 0f), new Vector3(0f, -1f, 0f));
                    bs = this.shipSO.WorldBoundingSphere;
                    Viewport viewport9 = base.ScreenManager.GraphicsDevice.Viewport;
                    pScreenSpace = viewport9.Project(Vector3.Zero, this.projection, this.view, Matrix.Identity);
                    pPos = new Vector2(pScreenSpace.X, pScreenSpace.Y);
                    radialPos = this.GeneratePointOnCircle(90f, Vector2.Zero, xDistance);
                    Viewport viewport10 = base.ScreenManager.GraphicsDevice.Viewport;
                    insetRadialPos = viewport10.Project(new Vector3(radialPos, 0f), this.projection, this.view, Matrix.Identity);
                    insetRadialSS = new Vector2(insetRadialPos.X, insetRadialPos.Y);
                    Radius = Vector2.Distance(insetRadialSS, pPos) + 10f;
                    this.cameraPosition.Z = this.cameraPosition.Z - 1f;
                }
            }
            this.BlackBar = new Rectangle(0, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 70, 3000, 70);
            this.SideBar = new Rectangle(0, 0, 280, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight);
            Rectangle w = new Rectangle(20, this.modSel.Menu.Y - 10, 32, 32);
            Rectangle p = new Rectangle(80, w.Y, 32, 32);
            Rectangle df = new Rectangle(150, w.Y, 32, 32);
            Rectangle sp = new Rectangle(220, w.Y, 32, 32);
            this.wpn = new SkinnableButton(w, "Modules/FlakTurret3x3")
            {
                IsToggle = true,
                Toggled = true
            };
            this.pwr = new SkinnableButton(p, "Modules/NuclearReactorMedium")
            {
                IsToggle = true
            };
            this.def = new SkinnableButton(df, "Modules/SteelArmorMedium")
            {
                IsToggle = true
            };
            this.spc = new SkinnableButton(sp, "Modules/sensors_2x2")
            {
                IsToggle = true
            };
            this.SelectedCatTextPos = new Vector2(20f, (float)(w.Y - 25 - Fonts.Arial20Bold.LineSpacing / 2));
            this.SearchBar = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 585, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 47, 210, 25);
            Cursor = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 370), (float)(modSelR.Y + modSelR.Height + 408));
            Vector2 OrdersBarPos = new Vector2(Cursor.X - 60f, (float)((int)Cursor.Y + 10));
            ToggleButton AttackRuns = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_headon");
            this.CombatStatusButtons.Add(AttackRuns);
            AttackRuns.Action = "attack";
            AttackRuns.HasToolTip = true;
            AttackRuns.WhichToolTip = 1;
            OrdersBarPos.X = OrdersBarPos.X + 29f;
            ToggleButton Artillery = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_aft");
            this.CombatStatusButtons.Add(Artillery);
            Artillery.Action = "arty";
            Artillery.HasToolTip = true;
            Artillery.WhichToolTip = 2;
            OrdersBarPos.X = OrdersBarPos.X + 29f;
            ToggleButton HoldPos = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_x");
            this.CombatStatusButtons.Add(HoldPos);
            HoldPos.Action = "hold";
            HoldPos.HasToolTip = true;
            HoldPos.WhichToolTip = 65;
            OrdersBarPos.X = OrdersBarPos.X + 29f;
            ToggleButton OrbitLeft = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_left");
            this.CombatStatusButtons.Add(OrbitLeft);
            OrbitLeft.Action = "orbit_left";
            OrbitLeft.HasToolTip = true;
            OrbitLeft.WhichToolTip = 3;
            OrdersBarPos.Y = OrdersBarPos.Y + 29f;

            ToggleButton BroadsideLeft = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_bleft");
            this.CombatStatusButtons.Add(BroadsideLeft);
            BroadsideLeft.Action = "broadside_left";
            BroadsideLeft.HasToolTip = true;
            BroadsideLeft.WhichToolTip = 159;
            OrdersBarPos.Y = OrdersBarPos.Y - 29f;
            OrdersBarPos.X = OrdersBarPos.X + 29f;
            ToggleButton OrbitRight = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_right");
            this.CombatStatusButtons.Add(OrbitRight);
            OrbitRight.Action = "orbit_right";
            OrbitRight.HasToolTip = true;
            OrbitRight.WhichToolTip = 4;
            OrdersBarPos.Y = OrdersBarPos.Y + 29f;

            ToggleButton BroadsideRight = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_bright");
            this.CombatStatusButtons.Add(BroadsideRight);
            BroadsideRight.Action = "broadside_right";
            BroadsideRight.HasToolTip = true;
            BroadsideRight.WhichToolTip = 160;
            OrdersBarPos.Y = OrdersBarPos.Y - 29f;
            OrdersBarPos.X = OrdersBarPos.X + 29f;
            ToggleButton Evade = new ToggleButton(new Rectangle((int)OrdersBarPos.X, (int)OrdersBarPos.Y, 24, 24), "SelectionBox/button_formation_active", "SelectionBox/button_formation_inactive", "SelectionBox/button_formation_hover", "SelectionBox/button_formation_press", "SelectionBox/icon_formation_stop");
            this.CombatStatusButtons.Add(Evade);
            Evade.Action = "evade";
            Evade.HasToolTip = true;
            Evade.WhichToolTip = 6;

            Cursor = new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 150), (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 47);

            this.SaveButton = new UIButton()
            {
                Rect = new Rectangle((int)Cursor.X, (int)Cursor.Y, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_132px"].Width, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_132px"].Height),
                NormalTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_132px"],
                HoverTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_132px_hover"],
                PressedTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_132px_pressed"],
                Text = Localizer.Token(105),
                Launches = "Save As..."
            };
            this.Buttons.Add(this.SaveButton);
            this.LoadButton = new UIButton()
            {
                Rect = new Rectangle((int)Cursor.X - 78, (int)Cursor.Y, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Width, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Height),
                NormalTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"],
                HoverTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px_hover"],
                PressedTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px_pressed"],
                Text = Localizer.Token(8),
                Launches = "Load"
            };
            this.Buttons.Add(this.LoadButton);
            this.ToggleOverlayButton = new UIButton()
            {
                Rect = new Rectangle(this.LoadButton.Rect.X - 140, (int)Cursor.Y, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_132px"].Width, Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_68px"].Height),
                NormalTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_132px"],
                HoverTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_132px_hover"],
                PressedTexture = Ship_Game.ResourceManager.TextureDict["EmpireTopBar/empiretopbar_btn_132px_pressed"],
                Launches = "Toggle Overlay",
                Text = Localizer.Token(106)
            };
            this.Buttons.Add(this.ToggleOverlayButton);
            this.bottom_sep = new Rectangle(this.BlackBar.X, this.BlackBar.Y, this.BlackBar.Width, 1);
            this.HullSelectionRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 285, (this.LowRes ? 45 : 100), 280, (this.LowRes ? 350 : 400));
            this.hullSelectionSub = new Submenu(base.ScreenManager, this.HullSelectionRect, true);
            this.weaponSL = new ScrollList(this.modSel);
            this.hullSelectionSub.AddTab(Localizer.Token(107));
            this.hullSL = new ScrollList(this.hullSelectionSub);
            List<string> Categories = new List<string>();
            foreach (KeyValuePair<string, ShipData> hull in Ship_Game.ResourceManager.HullsDict)
            {
                if (!EmpireManager.GetEmpireByName(this.EmpireUI.screen.PlayerLoyalty).GetHDict()[hull.Key])
                {
                    continue;
                }
                string cat = Localizer.GetRole(hull.Value.Role, EmpireManager.GetEmpireByName(this.EmpireUI.screen.PlayerLoyalty));
                if (Categories.Contains(cat))
                {
                    continue;
                }
                Categories.Add(cat);
            }
            Categories.Sort();
            foreach (string cat in Categories)
            {
                ModuleHeader type = new ModuleHeader(cat, 240f);
                this.hullSL.AddItem(type);
            }
            foreach (ScrollList.Entry e in this.hullSL.Entries)
            {
                foreach (KeyValuePair<string, ShipData> hull in Ship_Game.ResourceManager.HullsDict)
                {
                    if (!EmpireManager.GetEmpireByName(this.EmpireUI.screen.PlayerLoyalty).GetHDict()[hull.Key] || !((e.item as ModuleHeader).Text == Localizer.GetRole(hull.Value.Role, EmpireManager.GetEmpireByName(this.EmpireUI.screen.PlayerLoyalty))))
                    {
                        continue;
                    }
                    e.AddItem(hull.Value);
                }
            }
            Rectangle ShipStatsPanel = new Rectangle(this.HullSelectionRect.X + 50, this.HullSelectionRect.Y + this.HullSelectionRect.Height - 20, 280, 320);

            this.classifCursor = new Vector2(ShipStatsPanel.X - 100, ShipStatsPanel.Y + ShipStatsPanel.Height + 92);

            dropdownRect = new Rectangle((int)ShipStatsPanel.X, (int)ShipStatsPanel.Y + ShipStatsPanel.Height + 118, 100, 18);

            this.CategoryList = new DropOptions(dropdownRect);
            this.CategoryList.AddOption("Unclassified", 1);
            this.CategoryList.AddOption("Civilian", 2);
            this.CategoryList.AddOption("Recon", 3);
            this.CategoryList.AddOption("Fighter", 4);
            this.CategoryList.AddOption("Bomber", 5);

            this.CarrierOnly = this.ActiveHull.CarrierShip;
            Ref<bool> CORef = new Ref<bool>(() => this.CarrierOnly, (bool x) => {
                this.CarrierOnly = x;
            });

            this.COBoxCursor = new Vector2(dropdownRect.X + 106, dropdownRect.Y);
            this.CarrierOnlyBox = new Checkbox(this.COBoxCursor, "Carrier Only", CORef, Fonts.Arial12Bold);

            this.ShipStats = new Menu1(base.ScreenManager, ShipStatsPanel);
            this.statsSub = new Submenu(base.ScreenManager, ShipStatsPanel);
            this.statsSub.AddTab(Localizer.Token(108));
            this.ArcsButton = new GenericButton(new Vector2((float)(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 32), 97f), "Arcs", Fonts.Pirulen20, Fonts.Pirulen16);
            this.close = new CloseButton(new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 27, 99, 20, 20));
            this.OriginalZ = this.cameraPosition.Z;
        }
 public override void LoadContent()
 {
     Rectangle prect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 659, 0, 1318, 757);
     this.BridgeRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 960, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 540, 1920, 1080);
     this.Player = new Menu2(base.ScreenManager, prect);
     this.Portrait = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 640, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 360, 1280, 720);
     Vector2 Cursor = new Vector2((float)(this.Portrait.X + this.Portrait.Width - 85), (float)(this.Portrait.Y + 140));
     this.EmpireNamePos = new Vector2(Cursor.X - Fonts.Pirulen20.MeasureString(this.them.data.Traits.Name).X, (float)(this.Portrait.Y + 40));
     if (!this.playerEmpire.GetRelations()[this.them].AtWar)
     {
         this.DeclareWar = new GenericButton(Cursor, Localizer.Token(1200), Fonts.Pirulen20, Fonts.Pirulen16);
         this.Buttons.Add(this.DeclareWar);
         Cursor.Y = Cursor.Y + 25f;
         this.Discuss = new GenericButton(Cursor, Localizer.Token(1201), Fonts.Pirulen20, Fonts.Pirulen16);
         this.Buttons.Add(this.Discuss);
         Cursor.Y = Cursor.Y + 25f;
     }
     this.Negotiate = new GenericButton(Cursor, Localizer.Token(1202), Fonts.Pirulen20, Fonts.Pirulen16);
     this.Buttons.Add(this.Negotiate);
     Cursor.Y = Cursor.Y + 25f;
     this.Exit = new GenericButton(Cursor, Localizer.Token(1203), Fonts.Pirulen20, Fonts.Pirulen16);
     this.Buttons.Add(this.Exit);
     Cursor = new Vector2((float)(this.Portrait.X + 115), (float)(this.Portrait.Y + 160));
     this.Trust = new GenericButton(Cursor, Localizer.Token(1204), Fonts.Pirulen16, Fonts.Pirulen12)
     {
         ToggleOn = true
     };
     this.TAFButtons.Add(this.Trust);
     this.TrustRect = new Rectangle(this.Portrait.X + 125, this.Trust.R.Y + 2, 100, this.Trust.R.Height);
     Cursor.Y = Cursor.Y + 25f;
     this.Anger = new GenericButton(Cursor, Localizer.Token(1205), Fonts.Pirulen16, Fonts.Pirulen12)
     {
         ToggleOn = true
     };
     this.AngerRect = new Rectangle(this.Portrait.X + 125, this.Anger.R.Y + 2, 100, this.Anger.R.Height);
     this.TAFButtons.Add(this.Anger);
     Cursor.Y = Cursor.Y + 25f;
     this.Fear = new GenericButton(Cursor, Localizer.Token(1206), Fonts.Pirulen16, Fonts.Pirulen12)
     {
         ToggleOn = true
     };
     this.TAFButtons.Add(this.Fear);
     this.FearRect = new Rectangle(this.Portrait.X + 125, this.Fear.R.Y + 2, 100, this.Fear.R.Height);
     Cursor.Y = Cursor.Y + 25f;
     this.DialogRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 350, this.Portrait.Y + this.Portrait.Height - 110, 700, 55);
     if (base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight < 820)
     {
         this.DialogRect.Y = this.Portrait.Y + this.Portrait.Height - 100;
     }
     this.R = this.DialogRect;
     this.R.Height = this.R.Height + 75;
     if (this.R.Y + this.R.Height > base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight)
     {
         this.R.Y = this.R.Y - (this.R.Y + this.R.Height - base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight + 2);
     }
     Rectangle blerdybloo = this.R;
     blerdybloo.Height = blerdybloo.Height - 40;
     Submenu ot = new Submenu(base.ScreenManager, blerdybloo);
     this.OfferTextSL = new ScrollList(ot, Fonts.Consolas18.LineSpacing + 2, true);
     this.Attitude_Pleading_Rect = new Rectangle(this.R.X + 45, this.R.Y + this.R.Height - 48, 180, 48);
     this.Attitude_Respectful_Rect = new Rectangle(this.R.X + 250 + 5, this.R.Y + this.R.Height - 48, 180, 48);
     this.Attitude_Threaten_Rect = new Rectangle(this.R.X + 450 + 15, this.R.Y + this.R.Height - 48, 180, 48);
     this.ToneContainerRect = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 324, this.Attitude_Pleading_Rect.Y, 648, 48);
     this.ap = new GenericButton(this.Attitude_Pleading_Rect, Localizer.Token(1207), Fonts.Pirulen12);
     this.ar = new GenericButton(this.Attitude_Respectful_Rect, Localizer.Token(1209), Fonts.Pirulen12)
     {
         ToggleOn = true
     };
     this.at = new GenericButton(this.Attitude_Threaten_Rect, Localizer.Token(1208), Fonts.Pirulen12);
     this.AccRejRect = new Rectangle(this.R.X + this.R.Width / 2 - 220, this.R.Y + this.R.Height - 48, 440, 48);
     this.Accept = new GenericButton(new Rectangle(this.AccRejRect.X, this.AccRejRect.Y, 220, 48), Localizer.Token(1210), Fonts.Pirulen12);
     this.Reject = new GenericButton(new Rectangle(this.AccRejRect.X + 220, this.AccRejRect.Y, 220, 48), Localizer.Token(1211), Fonts.Pirulen12);
     this.Negotiate_Right = new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth - 192, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 280, 192, 280);
     this.Negotiate_Left = new Rectangle(0, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight - 280, 192, 280);
     this.BigTradeRect = new Rectangle(this.DialogRect.X + 75, this.DialogRect.Y - 202, this.DialogRect.Width - 150, 200);
     this.UsRect = new Rectangle(this.Negotiate_Right.X + 20, this.Negotiate_Right.Y + 35, this.BigTradeRect.Width / 2 - 9, 300);
     this.ThemRect = new Rectangle(this.Negotiate_Left.X + 15, this.Negotiate_Left.Y + 35, this.BigTradeRect.Width / 2 - 10, 300);
     this.SendOffer = new GenericButton(new Rectangle(this.R.X + this.R.Width / 2 - 90, this.R.Y - 40, 180, 33), Localizer.Token(1212), Fonts.Pirulen20);
     Submenu themsub = new Submenu(base.ScreenManager, this.ThemRect);
     this.TheirItemsSL = new ScrollList(themsub, Fonts.Consolas18.LineSpacing + 5, true);
     Submenu ussub = new Submenu(base.ScreenManager, this.UsRect);
     this.OurItemsSL = new ScrollList(ussub, Fonts.Consolas18.LineSpacing + 5, true);
     Submenu sub = new Submenu(base.ScreenManager, blerdybloo);
     this.StatementsSL = new ScrollList(sub, Fonts.Consolas18.LineSpacing + 2, true);
     if (!string.IsNullOrEmpty(this.them.data.Traits.VideoPath))
     {
         try
         {
             this.video = base.ScreenManager.Content.Load<Video>(string.Concat("Video/", this.them.data.Traits.VideoPath));
             this.player = new VideoPlayer()
             {
                 Volume = GlobalStats.Config.MusicVolume,
                 IsLooped = true
             };
             this.player.Play(this.video);
         }
         catch
         {
             this.video = base.ScreenManager.Content.Load<Video>(string.Concat("ModVideo/", this.them.data.Traits.VideoPath));
             this.player = new VideoPlayer()
             {
                 Volume = GlobalStats.Config.MusicVolume,
                 IsLooped = true
             };
             this.player.Play(this.video);
         }
     }
     base.ScreenManager.musicCategory.Pause();
     if (!this.them.data.ModRace)
     {
         //base.ScreenManager.racialMusic.SetVolume(GlobalStats.Config.MusicVolume);
         if (this.them.data.MusicCue != null)
         {
             if (this.WarDeclared)
             {
                 this.music = AudioManager.GetCue("Stardrive_Combat 1c_114BPM");
                 this.music.Play();
             }
             else
             {
                 this.music = AudioManager.GetCue(this.them.data.MusicCue);
                 this.music.Play();
             }
         }
     }
     this.TextCursor = new Vector2((float)(this.DialogRect.X + 5), (float)(this.DialogRect.Y + 5));
 }