public static List <string> GetProperties(object source) { List <string> props = new List <string>(); if (source != null) { foreach (PropertyInfo pi in source.GetType().GetProperties(bflags)) { if (GenericSlider.isTypeSupported(pi.PropertyType) && pi.CanWrite && !pi.GetSetMethod().IsStatic&& !pi.IsDefined(typeof(System.ObsoleteAttribute), true)) { props.Add(pi.Name); } } foreach (FieldInfo fi in source.GetType().GetFields(bflags)) { if (GenericSlider.isTypeSupported(fi.FieldType) && fi.IsPublic && !fi.IsLiteral && !fi.IsStatic) { props.Add(fi.Name); } } } return(props); }
public override void LoadContent() { float screenWidth = (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth; float screenHeight = (float)base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight; Rectangle titleRect = new Rectangle((int)screenWidth / 2 - 200, 44, 400, 80); this.TitleBar = new Menu2(base.ScreenManager, titleRect); this.TitlePos = new Vector2((float)(titleRect.X + titleRect.Width / 2) - Fonts.Laserian14.MeasureString(Localizer.Token(6089)).X / 2f, (float)(titleRect.Y + titleRect.Height / 2 - Fonts.Laserian14.LineSpacing / 2)); Rectangle leftRect = new Rectangle((int)screenWidth / 2 - 640, (screenHeight > 768f ? titleRect.Y + titleRect.Height + 5 : 44), 1280, 660); this.DMenu = new Menu2(base.ScreenManager, leftRect); this.close = new CloseButton(new Rectangle(leftRect.X + leftRect.Width - 40, leftRect.Y + 20, 20, 20)); this.SelectedInfoRect = new Rectangle(leftRect.X + 60, leftRect.Y + 250, 368, 376); this.IntelligenceRect = new Rectangle(this.SelectedInfoRect.X + this.SelectedInfoRect.Width + 30, this.SelectedInfoRect.Y, 368, 376); this.OperationsRect = new Rectangle(this.IntelligenceRect.X + this.IntelligenceRect.Width + 30, this.SelectedInfoRect.Y, 368, 376); this.OpSLRect = new Rectangle(this.OperationsRect.X + 20, this.OperationsRect.Y + 20, this.OperationsRect.Width - 40, this.OperationsRect.Height - 45); Submenu OpSub = new Submenu(base.ScreenManager, this.OpSLRect); this.OperationsSL = new ScrollList(OpSub, Fonts.Arial12Bold.LineSpacing + 5); Vector2 ExecutePos = new Vector2((float)(this.OperationsRect.X + this.OperationsRect.Width / 2 - 91), (float)(this.OperationsRect.Y + this.OperationsRect.Height - 60)); this.ExecuteOperation = new DanButton(ExecutePos, "Execute Op") { Toggled = true }; Rectangle ComponentRect = new Rectangle(this.SelectedInfoRect.X + 20, this.SelectedInfoRect.Y + 35, this.SelectedInfoRect.Width - 40, this.SelectedInfoRect.Height - 95); this.AgentComponent = new Ship_Game.AgentComponent(ComponentRect, this); foreach (Empire e in EmpireManager.EmpireList) { if (e != EmpireManager.GetEmpireByName(this.screen.PlayerLoyalty)) { if (e.isFaction || e.MinorRace) { continue; } RaceEntry re = new RaceEntry() { e = e }; this.Races.Add(re); } else { RaceEntry re = new RaceEntry() { e = e }; this.SelectedEmpire = e; this.Races.Add(re); } } Vector2 Cursor = new Vector2(screenWidth / 2f - (float)(148 * this.Races.Count / 2), (float)(leftRect.Y + 10)); int j = 0; foreach (RaceEntry re in this.Races) { re.container = new Rectangle((int)Cursor.X + 10 + j * 148, leftRect.Y + 40, 124, 148); j++; } Rectangle rectangle = new Rectangle(); this.SpyBudgetSlider = new GenericSlider(rectangle, Localizer.Token(1637), 0f, 100f) { amount = 0f }; Rectangle rectangle1 = new Rectangle(); this.CounterSpySlider = new GenericSlider(rectangle1, Localizer.Token(1637), 0f, 100f) { amount = 0f }; base.ScreenManager.racialMusic.SetVolume(0f); }
public override void LoadContent() { this.window = new Menu2(base.ScreenManager, new Rectangle(base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferWidth / 2 - 197, base.ScreenManager.GraphicsDevice.PresentationParameters.BackBufferHeight / 2 - 225, 394, 450)); this.close = new CloseButton(new Rectangle(this.window.Menu.X + this.window.Menu.Width - 40, this.window.Menu.Y + 20, 20, 20)); Rectangle rectangle = new Rectangle(); this.TaxSlider = new GenericSlider(rectangle, Localizer.Token(309), 0f, 100f) { amount = EmpireManager.GetEmpireByName(this.screen.PlayerLoyalty).data.TaxRate }; this.TaxRateRect = new Rectangle(this.window.Menu.X + 20, this.window.Menu.Y + 37, 350, 52); this.IncomesRect = new Rectangle(this.TaxRateRect.X, this.TaxRateRect.Y + this.TaxRateRect.Height + 6, 168, 118); this.TradeRect = new Rectangle(this.TaxRateRect.X, this.IncomesRect.Y + this.IncomesRect.Height + 6, 168, 208); this.CostRect = new Rectangle(this.TaxRateRect.X + 12 + this.IncomesRect.Width, this.IncomesRect.Y, 168, 118); base.LoadContent(); }