private void ChannelListView_OnMouseUp(object sender, MouseButtonEventArgs e) { if (e.ChangedButton != MouseButton.Left) { return; } if (!(ChannelListView.SelectedItem is ChatTypeConfiguration configEntry)) { return; } var channelSetup = new ChatChannelSetup(configEntry); channelSetup.ShowDialog(); if (channelSetup.Result == null) { return; } var featureConfig = DalamudSettings.DiscordFeatureConfig; //featureConfig.ChatTypeConfigurations = featureConfig.ChatTypeConfigurations.Where(x => !x.CompareEx(configEntry)).ToList(); featureConfig.ChatTypeConfigurations.RemoveAt(ChannelListView.SelectedIndex); featureConfig.ChatTypeConfigurations.Add(channelSetup.Result); ChannelListView.ItemsSource = featureConfig.ChatTypeConfigurations; DalamudSettings.DiscordFeatureConfig = featureConfig; }
private void AddChannelConfig_OnClick(object sender, RoutedEventArgs e) { var channelSetup = new ChatChannelSetup(); channelSetup.ShowDialog(); if (channelSetup.Result == null) { return; } var featureConfig = DalamudSettings.DiscordFeatureConfig; featureConfig.ChatTypeConfigurations.Add(channelSetup.Result); ChannelListView.ItemsSource = featureConfig.ChatTypeConfigurations; DalamudSettings.DiscordFeatureConfig = featureConfig; }
private void SetCfPreferredRoleChannel_OnClick(object sender, RoutedEventArgs e) { var featureConfig = DalamudSettings.DiscordFeatureConfig; var channelConfig = featureConfig.CfPreferredRoleChannel ?? new ChannelConfiguration(); var channelSetup = new ChatChannelSetup(channelConfig); channelSetup.ShowDialog(); if (channelSetup.Result == null) { return; } featureConfig.CfPreferredRoleChannel = channelSetup.Result.Channel; DalamudSettings.DiscordFeatureConfig = featureConfig; }
private void SetRetainerNotificationChannel_OnClick(object sender, RoutedEventArgs e) { var featureConfig = Settings.DiscordFeatureConfig; var channelConfig = featureConfig.RetainerNotificationChannel ?? new ChannelConfiguration(); var channelSetup = new ChatChannelSetup(channelConfig); channelSetup.ShowDialog(); if (channelSetup.Result == null) { return; } featureConfig.RetainerNotificationChannel = channelSetup.Result.Channel; Settings.DiscordFeatureConfig = featureConfig; }