private FrameworkElement CreateTab() { var minDistanceEditBox = new TextBox(); _minDistanceEditBox = minDistanceEditBox; minDistanceEditBox.Width = 60; minDistanceEditBox.Text = _app.Config.MidAirCutMinDistance.ToString(); minDistanceEditBox.ToolTip = "The minimum distance between the position where the projectile was shot from and the impact position. Setting it to 0 will not filter based on distance."; var minAirTimeEditBox = new TextBox(); _minAirTimeEditBox = minAirTimeEditBox; minAirTimeEditBox.Width = 60; minAirTimeEditBox.Text = _app.Config.MidAirCutMinAirTimeMs.ToString(); minAirTimeEditBox.ToolTip = "The minimum amount of time the victim was in the air prior to the hit, in milli-seconds."; var allowRocketsCheckBox = new CheckBox(); _allowRocketsCheckBox = allowRocketsCheckBox; allowRocketsCheckBox.HorizontalAlignment = HorizontalAlignment.Left; allowRocketsCheckBox.VerticalAlignment = VerticalAlignment.Center; allowRocketsCheckBox.IsChecked = _app.Config.MidAirCutAllowRocket; var allowBFGsCheckBox = new CheckBox(); _allowBFGsCheckBox = allowBFGsCheckBox; allowBFGsCheckBox.HorizontalAlignment = HorizontalAlignment.Left; allowBFGsCheckBox.VerticalAlignment = VerticalAlignment.Center; allowBFGsCheckBox.IsChecked = _app.Config.MidAirCutAllowBFG; var rulesPanelList = new List <Tuple <FrameworkElement, FrameworkElement> >(); rulesPanelList.Add(App.CreateTuple("Allow Rockets?", allowRocketsCheckBox)); rulesPanelList.Add(App.CreateTuple("Allow BFG?", allowBFGsCheckBox)); rulesPanelList.Add(App.CreateTuple("Min. Distance", minDistanceEditBox)); rulesPanelList.Add(App.CreateTuple("Min. Air Time [ms]", minAirTimeEditBox)); var rulesPanel = WpfHelper.CreateDualColumnPanel(rulesPanelList, 120, 5); rulesPanel.HorizontalAlignment = HorizontalAlignment.Center; rulesPanel.VerticalAlignment = VerticalAlignment.Center; var rulesGroupBox = new GroupBox(); rulesGroupBox.Header = "Frag Rules"; rulesGroupBox.HorizontalAlignment = HorizontalAlignment.Left; rulesGroupBox.VerticalAlignment = VerticalAlignment.Top; rulesGroupBox.Margin = new Thickness(5); rulesGroupBox.Content = rulesPanel; var actionsGroupBox = CutByPatternComponent.CreateActionsGroupBox(UDT_DLL.udtPatternType.MidAirFrags); var helpTextBlock = new TextBlock(); helpTextBlock.Margin = new Thickness(5); helpTextBlock.TextWrapping = TextWrapping.WrapWithOverflow; helpTextBlock.Text = "Recommended minimum value for victim air time: 300 ms" + "\nRecommended minimum value for projectile distance: 300 \"Quake units\"" + "\n\nIf you set a low min. distance like 300, it would be recommended to set the air time to be at least 600." + "\nAlternatively, if you set a low min. air time like 300, it would be recommended to set the min. distance to at least 600."; var helpGroupBox = new GroupBox(); helpGroupBox.Margin = new Thickness(5); helpGroupBox.Header = "Help"; helpGroupBox.HorizontalAlignment = HorizontalAlignment.Left; helpGroupBox.VerticalAlignment = VerticalAlignment.Top; helpGroupBox.Content = helpTextBlock; var rootPanel = new WrapPanel(); rootPanel.HorizontalAlignment = HorizontalAlignment.Stretch; rootPanel.VerticalAlignment = VerticalAlignment.Stretch; rootPanel.Margin = new Thickness(5); rootPanel.Orientation = Orientation.Horizontal; rootPanel.Children.Add(rulesGroupBox); rootPanel.Children.Add(actionsGroupBox); rootPanel.Children.Add(helpGroupBox); var scrollViewer = new ScrollViewer(); scrollViewer.HorizontalAlignment = HorizontalAlignment.Stretch; scrollViewer.VerticalAlignment = VerticalAlignment.Stretch; scrollViewer.Margin = new Thickness(5); scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; scrollViewer.Content = rootPanel; return(scrollViewer); }
private FrameworkElement CreateTab() { var minCarryTimeTextBox = new TextBox(); _minCarryTimeTextBox = minCarryTimeTextBox; minCarryTimeTextBox.Width = 50; minCarryTimeTextBox.Text = App.FormatMinutesSeconds(_app.Config.FlagCaptureMinCarryTimeMs / 1000); minCarryTimeTextBox.ToolTip = "seconds OR minutes:seconds"; var maxCarryTimeTextBox = new TextBox(); _maxCarryTimeTextBox = maxCarryTimeTextBox; maxCarryTimeTextBox.Width = 50; maxCarryTimeTextBox.Text = App.FormatMinutesSeconds(_app.Config.FlagCaptureMaxCarryTimeMs / 1000); maxCarryTimeTextBox.ToolTip = "seconds OR minutes:seconds"; var allowBaseToBaseCheckBox = new CheckBox(); _allowBaseToBaseCheckBox = allowBaseToBaseCheckBox; allowBaseToBaseCheckBox.VerticalAlignment = VerticalAlignment.Center; allowBaseToBaseCheckBox.IsChecked = _app.Config.FlagCaptureAllowBaseToBase; allowBaseToBaseCheckBox.Content = " Allow flag pick-ups from the flag's return position?"; var allowMissingToBaseCheckBox = new CheckBox(); _allowMissingToBaseCheckBox = allowMissingToBaseCheckBox; allowMissingToBaseCheckBox.VerticalAlignment = VerticalAlignment.Center; allowMissingToBaseCheckBox.IsChecked = _app.Config.FlagCaptureAllowMissingToBase; allowMissingToBaseCheckBox.Content = " Allow flag pick-ups not from the flag's return position?"; var rulesPanelList = new List <Tuple <FrameworkElement, FrameworkElement> >(); rulesPanelList.Add(App.CreateTuple("Min. Carry Time", minCarryTimeTextBox)); rulesPanelList.Add(App.CreateTuple("Max. Carry Time", maxCarryTimeTextBox)); rulesPanelList.Add(App.CreateTuple("Base Pick-ups?", allowBaseToBaseCheckBox)); rulesPanelList.Add(App.CreateTuple("Non-base Pick-ups?", allowMissingToBaseCheckBox)); var rulesPanel = WpfHelper.CreateDualColumnPanel(rulesPanelList, 120, 5); rulesPanel.HorizontalAlignment = HorizontalAlignment.Center; rulesPanel.VerticalAlignment = VerticalAlignment.Center; var rulesGroupBox = new GroupBox(); rulesGroupBox.Header = "Capture Rules"; rulesGroupBox.HorizontalAlignment = HorizontalAlignment.Left; rulesGroupBox.VerticalAlignment = VerticalAlignment.Top; rulesGroupBox.Margin = new Thickness(5); rulesGroupBox.Content = rulesPanel; var actionsGroupBox = CutByPatternComponent.CreateActionsGroupBox(UDT_DLL.udtPatternType.FlagCaptures); var rootPanel = new WrapPanel(); rootPanel.HorizontalAlignment = HorizontalAlignment.Stretch; rootPanel.VerticalAlignment = VerticalAlignment.Stretch; rootPanel.Margin = new Thickness(5); rootPanel.Orientation = Orientation.Horizontal; rootPanel.Children.Add(rulesGroupBox); rootPanel.Children.Add(actionsGroupBox); var scrollViewer = new ScrollViewer(); scrollViewer.HorizontalAlignment = HorizontalAlignment.Stretch; scrollViewer.VerticalAlignment = VerticalAlignment.Stretch; scrollViewer.Margin = new Thickness(5); scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; scrollViewer.Content = rootPanel; return(scrollViewer); }
private FrameworkElement CreateTab() { var config = _app.Config; var minSpeedEditBox = new TextBox(); _minSpeedEditBox = minSpeedEditBox; minSpeedEditBox.HorizontalAlignment = HorizontalAlignment.Left; minSpeedEditBox.VerticalAlignment = VerticalAlignment.Top; minSpeedEditBox.Width = 60; minSpeedEditBox.Text = config.FlickRailMinSpeed.ToString(); minSpeedEditBox.ToolTip = "Angular velocity threshold, in degrees per second."; var minAngleDeltaEditBox = new TextBox(); _minAngleDeltaEditBox = minAngleDeltaEditBox; minAngleDeltaEditBox.HorizontalAlignment = HorizontalAlignment.Left; minAngleDeltaEditBox.VerticalAlignment = VerticalAlignment.Top; minAngleDeltaEditBox.Width = 60; minAngleDeltaEditBox.Text = config.FlickRailMinAngleDelta.ToString(); minAngleDeltaEditBox.ToolTip = "Absolute angle difference threshold, in degrees."; _minSpeedSnapsComboBox = CreateSnapshotCountComboBox(config.FlickRailMinSpeedSnaps); _minAngleDeltaSnapsComboBox = CreateSnapshotCountComboBox(config.FlickRailMinAngleDeltaSnaps); var rulesPanelList = new List <Tuple <FrameworkElement, FrameworkElement> >(); rulesPanelList.Add(App.CreateTuple("Min. Speed", minSpeedEditBox)); rulesPanelList.Add(App.CreateTuple("Speed Snapshots", _minSpeedSnapsComboBox)); rulesPanelList.Add(App.CreateTuple("Min. Angle Delta", minAngleDeltaEditBox)); rulesPanelList.Add(App.CreateTuple("Angle Delta Snapshots", _minAngleDeltaSnapsComboBox)); var rulesPanel = WpfHelper.CreateDualColumnPanel(rulesPanelList, 120, 5); rulesPanel.HorizontalAlignment = HorizontalAlignment.Center; rulesPanel.VerticalAlignment = VerticalAlignment.Center; var rulesGroupBox = new GroupBox(); rulesGroupBox.Header = "Flick Rail Rules"; rulesGroupBox.HorizontalAlignment = HorizontalAlignment.Left; rulesGroupBox.VerticalAlignment = VerticalAlignment.Top; rulesGroupBox.Margin = new Thickness(5); rulesGroupBox.Content = rulesPanel; var actionsGroupBox = CutByPatternComponent.CreateActionsGroupBox(UDT_DLL.udtPatternType.FlickRails); var helpTextBlock = new TextBlock(); helpTextBlock.Margin = new Thickness(5); helpTextBlock.TextWrapping = TextWrapping.WrapWithOverflow; helpTextBlock.Text = "Recommended minimum value for angular velocity:" + "\n- 800 degrees/second for a fast flick shot" + "\n- 500 degrees/second for a reasonably fast flick shot" + "\n\nRecommended minimum angle delta for a good flick shot:" + "\n- 50 degrees if over the duration of 2 snapshots in Quake 3 (snapshot duration: usually 33 ms)" + "\n- 37 degrees if over the duration of 2 snapshots in Quake Live (snapshot duration: 25 ms)" + "\n\nNote that:" + "\n- Min. Angle Delta is linearly dependent on Angle Delta Snapshots" + "\n- Min. Speed is independent of Speed Snapshots" + "\n\nIf you don't care about the minimum angle, set Min. Angle Delta to 0 and just tune the Min. Speed value."; rulesPanelList.Add(App.CreateTuple("Min. Speed", minSpeedEditBox)); rulesPanelList.Add(App.CreateTuple("Speed Snapshots", _minSpeedSnapsComboBox)); rulesPanelList.Add(App.CreateTuple("Min. Angle Delta", minAngleDeltaEditBox)); rulesPanelList.Add(App.CreateTuple("Angle Delta Snapshots", _minAngleDeltaSnapsComboBox)); var helpGroupBox = new GroupBox(); helpGroupBox.Margin = new Thickness(5); helpGroupBox.Header = "Help"; helpGroupBox.HorizontalAlignment = HorizontalAlignment.Left; helpGroupBox.VerticalAlignment = VerticalAlignment.Top; helpGroupBox.Content = helpTextBlock; var rootPanel = new WrapPanel(); rootPanel.HorizontalAlignment = HorizontalAlignment.Stretch; rootPanel.VerticalAlignment = VerticalAlignment.Stretch; rootPanel.Margin = new Thickness(5); rootPanel.Orientation = Orientation.Horizontal; rootPanel.Children.Add(rulesGroupBox); rootPanel.Children.Add(actionsGroupBox); rootPanel.Children.Add(helpGroupBox); var scrollViewer = new ScrollViewer(); scrollViewer.HorizontalAlignment = HorizontalAlignment.Stretch; scrollViewer.VerticalAlignment = VerticalAlignment.Stretch; scrollViewer.Margin = new Thickness(5); scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; scrollViewer.Content = rootPanel; return(scrollViewer); }
private FrameworkElement CreateTab() { var startTimeOffsetTextBox = new TextBox(); _startTimeOffsetTextBox = startTimeOffsetTextBox; startTimeOffsetTextBox.Width = 50; startTimeOffsetTextBox.Text = App.FormatMinutesSeconds(_app.Config.MatchCutStartTimeOffsetMs / 1000); startTimeOffsetTextBox.ToolTip = "seconds OR minutes:seconds"; var endTimeOffsetTextBox = new TextBox(); _endTimeOffsetTextBox = endTimeOffsetTextBox; endTimeOffsetTextBox.Width = 50; endTimeOffsetTextBox.Text = App.FormatMinutesSeconds(_app.Config.MatchCutEndTimeOffsetMs / 1000); endTimeOffsetTextBox.ToolTip = "seconds OR minutes:seconds"; var rulesPanelList = new List <Tuple <FrameworkElement, FrameworkElement> >(); rulesPanelList.Add(App.CreateTuple("Start Time Offset", startTimeOffsetTextBox)); rulesPanelList.Add(App.CreateTuple("End Time Offset", endTimeOffsetTextBox)); var rulesPanel = WpfHelper.CreateDualColumnPanel(rulesPanelList, 120, 5); rulesPanel.HorizontalAlignment = HorizontalAlignment.Center; rulesPanel.VerticalAlignment = VerticalAlignment.Center; var rulesGroupBox = new GroupBox(); rulesGroupBox.Header = "Match Cut Rules"; rulesGroupBox.HorizontalAlignment = HorizontalAlignment.Left; rulesGroupBox.VerticalAlignment = VerticalAlignment.Top; rulesGroupBox.Margin = new Thickness(5); rulesGroupBox.Content = rulesPanel; var actionsGroupBox = CutByPatternComponent.CreateActionsGroupBox(UDT_DLL.udtPatternType.Matches); var helpTextBlock = new TextBlock(); helpTextBlock.Margin = new Thickness(5); helpTextBlock.TextWrapping = TextWrapping.WrapWithOverflow; helpTextBlock.Text = "This cut filter is there to help create a new demo for every match in the demo.\n\n" + "The 'Start Time Offset' field is only applied if no pre-match count-down is found.\n" + "The 'End Time Offset' field is only applied if no post-match intermission is found."; var helpGroupBox = new GroupBox(); helpGroupBox.Margin = new Thickness(5); helpGroupBox.Header = "Help"; helpGroupBox.HorizontalAlignment = HorizontalAlignment.Left; helpGroupBox.VerticalAlignment = VerticalAlignment.Top; helpGroupBox.Content = helpTextBlock; var rootPanel = new WrapPanel(); rootPanel.HorizontalAlignment = HorizontalAlignment.Stretch; rootPanel.VerticalAlignment = VerticalAlignment.Stretch; rootPanel.Margin = new Thickness(5); rootPanel.Orientation = Orientation.Horizontal; rootPanel.Children.Add(rulesGroupBox); rootPanel.Children.Add(actionsGroupBox); rootPanel.Children.Add(helpGroupBox); var scrollViewer = new ScrollViewer(); scrollViewer.HorizontalAlignment = HorizontalAlignment.Stretch; scrollViewer.VerticalAlignment = VerticalAlignment.Stretch; scrollViewer.Margin = new Thickness(5); scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; scrollViewer.Content = rootPanel; return(scrollViewer); }
private FrameworkElement CreateCutByChatTab() { var chatRulesGridView = new GridView(); chatRulesGridView.AllowsColumnReorder = false; chatRulesGridView.Columns.Add(new GridViewColumn { Header = "Operator", Width = 90, DisplayMemberBinding = new Binding("Operator") }); chatRulesGridView.Columns.Add(new GridViewColumn { Header = "Pattern", Width = 155, DisplayMemberBinding = new Binding("Pattern") }); chatRulesGridView.Columns.Add(new GridViewColumn { Header = "Case Sens.", Width = 80, DisplayMemberBinding = new Binding("CaseSensitive") }); chatRulesGridView.Columns.Add(new GridViewColumn { Header = "No Colors", Width = 80, DisplayMemberBinding = new Binding("IgnoreColors") }); chatRulesGridView.Columns.Add(new GridViewColumn { Header = "Team", Width = 70, DisplayMemberBinding = new Binding("SearchTeam") }); var chatRulesListView = new DemoInfoListView(); _chatRulesListView = chatRulesListView; chatRulesListView.HorizontalAlignment = HorizontalAlignment.Stretch; chatRulesListView.VerticalAlignment = VerticalAlignment.Stretch; chatRulesListView.Margin = new Thickness(5); chatRulesListView.View = chatRulesGridView; chatRulesListView.SelectionMode = SelectionMode.Single; chatRulesListView.Width = 485; foreach (var rule in _app.Config.ChatRules) { chatRulesListView.Items.Add(new ChatRuleDisplayInfo(rule)); } var addButton = new Button(); addButton.Content = "Add"; addButton.Width = 75; addButton.Height = 25; addButton.Margin = new Thickness(0, 0, 0, 5); addButton.Click += (obj, args) => OnAddChatRuleClicked(); var editButton = new Button(); editButton.Content = "Edit"; editButton.Width = 75; editButton.Height = 25; editButton.Margin = new Thickness(0, 0, 0, 5); editButton.Click += (obj, args) => OnEditChatRuleClicked(); var removeButton = new Button(); removeButton.Content = "Remove"; removeButton.Width = 75; removeButton.Height = 25; removeButton.Margin = new Thickness(0, 0, 0, 5); removeButton.Click += (obj, args) => OnRemoveChatRuleClicked(); var chatRulesVerPanel = new StackPanel(); chatRulesVerPanel.HorizontalAlignment = HorizontalAlignment.Stretch; chatRulesVerPanel.VerticalAlignment = VerticalAlignment.Stretch; chatRulesVerPanel.Margin = new Thickness(5); chatRulesVerPanel.Orientation = Orientation.Vertical; chatRulesVerPanel.Children.Add(addButton); chatRulesVerPanel.Children.Add(editButton); chatRulesVerPanel.Children.Add(removeButton); var chatRulesHorPanel = new StackPanel(); chatRulesHorPanel.HorizontalAlignment = HorizontalAlignment.Stretch; chatRulesHorPanel.VerticalAlignment = VerticalAlignment.Stretch; chatRulesHorPanel.Margin = new Thickness(5); chatRulesHorPanel.Orientation = Orientation.Horizontal; chatRulesHorPanel.Children.Add(chatRulesListView); chatRulesHorPanel.Children.Add(chatRulesVerPanel); var chatRulesGroupBox = new GroupBox(); chatRulesGroupBox.Header = "Chat Rules"; chatRulesGroupBox.HorizontalAlignment = HorizontalAlignment.Stretch; chatRulesGroupBox.VerticalAlignment = VerticalAlignment.Stretch; chatRulesGroupBox.Margin = new Thickness(5); chatRulesGroupBox.Content = chatRulesHorPanel; var actionsGroupBox = CutByPatternComponent.CreateActionsGroupBox(UDT_DLL.udtPatternType.Chat); var helpTextBlock = new TextBlock(); helpTextBlock.Margin = new Thickness(5); helpTextBlock.TextWrapping = TextWrapping.WrapWithOverflow; helpTextBlock.Text = "A cut section is created if the chat message matches any of the rules." + "\nIn other words, rules are logically ORed, not ANDed:" + "\ncreate_cut = match(message, rule_1) OR match(message, rule_2) OR ... OR match(message, rule_N)"; var helpGroupBox = new GroupBox(); helpGroupBox.HorizontalAlignment = HorizontalAlignment.Left; helpGroupBox.VerticalAlignment = VerticalAlignment.Top; helpGroupBox.Margin = new Thickness(5); helpGroupBox.Header = "Help"; helpGroupBox.Content = helpTextBlock; var rootPanel = new WrapPanel(); rootPanel.HorizontalAlignment = HorizontalAlignment.Stretch; rootPanel.VerticalAlignment = VerticalAlignment.Stretch; rootPanel.Margin = new Thickness(5); rootPanel.Orientation = Orientation.Horizontal; rootPanel.Children.Add(chatRulesGroupBox); rootPanel.Children.Add(actionsGroupBox); rootPanel.Children.Add(helpGroupBox); var scrollViewer = new ScrollViewer(); scrollViewer.HorizontalAlignment = HorizontalAlignment.Stretch; scrollViewer.VerticalAlignment = VerticalAlignment.Stretch; scrollViewer.Margin = new Thickness(5); scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; scrollViewer.Content = rootPanel; return(scrollViewer); }
private FrameworkElement CreateCutByFragTab() { _playerMODFilters = new FilterGroupBox("Cause of Death Filters", UDT_DLL.udtStringArray.PlayerMeansOfDeath, 3); // @TODO: Power-up Filters var minFragCountEditBox = new TextBox(); _minFragCountEditBox = minFragCountEditBox; minFragCountEditBox.Width = 40; minFragCountEditBox.Text = _app.Config.FragCutMinFragCount.ToString(); var timeBetweenFragsEditBox = new TextBox(); _timeBetweenFragsEditBox = timeBetweenFragsEditBox; timeBetweenFragsEditBox.Width = 40; timeBetweenFragsEditBox.Text = _app.Config.FragCutTimeBetweenFrags.ToString(); var allowSelfKillsCheckBox = new CheckBox(); _allowSelfKillsCheckBox = allowSelfKillsCheckBox; allowSelfKillsCheckBox.HorizontalAlignment = HorizontalAlignment.Left; allowSelfKillsCheckBox.VerticalAlignment = VerticalAlignment.Center; allowSelfKillsCheckBox.IsChecked = _app.Config.FragCutAllowSelfKills; allowSelfKillsCheckBox.ToolTip = "Self kills are suicides where the player shot himself with a weapon"; var allowTeamKillsCheckBox = new CheckBox(); _allowTeamKillsCheckBox = allowTeamKillsCheckBox; allowTeamKillsCheckBox.HorizontalAlignment = HorizontalAlignment.Left; allowTeamKillsCheckBox.VerticalAlignment = VerticalAlignment.Center; allowTeamKillsCheckBox.IsChecked = _app.Config.FragCutAllowTeamKills; var allowAnyDeathCheckBox = new CheckBox(); _allowAnyDeathCheckBox = allowAnyDeathCheckBox; allowAnyDeathCheckBox.HorizontalAlignment = HorizontalAlignment.Left; allowAnyDeathCheckBox.VerticalAlignment = VerticalAlignment.Center; allowAnyDeathCheckBox.IsChecked = _app.Config.FragCutAllowAnyDeath; allowAnyDeathCheckBox.ToolTip = "This includes suicides where the killer is the world: lava, fall damage, hurt triggers, etc"; var rulesPanelList = new List <Tuple <FrameworkElement, FrameworkElement> >(); rulesPanelList.Add(App.CreateTuple("Min. Frag Count", minFragCountEditBox)); rulesPanelList.Add(App.CreateTuple("Max. Time Between Frags [s]", timeBetweenFragsEditBox)); rulesPanelList.Add(App.CreateTuple("Allow Self Kills?", allowSelfKillsCheckBox)); rulesPanelList.Add(App.CreateTuple("Allow Any Death?", allowAnyDeathCheckBox)); rulesPanelList.Add(App.CreateTuple("Allow Team Kills?", allowTeamKillsCheckBox)); var rulesPanel = WpfHelper.CreateDualColumnPanel(rulesPanelList, 175, 5); rulesPanel.HorizontalAlignment = HorizontalAlignment.Center; rulesPanel.VerticalAlignment = VerticalAlignment.Center; var rulesGroupBox = new GroupBox(); rulesGroupBox.Header = "Frag Rules"; rulesGroupBox.HorizontalAlignment = HorizontalAlignment.Left; rulesGroupBox.VerticalAlignment = VerticalAlignment.Top; rulesGroupBox.Margin = new Thickness(5); rulesGroupBox.Content = rulesPanel; var actionsGroupBox = CutByPatternComponent.CreateActionsGroupBox(UDT_DLL.udtPatternType.FragSequences); var helpTextBlock = new TextBlock(); helpTextBlock.Margin = new Thickness(5); helpTextBlock.TextWrapping = TextWrapping.WrapWithOverflow; helpTextBlock.Text = "Self-kills are suicides where the player shot himself with a weapon." + "\nDeaths can include 'suicides' where the killer is the world: lava, fall damage, hurt triggers, etc."; var helpGroupBox = new GroupBox(); helpGroupBox.Margin = new Thickness(5); helpGroupBox.Header = "Help"; helpGroupBox.HorizontalAlignment = HorizontalAlignment.Left; helpGroupBox.VerticalAlignment = VerticalAlignment.Top; helpGroupBox.Content = helpTextBlock; var rootPanel = new WrapPanel(); rootPanel.HorizontalAlignment = HorizontalAlignment.Stretch; rootPanel.VerticalAlignment = VerticalAlignment.Stretch; rootPanel.Margin = new Thickness(5); rootPanel.Orientation = Orientation.Horizontal; rootPanel.Children.Add(rulesGroupBox); rootPanel.Children.Add(actionsGroupBox); rootPanel.Children.Add(helpGroupBox); rootPanel.Children.Add(new WpfHelper.WrapPanelNewLine()); rootPanel.Children.Add(_playerMODFilters.RootElement); var scrollViewer = new ScrollViewer(); scrollViewer.HorizontalAlignment = HorizontalAlignment.Stretch; scrollViewer.VerticalAlignment = VerticalAlignment.Stretch; scrollViewer.Margin = new Thickness(5); scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; scrollViewer.Content = rootPanel; return(scrollViewer); }
private FrameworkElement CreateTab() { var minCount = _app.Config.MultiRailCutMinFragCount; var minCountIndex = 0; if (minCount >= 2 && minCount <= 8) { minCountIndex = minCount - 2; } var minFragCountComboBox = new ComboBox(); _minFragCountComboBox = minFragCountComboBox; minFragCountComboBox.MinWidth = 40; for (var i = 2; i <= 8; ++i) { minFragCountComboBox.Items.Add(i.ToString()); } minFragCountComboBox.SelectedIndex = minCountIndex; var rulesPanelList = new List <Tuple <FrameworkElement, FrameworkElement> >(); rulesPanelList.Add(App.CreateTuple("Min. Frag Count", minFragCountComboBox)); var rulesPanel = WpfHelper.CreateDualColumnPanel(rulesPanelList, 120, 5); rulesPanel.HorizontalAlignment = HorizontalAlignment.Center; rulesPanel.VerticalAlignment = VerticalAlignment.Center; var rulesGroupBox = new GroupBox(); rulesGroupBox.Header = "Frag Rules"; rulesGroupBox.HorizontalAlignment = HorizontalAlignment.Left; rulesGroupBox.VerticalAlignment = VerticalAlignment.Top; rulesGroupBox.Margin = new Thickness(5); rulesGroupBox.Content = rulesPanel; var actionsGroupBox = CutByPatternComponent.CreateActionsGroupBox(UDT_DLL.udtPatternType.MultiFragRails); var helpTextBlock = new TextBlock(); helpTextBlock.Margin = new Thickness(5); helpTextBlock.TextWrapping = TextWrapping.WrapWithOverflow; helpTextBlock.Text = "A \"multi-frag rail\" is a railgun shot that kills at least 2 players."; var helpGroupBox = new GroupBox(); helpGroupBox.Margin = new Thickness(5); helpGroupBox.Header = "Help"; helpGroupBox.HorizontalAlignment = HorizontalAlignment.Left; helpGroupBox.VerticalAlignment = VerticalAlignment.Top; helpGroupBox.Content = helpTextBlock; var rootPanel = new WrapPanel(); rootPanel.HorizontalAlignment = HorizontalAlignment.Stretch; rootPanel.VerticalAlignment = VerticalAlignment.Stretch; rootPanel.Margin = new Thickness(5); rootPanel.Orientation = Orientation.Horizontal; rootPanel.Children.Add(rulesGroupBox); rootPanel.Children.Add(actionsGroupBox); rootPanel.Children.Add(helpGroupBox); var scrollViewer = new ScrollViewer(); scrollViewer.HorizontalAlignment = HorizontalAlignment.Stretch; scrollViewer.VerticalAlignment = VerticalAlignment.Stretch; scrollViewer.Margin = new Thickness(5); scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; scrollViewer.Content = rootPanel; return(scrollViewer); }