Skip to content

Commit 1845435

Browse files
committed
Delete floating objects button
1 parent 2900a6c commit 1845435

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎Torch.Server/Views/EntitiesControl.xaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
<StackPanel Grid.Row="2" DockPanel.Dock="Bottom">
9191
<Button Content="Delete" Click="Delete_OnClick" IsEnabled="{Binding CurrentEntity.CanDelete}"
9292
Margin="3" />
93+
<Button Content="Delete Floating objects" Click="DeleteFloating_OnClick" IsEnabled="{Binding CurrentEntity.CanStop}" Margin="3" />
9394
<Button Content="Stop" Click="Stop_OnClick" IsEnabled="{Binding CurrentEntity.CanStop}" Margin="3" />
9495
</StackPanel>
9596
</Grid>

‎Torch.Server/Views/EntitiesControl.xaml.cs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,11 @@ private void SortCombo_SelectionChanged(object sender, SelectionChangedEventArgs
107107
i.DescriptiveName = i.GetSortedName(sort);
108108

109109
}
110+
111+
private void DeleteFloating_OnClick(object sender, RoutedEventArgs e)
112+
{
113+
foreach (var i in Entities.SortedFloatingObjects)
114+
TorchBase.Instance.Invoke(() => i?.Delete());
115+
}
110116
}
111117
}

0 commit comments

Comments
 (0)