mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
First steps toward highlighting folders and files with special states
This commit is contained in:
@ -2321,6 +2321,19 @@
|
||||
ContentSource="Header"/>
|
||||
</StackPanel>
|
||||
<ComboBox Name="CompilerFileStateListbox" ItemsSource="{wj:EnumToItemsSource {x:Type wj:CompilerFileState}}" DisplayMemberPath="DisplayName" SelectedValue="{Binding Path=CompilerFileState, RelativeSource={RelativeSource TemplatedParent}}" SelectedValuePath="Value" Grid.Column="2"/>
|
||||
<Grid.Style>
|
||||
<Style TargetType="Grid">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Path=SpecialFileState, RelativeSource={RelativeSource TemplatedParent}}" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource PrimaryVariantBrush}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Grid.Style>
|
||||
<!--
|
||||
<Grid.Triggers>
|
||||
</Grid.Triggers>
|
||||
-->
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
@ -51,12 +51,22 @@ namespace Wabbajack
|
||||
}
|
||||
public class FileTreeViewItemVM : TreeViewItem
|
||||
{
|
||||
public int Depth { get; set; }
|
||||
private CompilerFileState _compilerFileState = CompilerFileState.AutoMatch;
|
||||
public FileSystemInfo Info { get; set; }
|
||||
public bool IsDirectory { get; set; }
|
||||
public Symbol Symbol { get; set; }
|
||||
public CompilerFileState CompilerFileState { get; set; }
|
||||
public CompilerFileState CompilerFileState
|
||||
{
|
||||
get => _compilerFileState;
|
||||
set
|
||||
{
|
||||
_compilerFileState = value;
|
||||
SpecialFileState = _compilerFileState != CompilerFileState.AutoMatch;
|
||||
}
|
||||
}
|
||||
|
||||
public RelativePath PathRelativeToRoot { get; set; }
|
||||
[Reactive] public bool SpecialFileState { get; set; }
|
||||
public FileTreeViewItemVM(DirectoryInfo info)
|
||||
{
|
||||
Info = info;
|
||||
@ -84,6 +94,7 @@ namespace Wabbajack
|
||||
".esp" or ".esl" or ".esm" or ".archive" => Symbol.DocumentTable,
|
||||
_ => Symbol.Document
|
||||
};
|
||||
SpecialFileState = CompilerFileState != CompilerFileState.AutoMatch;
|
||||
}
|
||||
public override string ToString() => Info.FullName;
|
||||
}
|
||||
@ -158,7 +169,15 @@ namespace Wabbajack
|
||||
else if(Settings.Include.Contains(item.PathRelativeToRoot)) { item.CompilerFileState = CompilerFileState.Include; }
|
||||
else if(Settings.Ignore.Contains(item.PathRelativeToRoot)) { item.CompilerFileState = CompilerFileState.Ignore; }
|
||||
else if(Settings.AlwaysEnabled.Contains(item.PathRelativeToRoot)) { item.CompilerFileState = CompilerFileState.AlwaysEnabled; }
|
||||
|
||||
item.SpecialFileState = item.CompilerFileState != CompilerFileState.AutoMatch;
|
||||
while(!item.SpecialFileState)
|
||||
{
|
||||
item.SpecialFileState = Settings.NoMatchInclude.Any(p => item.PathRelativeToRoot.InFolder(p));
|
||||
item.SpecialFileState = Settings.Include.Any(p => item.PathRelativeToRoot.InFolder(p));
|
||||
item.SpecialFileState = Settings.Ignore.Any(p => item.PathRelativeToRoot.InFolder(p));
|
||||
item.SpecialFileState = Settings.AlwaysEnabled.Any(p => item.PathRelativeToRoot.InFolder(p));
|
||||
break;
|
||||
}
|
||||
return item;
|
||||
})
|
||||
.Concat(parent.EnumerateFiles()
|
||||
|
Reference in New Issue
Block a user