diff --git a/Filtration.ObjectModel/BlockItemTypes/GemLevelBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/GemLevelBlockItem.cs index 35bc632..f12136d 100644 --- a/Filtration.ObjectModel/BlockItemTypes/GemLevelBlockItem.cs +++ b/Filtration.ObjectModel/BlockItemTypes/GemLevelBlockItem.cs @@ -23,6 +23,6 @@ namespace Filtration.ObjectModel.BlockItemTypes public override Color SummaryTextColor => Colors.White; public override int SortOrder => 15; public override int Minimum => 0; - public override int Maximum => 40; + public override int Maximum => 21; } } diff --git a/Filtration.Parser/Services/ItemFilterBlockTranslator.cs b/Filtration.Parser/Services/ItemFilterBlockTranslator.cs index 9f306fb..3e23653 100644 --- a/Filtration.Parser/Services/ItemFilterBlockTranslator.cs +++ b/Filtration.Parser/Services/ItemFilterBlockTranslator.cs @@ -299,7 +299,7 @@ namespace Filtration.Parser.Services } case "Icon": { - // Only ever use the last PlayAlertSound item encountered as multiples aren't valid. + // Only ever use the last Icon item encountered as multiples aren't valid. RemoveExistingBlockItemsOfType(block); var match = Regex.Match(trimmedLine, @"\S+\s+(\S+)"); @@ -593,10 +593,11 @@ namespace Filtration.Parser.Services } } + //TODO: Disabled for the time being. A better solution is needed. // Replace 'Maelström' to prevent encoding problems in other editors - outputString.Replace("Maelström Staff", "Maelstr"); - outputString.Replace("Maelström of Chaos", "Maelstr"); - outputString.Replace("Maelström", "Maelstr"); + //outputString.Replace("Maelström Staff", "Maelstr"); + //outputString.Replace("Maelström of Chaos", "Maelstr"); + //outputString.Replace("Maelström", "Maelstr"); return outputString; } diff --git a/Filtration.Parser/Services/ItemFilterScriptTranslator.cs b/Filtration.Parser/Services/ItemFilterScriptTranslator.cs index 6407226..dc2d967 100644 --- a/Filtration.Parser/Services/ItemFilterScriptTranslator.cs +++ b/Filtration.Parser/Services/ItemFilterScriptTranslator.cs @@ -245,6 +245,12 @@ namespace Filtration.Parser.Services // ReSharper disable once LoopCanBeConvertedToQuery foreach (var block in script.ItemFilterBlocks) { + // Do not save temporary block until the new feature is fully implemented + if(block is ObjectModel.BlockItemTypes.IconBlockItem) + { + continue; + } + outputString += _blockTranslator.TranslateItemFilterBlockBaseToString(block) + Environment.NewLine; if (Settings.Default.ExtraLineBetweenBlocks) diff --git a/Filtration/Converters/DropIconConverter.cs b/Filtration/Converters/DropIconConverter.cs index 1f4b21a..4caeffa 100644 --- a/Filtration/Converters/DropIconConverter.cs +++ b/Filtration/Converters/DropIconConverter.cs @@ -25,7 +25,7 @@ namespace Filtration.Converters return "/Filtration;component/Resources/DropIcons/Icon6.png"; } - return ""; + return "/Filtration;component/Resources/DropIcons/NoIcon.png"; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/Filtration/Filtration.csproj b/Filtration/Filtration.csproj index c6a582b..9b35e47 100644 --- a/Filtration/Filtration.csproj +++ b/Filtration/Filtration.csproj @@ -552,6 +552,7 @@ + diff --git a/Filtration/Resources/DropIcons/NoIcon.png b/Filtration/Resources/DropIcons/NoIcon.png new file mode 100644 index 0000000..fb56f36 Binary files /dev/null and b/Filtration/Resources/DropIcons/NoIcon.png differ diff --git a/Filtration/ViewModels/ItemFilterCommentBlockViewModel.cs b/Filtration/ViewModels/ItemFilterCommentBlockViewModel.cs index 9327788..618065a 100644 --- a/Filtration/ViewModels/ItemFilterCommentBlockViewModel.cs +++ b/Filtration/ViewModels/ItemFilterCommentBlockViewModel.cs @@ -8,12 +8,14 @@ namespace Filtration.ViewModels { IItemFilterCommentBlock ItemFilterCommentBlock { get; } string Comment { get; } - bool IsExpanded { get; set; } + bool IsExpanded { get; set; } + bool HasChild { get; set; } } internal class ItemFilterCommentBlockViewModel : ItemFilterBlockViewModelBase, IItemFilterCommentBlockViewModel { private bool _isExpanded; + private bool _hasChild; public ItemFilterCommentBlockViewModel() { @@ -79,7 +81,6 @@ namespace Filtration.ViewModels } } - public bool IsExpanded { get => _isExpanded; @@ -90,6 +91,16 @@ namespace Filtration.ViewModels } } + public bool HasChild + { + get => _hasChild; + set + { + _hasChild = value; + RaisePropertyChanged(); + } + } + private void OnToggleSectionCommand() { _parentScriptViewModel.ToggleSection(this); diff --git a/Filtration/ViewModels/ItemFilterScriptViewModel.cs b/Filtration/ViewModels/ItemFilterScriptViewModel.cs index 3ecb278..2d173b6 100644 --- a/Filtration/ViewModels/ItemFilterScriptViewModel.cs +++ b/Filtration/ViewModels/ItemFilterScriptViewModel.cs @@ -838,10 +838,11 @@ namespace Filtration.ViewModels var blockIndex = ItemFilterBlockViewModels.IndexOf(targetBlockViewModelBase) + 1; _scriptCommandManager.ExecuteCommand(new PasteSectionCommand(Script, blocksToPaste, targetBlockViewModelBase.BaseBlock)); + SelectedBlockViewModel = ItemFilterBlockViewModels[blockIndex]; + RaisePropertyChanged("SelectedBlockViewModel"); var firstBlockAsComment = blocksToPaste[0] as IItemFilterCommentBlock; if (firstBlockAsComment != null) { - SelectedBlockViewModel = ItemFilterBlockViewModels[blockIndex]; OnCollapseSectionCommand(); } } @@ -954,6 +955,8 @@ namespace Filtration.ViewModels if (ItemFilterBlockViewModels[blockIndex - 1].IsVisible) { _scriptCommandManager.ExecuteCommand(new MoveBlockUpCommand(Script, targetBlockViewModelBase?.BaseBlock)); + SelectedBlockViewModel = ItemFilterBlockViewModels[blockIndex - 1]; + RaisePropertyChanged("SelectedBlockViewModel"); } else { @@ -963,6 +966,8 @@ namespace Filtration.ViewModels aboveSectionStart--; } _scriptCommandManager.ExecuteCommand(new MoveSectionToIndexCommand(Script, blockIndex, 1, aboveSectionStart)); + SelectedBlockViewModel = ItemFilterBlockViewModels[aboveSectionStart]; + RaisePropertyChanged("SelectedBlockViewModel"); } } @@ -991,6 +996,7 @@ namespace Filtration.ViewModels ToggleSection(ItemFilterBlockViewModels[newLocation] as IItemFilterCommentBlockViewModel); SelectedBlockViewModel = ItemFilterBlockViewModels[newLocation]; + RaisePropertyChanged("SelectedBlockViewModel"); } private void OnMoveBlockDownCommand() @@ -1013,6 +1019,8 @@ namespace Filtration.ViewModels if (beloveBlockAsComment == null || beloveBlockAsComment.IsExpanded) { _scriptCommandManager.ExecuteCommand(new MoveBlockDownCommand(Script, targetBlockViewModelBase?.BaseBlock)); + SelectedBlockViewModel = ItemFilterBlockViewModels[blockIndex + 1]; + RaisePropertyChanged("SelectedBlockViewModel"); } else { @@ -1022,6 +1030,8 @@ namespace Filtration.ViewModels beloveSectionEnd++; } _scriptCommandManager.ExecuteCommand(new MoveSectionToIndexCommand(Script, blockIndex, 1, beloveSectionEnd - 1)); + SelectedBlockViewModel = ItemFilterBlockViewModels[beloveSectionEnd - 1]; + RaisePropertyChanged("SelectedBlockViewModel"); } } @@ -1056,6 +1066,7 @@ namespace Filtration.ViewModels ToggleSection(ItemFilterBlockViewModels[newLocation] as IItemFilterCommentBlockViewModel); SelectedBlockViewModel = ItemFilterBlockViewModels[newLocation]; + RaisePropertyChanged("SelectedBlockViewModel"); } private void OnMoveBlockToBottomCommand() @@ -1304,11 +1315,26 @@ namespace Filtration.ViewModels private void UpdateBlockModelsForView() { ObservableCollection blocksForView = new ObservableCollection(); - foreach (var block in ItemFilterBlockViewModels) + for (var i = 0; i < ItemFilterBlockViewModels.Count; i++) { + var block = ItemFilterBlockViewModels[i]; if (block.IsVisible) { blocksForView.Add(block); + + var blockAsComment = block as IItemFilterCommentBlockViewModel; + if(blockAsComment != null && i < (ItemFilterBlockViewModels.Count - 1)) + { + var followingBlock = ItemFilterBlockViewModels[i + 1] as IItemFilterBlockViewModel; + if(followingBlock != null) + { + blockAsComment.HasChild = true; + } + else + { + blockAsComment.HasChild = false; + } + } } } diff --git a/Filtration/Views/ItemFilterCommentBlockView.xaml b/Filtration/Views/ItemFilterCommentBlockView.xaml index 2989243..e8a521e 100644 --- a/Filtration/Views/ItemFilterCommentBlockView.xaml +++ b/Filtration/Views/ItemFilterCommentBlockView.xaml @@ -44,7 +44,7 @@ - + @@ -81,45 +81,46 @@ Style="{StaticResource ExpanderRightAlignStyle}" x:Name="BlockExpander"> - + + + + + + + + + - - - - - + + + - - - - - - - - - +