private void AddArrestReportsTab() { if (DetailedEntity.Arrests == null) { return; } lock (DetailedEntity.Arrests) { if (DetailedEntity.Arrests.Count > 0) { if (arrestsContainer.Children.Count == 0) { arrestsContainer.Dock = Pos.Fill; arrestsContainer.LeftDock.Width = 300; arrestReportList = new ArrestReportList(arrestsContainer.LeftDock, DetailedEntity.Arrests, ChangeArrestReportDetailView, RenderArrestReportListBoxRow) { ListClickStyle = ArrestReportList.ListItemClickType.DOUBLE }; arrestReportView = new ArrestReportView(arrestsContainer, DetailedEntity.Arrests[0]); arrestsContainer.Name = String.Empty; arrestReportList.Dock = Pos.Fill; arrestReportView.Dock = Pos.Fill; arrestsContainer.Show(); var page = tabcontrol_details.AddPage("Arrests", arrestsContainer); page.UserData = Page.PED_ARRESTS; page.Clicked += PageTabClicked; } else { arrestReportList.ChangeReports(DetailedEntity.Arrests); arrestReportView.ChangeReport(DetailedEntity.Arrests[0]); } } } }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// private void InitConsole() { TabControl tbc = new TabControl(Manager); Console con1 = new Console(Manager); Console con2 = new Console(Manager); // Setup of TabControl, which will be holding both consoles tbc.Init(); tbc.AddPage("Global"); tbc.AddPage("Private"); tbc.Alpha = 220; tbc.Left = 220; tbc.Height = 220; tbc.Width = 400; tbc.Top = Manager.TargetHeight - tbc.Height - 32; tbc.Movable = true; tbc.Resizable = true; tbc.MinimumHeight = 96; tbc.MinimumWidth = 160; tbc.TabPages[0].Add(con1); tbc.TabPages[1].Add(con2); con1.Init(); con2.Init(); con2.Width = con1.Width = tbc.TabPages[0].ClientWidth; con2.Height = con1.Height = tbc.TabPages[0].ClientHeight; con2.Anchor = con1.Anchor = Anchors.All; con1.Channels.Add(new ConsoleChannel(0, "General", Color.Orange)); con1.Channels.Add(new ConsoleChannel(1, "Private", Color.White)); con1.Channels.Add(new ConsoleChannel(2, "System", Color.Yellow)); // We want to share channels and message buffer in both consoles con2.Channels = con1.Channels; con2.MessageBuffer = con1.MessageBuffer; // In the second console we display only "Private" messages con2.ChannelFilter.Add(1); // Select default channels for each tab con1.SelectedChannel = 0; con2.SelectedChannel = 1; // Do we want to add timestamp or channel name at the start of every message? con1.MessageFormat = ConsoleMessageFormats.All; con2.MessageFormat = ConsoleMessageFormats.TimeStamp; // Handler for altering incoming message con1.MessageSent += new ConsoleMessageEventHandler(con1_MessageSent); // We send initial welcome message to System channel con1.MessageBuffer.Add(new ConsoleMessage("Welcome to Neoforce!", 2)); Manager.Add(tbc); }
private void Setup() { Dictionary <string, bool> trackfeatures; using (var trk = _editor.CreateTrackReader()) { trackfeatures = trk.GetFeatures(); } TabControl tabs = new TabControl(this) { Dock = Dock.Fill }; var settings = tabs.AddPage("Settings"); var song = tabs.AddPage("Song"); _tree = new PropertyTree(settings) { Dock = Dock.Fill, }; var table = _tree.Add("Settings", 150); NumberProperty startzoom = new NumberProperty(null) { Min = 1, NumberValue = _editor.StartZoom, Max = Constants.MaxZoom, }; startzoom.ValueChanged += (o, e) => { _editor.StartZoom = (float)startzoom.NumberValue; }; table.Add("Start Zoom", startzoom); var zerostart = GwenHelper.AddPropertyCheckbox(table, "Zero Start", _editor.ZeroStart); zerostart.ValueChanged += (o, e) => { _editor.ZeroStart = zerostart.IsChecked; }; table = _tree.Add("Info", 150); // var trackname = table.AddLabel("Track Name", _editor.Name); var physics = table.AddLabel("Physics", CheckFeature(trackfeatures, TrackFeatures.six_one) ? "6.1" : "6.2"); table.AddLabel("Blue Lines", _editor.BlueLines.ToString()); table.AddLabel("Red Lines", _editor.RedLines.ToString()); table.AddLabel("Scenery Lines", _editor.GreenLines.ToString()); table = _tree.Add("Features Used", 150); AddFeature(table, trackfeatures, "Red Multiplier", TrackFeatures.redmultiplier); AddFeature(table, trackfeatures, "Scenery Width", TrackFeatures.scenerywidth); AddFeature(table, trackfeatures, "Line Triggers", TrackFeatures.ignorable_trigger); PopulateSong(song); _tree.ExpandAll(); // table.Add }
private void CreateContentArea(String[] worldNames) { CreateTabs(); _playerCount = 0; _gameInfoTab = _tabs.AddPage(); CreateGameRules(_gameInfoTab, worldNames); CreatePlayers(); SwitchToTab(0); }
private static void InitConsole() { Console con1 = new Console(); Console con2 = new Console(); // Setup of TabControl, which will be holding both consoles TabControl tbc = new TabControl { Alpha = 220, Left = 220, Height = 220, Width = 400, Movable = true, Resizable = true, MinimumHeight = 96, MinimumWidth = 160 }; tbc.Top = Screen.Height - tbc.Height - 32; tbc.AddPage("Global"); tbc.AddPage("Private"); con1.Parent = tbc.TabPages[0]; con2.Parent = tbc.TabPages[1]; con2.Width = con1.Width = tbc.TabPages[0].ClientWidth; con2.Height = con1.Height = tbc.TabPages[0].ClientHeight; con2.Anchor = con1.Anchor = Anchors.All; con1.Channels.Add(new ConsoleChannel(0, "General", Color.Orange)); con1.Channels.Add(new ConsoleChannel(1, "Private", Color.White)); con1.Channels.Add(new ConsoleChannel(2, "System", Color.Yellow)); // We want to share channels and message buffer in both consoles con2.Channels = con1.Channels; con2.MessageBuffer = con1.MessageBuffer; // In the second console we display only "Private" messages con2.ChannelFilter.Add(1); // Select default channels for each tab con1.SelectedChannel = 0; con2.SelectedChannel = 1; // Do we want to add timestamp or channel name at the start of every message? con1.MessageFormat = ConsoleMessageFormats.All; con2.MessageFormat = ConsoleMessageFormats.TimeStamp; // We send initial welcome message to System channel con1.MessageBuffer.Add(new ConsoleMessage("Welcome to Neoforce!", 2)); }
public TabControlTest(ControlBase parent) : base(parent) { { m_DockControl = new TabControl(this); m_DockControl.Margin = Margin.Zero; m_DockControl.Width = 200; //m_DockControl.Height = 150; m_DockControl.Dock = Dock.Top; { TabButton button = m_DockControl.AddPage("Controls"); ControlBase page = button.Page; { GroupBox group = new GroupBox(page); group.Text = "Tab position"; RadioButtonGroup radio = new RadioButtonGroup(group); radio.AddOption("Top").Select(); radio.AddOption("Bottom"); radio.AddOption("Left"); radio.AddOption("Right"); radio.SelectionChanged += OnDockChange; } } m_DockControl.AddPage("Red"); m_DockControl.AddPage("Green"); m_DockControl.AddPage("Blue"); m_DockControl.AddPage("Blue"); m_DockControl.AddPage("Blue"); } { TabControl dragMe = new TabControl(this); dragMe.Margin = Margin.Five; dragMe.Width = 200; dragMe.Dock = Dock.Top; dragMe.AddPage("You"); dragMe.AddPage("Can"); dragMe.AddPage("Reorder").SetImage("test16.png"); dragMe.AddPage("These"); dragMe.AddPage("Tabs"); dragMe.AllowReorder = true; } }
private void CreateAdvancedTab(TabControl tcontainer) { var container = tcontainer.AddPage("Advanced").Page; PropertyTree tree = new PropertyTree(container); var pt = tree.Add("Advanced"); tree.ExpandAll(); tree.Dock = Pos.Top; var zoom = CreateEditableNumber("Zoom", game.Track.Zoom.ToString(), pt); zoom.MinValue = 0.1; zoom.MaxValue = 200; zoom.ValueChanged += (o, e) => { if (!double.IsNaN(zoom.NumValue)) { game.Zoom((float)zoom.NumValue - game.Track.Zoom); } }; tree.Dock = Pos.Fill; var mar = tree.Margin; mar.Right = 100; tree.Margin = mar; pt.SplitWidth = 200; Button btn = new Button(container); btn.Width = 100; btn.Height = 20; Align.AlignBottom(btn); Align.AlignRight(btn); }
public override TabControl GetTabbedControl(TabControl tabControl, Manager manager, Player[] playerList) { var firstPage = tabControl.AddPage("Leader Board"); CreateFirstPage(manager, playerList, firstPage); return(base.GetTabbedControl(tabControl, manager, playerList)); }
public override bool DragAndDrop_HandleDrop(Package p, int x, int y) { Point LocalPos = CanvasPosToLocal(new Point(x, y)); TabButton button = DragAndDrop.SourceControl as TabButton; TabControl tabControl = Parent as TabControl; if (tabControl != null && button != null) { if (button.TabControl != tabControl) { // We've moved tab controls! tabControl.AddPage(button); } } ControlBase droppedOn = GetControlAt(LocalPos.X, LocalPos.Y); if (droppedOn != null && droppedOn != this) { Point dropPos = droppedOn.CanvasPosToLocal(new Point(x, y)); DragAndDrop.SourceControl.BringNextToControl(droppedOn, dropPos.X > droppedOn.ActualWidth / 2); } else { DragAndDrop.SourceControl.BringToFront(); } return(true); }
private void InitControls() { // Setup window Init(); Text = "XNA Dash - Options"; Width = 600; Height = 400; Center(); Resizable = false; Visible = true; // Setup close button closeButton = new Button(GUIManager); closeButton.Init(); closeButton.Height = 30; closeButton.Width = 50; closeButton.Text = "Close"; closeButton.Left = (Width - closeButton.Width) - 20; closeButton.Top = (Height - closeButton.Width) - 20; closeButton.ModalResult = ModalResult.Ok; closeButton.Click += new MouseEventHandler(closeButton_Click); Add(closeButton); // Setup tab tab = new TabControl(GUIManager); tab.Init(); tab.Anchor = Anchors.Top; tab.Height = Height - 20; tab.Width = Width - 8; tab.AddPage(); tab.TabPages[0].Text = "Graphics"; tab.AddPage(); tab.TabPages[1].Text = "Sound"; tab.AddPage(); tab.TabPages[2].Text = "About"; graphicsLabel = new Label(GUIManager); graphicsLabel.Init(); graphicsLabel.Text = "Graphics settings"; graphicsLabel.Width = 100; tab.TabPages[0].Add(graphicsLabel); Add(tab); }
private void AddPlayer() { if (playerCount == maxPlayers) { return; } playerCount++; tabs.AddPage(); PopulatePlayerPage(tabs.TabPages[playerCount]); SwitchToTab(playerCount); }
private void CreateRecordingTab(TabControl tcontainer) { var container = tcontainer.AddPage("Recording").Page; var gb = new GroupBox(container); gb.Text = "Recording Mode"; gb.Width = 180; gb.Height = 150; var marg = gb.Margin; marg.Bottom = 5; marg.Right = 5; gb.Margin = marg; Gwen.Align.AlignTop(gb); Gwen.Align.AlignLeft(gb); var lcb = new LabeledCheckBox(gb); lcb.Text = "Show PPF"; lcb.IsChecked = Settings.Local.ShowPpf; lcb.CheckChanged += (o, e) => { Settings.Local.ShowPpf = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Show FPS"; lcb.IsChecked = Settings.Local.ShowFps; lcb.CheckChanged += (o, e) => { Settings.Local.ShowFps = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Show Timer"; lcb.IsChecked = Settings.Local.ShowTimer; lcb.CheckChanged += (o, e) => { Settings.Local.ShowTimer = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Show Tools"; lcb.IsChecked = Settings.Local.RecordingShowTools; lcb.CheckChanged += (o, e) => { Settings.Local.RecordingShowTools = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; }
private void AddArrestReportsTab() { if (Arrests == null) { return; } lock (Arrests) { if (Arrests.Count > 0) { if (arrestsContainer.Children.Count == 0) { //Function.Log("AddArrestReportsTab with " + Arrests.Length.ToString()); arrestsContainer.Dock = Pos.Fill; arrestsContainer.LeftDock.Width = 200; arrestsContainer.RightDock.Width = arrestsContainer.Width - arrestsContainer.LeftDock.Width; arrestReportList = new ArrestReportList(arrestsContainer.LeftDock, Arrests, ChangeArrestReportDetailView, RenderArrestReportListBoxRow); arrestReportView = new ArrestReportView(arrestsContainer, Arrests[0]); arrestsContainer.Name = String.Empty; arrestReportList.Dock = Pos.Fill; arrestReportView.Dock = Pos.Fill; //arrestReportView.SizeFull(); arrestsContainer.Show(); var page = tabcontrol_details.AddPage("Arrests", arrestsContainer); page.UserData = Page.ARRESTS; page.Clicked += PageTabClicked; } else { arrestReportList.ChangeReports(Arrests); arrestReportView.ChangeReport(Arrests[0]); } } } }
public virtual TabControl GetTabbedControl(TabControl tabControl, Manager manager, Player[] playerList) { _playerList = playerList; tabControl.Left = 10; tabControl.Top = 10; foreach (var player in playerList) { var newTab = tabControl.AddPage(player.Name); var componentHeight = PopulateTab(manager, player, newTab); tabControl.Height = Math.Max(tabControl.Height, componentHeight + 50); createdPages[newTab] = componentHeight; } tabControl.PageChanged += (sender, args) => RecalculateHeight(tabControl); tabControl.PageChanged += (sender, args) => RecalculateHeight(tabControl); tabControl.PageChanged += (sender, args) => RecalculateHeight(tabControl); tabControl.PageChanged += (sender, args) => RecalculateHeight(tabControl); return(tabControl); }
internal void InitializeLayout() { VehicleDetails = new ComputerVehicleDetails(this, DetailedEntity, VehicleViewQuickActionSelected); VehicleDetails.Dock = Pos.Fill; tabcontrol_details = new TabControl(this); tabcontrol_details.Dock = Pos.Fill; arrestsContainer = new DockBase(this); arrestsContainer.Hide(); trafficCitationContainer = new DockBase(this); trafficCitationContainer.Hide(); var details = tabcontrol_details.AddPage("Details", VehicleDetails); details.UserData = Page.VEHICLE_DETAILS; details.Clicked += PageTabClicked; AddArrestReportsTab(); AddTrafficCitationsTab(); }
internal void InitializeLayout() { Function.LogDebug("Creating ComputerPedView"); pedView = new ComputerPedView(this, DetailedEntity, PedViewQuickActionSelected); pedView.Dock = Pos.Fill; tabcontrol_details = new TabControl(this); tabcontrol_details.Dock = Pos.Fill; arrestsContainer = new DockBase(this); arrestsContainer.Hide(); trafficCitationContainer = new DockBase(this); trafficCitationContainer.Hide(); var details = tabcontrol_details.AddPage("Details", pedView); details.UserData = Page.PED_DETAILS; details.Clicked += PageTabClicked; AddArrestReportsTab(); AddTrafficCitationsTab(); }
public override void InitializeLayout() { base.InitializeLayout(); this.Position = this.GetLaunchPosition(); pedView = new ComputerPedView(this, Entity, PedViewQuickActionSelected); pedView.Dock = Pos.Fill; tabcontrol_details = new TabControl(this); tabcontrol_details.Dock = Pos.Fill; arrestsContainer = new DockBase(this); arrestsContainer.Hide(); trafficCitationContainer = new DockBase(this); trafficCitationContainer.Hide(); var details = tabcontrol_details.AddPage("Details", pedView); details.UserData = Page.PED_DETAILS; details.Clicked += PageTabClicked; AddArrestReportsTab(); AddTrafficCitationsTab(); }
public void CreateComponents() { /***** Main Tab Control *****/ tc_main = new TabControl(this); tc_main.SetPosition(15, 12); tc_main.SetSize(625, 389); /***** Call List Tab *****/ // base container base_calls = new Base(this); base_calls.SetPosition(0, 0); base_calls.SetSize(617, 358); // calls listbox list_calls = new ListBox(base_calls); list_calls.SetPosition(0, 18); list_calls.SetSize(613, 333); // "Unit" label lbl_c_unit = new Label(base_calls); lbl_c_unit.Text = "Unit"; lbl_c_unit.SetPosition(3, 1); lbl_c_unit.SetSize(26, 13); // "Time" label lbl_c_time = new Label(base_calls); lbl_c_time.Text = "Time"; lbl_c_time.SetPosition(50, 1); lbl_c_time.SetSize(30, 13); // "Status" label lbl_c_status = new Label(base_calls); lbl_c_status.Text = "Status"; lbl_c_status.SetPosition(120, 1); lbl_c_status.SetSize(37, 13); // "Call" label lbl_c_call = new Label(base_calls); lbl_c_call.Text = "Call"; lbl_c_call.SetPosition(230, 1); lbl_c_call.SetSize(24, 13); /***** Active Call Tab *****/ // base container base_active = new Base(this); base_active.SetPosition(0, 0); base_active.SetSize(617, 358); // "ID No." label lbl_a_id = new Label(base_active); lbl_a_id.Text = "ID No."; lbl_a_id.SetPosition(26, 6); lbl_a_id.SetSize(38, 13); // "ID No." textbox out_id = new TextBox(base_active); out_id.SetPosition(70, 3); out_id.SetSize(306, 20); out_id.KeyboardInputEnabled = false; // "Time" label lbl_a_time = new Label(base_active); lbl_a_time.Text = "Time"; lbl_a_time.SetPosition(422, 7); lbl_a_time.SetSize(30, 13); // "Time" date textbox out_date = new TextBox(base_active); out_date.SetPosition(455, 3); out_date.SetSize(66, 20); out_date.KeyboardInputEnabled = false; // "Time" time textbox out_time = new TextBox(base_active); out_time.SetPosition(527, 3); out_time.SetSize(66, 20); out_time.KeyboardInputEnabled = false; // "Situation" label lbl_a_call = new Label(base_active); lbl_a_call.Text = "Situation"; lbl_a_call.SetPosition(17, 33); lbl_a_call.SetSize(48, 13); // "Situation" textbox out_call = new TextBox(base_active); out_call.SetPosition(70, 29); out_call.SetSize(523, 20); out_call.KeyboardInputEnabled = false; // "Location" label lbl_a_loc = new Label(base_active); lbl_a_loc.Text = "Location"; lbl_a_loc.SetPosition(18, 58); lbl_a_loc.SetSize(48, 13); // "Location" textbox out_loc = new TextBox(base_active); out_loc.SetPosition(70, 55); out_loc.SetSize(523, 20); out_loc.KeyboardInputEnabled = false; // "Status" label lbl_a_stat = new Label(base_active); lbl_a_stat.Text = "Status"; lbl_a_stat.SetPosition(27, 84); lbl_a_stat.SetSize(37, 13); // "Status" textbox out_stat = new TextBox(base_active); out_stat.SetPosition(70, 81); out_stat.SetSize(106, 20); out_stat.KeyboardInputEnabled = false; // "Unit" label lbl_a_unit = new Label(base_active); lbl_a_unit.Text = "Unit"; lbl_a_unit.SetPosition(258, 84); lbl_a_unit.SetSize(26, 13); // "Unit" textbox out_unit = new TextBox(base_active); out_unit.SetPosition(290, 81); out_unit.SetSize(86, 20); out_unit.KeyboardInputEnabled = false; // "Response" label lbl_a_resp = new Label(base_active); lbl_a_resp.Text = "Response"; lbl_a_resp.SetPosition(454, 84); lbl_a_resp.SetSize(55, 13); // "Response" textbox out_resp = new TextBox(base_active); out_resp.SetPosition(514, 81); out_resp.SetSize(79, 20); out_resp.KeyboardInputEnabled = false; // "Comments" label lbl_a_desc = new Label(base_active); lbl_a_desc.Text = "Comments"; lbl_a_desc.SetPosition(8, 113); lbl_a_desc.SetSize(56, 13); // "Comments" textbox out_desc = new MultilineTextBox(base_active); out_desc.SetPosition(70, 110); out_desc.SetSize(523, 103); out_desc.KeyboardInputEnabled = false; // "Persons" label lbl_a_peds = new Label(base_active); lbl_a_peds.Text = "Persons"; lbl_a_peds.SetPosition(19, 226); lbl_a_peds.SetSize(45, 13); // "Persons" textbox out_peds = new MultilineTextBox(base_active); out_peds.SetPosition(70, 226); out_peds.SetSize(523, 57); out_peds.KeyboardInputEnabled = false; // "Vehicles" label lbl_a_vehs = new Label(base_active); lbl_a_vehs.Text = "Vehicles"; lbl_a_vehs.SetPosition(19, 298); lbl_a_vehs.SetSize(47, 13); // "Vehicles" textbox out_vehs = new MultilineTextBox(base_active); out_vehs.SetPosition(70, 295); out_vehs.SetSize(523, 57); out_vehs.KeyboardInputEnabled = false; // Add tabs and their corresponding containers // Active Call tab is hidden when no callout is active if (Globals.ActiveCallout != null) { tc_main.AddPage("Active Call", base_active); } else { base_active.Hide(); } tc_main.AddPage("Call List", base_calls); List <CalloutData> mActiveCalls = (from CalloutData x in Globals.CallQueue orderby x.TimeReceived descending select x).ToList(); foreach (CalloutData x in mActiveCalls) { list_calls.AddRow(String.Format("{0}{1}{2}{3}", x.PrimaryUnit.PadRight(12), x.TimeReceived.ToLocalTime().ToString("HH:mm").PadRight(21), x.Status.ToFriendlyString().PadRight(31), x.Name.ToUpper())); } }
private void InitConsole() { TabControl tbc = new TabControl(Manager); Console con1 = new Console(Manager); Console con2 = new Console(Manager); // Setup of TabControl, which will be holding both consoles tbc.Init(); tbc.AddPage("Global"); tbc.AddPage("Private"); tbc.Alpha = 220; tbc.Left = 220; tbc.Height = 220; tbc.Width = 400; tbc.Top = Manager.TargetHeight - tbc.Height - 32; tbc.Movable = true; tbc.Resizable = true; tbc.MinimumHeight = 96; tbc.MinimumWidth = 160; tbc.TabPages[0].Add(con1); tbc.TabPages[1].Add(con2); con1.Init(); con2.Init(); con2.Width = con1.Width = tbc.TabPages[0].ClientWidth; con2.Height = con1.Height = tbc.TabPages[0].ClientHeight; con2.Anchor = con1.Anchor = EAnchors.All; con1.Channels.Add(new ConsoleChannel(0, "General", Color.Orange)); con1.Channels.Add(new ConsoleChannel(1, "Private", Color.White)); con1.Channels.Add(new ConsoleChannel(2, "System", Color.Yellow)); // We want to share channels and message buffer in both consoles con2.Channels = con1.Channels; con2.MessageBuffer = con1.MessageBuffer; // In the second console we display only "Private" messages con2.ChannelFilter.Add(1); // Select default channels for each tab con1.SelectedChannel = 0; con2.SelectedChannel = 1; // Do we want to add timestamp or channel name at the start of every message? con1.MessageFormat = EConsoleMessageFormats.All; con2.MessageFormat = EConsoleMessageFormats.TimeStamp; // Handler for altering incoming message con1.MessageSent += new ConsoleMessageEventHandler(con1_MessageSent); // We send initial welcome message to System channel con1.MessageBuffer.Add(new ConsoleMessage("Window Library Test!", 2)); Manager.Add(tbc); }
public override void Initialize() { base.Initialize(); string[] actions = new string[]{ "Gegner suchen", "Deck bearbeiten", "noch ne Aktion", "Und noch eine", "keine Ahnung", "Ficken?", "Ok o.o", "blubb", "foo", "bar", "moepse sin toll", }; // just to refresh ScreenManager.MainWindow.BringToFront(); #region Links - Übersicht GroupPanel wnd = new GroupPanel(WindowManager); wnd.Init(); wnd.Text = "Übersicht"; wnd.TextColor = Color.LightGray; wnd.Width = 200; wnd.Height = ScreenManager.MainWindow.ClientHeight - 40; wnd.Top = 20; wnd.Left = 20; wnd.Visible = true; // Actions int btnWidth = 160; int btnHeight = 40; Button btn; for (int i = 0; i < actions.Length; i++) { btn = new Button(WindowManager); btn.Init(); btn.Width = btnWidth; btn.Height = btnHeight; btn.Left = 20; btn.Top = ((i * 20) + btnHeight * i) + 20; btn.Text = actions[i]; btn.Click += new WindowLibrary.Controls.EventHandler(ActionButton_Click); btn.Tag = i; wnd.Add(btn); } AddWindow(wnd); #endregion #region Rechts - Spiele & Statistik GroupPanel runingGamesPanel = new GroupPanel(WindowManager); runingGamesPanel.Init(); runingGamesPanel.Text = "Laufende Spiele"; runingGamesPanel.TextColor = Color.LightGray; runingGamesPanel.Width = 200; runingGamesPanel.Height = 400; runingGamesPanel.Top = 20; runingGamesPanel.Left = ScreenManager.MainWindow.ClientWidth - runingGamesPanel.Width - 20; runingGamesPanel.Visible = true; AddWindow(runingGamesPanel); GroupPanel statPanel = new GroupPanel(WindowManager); statPanel.Init(); statPanel.Text = "Statistik"; statPanel.TextColor = Color.LightGray; statPanel.Width = 200; statPanel.Height = ScreenManager.MainWindow.ClientHeight - 460; statPanel.Top = 440; statPanel.Left = ScreenManager.MainWindow.ClientWidth - statPanel.Width - 20; statPanel.Visible = true; AddWindow(statPanel); #endregion #region Mitte - Chat TabControl tbc = new TabControl(WindowManager); mConsole = new WindowLibrary.Controls.Console(WindowManager); tbc.Init(); tbc.AddPage("Allgemein"); tbc.Alpha = 200; tbc.Left = 240; tbc.Height = 220; tbc.Width = ScreenManager.MainWindow.ClientWidth - 480; tbc.Top = ScreenManager.MainWindow.ClientHeight - tbc.Height - 18; tbc.Movable = false; tbc.Resizable = false; tbc.MinimumHeight = 96; tbc.MinimumWidth = 160; tbc.TabPages[0].Add(mConsole); mConsole.Init(); mConsole.Width = tbc.TabPages[0].ClientWidth; mConsole.Height = tbc.TabPages[0].ClientHeight; mConsole.Anchor = EAnchors.All; mConsole.Channels.Add(new ConsoleChannel(0, "Allgemein", Color.White)); mConsole.SelectedChannel = 0; mConsole.MessageFormat = ConsoleMessageFormats.None; SendSystemMessage("Dein Login war erfolgreich!"); SendSystemMessage("Willkommen im InsaneRO Card Game ;D"); mConsole.MessageSent += new ConsoleMessageEventHandler(Channel1_MessageSent); AddWindow(tbc); #endregion GroupPanel newsPanel = new GroupPanel(WindowManager); newsPanel.Init(); newsPanel.Text = "InsaneRO News"; newsPanel.TextColor = Color.LightGray; newsPanel.Width = ScreenManager.MainWindow.ClientWidth - 480; newsPanel.Height = ScreenManager.MainWindow.ClientHeight - 40 - 220; newsPanel.Top = 20; newsPanel.Left = 240; newsPanel.Visible = true; newsPanel.AutoScroll = EAutoScroll.Vertical; AddWindow(newsPanel); LoadNews(); }
public TabTest(ControlBase parent) : base(parent) { TabControl tab = new TabControl(parent); // tab.DrawDebugOutlines = true; tab.Width = 300; tab.Height = 200; var page = tab.AddPage("Layout Test"); Label l = new Label(page); l.Text = "0,0 100x100"; // l.SetSize(100, 100); l.AutoSizeToContents = true; var btn = new Button(page); btn.Y += 100; btn.Text = "Reorder"; btn.Clicked += (o, e) => { var ch = tab.GetPage(0); ch.SetIndex(3); }; page = tab.AddPage("Page 2"); btn = new Button(page); btn.Clicked += (o, e) => { var ch = tab.GetPage("Page 3"); if (ch != null) { ch.RemoveTab(); } else { var p = tab.AddPage("Page 3"); var b = new Button(p); b.Text = "Delete self (X)"; b.Clicked += (ox, ex) => { tab.GetPage("Page 3").RemoveTab(); }; p.SetIndex(2); } }; btn.Text = "Toggle Delete page 3"; btn.AutoSizeToContents = true; btn = new Button(page); btn.Clicked += (o, e) => { tab.GetPage(0).FocusTab(); }; btn.Text = "Focus First Page"; btn.AutoSizeToContents = true; btn.Y += 50; page = tab.AddPage("Page 3"); btn = new Button(page); btn.Text = "Delete self"; btn.AutoSizeToContents = true; btn.Clicked += (o, e) => { tab.GetPage("Page 3").RemoveTab(); }; page = tab.AddPage("disabled"); page.TabButton.IsDisabled = true; page = tab.AddPage("stretch"); page = tab.AddPage("stretch"); }
public TaskDialog(Manager manager) : base(manager) { //Alpha = 200; Height = 520; MinimumWidth = 254; MinimumHeight = 160; Center(); TopPanel.Height = 80; TopPanel.BevelStyle = EBevelStyle.None; TopPanel.BevelBorder = EBevelBorder.None; Caption.Visible = false; Description.Visible = false; Text = "Dialog Template"; imgTop = new ImageBox(manager); imgTop.Init(); imgTop.Parent = TopPanel; imgTop.Top = 0; imgTop.Left = 0; imgTop.Width = TopPanel.ClientWidth; imgTop.Height = TopPanel.ClientHeight; imgTop.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right | EAnchors.Bottom; imgTop.SizeMode = ESizeMode.Normal; imgTop.Image = Manager.Content.Load<Texture2D>("Content\\Images\\Caption"); tbcMain = new TabControl(manager); tbcMain.Init(); tbcMain.Parent = this; tbcMain.Left = 4; tbcMain.Top = TopPanel.Height + 4; tbcMain.Width = ClientArea.Width - 8; tbcMain.Height = ClientArea.Height - 8 - TopPanel.Height - BottomPanel.Height; tbcMain.Anchor = EAnchors.All; tbcMain.AddPage(); tbcMain.TabPages[0].Text = "First"; tbcMain.AddPage(); tbcMain.TabPages[1].Text = "Second"; tbcMain.AddPage(); tbcMain.TabPages[2].Text = "Third"; btnFirst = new Button(manager); btnFirst.Init(); btnFirst.Parent = tbcMain.TabPages[0]; btnFirst.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; btnFirst.Top = 8; btnFirst.Left = 8; btnFirst.Width = btnFirst.Parent.ClientWidth - 16; btnFirst.Text = ">>> First Page Button <<<"; grpFirst = new GroupPanel(manager); grpFirst.Init(); grpFirst.Parent = tbcMain.TabPages[0]; grpFirst.Anchor = EAnchors.All; //grpFirst.Type = GroupBoxType.Flat; grpFirst.Left = 8; grpFirst.Top = btnFirst.Top + btnFirst.Height + 4; grpFirst.Width = btnFirst.Parent.ClientWidth - 16; grpFirst.Height = btnFirst.Parent.ClientHeight - grpFirst.Top - 8; btnSecond = new Button(manager); btnSecond.Init(); btnSecond.Parent = tbcMain.TabPages[1]; btnSecond.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; btnSecond.Top = 8; btnSecond.Left = 8; btnSecond.Width = btnSecond.Parent.ClientWidth - 16; btnSecond.Text = ">>> Second Page Button <<<"; btnThird = new Button(manager); btnThird.Init(); btnThird.Parent = tbcMain.TabPages[2]; btnThird.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right; btnThird.Top = 8; btnThird.Left = 8; btnThird.Width = btnThird.Parent.ClientWidth - 16; btnThird.Text = ">>> Third Page Button <<<"; btnOk = new Button(manager); btnOk.Init(); btnOk.Parent = BottomPanel; btnOk.Anchor = EAnchors.Top | EAnchors.Right; btnOk.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8; btnOk.Left = btnOk.Parent.ClientWidth - 8 - btnOk.Width * 3 - 8; btnOk.Text = "OK"; btnOk.ModalResult = EModalResult.Ok; btnApply = new Button(manager); btnApply.Init(); btnApply.Parent = BottomPanel; btnApply.Anchor = EAnchors.Top | EAnchors.Right; btnApply.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8; btnApply.Left = btnOk.Parent.ClientWidth - 4 - btnOk.Width * 2 - 8; btnApply.Text = "Apply"; btnClose = new Button(manager); btnClose.Init(); btnClose.Parent = BottomPanel; btnClose.Anchor = EAnchors.Top | EAnchors.Right; btnClose.Top = btnOk.Parent.ClientHeight - btnClose.Height - 8; btnClose.Left = btnOk.Parent.ClientWidth - btnClose.Width - 8; btnClose.Text = "Close"; btnClose.ModalResult = EModalResult.Cancel; btnFirst.Focused = true; }
private void CreateAboutTab(TabControl tcontainer) { var container = tcontainer.AddPage("About").Page; PropertyTree tree = new PropertyTree(container); var pt = tree.Add("Keys (uneditable)"); tree.ExpandAll(); tree.Dock = Pos.Top; pt.Add("Pencil Tool", CreateUneditable(pt), "Q"); pt.Add("Line Tool", CreateUneditable(pt), "W"); pt.Add("Eraser Tool", CreateUneditable(pt), "E"); pt.Add("Line Adjust Tool", CreateUneditable(pt), "R"); pt.Add("Select Hand Tool", CreateUneditable(pt), "T"); pt.Add("Hand Tool", CreateUneditable(pt), "Space"); pt.Add("Move Rider", CreateUneditable(pt), "D").SetToolTipText("Hold D and click the rider to move him"); pt.Add("Start Track", CreateUneditable(pt), "Y"); pt.Add("Stop Track", CreateUneditable(pt), "U"); pt.Add("Play before flag (w/scrubbing)", CreateUneditable(pt), "Shift+I"); pt.Add("Play ignoring flag", CreateUneditable(pt), "ALT+Y"); pt.Add("Slowmo Playback", CreateUneditable(pt), "Shift+Y"); pt.Add("Open Preferences", CreateUneditable(pt), "ESC, CTRL+P"); pt.Add("Save Track", CreateUneditable(pt), "CTRL+S"); pt.Add("Load Track", CreateUneditable(pt), "O"); pt.Add("Blue Color", CreateUneditable(pt), "1").SetToolTipText("Set tool color to blue"); pt.Add("Red Color", CreateUneditable(pt), "2").SetToolTipText("Set tool color to red"); pt.Add("Green Color", CreateUneditable(pt), "3").SetToolTipText("Set tool color to green"); pt.Add("Disable Line Snap", CreateUneditable(pt), "S").SetToolTipText("Disables line snapping while pressed"); pt.Add("15° Line Snap", CreateUneditable(pt), "X").SetToolTipText("Snap lines to the nearest 15 degree angle"); pt.Add("Move to First Line", CreateUneditable(pt), "HOME"); pt.Add("Move to Last Line", CreateUneditable(pt), "END"); pt.Add("Toggle Tool Settings", CreateUneditable(pt), "TAB").SetToolTipText("Shift between current line settings, \r\nlike the red line multiplier if it's the selected line type."); pt.Add("(Line tool) Flip Line", CreateUneditable(pt), "Shift").SetToolTipText("Flips line while using the line tool"); pt.Add("(Adjust tool) Lock Angle", CreateUneditable(pt), "Shift").SetToolTipText("Locks the angle of the selected line\r\nwith the line adjust tool"); pt.Add("(Adjust tool) Move Whole Line", CreateUneditable(pt), "CTRL"); pt.Add("(Adjust tool) Move Line On Axis", CreateUneditable(pt), "(CTRL)+Shift"); pt.Add("(Adjust tool) Move Line Up/Down", CreateUneditable(pt), "(CTRL)+Shift+X"); pt.Add("(Adjust tool) Lock Length", CreateUneditable(pt), "L"); pt.Add("(Adjust tool) Lifelock", CreateUneditable(pt), "ALT").SetToolTipText("While pressed, move a line until \r\nit no longer kills bosh in that frame"); pt.Add("Focus Start Point", CreateUneditable(pt), "F1"); pt.Add("Focus on Flag", CreateUneditable(pt), "F2"); pt.Add("Calculate Flag", CreateUneditable(pt), "Right Click Flag Icon").SetToolTipText("Right click the flag icon to calculate the validity of a flag"); pt.Add("(playback) Pause/Resume", CreateUneditable(pt), "Space"); pt.Add("(playback) Flag", CreateUneditable(pt), "I"); pt.Add("(playback) Zoom In", CreateUneditable(pt), "Z"); pt.Add("(playback) Zoom Out", CreateUneditable(pt), "X"); pt.Add("(playback) Slow Playback", CreateUneditable(pt), "-"); pt.Add("(playback) Speed Playback", CreateUneditable(pt), "+"); pt.Add("(playback) Frame Left", CreateUneditable(pt), "Left"); pt.Add("(playback) Frame Right", CreateUneditable(pt), "Right"); pt.Add("(playback) (hold) Rewind", CreateUneditable(pt), "Shift+Left"); pt.Add("(playback) (hold) Playback", CreateUneditable(pt), "Shift+Right"); pt.Add("(playback) Iterations Left", CreateUneditable(pt), "Alt+Left"); pt.Add("(playback) Iterations Right", CreateUneditable(pt), "Alt+Right"); tree.Dock = Pos.Fill; pt.SplitWidth = 200; }
public TaskLauncher(Manager manager) : base(manager) { Game.CurrentGameState = Game.GameState.HomeLoggedOff; //Setup window Text = "Zarknorth Launcher"; CaptionVisible = false; TopPanel.Visible = true; BottomPanel.Visible = false; Caption.Text = "Welcome To Zarknorth!"; Description.Text = "Sign in, sign up or view the latest news!"; Description.TextColor = new Color(96, 96, 96); Caption.TextColor = Color.LightGray; Resizable = false; Movable = false; DefaultControl = txtUser; RealTop = Top; //Add feeds tab tabFeeds = new TabControl(manager); tabFeeds.Init(); tabFeeds.Left = 8; tabFeeds.Top = 8 + TopPanel.Height; tabFeeds.Width = 400; tabFeeds.Height = 164; Add(tabFeeds); //Add news item configs NewsItem.NewsItems.Clear(); //Just in case we logged in then out again NewsItem.NewsItems.Add(new NewsItem("News", "The latest news from the official Zarknorth news forum", "http://www.zarknorth.com/forum/viewforum.php?f=1", "http://www.zarknorth.com/forum/feed.php?mode=news")); NewsItem.NewsItems[0].ToolTip += delegate(object o, NewsItem n, SyndicationItem s) { return("Posted by " + s.Authors[0].Name + " " + s.PublishDate.DateTime.GetPrettyDate() + "."); }; NewsItem.NewsItems.Add(new NewsItem("Reddit", "Hottest links around the /r/Zarknorth Reddit community", "http://www.reddit.com/r/zarknorth", "http://www.reddit.com/r/Zarknorth/.rss")); NewsItem.NewsItems[1].ToolTip += delegate(object o, NewsItem n, SyndicationItem s) { //Get /u/username from html int a = s.Summary.Text.IndexOf("<a href=\"http://www.reddit.com/user/"); int b = s.Summary.Text.IndexOf("\">", a); string author = s.Summary.Text.Substring(a + 36, (b) - (a + 36)); return("Submitted by " + author + " " + s.PublishDate.DateTime.GetPrettyDate() + "."); }; NewsItem.NewsItems.Add(new NewsItem("YouTube", "Newest videos about Zarknorth on the official YouTube", "https://youtube.com/Zarknorth", "http://www.youtube.com/rss/user/Zarknorth/videos.rss")); NewsItem.NewsItems[2].ToolTip += delegate(object o, NewsItem n, SyndicationItem s) { return("Published " + s.PublishDate.DateTime.GetPrettyDate() + "."); }; //Load them for (int i = 0; i < NewsItem.NewsItems.Count; i++) { tabFeeds.AddPage(NewsItem.NewsItems[i].Name); NewsItem.NewsItems[i].Load(tabFeeds.TabPages[i]); } #region Init Controls //Add user account area grpLogin = new GroupPanel(manager); grpLogin.Init(); grpLogin.Text = "Sign In"; grpLogin.Left = 16 + tabFeeds.Width; grpLogin.Top = 8 + TopPanel.Height; grpLogin.Width = 200; grpLogin.Height = 124; grpLogin.Enabled = false; // 2018 - Disable login Add(grpLogin); //Username label_TextChanged and input lblUser = new Label(manager); lblUser.Init(); lblUser.Top = 2; lblUser.Left = 8; lblUser.Width = grpLogin.Width - 16; lblUser.Text = "Username:"******"Password:"******"Remember Me"; chkRememberMe.Top = txtPass.Top + txtPass.Height + 4; chkRememberMe.Left = 8; chkRememberMe.Width = 110; lblResetPass = new Label(manager); lblResetPass.Init(); lblResetPass.Text = "Forgot Password?"; lblResetPass.Top = lblPass.Top; lblResetPass.Width = 100; lblResetPass.Left = grpLogin.Width - lblResetPass.Width - 8; lblResetPass.TextColor = Color.SkyBlue; lblResetPass.Passive = false; lblResetPass.Visible = false; lblResetPass.MouseOver += new TomShane.Neoforce.Controls.MouseEventHandler(delegate(object o, TomShane.Neoforce.Controls.MouseEventArgs e) { lblResetPass.TextColor = Color.DeepSkyBlue; }); lblResetPass.MouseOut += new TomShane.Neoforce.Controls.MouseEventHandler(delegate(object o, TomShane.Neoforce.Controls.MouseEventArgs e) { lblResetPass.TextColor = Color.SkyBlue; }); lblResetPass.Click += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e) { System.Diagnostics.Process.Start("http://zarknorth.com/profile?view=reset"); }); lblRemindUser = new Label(manager); lblRemindUser.Init(); lblRemindUser.Text = "Forgot Username?"; lblRemindUser.Top = lblUser.Top; lblRemindUser.Width = 104; lblRemindUser.Left = grpLogin.Width - lblRemindUser.Width - 8; lblRemindUser.TextColor = Color.SkyBlue; lblRemindUser.Passive = false; lblRemindUser.Visible = false; lblRemindUser.MouseOver += new TomShane.Neoforce.Controls.MouseEventHandler(delegate(object o, TomShane.Neoforce.Controls.MouseEventArgs e) { lblRemindUser.TextColor = Color.DeepSkyBlue; }); lblRemindUser.MouseOut += new TomShane.Neoforce.Controls.MouseEventHandler(delegate(object o, TomShane.Neoforce.Controls.MouseEventArgs e) { lblRemindUser.TextColor = Color.SkyBlue; }); lblRemindUser.Click += new TomShane.Neoforce.Controls.EventHandler(delegate(object o, TomShane.Neoforce.Controls.EventArgs e) { System.Diagnostics.Process.Start("http://zarknorth.com/profile?view=remind"); }); //Add controls grpLogin.Add(txtUser); grpLogin.Add(txtPass); grpLogin.Add(lblPass); grpLogin.Add(lblUser); grpLogin.Add(chkRememberMe); grpLogin.Add(lblRemindUser); grpLogin.Add(lblResetPass); //Add Login and Register buttons btnLogin = new Button(manager); btnLogin.Init(); btnLogin.Left = 16 + tabFeeds.Width; btnLogin.Height = 32; btnLogin.Width = 96; btnLogin.Top = grpLogin.Height + grpLogin.Top + 6; btnLogin.Text = "Sign In"; btnLogin.Click += new TomShane.Neoforce.Controls.EventHandler(LoginClick); Add(btnLogin); btnRegister = new Button(manager); btnRegister.Init(); btnRegister.Left = 16 + tabFeeds.Width + 104; btnRegister.Height = 32; btnRegister.Width = 96; btnRegister.Top = grpLogin.Height + grpLogin.Top + 6; btnRegister.Text = "Sign Up"; btnRegister.Click += new TomShane.Neoforce.Controls.EventHandler(RegisterClick); Add(btnRegister); // 2018 btnStart = new Button(manager); btnStart.Init(); btnStart.Left = 16; btnStart.Height = 64; btnStart.Width = 256; btnStart.Text = "Start Game"; btnStart.Color = new Color(30, 255, 0); btnStart.Click += new TomShane.Neoforce.Controls.EventHandler(BypassLoginAndStartGame); Add(btnStart); // 2018 btnRegister.Enabled = btnLogin.Enabled = false; #endregion //Change dimensions based on control size Width = tabFeeds.Width + grpLogin.Width + 40; Height = tabFeeds.Height + tabFeeds.Top + 22 + 64 + 16; btnStart.Left = (Width / 2) - (btnStart.Width / 2); btnStart.Top = Height - 64 - 24; //Center window Center(); //Populate username and password fields if remember me data is present GetRememberMeData(); }
public override Dialog GetControl(Control parent) { Control.Text = ""; Manager.Add(Control); Control.Show(); // stop listening while redrawing tabs.PageChanged -= Tabs_PageChanged; foreach (TabPage tab in tabs.TabPages) { tabs.RemovePage(tab); } if (Data.HasComponent <BuildableComponent>()) { BuildableComponent buildable = Data.Get <BuildableComponent>(); Control.Text = buildable.Name; Control.Caption.Text = "Description"; Control.Description.Text = buildable.Description; } if (Data.HasComponent <CitizenComponent>()) { CitizenComponent citizen = Data.Get <CitizenComponent>(); Control.Text = citizen.DisplayName; Control.Caption.Text = "Pleb"; Control.Description.Text = "A lower class citizen of the city."; cr = new CitizenRenderer(Data.Get <CitizenComponent>(), World); TabPage tab = tabs.AddPage("Info"); Panel cp = cr.GetControl(tab); } // Get housing control if (Data.HasComponent <HousingComponent>()) { hr = new HousingRenderer(Data.Get <HousingComponent>(), World); TabPage tab = tabs.AddPage("Housing"); Panel gp = hr.GetControl(tab); } // Get production control if (Data.HasComponent <ProductionComponent>()) { pr = new ProductionRenderer(Data.Get <ProductionComponent>(), World); TabPage tab = tabs.AddPage("Production"); Panel p = pr.GetControl(tab); } // Get stockpile if (Data.HasComponent <StockpileComponent>()) { sr = new StockpileRenderer(Data.Get <StockpileComponent>(), World); TabPage tab = tabs.AddPage("Stockpile"); Table t = sr.GetControl(tab); t.SetPosition(-tabs.ClientMargins.Left, -2); t.SetSize(tab.ClientWidth + tabs.ClientMargins.Horizontal, tab.ClientHeight + 2 + tabs.ClientMargins.Bottom); t.Parent = tab; } // Get inventory if (Data.HasComponent <Inventory>()) { ir = new InventoryRenderer(Data.Get <Inventory>(), World); TabPage tab = tabs.AddPage("Inventory"); Table it = ir.GetControl(tab); it.SetPosition(-tabs.ClientMargins.Left, -2); it.SetSize(tab.ClientWidth + tabs.ClientMargins.Horizontal, tab.ClientHeight + 2 + tabs.ClientMargins.Bottom); it.Parent = tab; } Control.Text = string.Format("({0}) {1}", Data.ID, Control.Text); if (previousSelectedTab < tabs.TabPages.Length) { tabs.SelectedIndex = previousSelectedTab; } tabs.PageChanged += new EventHandler(Tabs_PageChanged); return(Control); }
private void CreateBasicTab(TabControl tcontainer) { var container = tcontainer.AddPage("Basic").Page; tcontainer.Dock = Gwen.Pos.Fill; //modes GroupBox gb = new GroupBox(container); var modesgb = gb; gb.Text = "Modes"; gb.Width = 180; gb.Height = 200; var marg = tcontainer.Margin; marg.Bottom = 5; tcontainer.Margin = marg; marg = gb.Margin; marg.Bottom = 15; marg.Right = 5; gb.Margin = marg; RecurseLayout(Skin); Gwen.Align.AlignBottom(gb); Gwen.Align.AlignRight(gb); LabeledCheckBox lcb = new LabeledCheckBox(gb); marg = lcb.Margin; marg.Top += 5; lcb.Margin = marg; lcb.Text = "Recording Mode"; lcb.Dock = Pos.Top; lcb.IsChecked = Settings.Local.RecordingMode; lcb.CheckChanged += (o, e) => { Settings.Local.RecordingMode = ((LabeledCheckBox)o).IsChecked; }; lcb.SetToolTipText(@"Disables many editor features and changes the client so it can be recorded with a specific aesthetic"); lcb = new LabeledCheckBox(gb); lcb.Text = "Color Playback"; lcb.IsChecked = Settings.Local.ColorPlayback; lcb.CheckChanged += (o, e) => { Settings.Local.ColorPlayback = ((LabeledCheckBox)o).IsChecked; }; lcb.SetToolTipText(@"During playback the lines will no longer turn black by default, and will stay as they are in editor mode"); lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Hit Test"; lcb.IsChecked = Settings.Local.HitTest; lcb.CheckChanged += (o, e) => { Settings.Local.HitTest = ((LabeledCheckBox)o).IsChecked; }; lcb.SetToolTipText(@"During playback, hitting a line will turn it the color of the original line."); lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Preview Mode"; lcb.IsChecked = Settings.Local.PreviewMode; lcb.CheckChanged += (o, e) => { Settings.Local.PreviewMode = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb.SetToolTipText(@"The opposite of Color Playback. The editor will show the lines as black instead"); // lcb = new LabeledCheckBox(gb); lcb.Text = "Zero Start"; lcb.IsChecked = game.Track.ZeroStart; lcb.CheckChanged += (o, e) => { game.Track.ZeroStart = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb.SetToolTipText(@"Starts the track with 0 momentum"); lcb = new LabeledCheckBox(gb); lcb.Text = "Smooth Camera"; lcb.IsChecked = Settings.SmoothCamera; lcb.CheckChanged += (o, e) => { Settings.SmoothCamera = ((LabeledCheckBox)o).IsChecked; Settings.Save(); game.Track.Stop(); game.Track.InitCamera(); var round = FindChildByName("roundlegacycamera", true); foreach (var c in round.Children) { c.IsDisabled = Settings.SmoothCamera; } }; lcb.Dock = Pos.Top; lcb.SetToolTipText("Enables a smooth predictive camera.\r\nExperimental and subject to change."); lcb = new LabeledCheckBox(gb); lcb.Name = "roundlegacycamera"; lcb.Text = "Round Legacy Camera"; lcb.IsChecked = Settings.RoundLegacyCamera; lcb.CheckChanged += (o, e) => { Settings.RoundLegacyCamera = ((LabeledCheckBox)o).IsChecked; Settings.Save(); game.Track.Stop(); game.Track.InitCamera(); }; lcb.Dock = Pos.Top; lcb.SetToolTipText("If the new camera is disabled\r\nmakes the camera bounds round\r\ninstead of rectangle"); foreach (var c in lcb.Children) { c.IsDisabled = Settings.SmoothCamera; } lcb = new LabeledCheckBox(gb); lcb.Text = "Smooth Playback"; lcb.IsChecked = Settings.SmoothPlayback; lcb.CheckChanged += (o, e) => { Settings.SmoothPlayback = ((LabeledCheckBox)o).IsChecked; Settings.Save(); }; lcb.SetToolTipText("Interpolates frames for a smooth 60+ fps."); lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Onion Skinning"; lcb.IsChecked = Settings.Local.OnionSkinning; lcb.CheckChanged += (o, e) => { Settings.Local.OnionSkinning = ((LabeledCheckBox)o).IsChecked; game.Invalidate(); }; lcb.Dock = Pos.Top; // gb = new GroupBox(container); gb.Text = "Editor View"; gb.Width = 180; gb.Height = 100; marg = gb.Margin; marg.Bottom = 15; marg.Right = 5; gb.Margin = marg; Gwen.Align.AlignTop(gb); Gwen.Align.AlignRight(gb); Align.PlaceDownLeft(modesgb, gb); lcb = new LabeledCheckBox(gb); marg = lcb.Margin; marg.Top += 5; lcb.Margin = marg; lcb.Text = "Contact Lines"; lcb.IsChecked = Settings.Local.DrawContactPoints; lcb.CheckChanged += (o, e) => { Settings.Local.DrawContactPoints = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Momentum Vectors"; lcb.IsChecked = Settings.Local.MomentumVectors; lcb.CheckChanged += (o, e) => { Settings.Local.MomentumVectors = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Gravity Wells"; lcb.IsChecked = Settings.Local.RenderGravityWells; lcb.CheckChanged += (o, e) => { Settings.Local.RenderGravityWells = ((LabeledCheckBox)o).IsChecked; game.Track.Invalidate(); }; lcb.Dock = Pos.Top; //playback gb = new GroupBox(container); gb.Text = "Playback"; gb.Width = 180; gb.Height = 150; marg = gb.Margin; marg.Bottom = 5; marg.Right = 5; gb.Margin = marg; Gwen.Align.AlignTop(gb); Gwen.Align.AlignLeft(gb); RadioButtonGroup rbg = new RadioButtonGroup(gb); rbg.Text = "Playback Zoom"; rbg.AddOption("Current Zoom"); rbg.AddOption("Default Zoom"); rbg.AddOption("Specific Zoom"); rbg.SetSelection(Settings.PlaybackZoomType); rbg.SelectionChanged += (o, e) => { Settings.PlaybackZoomType = ((RadioButtonGroup)o).SelectedIndex; Settings.Save(); }; rbg.Dock = Pos.Top; rbg.AutoSizeToContents = false; rbg.Height = 90; var nud = new NumericUpDown(rbg); nud.Value = Settings.PlaybackZoomValue; nud.Max = 24; nud.Min = 1; nud.Dock = Pos.Bottom; nud.ValueChanged += (o, e) => { Settings.PlaybackZoomValue = ((NumericUpDown)o).Value; Settings.Save(); }; var cbplayback = new ComboBox(gb); cbplayback.Dock = Pos.Top; for (var i = 0; i < Constants.MotionArray.Length; i++) { var f = (Constants.MotionArray[i] / (float)Constants.PhysicsRate); cbplayback.AddItem("Playback: " + f + "x", f.ToString(CultureInfo.InvariantCulture), f); } cbplayback.SelectByName(Settings.Local.DefaultPlayback.ToString(CultureInfo.InvariantCulture)); cbplayback.ItemSelected += (o, e) => { Settings.Local.DefaultPlayback = (float)e.SelectedItem.UserData; }; var cbslowmo = new ComboBox(gb); cbslowmo.Dock = Pos.Top; var fpsarray = new[] { 1, 2, 5, 10, 20 }; for (var i = 0; i < fpsarray.Length; i++) { cbslowmo.AddItem("Slowmo FPS: " + fpsarray[i], fpsarray[i].ToString(CultureInfo.InvariantCulture), fpsarray[i]); } cbslowmo.SelectByName(Settings.Local.SlowmoSpeed.ToString(CultureInfo.InvariantCulture)); cbslowmo.ItemSelected += (o, e) => { Settings.Local.SlowmoSpeed = (int)e.SelectedItem.UserData; }; //editor var backup = gb; gb = new GroupBox(container); gb.Text = "Editor"; gb.Width = 180; gb.Height = 170; marg = gb.Margin; marg.Bottom = 5; marg.Right = 5; gb.Margin = marg; Gwen.Align.PlaceDownLeft(gb, backup); //Gwen.Align.AlignRight(gb); lcb = new LabeledCheckBox(gb); marg = lcb.Margin; marg.Top += 5; lcb.Margin = marg; lcb.Text = "All Pink Lifelock"; lcb.SetToolTipText(@"I hope you know where the manual is."); lcb.IsChecked = Settings.PinkLifelock; lcb.CheckChanged += (o, e) => { Settings.PinkLifelock = ((LabeledCheckBox)o).IsChecked; Settings.Save(); }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Disable Line Snap"; lcb.IsChecked = Settings.Local.DisableSnap; lcb.CheckChanged += (o, e) => { Settings.Local.DisableSnap = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Force XY Snap"; lcb.IsChecked = Settings.Local.ForceXySnap; lcb.CheckChanged += (o, e) => { Settings.Local.ForceXySnap = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Superzoom"; lcb.IsChecked = Settings.SuperZoom; lcb.CheckChanged += (o, e) => { Settings.SuperZoom = ((LabeledCheckBox)o).IsChecked; Settings.Save(); }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "White BG"; lcb.IsChecked = Settings.WhiteBG; lcb.CheckChanged += (o, e) => { Settings.WhiteBG = ((LabeledCheckBox)o).IsChecked; Settings.Save(); }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Night Mode"; lcb.IsChecked = Settings.NightMode; lcb.CheckChanged += (o, e) => { Settings.NightMode = ((LabeledCheckBox)o).IsChecked; Settings.Save(); game.Invalidate(); game.Canvas.ButtonsToggleNightmode(); }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(container); lcb.Text = "Check for Updates"; lcb.IsChecked = Settings.CheckForUpdates; lcb.CheckChanged += (o, e) => { Settings.CheckForUpdates = ((LabeledCheckBox)o).IsChecked; Settings.Save(); }; lcb.Dock = Pos.Bottom; }
private void CreateBasicTab(TabControl tcontainer) { var container = tcontainer.AddPage("Basic").Page; tcontainer.Dock = Gwen.Pos.Fill; //modes GroupBox gb = new GroupBox(container); var modesgb = gb; gb.Text = "Modes"; gb.Width = 180; gb.Height = 160; var marg = tcontainer.Margin; marg.Bottom = 5; tcontainer.Margin = marg; marg = gb.Margin; marg.Bottom = 15; marg.Right = 5; gb.Margin = marg; RecurseLayout(Skin); Gwen.Align.AlignBottom(gb); Gwen.Align.AlignRight(gb); LabeledCheckBox lcb = new LabeledCheckBox(gb); marg = lcb.Margin; marg.Top += 5; lcb.Margin = marg; lcb.Text = "Recording Mode"; lcb.Dock = Pos.Top; lcb.IsChecked = game.SettingRecordingMode; lcb.CheckChanged += (o, e) => { game.SettingRecordingMode = ((LabeledCheckBox)o).IsChecked; }; lcb.SetToolTipText(@"Disables many editor features and changes the client so it can be recorded with a specific aesthetic"); lcb = new LabeledCheckBox(gb); lcb.Text = "Color Playback"; lcb.IsChecked = game.SettingColorPlayback; lcb.CheckChanged += (o, e) => { game.SettingColorPlayback = ((LabeledCheckBox)o).IsChecked; }; lcb.SetToolTipText(@"During playback the lines will no longer turn black by default, and will stay as they are in editor mode"); lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Hit Test"; lcb.IsChecked = game.HitTest; lcb.CheckChanged += (o, e) => { game.HitTest = ((LabeledCheckBox)o).IsChecked; }; lcb.SetToolTipText(@"During playback, hitting a line will turn it the color of the original line."); lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Preview Mode"; lcb.IsChecked = game.SettingPreviewMode; lcb.CheckChanged += (o, e) => { game.SettingPreviewMode = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb.SetToolTipText(@"The opposite of Color Playback. The editor will shoe the lines as black instead"); // lcb = new LabeledCheckBox(gb); lcb.Text = "Zero Start"; lcb.IsChecked = game.Track.ZeroStart; lcb.CheckChanged += (o, e) => { game.Track.ZeroStart = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb.SetToolTipText(@"Starts the track with 0 momentum"); lcb = new LabeledCheckBox(gb); lcb.Text = "Smooth Camera"; lcb.IsChecked = Settings.Default.SmoothCamera; lcb.CheckChanged += (o, e) => { Settings.Default.SmoothCamera = ((LabeledCheckBox)o).IsChecked; Settings.Default.Save(); }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Onion Skinning"; lcb.IsChecked = game.SettingOnionSkinning; lcb.CheckChanged += (o, e) => { game.SettingOnionSkinning = ((LabeledCheckBox)o).IsChecked; game.Invalidate(); }; lcb.Dock = Pos.Top; // gb = new GroupBox(container); gb.Text = "Editor View"; gb.Width = 180; gb.Height = 100; marg = gb.Margin; marg.Bottom = 15; marg.Right = 5; gb.Margin = marg; Gwen.Align.AlignTop(gb); Gwen.Align.AlignRight(gb); Align.PlaceDownLeft(modesgb, gb); lcb = new LabeledCheckBox(gb); marg = lcb.Margin; marg.Top += 5; lcb.Margin = marg; lcb.Text = "Contact Lines"; lcb.IsChecked = game.SettingDrawContactPoints; lcb.CheckChanged += (o, e) => { game.SettingDrawContactPoints = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Momentum Vectors"; lcb.IsChecked = game.SettingMomentumVectors; lcb.CheckChanged += (o, e) => { game.SettingMomentumVectors = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Gravity Wells"; lcb.IsChecked = game.SettingRenderGravityWells; lcb.CheckChanged += (o, e) => { game.SettingRenderGravityWells = ((LabeledCheckBox)o).IsChecked; game.InvalidateTrack(); }; lcb.Dock = Pos.Top; //playback gb = new GroupBox(container); gb.Text = "Playback"; gb.Width = 180; gb.Height = 150; marg = gb.Margin; marg.Bottom = 5; marg.Right = 5; gb.Margin = marg; Gwen.Align.AlignTop(gb); Gwen.Align.AlignLeft(gb); RadioButtonGroup rbg = new RadioButtonGroup(gb); rbg.Text = "Playback Zoom"; rbg.AddOption("Current Zoom"); rbg.AddOption("Default Zoom"); rbg.AddOption("Specific Zoom"); rbg.SetSelection(Settings.Default.PlaybackZoom); rbg.SelectionChanged += (o, e) => { Settings.Default.PlaybackZoom = ((RadioButtonGroup)o).SelectedIndex; Settings.Default.Save(); }; rbg.Dock = Pos.Top; rbg.AutoSizeToContents = false; rbg.Height = 90; var nud = new NumericUpDown(rbg); nud.Value = Settings.Default.PlaybackZoomSpecific; nud.Max = 24; nud.Min = 1; nud.Dock = Pos.Bottom; nud.ValueChanged += (o, e) => { Settings.Default.PlaybackZoomSpecific = ((NumericUpDown)o).Value; Settings.Default.Save(); }; var cbplayback = new ComboBox(gb); cbplayback.Dock = Pos.Top; for (var i = 0; i < GLWindow.MotionArray.Length; i++) { var f = (GLWindow.MotionArray[i] / 40f); cbplayback.AddItem("Playback: " + f + "x", f.ToString(CultureInfo.InvariantCulture), f); } cbplayback.SelectByName(game.SettingDefaultPlayback.ToString(CultureInfo.InvariantCulture)); cbplayback.ItemSelected += (o, e) => { game.SettingDefaultPlayback = (float)e.SelectedItem.UserData; }; var cbslowmo = new ComboBox(gb); cbslowmo.Dock = Pos.Top; var fpsarray = new[] { 1, 2, 5, 10, 20 }; for (var i = 0; i < fpsarray.Length; i++) { cbslowmo.AddItem("Slowmo FPS: " + fpsarray[i], fpsarray[i].ToString(CultureInfo.InvariantCulture), fpsarray[i]); } cbslowmo.SelectByName(game.SettingSlowmoSpeed.ToString(CultureInfo.InvariantCulture)); cbslowmo.ItemSelected += (o, e) => { game.SettingSlowmoSpeed = (int)e.SelectedItem.UserData; }; //editor var backup = gb; gb = new GroupBox(container); gb.Text = "Editor"; gb.Width = 180; gb.Height = 170; marg = gb.Margin; marg.Bottom = 5; marg.Right = 5; gb.Margin = marg; Gwen.Align.PlaceDownLeft(gb, backup); //Gwen.Align.AlignRight(gb); lcb = new LabeledCheckBox(gb); marg = lcb.Margin; marg.Top += 5; lcb.Margin = marg; lcb.Text = "All Pink Lifelock"; lcb.IsChecked = Settings.Default.PinkLifelock; lcb.CheckChanged += (o, e) => { Settings.Default.PinkLifelock = ((LabeledCheckBox)o).IsChecked; Settings.Default.Save(); }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Disable Line Snap"; lcb.IsChecked = game.SettingDisableSnap; lcb.CheckChanged += (o, e) => { game.SettingDisableSnap = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Force XY Snap"; lcb.IsChecked = game.SettingForceXySnap; lcb.CheckChanged += (o, e) => { game.SettingForceXySnap = ((LabeledCheckBox)o).IsChecked; }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Superzoom"; lcb.IsChecked = Settings.Default.SuperZoom; lcb.CheckChanged += (o, e) => { Settings.Default.SuperZoom = ((LabeledCheckBox)o).IsChecked; Settings.Default.Save(); }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "White BG"; lcb.SetToolTipText(@"For if you're a bad person"); lcb.IsChecked = Settings.Default.WhiteBG; lcb.CheckChanged += (o, e) => { Settings.Default.WhiteBG = ((LabeledCheckBox)o).IsChecked; Settings.Default.Save(); if (!Settings.Default.NightMode) { GL.ClearColor(Settings.Default.WhiteBG ? GLWindow.ColorWhite : GLWindow.ColorOffwhite); } }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Night Mode"; lcb.IsChecked = Settings.Default.NightMode; lcb.CheckChanged += (o, e) => { if (((LabeledCheckBox)o).IsChecked) { GL.ClearColor(new Color4(50, 50, 60, 255)); } else { GL.ClearColor(Settings.Default.WhiteBG ? GLWindow.ColorWhite : GLWindow.ColorOffwhite); } Settings.Default.NightMode = ((LabeledCheckBox)o).IsChecked; Settings.Default.Save(); game.Canvas.ButtonsToggleNightmode(); game.Track.RefreshTrack(); }; lcb.Dock = Pos.Top; lcb = new LabeledCheckBox(gb); lcb.Text = "Live Line Editing"; lcb.SetToolTipText("For the line adjust tool during playback\r\nEnable this if you have a slow PC"); lcb.IsChecked = Settings.Default.LiveAdjustment; lcb.CheckChanged += (o, e) => { Settings.Default.LiveAdjustment = ((LabeledCheckBox)o).IsChecked; Settings.Default.Save(); }; lcb.Dock = Pos.Top; }
private void InitializeControls() { manager = new Manager(CurrGame, CurrGame.Graphics, "Green") { SkinDirectory = CurrGame.ApplicationDirectory + @"\Content\GUI\Skin\" }; try { manager.Initialize(); } catch (Exception) { throw; } manager.AutoCreateRenderTarget = true; Console = new Console(manager); Console.Init(); LoadConsoleCommands(); manager.Add(Console); Console.ChannelsVisible = false; Console.MessageSent += Console_MessageSent; Console.MessageFormat = ConsoleMessageFormats.None; Console.Width = manager.ScreenWidth; Console.Channels.Add(new ConsoleChannel(0, "[System]", Color.Orange)); Console.Channels.Add(new ConsoleChannel(1, "[User]", Color.White)); Console.Channels.Add(new ConsoleChannel(2, "[Error]", Color.DarkRed)); Console.SelectedChannel = 1; Console.Hide(); tabControl = new TabControl(manager); tabControl.Init(); tabControl.Left = CurrGame.CreepFieldWidth; tabControl.Top = 0; tabControl.Width = CurrGame.Width - CurrGame.CreepFieldWidth; tabControl.Height = CurrGame.Height; #region Gameplaypage GameplayPage = tabControl.AddPage(); GameplayPage.Init(); GameplayPage.Text = "Spiel"; #region Turmauswahl var thumbnailBox = new GroupBox(manager); thumbnailBox.Init(); thumbnailBox.Parent = GameplayPage; thumbnailBox.Left = 2; thumbnailBox.Top = 2; thumbnailBox.Width = thumbnailBox.Parent.Width - 4; thumbnailBox.Height = 100; int counter = 0; foreach (TowerClass towerClass in GamePlayScreen.TowerManager.TowerClassList) { var towerButton = new ImageButton(manager) { Image = GamePlayScreen.TowerManager.GetThumbnail(towerClass.TowerKey), SizeMode = SizeMode.Stretched, Top = 14, Tag = towerClass }; towerButton.Width = towerButton.Height = 60; towerButton.Left = 6 + counter * (towerButton.Width + 5); towerButton.Click += towerButton_Click; towerButton.MouseOver += towerButton_MouseOver; towerButton.MouseOut += towerButton_MouseOut; towerButton.Init(); thumbnailBox.Add(towerButton); BuyTowerButtons.Add(towerButton); counter++; } thumbnailBox.AutoScroll = true; var scrollBar = new ScrollBar(manager, Orientation.Horizontal); scrollBar.Init(); thumbnailBox.Add(scrollBar); scrollBar.Visible = false; #endregion #region Informationen var infoBox = new GroupBox(manager); infoBox.Init(); infoBox.Parent = GameplayPage; infoBox.Text = "Informationen"; infoBox.Width = infoBox.Parent.Width - 4; infoBox.Height = 110; infoBox.Left = 2; infoBox.Top = thumbnailBox.Top + thumbnailBox.Height + 2; CreepNumber = new Label(manager); CreepNumber.Init(); CreepNumber.Parent = infoBox; CreepNumber.Top = 14; CreepNumber.Left = 4; CreepNumber.Width = CreepNumber.Parent.Width - 4; CreepNumber.ToolTip = new ToolTip(manager) { Text = "So viele Creeps sind momentan\nauf dem Spielfeld" }; CreepNumber.Passive = false; CreepHealth = new Label(manager); CreepHealth.Init(); CreepHealth.Parent = infoBox; CreepHealth.Top = CreepNumber.Top + CreepNumber.Height + 2; CreepHealth.Left = CreepNumber.Left; CreepHealth.Width = CreepHealth.Parent.Width - 4; CreepHealth.ToolTip = new ToolTip(manager) { Text = "Die Gesamtenergie aller auf dem\nSpielfeld befindlicher Creeps" }; CreepHealth.Passive = false; Money = new Label(manager); Money.Init(); Money.Parent = infoBox; Money.Top = CreepHealth.Top + CreepHealth.Height + 2; Money.Left = CreepNumber.Left; Money.Width = Money.Parent.Width - 4; Money.ToolTip = new ToolTip(manager) { Text = "So viel Geld besitzt der Spieler" }; Money.Passive = false; OwnHealth = new Label(manager); OwnHealth.Init(); OwnHealth.Parent = infoBox; OwnHealth.Top = Money.Top + Money.Height + 2; OwnHealth.Left = CreepNumber.Left; OwnHealth.Width = OwnHealth.Parent.Width - 4; OwnHealth.ToolTip = new ToolTip(manager) { Text = "So viel Energie hat der Spieler noch" }; OwnHealth.Passive = false; Points = new Label(manager); Points.Init(); Points.Parent = infoBox; Points.Top = OwnHealth.Top + OwnHealth.Height + 2; Points.Left = CreepNumber.Left; Points.Width = Points.Parent.Width - 4; Points.ToolTip = new ToolTip(manager) { Text = "So viele Punkte hat der Spieler schon.\nDie Punkte setzen sich aus Energie\nund Geschwindigkeit der Creeps zusammen.\nJe näher ein Gegner am Ziel ist, desto mehr\nPunkte gibt er." }; Points.Passive = false; #endregion #region Waves var waveBox = new GroupBox(manager); waveBox.Init(); waveBox.Parent = GameplayPage; waveBox.Text = "Waves"; waveBox.Left = 2; waveBox.Top = infoBox.Top + infoBox.Height + 2; waveBox.Width = waveBox.Parent.Width - 4; waveBox.Height = 137; WaveNumber = new Label(manager); WaveNumber.Init(); WaveNumber.Parent = waveBox; WaveNumber.Top = 14; WaveNumber.Left = 4; WaveNumber.Width = WaveNumber.Parent.Width - 4; RealWaveNumber = new Label(manager); RealWaveNumber.Init(); RealWaveNumber.Parent = waveBox; RealWaveNumber.Top = WaveNumber.Top + WaveNumber.Height + 2; RealWaveNumber.Left = WaveNumber.Left; RealWaveNumber.Width = RealWaveNumber.Parent.Width - 4; CreepsLeft = new Label(manager); CreepsLeft.Init(); CreepsLeft.Parent = waveBox; CreepsLeft.Top = RealWaveNumber.Top + RealWaveNumber.Height + 2; CreepsLeft.Left = WaveNumber.Left; CreepsLeft.Width = CreepsLeft.Parent.Width - 4; CreepsLeft.Passive = false; CreepsLeft.ToolTip = new ToolTip(manager) { Text = "So viele Creeps werden noch im Level erscheinen,\nbevor die Aktuelle Welle vorbei ist." }; CreepHealthLevel = new Label(manager); CreepHealthLevel.Init(); CreepHealthLevel.Parent = waveBox; CreepHealthLevel.Top = CreepsLeft.Top + CreepsLeft.Height + 2; CreepHealthLevel.Left = WaveNumber.Left; CreepHealthLevel.Width = CreepHealthLevel.Parent.Width - 4; CreepHealthLevel.Passive = false; CreepHealthLevel.ToolTip = new ToolTip(manager) { Text = "Wenn alle Waves eines Levels fertig sind, werden die Waves von Anfang anwiederholt.\nAllerdings steigt die Energie der Creeps dabei.\nDas Gesundheitsniveau liegt dieser Energie zugrunde." }; TimeLeftNextWave = new Label(manager); TimeLeftNextWave.Init(); TimeLeftNextWave.Parent = waveBox; TimeLeftNextWave.Top = CreepHealthLevel.Top + CreepHealthLevel.Height + 2; TimeLeftNextWave.Left = WaveNumber.Left; TimeLeftNextWave.Width = TimeLeftNextWave.Parent.Width - 4; var nextWaveButton = new Button(manager); nextWaveButton.Init(); nextWaveButton.Parent = waveBox; nextWaveButton.Text = "Nächste Welle"; nextWaveButton.Left = 2; nextWaveButton.Top = TimeLeftNextWave.Top + TimeLeftNextWave.Height + 2; nextWaveButton.Width = nextWaveButton.Parent.Width - 4; nextWaveButton.Click += delegate { GamePlayScreen.StartNextWave(); }; #endregion #region Spielsteuerung var gameBox = new GroupBox(manager); gameBox.Init(); gameBox.Text = "Spielsteuerung"; gameBox.Parent = GameplayPage; gameBox.Width = gameBox.Parent.Width - 4; gameBox.Height = 200; gameBox.Left = 2; gameBox.Top = waveBox.Top + waveBox.Height + 2; var playButton = new ImageButton(manager) { Image = CurrGame.Content.Load <Texture2D>(CurrGame.ApplicationDirectory + "\\Content\\GUI\\play"), SizeMode = SizeMode.Stretched, Top = 14, Left = 2, Width = 50 }; playButton.Height = playButton.Width; playButton.Click += ((sender, e) => GamePlayScreen.StartGame()); playButton.Init(); var pauseButton = new ImageButton(manager) { Image = CurrGame.Content.Load <Texture2D>(CurrGame.ApplicationDirectory + "\\Content\\GUI\\pause"), SizeMode = SizeMode.Stretched, Top = 14, Left = playButton.Left + playButton.Width + 4 }; pauseButton.Width = pauseButton.Height = playButton.Width; pauseButton.Click += ((sender, e) => GamePlayScreen.StopGame()); pauseButton.Init(); gameBox.Add(playButton); gameBox.Add(pauseButton); #endregion RefreshGameInformation(); #endregion #region Optionspage OptionsPage = tabControl.AddPage(); OptionsPage.Text = "Optionen"; #endregion #region SaveLoadPage #endregion manager.Add(tabControl); }
public TaskDialog(Manager manager) : base(manager) { //Alpha = 200; Height = 520; MinimumWidth = 254; MinimumHeight = 160; Center(); TopPanel.Height = 80; TopPanel.BevelStyle = BevelStyle.None; TopPanel.BevelBorder = BevelBorder.None; Caption.Visible = false; Description.Visible = false; Text = "Dialog Template"; imgTop = new ImageBox(manager); imgTop.Init(); imgTop.Parent = TopPanel; imgTop.Top = 0; imgTop.Left = 0; imgTop.Width = TopPanel.ClientWidth; imgTop.Height = TopPanel.ClientHeight; imgTop.Anchor = Anchors.Left | Anchors.Top | Anchors.Right | Anchors.Bottom; imgTop.SizeMode = SizeMode.Normal; imgTop.Image = Manager.Content.Load <Texture2D>("Content\\Images\\Caption"); tbcMain = new TabControl(manager); tbcMain.Init(); tbcMain.Parent = this; tbcMain.Left = 4; tbcMain.Top = TopPanel.Height + 4; tbcMain.Width = ClientArea.Width - 8; tbcMain.Height = ClientArea.Height - 8 - TopPanel.Height - BottomPanel.Height; tbcMain.Anchor = Anchors.All; tbcMain.AddPage(); tbcMain.TabPages[0].Text = "First"; tbcMain.AddPage(); tbcMain.TabPages[1].Text = "Second"; tbcMain.AddPage(); tbcMain.TabPages[2].Text = "Third"; btnFirst = new Button(manager); btnFirst.Init(); btnFirst.Parent = tbcMain.TabPages[0]; btnFirst.Anchor = Anchors.Left | Anchors.Top | Anchors.Right; btnFirst.Top = 8; btnFirst.Left = 8; btnFirst.Width = btnFirst.Parent.ClientWidth - 16; btnFirst.Text = ">>> First Page Button <<<"; grpFirst = new GroupPanel(manager); grpFirst.Init(); grpFirst.Parent = tbcMain.TabPages[0]; grpFirst.Anchor = Anchors.All; //grpFirst.Type = GroupBoxType.Flat; grpFirst.Left = 8; grpFirst.Top = btnFirst.Top + btnFirst.Height + 4; grpFirst.Width = btnFirst.Parent.ClientWidth - 16; grpFirst.Height = btnFirst.Parent.ClientHeight - grpFirst.Top - 8; btnSecond = new Button(manager); btnSecond.Init(); btnSecond.Parent = tbcMain.TabPages[1]; btnSecond.Anchor = Anchors.Left | Anchors.Top | Anchors.Right; btnSecond.Top = 8; btnSecond.Left = 8; btnSecond.Width = btnSecond.Parent.ClientWidth - 16; btnSecond.Text = ">>> Second Page Button <<<"; btnThird = new Button(manager); btnThird.Init(); btnThird.Parent = tbcMain.TabPages[2]; btnThird.Anchor = Anchors.Left | Anchors.Top | Anchors.Right; btnThird.Top = 8; btnThird.Left = 8; btnThird.Width = btnThird.Parent.ClientWidth - 16; btnThird.Text = ">>> Third Page Button <<<"; btnOk = new Button(manager); btnOk.Init(); btnOk.Parent = BottomPanel; btnOk.Anchor = Anchors.Top | Anchors.Right; btnOk.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8; btnOk.Left = btnOk.Parent.ClientWidth - 8 - btnOk.Width * 3 - 8; btnOk.Text = "OK"; btnOk.ModalResult = ModalResult.Ok; btnApply = new Button(manager); btnApply.Init(); btnApply.Parent = BottomPanel; btnApply.Anchor = Anchors.Top | Anchors.Right; btnApply.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8; btnApply.Left = btnOk.Parent.ClientWidth - 4 - btnOk.Width * 2 - 8; btnApply.Text = "Apply"; btnClose = new Button(manager); btnClose.Init(); btnClose.Parent = BottomPanel; btnClose.Anchor = Anchors.Top | Anchors.Right; btnClose.Top = btnOk.Parent.ClientHeight - btnClose.Height - 8; btnClose.Left = btnOk.Parent.ClientWidth - btnClose.Width - 8; btnClose.Text = "Close"; btnClose.ModalResult = ModalResult.Cancel; btnFirst.Focused = true; }
public InventoryControl(GameScreen screen, Manager manager) : base(manager) { this.screen = screen; // Block images. blockImages = new ImageBox[inventorySlots]; selectImages = new ImageBox[inventorySlots]; normalWidth = ((inventorySlots + 1) * (Tile.Width + 2)) + 8; realWidth = Width = normalWidth; realHeight = Height = normalHeight; Left = Manager.TargetWidth / 2 - (Width / 2); Top = 0; Height += 1; // Background "gradient" image // TODO: Make an actual control. not a statusbar gradient = new StatusBar(manager); gradient.Init(); gradient.Width = Width; gradient.Height = Height; Add(gradient); // Create images. for (var i = 0; i < blockImages.Length; i++) { // Block icon image. blockImages[i] = new ImageBox(Manager) { Top = 4, // Center. Left = 12 + (Width / 2) - (((inventorySlots + 1) * (Tile.Width + 4)) / 2) + ((Tile.Width + 4) * i), Width = Tile.Width, Height = Tile.Width, Text = "", Passive = false }; // Select/border image. selectImages[i] = new ImageBox(Manager) { Top = 3, Left = 12 + (Width / 2) - (((inventorySlots + 1) * (Tile.Width + 4)) / 2) + ((Tile.Width + 4) * i) - 1, Width = Tile.Width + 2, Height = Tile.Width + 2, Text = "", Alpha = 128f, }; blockImages[i].Init(); selectImages[i].Init(); selectImages[i].Image = screen.Client.Content["gui.blockoutline"]; if (i < BlockType.Blocks.Count && BlockType.Blocks[i].IsRenderable) { blockImages[i].Image = BlockType.Blocks[i].Texture; blockImages[i].ToolTipType = typeof(BlockToolTip); ((BlockToolTip)blockImages[i].ToolTip).SetBlock(BlockType.Blocks[i]); } blockImages[i].SourceRect = BlockType.SourceRect; Add(selectImages[i]); Add(blockImages[i]); } SelectBlock(1); tabControl = new TabControl(Manager) { Left = 8, Top = 3 + Tile.FullHeight + 3, }; tabControl.Init(); tabControl.AddPage("Blocks"); tabControl.AddPage("Interactive"); tabControl.AddPage("Miscellaneous"); Add(tabControl); tabControl.BringToFront(); }
public OptionsWindow(BaseControl owner) : base(owner) { Font = CtlCommon.SmFont; Width = 480; Height = 390; WindowStyle = new WindowStyles(WindowStyles.wsScreenCenter, WindowStyles.wsModal, WindowStyles.wsKeyPreview); fPages = new TabControl(this); fPages.Left = 10; fPages.Top = 10; fPages.Width = Width - 20; fPages.Height = Height - 30 - 40; TabSheet ts = fPages.AddPage(BaseLocale.GetStr(RS.rs_CommonOptions)); ts.OnLangChange = GlobalVars.nwrWin.LangChange; ts.LangResID = 9; fSngVolume = new ScrollBar(ts); fSngVolume.Min = 0; fSngVolume.Max = 255; fSngVolume.Pos = 255; fSngVolume.OnChange = OnSongsVolumeChange; fSngVolume.Kind = ScrollBar.SBK_HORIZONTAL; fSngVolume.Width = ts.Width - 50; fSngVolume.Left = 25; fSngVolume.Top = 30; Label label = new Label(ts); label.Bounds = ExtRect.Create(25, 30 - 20, 25 + fSngVolume.Width, 30); label.LangResID = RS.rs_MusicVolume; label.OnLangChange = GlobalVars.nwrWin.LangChange; fSndVolume = new ScrollBar(ts); fSndVolume.Min = 0; fSndVolume.Max = 255; fSndVolume.Pos = 255; fSndVolume.OnChange = OnSoundsVolumeChange; fSndVolume.Kind = ScrollBar.SBK_HORIZONTAL; fSndVolume.Width = ts.Width - 50; fSndVolume.Left = 25; fSndVolume.Top = 70; label = new Label(ts); label.Bounds = ExtRect.Create(25, 70 - 20, 25 + fSndVolume.Width, 70); label.LangResID = RS.rs_SoundsVolume; label.OnLangChange = GlobalVars.nwrWin.LangChange; fNewStyle = new CheckBox(ts); fNewStyle.OnLangChange = GlobalVars.nwrWin.LangChange; fNewStyle.LangResID = 12; fNewStyle.Group = 1; fNewStyle.Left = 25; fNewStyle.Top = 100; fNewStyle.Width = Width - 50; fNewStyle.OnClick = OnNewStyleClick; fModernStyle = new CheckBox(ts); fModernStyle.OnLangChange = GlobalVars.nwrWin.LangChange; fModernStyle.LangResID = 13; fModernStyle.Group = 1; fModernStyle.Left = 225; fModernStyle.Top = 100; fModernStyle.Width = Width - 50; fModernStyle.OnClick = OnModernStyleClick; fHideLocMap = new CheckBox(ts); fHideLocMap.OnLangChange = GlobalVars.nwrWin.LangChange; fHideLocMap.LangResID = 14; fHideLocMap.Left = 25; fHideLocMap.Top = 130; fHideLocMap.Width = Width - 50; fHideLocMap.OnClick = OnHideLocMapClick; fHideCtlPanel = new CheckBox(ts); fHideCtlPanel.OnLangChange = GlobalVars.nwrWin.LangChange; fHideCtlPanel.LangResID = 15; fHideCtlPanel.Left = 25; fHideCtlPanel.Top = 160; fHideCtlPanel.Width = Width - 50; fHideCtlPanel.OnClick = OnHideCtlPanelClick; fHideInfoPanel = new CheckBox(ts); fHideInfoPanel.OnLangChange = GlobalVars.nwrWin.LangChange; fHideInfoPanel.LangResID = 16; fHideInfoPanel.Left = 25; fHideInfoPanel.Top = 190; fHideInfoPanel.Width = Width - 50; fHideInfoPanel.OnClick = OnHideInfoPanelClick; fInvOnlyIcons = new CheckBox(ts); fInvOnlyIcons.OnLangChange = GlobalVars.nwrWin.LangChange; fInvOnlyIcons.LangResID = 549; fInvOnlyIcons.Left = 25; fInvOnlyIcons.Top = 220; fInvOnlyIcons.Width = Width - 50; fInvOnlyIcons.OnClick = OnInvOnlyIconsClick; ts = fPages.AddPage(BaseLocale.GetStr(RS.rs_KeyOptions)); ts.OnLangChange = GlobalVars.nwrWin.LangChange; ts.LangResID = 10; fKeyList = new ListBox(ts); fKeyList.Mode = ListBox.MODE_REPORT; fKeyList.Left = 10; fKeyList.Top = 10; fKeyList.Width = ts.Width - 20; fKeyList.Height = ts.Height - 20; fKeyList.ColumnTitles.Add("name", 300); fKeyList.ColumnTitles.Add("key", 150); fKeyList.OnKeyDown = OnKeyListKeyDown; fKeyList.ShowHints = true; fKeyList.Hint = "hint"; ts = fPages.AddPage(BaseLocale.GetStr(RS.rs_GameplayOptions)); ts.OnLangChange = GlobalVars.nwrWin.LangChange; ts.LangResID = 11; fCircularFOV = new CheckBox(ts); fCircularFOV.OnLangChange = GlobalVars.nwrWin.LangChange; fCircularFOV.LangResID = 17; fCircularFOV.Left = 25; fCircularFOV.Top = 25; fCircularFOV.Width = Width - 50; fCircularFOV.OnClick = OnCircularFOVClick; fAutoPickup = new CheckBox(ts); fAutoPickup.OnLangChange = GlobalVars.nwrWin.LangChange; fAutoPickup.LangResID = 536; fAutoPickup.Left = 25; fAutoPickup.Top = 65; fAutoPickup.Width = Width - 50; fAutoPickup.OnClick = OnAutoPickupClick; fExtremeMode = new CheckBox(ts); fExtremeMode.OnLangChange = GlobalVars.nwrWin.LangChange; fExtremeMode.LangResID = 82; fExtremeMode.Left = 25; fExtremeMode.Top = 105; fExtremeMode.Width = Width - 50; fExtremeMode.OnClick = OnExtremeModeClick; ts = fPages.AddPage(BaseLocale.GetStr(RS.rs_Language)); ts.OnLangChange = GlobalVars.nwrWin.LangChange; ts.LangResID = 815; fLangList = new ListBox(ts); fLangList.Mode = ListBox.MODE_LIST; fLangList.Options = new LBOptions(LBOptions.lboChecks, LBOptions.lboRadioChecks); fLangList.Left = 10; fLangList.Top = 10; fLangList.Width = ts.Width - 20; fLangList.Height = ts.Height - 20; Locale locale = GlobalVars.nwrWin.Locale; int num = locale.LangsCount; for (int i = 0; i < num; i++) { fLangList.Items.Add(locale.GetLang(i).Name, null); } fLangList.OnItemSelect = OnLangSelect; fPages.TabIndex = 0; NWButton tRButton = new NWButton(this); tRButton.Width = 90; tRButton.Height = 30; tRButton.Left = Width - 90 - 20; tRButton.Top = Height - 30 - 20; tRButton.ImageFile = "itf/DlgBtn.tga"; tRButton.OnClick = OnBtnClose; tRButton.OnLangChange = GlobalVars.nwrWin.LangChange; tRButton.LangResID = 8; }
public override void Initialize() { base.Initialize(); string[] actions = new string[] { "Gegner suchen", "Deck bearbeiten", "noch ne Aktion", "Und noch eine", "keine Ahnung", "Ficken?", "Ok o.o", "blubb", "foo", "bar", "moepse sin toll", }; // just to refresh ScreenManager.MainWindow.BringToFront(); #region Links - Übersicht GroupPanel wnd = new GroupPanel(WindowManager); wnd.Init(); wnd.Text = "Übersicht"; wnd.TextColor = Color.LightGray; wnd.Width = 200; wnd.Height = ScreenManager.MainWindow.ClientHeight - 40; wnd.Top = 20; wnd.Left = 20; wnd.Visible = true; // Actions int btnWidth = 160; int btnHeight = 40; Button btn; for (int i = 0; i < actions.Length; i++) { btn = new Button(WindowManager); btn.Init(); btn.Width = btnWidth; btn.Height = btnHeight; btn.Left = 20; btn.Top = ((i * 20) + btnHeight * i) + 20; btn.Text = actions[i]; btn.Click += new WindowLibrary.Controls.EventHandler(ActionButton_Click); btn.Tag = i; wnd.Add(btn); } AddWindow(wnd); #endregion #region Rechts - Spiele & Statistik GroupPanel runingGamesPanel = new GroupPanel(WindowManager); runingGamesPanel.Init(); runingGamesPanel.Text = "Laufende Spiele"; runingGamesPanel.TextColor = Color.LightGray; runingGamesPanel.Width = 200; runingGamesPanel.Height = 400; runingGamesPanel.Top = 20; runingGamesPanel.Left = ScreenManager.MainWindow.ClientWidth - runingGamesPanel.Width - 20; runingGamesPanel.Visible = true; AddWindow(runingGamesPanel); GroupPanel statPanel = new GroupPanel(WindowManager); statPanel.Init(); statPanel.Text = "Statistik"; statPanel.TextColor = Color.LightGray; statPanel.Width = 200; statPanel.Height = ScreenManager.MainWindow.ClientHeight - 460; statPanel.Top = 440; statPanel.Left = ScreenManager.MainWindow.ClientWidth - statPanel.Width - 20; statPanel.Visible = true; AddWindow(statPanel); #endregion #region Mitte - Chat TabControl tbc = new TabControl(WindowManager); mConsole = new WindowLibrary.Controls.Console(WindowManager); tbc.Init(); tbc.AddPage("Allgemein"); tbc.Alpha = 200; tbc.Left = 240; tbc.Height = 220; tbc.Width = ScreenManager.MainWindow.ClientWidth - 480; tbc.Top = ScreenManager.MainWindow.ClientHeight - tbc.Height - 18; tbc.Movable = false; tbc.Resizable = false; tbc.MinimumHeight = 96; tbc.MinimumWidth = 160; tbc.TabPages[0].Add(mConsole); mConsole.Init(); mConsole.Width = tbc.TabPages[0].ClientWidth; mConsole.Height = tbc.TabPages[0].ClientHeight; mConsole.Anchor = EAnchors.All; mConsole.Channels.Add(new ConsoleChannel(0, "Allgemein", Color.White)); mConsole.SelectedChannel = 0; mConsole.MessageFormat = ConsoleMessageFormats.None; SendSystemMessage("Dein Login war erfolgreich!"); SendSystemMessage("Willkommen im InsaneRO Card Game ;D"); mConsole.MessageSent += new ConsoleMessageEventHandler(Channel1_MessageSent); AddWindow(tbc); #endregion GroupPanel newsPanel = new GroupPanel(WindowManager); newsPanel.Init(); newsPanel.Text = "InsaneRO News"; newsPanel.TextColor = Color.LightGray; newsPanel.Width = ScreenManager.MainWindow.ClientWidth - 480; newsPanel.Height = ScreenManager.MainWindow.ClientHeight - 40 - 220; newsPanel.Top = 20; newsPanel.Left = 240; newsPanel.Visible = true; newsPanel.AutoScroll = EAutoScroll.Vertical; AddWindow(newsPanel); LoadNews(); }
private void Setup() { Dictionary <string, bool> trackfeatures; using (var trk = _editor.CreateTrackReader()) { trackfeatures = trk.GetFeatures(); } TabControl tabs = new TabControl(this) { Dock = Dock.Fill }; var settings = tabs.AddPage("Settings"); var song = tabs.AddPage("Song"); _tree = new PropertyTree(settings) { Dock = Dock.Fill, }; var table = _tree.Add("Settings", 150); NumberProperty startzoom = new NumberProperty(null) { Min = 1, NumberValue = _editor.StartZoom, Max = Constants.MaxZoom, }; startzoom.ValueChanged += (o, e) => { _editor.StartZoom = (float)startzoom.NumberValue; }; table.Add("Start Zoom", startzoom); var zerostart = GwenHelper.AddPropertyCheckbox(table, "Zero Start", _editor.ZeroStart); zerostart.ValueChanged += (o, e) => { _editor.ZeroStart = zerostart.IsChecked; }; NumberProperty ygravity = new NumberProperty(null) { Min = float.MinValue + 1, Max = float.MaxValue - 1, }; ygravity.Value = ((float)_editor.YGravity).ToString(); ygravity.ValueChanged += (o, e) => { _editor.YGravity = float.Parse(ygravity.Value); }; table.Add("Y Gravity Multiplier", ygravity); NumberProperty xgravity = new NumberProperty(null) { Min = float.MinValue + 1, Max = float.MaxValue - 1, }; xgravity.Value = ((float)_editor.XGravity).ToString(); xgravity.ValueChanged += (o, e) => { _editor.XGravity = float.Parse(xgravity.Value); }; table.Add("X Gravity Multiplier", xgravity); NumberProperty gravitywellsize = new NumberProperty(null) { Min = 0, Max = double.MaxValue - 1, }; gravitywellsize.Value = ((double)_editor.GravityWellSize).ToString(); gravitywellsize.ValueChanged += (o, e) => { _editor.GravityWellSize = double.Parse(gravitywellsize.Value); }; table.Add("Gravity Well Size", gravitywellsize); //BG COLORS table = _tree.Add("Starting Background Color", 150); NumberProperty startbgred = new NumberProperty(null) { Min = 0, Max = 255 }; startbgred.Value = _editor.StartingBGColorR.ToString(); //Put value out here because putting it in the number property makes it get set to 100 for some reason??? startbgred.ValueChanged += (o, e) => { _editor.StartingBGColorR = int.Parse(startbgred.Value); }; table.Add("Background Red", startbgred); NumberProperty startbggreen = new NumberProperty(null) { Min = 0, Max = 255 }; startbggreen.Value = _editor.StartingBGColorG.ToString(); //Put value out here because putting it in the number property makes it get set to 100 for some reason??? startbggreen.ValueChanged += (o, e) => { _editor.StartingBGColorG = int.Parse(startbggreen.Value); }; table.Add("Background Green", startbggreen); NumberProperty startbgblue = new NumberProperty(null) { Min = 0, Max = 255 }; startbgblue.Value = _editor.StartingBGColorB.ToString(); //Put value out here because putting it in the number property makes it get set to 100 for some reason??? startbgblue.ValueChanged += (o, e) => { _editor.StartingBGColorB = int.Parse(startbgblue.Value); }; table.Add("Background Blue", startbgblue); //LINE COLORS table = _tree.Add("Starting Line Color", 150); NumberProperty startlinered = new NumberProperty(null) { Min = 0, Max = 255 }; startlinered.Value = _editor.StartingLineColorR.ToString(); //Put value out here because putting it in the number property makes it get set to 100 for some reason??? startlinered.ValueChanged += (o, e) => { _editor.StartingLineColorR = int.Parse(startlinered.Value); }; table.Add("Line Red", startlinered); NumberProperty startlinegreen = new NumberProperty(null) { Min = 0, Max = 255 }; startlinegreen.Value = _editor.StartingLineColorG.ToString(); //Put value out here because putting it in the number property makes it get set to 100 for some reason??? startlinegreen.ValueChanged += (o, e) => { _editor.StartingLineColorG = int.Parse(startlinegreen.Value); }; table.Add("Line Green", startlinegreen); NumberProperty startlineblue = new NumberProperty(null) { Min = 0, Max = 255 }; startlineblue.Value = _editor.StartingLineColorB.ToString(); //Put value out here because putting it in the number property makes it get set to 100 for some reason??? startlineblue.ValueChanged += (o, e) => { _editor.StartingLineColorB = int.Parse(startlineblue.Value); }; table.Add("Line Blue", startlineblue); table = _tree.Add("Info", 150); // var trackname = table.AddLabel("Track Name", _editor.Name); var physics = table.AddLabel("Physics", CheckFeature(trackfeatures, TrackFeatures.six_one) ? "6.1" : "6.2"); table.AddLabel("Blue Lines", _editor.BlueLines.ToString()); table.AddLabel("Red Lines", _editor.RedLines.ToString()); table.AddLabel("Scenery Lines", _editor.GreenLines.ToString()); table = _tree.Add("Features Used", 150); AddFeature(table, trackfeatures, "Red Multiplier", TrackFeatures.redmultiplier); AddFeature(table, trackfeatures, "Scenery Width", TrackFeatures.scenerywidth); AddFeature(table, trackfeatures, "Line Triggers", TrackFeatures.ignorable_trigger); table = _tree.Add("Physics Modifiers", 150); var remount = GwenHelper.AddPropertyCheckbox(table, "Remount", _editor.UseRemount); remount.ValueChanged += (o, e) => { _editor.UseRemount = remount.IsChecked; }; PopulateSong(song); _tree.ExpandAll(); // table.Add }