Skip to content

Fix for FloatingEntites Treeview #586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Torch.Server/ViewModels/SessionSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ public class SessionSettingsViewModel : ViewModel

[Torch.Views.Display(Description = "Enables system for weather", Name = "Enable Weather System", GroupName = "Others")]
public bool EnableWeatherSystem { get => _settings.WeatherSystem; set => SetValue(ref _settings.WeatherSystem, value); }

[Torch.Views.Display(Description = "Enable temporary containers to spawn after destroying a block with inventory.", Name = "Temporary Containers", GroupName = "Others")]
public bool EnableTemporaryContainers { get => _settings.TemporaryContainers; set => SetValue(ref _settings.TemporaryContainers, value); }

public SessionSettingsViewModel(MyObjectBuilder_SessionSettings settings)
{
Expand Down
15 changes: 9 additions & 6 deletions Torch.Server/Views/EntitiesControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,16 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TreeView Grid.Row="0" Grid.Column="0" Margin="3" DockPanel.Dock="Top"
SelectedItemChanged="TreeView_FloatingObjects_OnSelectionItemChanged"
TreeViewItem.Expanded="TreeViewItem_OnExpanded" Name="EntityTree_FloatingObjects">
<TreeViewItem ItemsSource="{Binding Path=SortedFloatingObjects}">
<TreeView Grid.Row="0" Grid.Column="0" Margin="3" DockPanel.Dock="Top" TreeViewItem.Expanded="TreeViewItem_OnExpanded" Name="EntityTree_FloatingObjects">
<TreeViewItem ItemsSource="{Binding Path=SortedFloatingObjects, Mode=OneWay}">
<TreeViewItem.Header>
<TextBlock Text="{Binding VoxelMaps.Count, StringFormat=Floating Objects ({0})}" />
<TextBlock Text="{Binding FloatingObjects.Count, StringFormat=Floating Objects ({0}), Mode=OneWay}" />
</TreeViewItem.Header>
<TreeViewItem.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding DescriptiveName, Mode=OneWay}" />
</DataTemplate>
</TreeViewItem.ItemTemplate>
</TreeViewItem>
</TreeView>

Expand All @@ -243,7 +246,7 @@
<Button Content="Delete Floating objects" Click="DeleteFloating_OnClick" IsEnabled="{Binding CurrentEntity.CanStop}" Margin="3" />
</StackPanel>
</Grid>
<Frame Grid.Column="1" x:Name="EditorFrame_FloatingObjects" Margin="3" NavigationUIVisibility="Hidden" />
<Frame Grid.Column="1" x:Name="EditorFrame_FloatingObjects" Margin="3" NavigationUIVisibility="Hidden" /> <!-- Will leave this here for optional future update. -->
<GridSplitter Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Stretch" ShowsPreview="True" Width="2" />
</Grid>
</TabItem>
Expand Down