Skip to content
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

A possibility to open "General info" and "Global init" tabs as a new tab. #1092

Merged
merged 1 commit into from
Oct 31, 2022
Merged
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
19 changes: 17 additions & 2 deletions UndertaleModTool/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@
<MenuItem Header="Copy name to clipboard" Click="MenuItem_CopyName_Click"/>
<MenuItem Header="Delete" Click="MenuItem_Delete_Click"/>
</ContextMenu>
<ContextMenu x:Key="StandaloneTabMenu">
<MenuItem Header="Open in new tab" Click="MenuItem_OpenInNewTab_Click"/>
</ContextMenu>

<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#D4D4D4"/>
<Style TargetType="{x:Type TreeViewItem}">
Expand All @@ -253,8 +256,20 @@
</Style>
</TreeView.Resources>
<TreeViewItem Header="Data" IsExpanded="True">
<TreeViewItem Header="General info" Visibility="{Binding GeneralInfo, Converter={StaticResource VisibleIfNotNull}}"/>
<TreeViewItem Header="Global init" Visibility="{Binding GlobalInitScripts, Converter={StaticResource VisibleIfNotNull}}"/>
<TreeViewItem Header="General info" Visibility="{Binding GeneralInfo, Converter={StaticResource VisibleIfNotNull}}" Tag="StandaloneTab">
<TreeViewItem.Style>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="ContextMenu" Value="{StaticResource StandaloneTabMenu}"/>
</Style>
</TreeViewItem.Style>
</TreeViewItem>
<TreeViewItem Header="Global init" Visibility="{Binding GlobalInitScripts, Converter={StaticResource VisibleIfNotNull}}" Tag="StandaloneTab">
<TreeViewItem.Style>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="ContextMenu" Value="{StaticResource StandaloneTabMenu}"/>
</Style>
</TreeViewItem.Style>
</TreeViewItem>
<TreeViewItem Header="Game End scripts" Visibility="{Binding GameEndScripts, Converter={StaticResource VisibleIfNotNull}}"/>
<TreeViewItem Header="Audio groups" ItemsSource="{Binding AudioGroups, Converter={StaticResource FilteredViewConverter}}" Visibility="{Binding AudioGroups, Converter={StaticResource VisibleIfNotNull}}">
<TreeViewItem.ItemTemplate>
Expand Down
3 changes: 2 additions & 1 deletion UndertaleModTool/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,8 @@ private void MainTree_MouseDown(object sender, MouseButtonEventArgs e)

item.IsSelected = true;

if (item.DataContext is not UndertaleResource)
if (item.DataContext is not UndertaleResource
&& (item.Tag as string) != "StandaloneTab")
return;

OpenInTab(Highlighted, true);
Expand Down