Skip to content

Commit

Permalink
Add missing warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MidoriKami committed Jul 13, 2024
1 parent 7c876fe commit a549d26
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Configuration/ConfigurationManagerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class ConfigurationManagerWindow : Window.Window, IDisposable {
[PluginService] private ITextureProvider TextureProvider { get; set; } = null!;
[PluginService] private INotificationManager NotificationManager { get; set; } = null!;
[PluginService] private IPluginLog Log { get; set; } = null!;
[PluginService] private IClientState ClientState { get; set; } = null!;
[PluginService] private IChatGui ChatGui { get; set; } = null!;

private List<CharacterConfiguration> characters = [];

Expand Down Expand Up @@ -169,9 +171,19 @@ private void ShowCharacterMultiSelectWindow() {
MultiSelectionCallback = selectedCharacters => {
destinationCharacters = selectedCharacters;

if (selectedSourceCharacter != null && destinationCharacters is not null && destinationCharacters.Contains(selectedSourceCharacter)) {
destinationCharacters.Remove(selectedSourceCharacter);
}
destinationCharacters.RemoveAll(character => {
if (character == selectedSourceCharacter) {
ChatGui.PrintError("Unable to select same source and target character.", PluginInterface.InternalName, 45);
return true;
}

if (character.ContentId == ClientState.LocalContentId) {
ChatGui.PrintError("Unable to select currently logged in character as target.", PluginInterface.InternalName, 45);
return true;
}

return false;
});
},
SelectionOptions = characters.ToList(),
});
Expand Down

0 comments on commit a549d26

Please sign in to comment.