mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
RCON Broadcast Mode
- Added RCON broadcast mode selection to ASM global settings. - Added new Mode selection method to ServerApp, so the correct command is used.
This commit is contained in:
parent
35d8153236
commit
dc830c602c
9 changed files with 149 additions and 107 deletions
|
|
@ -798,6 +798,11 @@
|
|||
<cctl:AnnotatedSlider Grid.Row="6" Grid.Column="0" Margin="0" Label="{DynamicResource GlobalSettings_LoggingMaxArchiveDaysLabel}" Value="{Binding Config.LoggingMaxArchiveDays}" Minimum="1" Maximum="365" SmallChange="1" LargeChange="5" TickFrequency="5" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" SuffixRelativeMinWidth="40" Suffix="{DynamicResource SliderUnits_Days}" ToolTip="{DynamicResource GlobalSettings_LoggingMaxArchiveDaysTooltip}" IsEnabled="{Binding Config.LoggingEnabled}"/>
|
||||
|
||||
<cctl:AnnotatedSlider Grid.Row="7" Grid.Column="0" Margin="0" Label="{DynamicResource GlobalSettings_LoggingMaxArchiveFilesLabel}" Value="{Binding Config.LoggingMaxArchiveFiles}" Minimum="1" Maximum="1000" SmallChange="1" LargeChange="5" TickFrequency="5" LabelRelativeWidth="Auto" SliderRelativeWidth="15*" SuffixRelativeWidth="Auto" SuffixRelativeMinWidth="40" Suffix="{DynamicResource SliderUnits_Files}" ToolTip="{DynamicResource GlobalSettings_LoggingMaxArchiveFilesTooltip}" IsEnabled="{Binding Config.LoggingEnabled}"/>
|
||||
|
||||
<StackPanel Grid.Row="7" Grid.Column="1" Margin="0" Orientation="Horizontal">
|
||||
<Label Content="{DynamicResource GlobalSettings_RCON_ModeLabel}" VerticalAlignment="Center"/>
|
||||
<ComboBox Name="RconMessageModesComboBox" Margin="5" ItemsSource="{Binding ElementName=GlobalSettings, Path=RconMessageModes}" SelectedValue="{Binding Config.RCON_MessageCommand}" ToolTip="{DynamicResource GlobalSettings_RCON_ModeTooltip}" SelectedValuePath="ValueMember" DisplayMemberPath="DisplayMember" PreviewMouseWheel="ComboBox_PreviewMouseWheel"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ namespace ServerManagerTool
|
|||
public static readonly DependencyProperty WindowStatesServerMonitorProperty = DependencyProperty.Register(nameof(WindowStatesServerMonitor), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty DiscordBotLogLevelsProperty = DependencyProperty.Register(nameof(DiscordBotLogLevels), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty DiscordBotWhitelistProperty = DependencyProperty.Register(nameof(DiscordBotWhitelist), typeof(List<DiscordBotWhitelistItem>), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty RconMessageModesProperty = DependencyProperty.Register(nameof(RconMessageModes), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
|
||||
public GlobalSettingsControl()
|
||||
{
|
||||
|
|
@ -52,6 +53,7 @@ namespace ServerManagerTool
|
|||
PopulateWindowsStatesMainWindowComboBox();
|
||||
PopulateWindowsStatesServerMonitorWindowComboBox();
|
||||
PopulateDiscordBotLogLevelsComboBox();
|
||||
PopulateRconMessageModesComboBox();
|
||||
|
||||
DiscordBotWhitelist = new List<DiscordBotWhitelistItem>();
|
||||
if (Config.DiscordBotWhitelist != null)
|
||||
|
|
@ -116,6 +118,12 @@ namespace ServerManagerTool
|
|||
set { SetValue(DiscordBotWhitelistProperty, value); }
|
||||
}
|
||||
|
||||
public ComboBoxItemList RconMessageModes
|
||||
{
|
||||
get { return (ComboBoxItemList)GetValue(RconMessageModesProperty); }
|
||||
set { SetValue(RconMessageModesProperty, value); }
|
||||
}
|
||||
|
||||
public void ApplyChangesToConfig()
|
||||
{
|
||||
if (Config.DiscordBotWhitelist is null)
|
||||
|
|
@ -412,6 +420,7 @@ namespace ServerManagerTool
|
|||
|
||||
PopulateWindowsStatesMainWindowComboBox();
|
||||
PopulateWindowsStatesServerMonitorWindowComboBox();
|
||||
PopulateRconMessageModesComboBox();
|
||||
|
||||
App.Instance.OnResourceDictionaryChanged(Config.CultureName);
|
||||
}
|
||||
|
|
@ -552,6 +561,27 @@ namespace ServerManagerTool
|
|||
}
|
||||
}
|
||||
|
||||
private void PopulateRconMessageModesComboBox()
|
||||
{
|
||||
var selectedValue = this.RconMessageModesComboBox?.SelectedValue ?? Config.RCON_MessageCommand;
|
||||
var list = new ComboBoxItemList();
|
||||
|
||||
foreach (InputMode inputMode in Enum.GetValues(typeof(InputMode)))
|
||||
{
|
||||
if (inputMode == InputMode.Command)
|
||||
continue;
|
||||
|
||||
var displayMember = _globalizer.GetResourceString($"InputMode_{inputMode}") ?? inputMode.ToString();
|
||||
list.Add(new Common.Model.ComboBoxItem(inputMode.ToString(), displayMember));
|
||||
}
|
||||
|
||||
this.RconMessageModes = list;
|
||||
if (this.RconMessageModesComboBox != null)
|
||||
{
|
||||
this.RconMessageModesComboBox.SelectedValue = selectedValue;
|
||||
}
|
||||
}
|
||||
|
||||
#region Discord Bot Whitelist
|
||||
private void AddDiscordBotWhitelist_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue