From 3c643eb07b1b2050070d3c9812c44680222e1d0a Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 6 Jun 2015 13:16:59 +0100 Subject: [PATCH] Removed FontAwesome dependency, added new icons --- Filtration/App.xaml | 13 --- Filtration/App.xaml.cs | 11 +- Filtration/Filtration.csproj | 37 +++--- Filtration/Properties/Resources.Designer.cs | 110 ++++++++++++++++++ Filtration/Properties/Resources.resx | 51 ++++++-- .../{ => AlertSounds}/AlertSound1.wav | Bin .../{ => AlertSounds}/AlertSound2.wav | Bin .../{ => AlertSounds}/AlertSound3.wav | Bin .../{ => AlertSounds}/AlertSound4.wav | Bin .../{ => AlertSounds}/AlertSound5.wav | Bin .../{ => AlertSounds}/AlertSound6.wav | Bin .../{ => AlertSounds}/AlertSound7.wav | Bin .../{ => AlertSounds}/AlertSound8.wav | Bin .../{ => AlertSounds}/AlertSound9.wav | Bin Filtration/Resources/Icons/add_block_icon.png | Bin 0 -> 269 bytes .../Resources/Icons/add_section_icon.png | Bin 0 -> 319 bytes .../Resources/Icons/arrow_down_large_icon.png | Bin 0 -> 238 bytes .../Resources/Icons/arrow_down_small_icon.png | Bin 0 -> 221 bytes .../Resources/Icons/arrow_up_large_icon.png | Bin 0 -> 230 bytes .../Resources/Icons/arrow_up_small_icon.png | Bin 0 -> 225 bytes Filtration/Resources/Icons/copy_icon.png | Bin 0 -> 194 bytes Filtration/Resources/Icons/delete_icon.png | Bin 0 -> 523 bytes Filtration/Resources/Icons/new_icon.png | Bin 0 -> 270 bytes Filtration/Resources/Icons/open_icon.png | Bin 0 -> 411 bytes Filtration/Resources/Icons/paste_icon.png | Bin 0 -> 265 bytes Filtration/Resources/Icons/play_icon.png | Bin 0 -> 247 bytes Filtration/Resources/Icons/save_all_icon.png | Bin 0 -> 2954 bytes Filtration/Resources/Icons/save_icon.png | Bin 0 -> 2923 bytes Filtration/Resources/Icons/speaker_icon.png | Bin 0 -> 1619 bytes .../ViewModels/LootFilterBlockViewModel.cs | 22 ++-- .../ViewModels/LootFilterScriptViewModel.cs | 92 +++++++++++---- Filtration/ViewModels/MainWindowViewModel.cs | 19 ++- .../LootFilterBlockDisplaySettingsView.xaml | 3 +- Filtration/Views/LootFilterBlockView.xaml | 28 ++--- Filtration/Views/LootFilterScriptView.xaml | 18 +-- Filtration/Views/LootFilterScriptView.xaml.cs | 3 +- Filtration/Views/MainWindow.xaml | 31 ++++- Filtration/Views/MainWindow.xaml.cs | 9 ++ Filtration/packages.config | 1 - 39 files changed, 345 insertions(+), 103 deletions(-) rename Filtration/Resources/{ => AlertSounds}/AlertSound1.wav (100%) rename Filtration/Resources/{ => AlertSounds}/AlertSound2.wav (100%) rename Filtration/Resources/{ => AlertSounds}/AlertSound3.wav (100%) rename Filtration/Resources/{ => AlertSounds}/AlertSound4.wav (100%) rename Filtration/Resources/{ => AlertSounds}/AlertSound5.wav (100%) rename Filtration/Resources/{ => AlertSounds}/AlertSound6.wav (100%) rename Filtration/Resources/{ => AlertSounds}/AlertSound7.wav (100%) rename Filtration/Resources/{ => AlertSounds}/AlertSound8.wav (100%) rename Filtration/Resources/{ => AlertSounds}/AlertSound9.wav (100%) create mode 100644 Filtration/Resources/Icons/add_block_icon.png create mode 100644 Filtration/Resources/Icons/add_section_icon.png create mode 100644 Filtration/Resources/Icons/arrow_down_large_icon.png create mode 100644 Filtration/Resources/Icons/arrow_down_small_icon.png create mode 100644 Filtration/Resources/Icons/arrow_up_large_icon.png create mode 100644 Filtration/Resources/Icons/arrow_up_small_icon.png create mode 100644 Filtration/Resources/Icons/copy_icon.png create mode 100644 Filtration/Resources/Icons/delete_icon.png create mode 100644 Filtration/Resources/Icons/new_icon.png create mode 100644 Filtration/Resources/Icons/open_icon.png create mode 100644 Filtration/Resources/Icons/paste_icon.png create mode 100644 Filtration/Resources/Icons/play_icon.png create mode 100644 Filtration/Resources/Icons/save_all_icon.png create mode 100644 Filtration/Resources/Icons/save_icon.png create mode 100644 Filtration/Resources/Icons/speaker_icon.png diff --git a/Filtration/App.xaml b/Filtration/App.xaml index f12e2dd..d5b0159 100644 --- a/Filtration/App.xaml +++ b/Filtration/App.xaml @@ -12,19 +12,6 @@ - - - - - - - - - - - - - diff --git a/Filtration/App.xaml.cs b/Filtration/App.xaml.cs index fcc31ba..ead2fca 100644 --- a/Filtration/App.xaml.cs +++ b/Filtration/App.xaml.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System; +using System.Linq; using System.Windows; using Castle.MicroKernel.ModelBuilder.Inspectors; using Castle.Windsor; @@ -26,6 +27,14 @@ namespace Filtration var mainWindow = _container.Resolve(); mainWindow.Show(); + + //String[] arguments = Environment.GetCommandLineArgs(); + + //if (arguments.GetLength(0) <= 1) return; + //if (!arguments[1].EndsWith(".filter")) return; + + //var filePathFormMainArgs = arguments[1]; + //mainWindow.OpenScriptFromCommandLineArgument(filePathFormMainArgs); } protected override void OnExit(ExitEventArgs e) diff --git a/Filtration/Filtration.csproj b/Filtration/Filtration.csproj index 93d0910..e298fff 100644 --- a/Filtration/Filtration.csproj +++ b/Filtration/Filtration.csproj @@ -41,10 +41,6 @@ ..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll - - False - ..\packages\FontAwesome.WPF.4.3.0.2\lib\FontAwesome.WPF.dll - False ..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.dll @@ -254,9 +250,24 @@ - + PreserveNewest + + + + + + + + + + + + + + + Always @@ -265,42 +276,42 @@ - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest diff --git a/Filtration/Properties/Resources.Designer.cs b/Filtration/Properties/Resources.Designer.cs index 63336cf..a5b8c53 100644 --- a/Filtration/Properties/Resources.Designer.cs +++ b/Filtration/Properties/Resources.Designer.cs @@ -60,6 +60,26 @@ namespace Filtration.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap add_block_icon { + get { + object obj = ResourceManager.GetObject("add_block_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap add_section_icon { + get { + object obj = ResourceManager.GetObject("add_section_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// @@ -141,6 +161,26 @@ namespace Filtration.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap copy_icon { + get { + object obj = ResourceManager.GetObject("copy_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap delete_icon { + get { + object obj = ResourceManager.GetObject("delete_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// @@ -160,5 +200,75 @@ namespace Filtration.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap new_icon { + get { + object obj = ResourceManager.GetObject("new_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap open_icon { + get { + object obj = ResourceManager.GetObject("open_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap paste_icon { + get { + object obj = ResourceManager.GetObject("paste_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap play_icon { + get { + object obj = ResourceManager.GetObject("play_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap save_all_icon { + get { + object obj = ResourceManager.GetObject("save_all_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap save_icon { + get { + object obj = ResourceManager.GetObject("save_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap speaker_icon { + get { + object obj = ResourceManager.GetObject("speaker_icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Filtration/Properties/Resources.resx b/Filtration/Properties/Resources.resx index 9308e95..f36472f 100644 --- a/Filtration/Properties/Resources.resx +++ b/Filtration/Properties/Resources.resx @@ -118,32 +118,44 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\Icons\add_block_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Icons\add_section_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + - ..\Resources\AlertSound1.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\AlertSounds\AlertSound1.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\AlertSound2.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\AlertSounds\AlertSound2.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\AlertSound3.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\AlertSounds\AlertSound3.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\AlertSound4.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\AlertSounds\AlertSound4.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\AlertSound5.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\AlertSounds\AlertSound5.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\AlertSound6.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\AlertSounds\AlertSound6.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\AlertSound7.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\AlertSounds\AlertSound7.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\AlertSound8.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\AlertSounds\AlertSound8.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\AlertSound9.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\AlertSounds\AlertSound9.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\Icons\copy_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Icons\delete_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\Fontin-SmallCaps.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -151,4 +163,25 @@ ..\Resources\groundtile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Icons\new_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Icons\open_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Icons\paste_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Icons\play_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Icons\save_all_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Icons\save_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\Icons\speaker_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Filtration/Resources/AlertSound1.wav b/Filtration/Resources/AlertSounds/AlertSound1.wav similarity index 100% rename from Filtration/Resources/AlertSound1.wav rename to Filtration/Resources/AlertSounds/AlertSound1.wav diff --git a/Filtration/Resources/AlertSound2.wav b/Filtration/Resources/AlertSounds/AlertSound2.wav similarity index 100% rename from Filtration/Resources/AlertSound2.wav rename to Filtration/Resources/AlertSounds/AlertSound2.wav diff --git a/Filtration/Resources/AlertSound3.wav b/Filtration/Resources/AlertSounds/AlertSound3.wav similarity index 100% rename from Filtration/Resources/AlertSound3.wav rename to Filtration/Resources/AlertSounds/AlertSound3.wav diff --git a/Filtration/Resources/AlertSound4.wav b/Filtration/Resources/AlertSounds/AlertSound4.wav similarity index 100% rename from Filtration/Resources/AlertSound4.wav rename to Filtration/Resources/AlertSounds/AlertSound4.wav diff --git a/Filtration/Resources/AlertSound5.wav b/Filtration/Resources/AlertSounds/AlertSound5.wav similarity index 100% rename from Filtration/Resources/AlertSound5.wav rename to Filtration/Resources/AlertSounds/AlertSound5.wav diff --git a/Filtration/Resources/AlertSound6.wav b/Filtration/Resources/AlertSounds/AlertSound6.wav similarity index 100% rename from Filtration/Resources/AlertSound6.wav rename to Filtration/Resources/AlertSounds/AlertSound6.wav diff --git a/Filtration/Resources/AlertSound7.wav b/Filtration/Resources/AlertSounds/AlertSound7.wav similarity index 100% rename from Filtration/Resources/AlertSound7.wav rename to Filtration/Resources/AlertSounds/AlertSound7.wav diff --git a/Filtration/Resources/AlertSound8.wav b/Filtration/Resources/AlertSounds/AlertSound8.wav similarity index 100% rename from Filtration/Resources/AlertSound8.wav rename to Filtration/Resources/AlertSounds/AlertSound8.wav diff --git a/Filtration/Resources/AlertSound9.wav b/Filtration/Resources/AlertSounds/AlertSound9.wav similarity index 100% rename from Filtration/Resources/AlertSound9.wav rename to Filtration/Resources/AlertSounds/AlertSound9.wav diff --git a/Filtration/Resources/Icons/add_block_icon.png b/Filtration/Resources/Icons/add_block_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1e6fdd87d0a5433099f57e89577217ba632d2426 GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5he4R}c>anMpx}N_ z7srr_xT6yd`3@QIxK^|99X>GUZuRa$ktIfj&5Q0VTF%HOmhkeyBCVGhA117t<~_;J zlTJ=44<*H*S%SKWVswYQ^3UHV+lh7RfHcN!1BU(Lc(JKth9SF6TX z?%3-Sw@zbdShZ@=w%pc?Od-Z;sh+;Y%bq`Wy?(m))h`Vf@6#a({rTrq42~7FICSjb zU~pV;K*rJJzxWB&EXN(&G%R=y*UB8PqW_wp2)dO2J*yyspYE+S?Nh P^a_KgtDnm{r-UW|BQt5Y literal 0 HcmV?d00001 diff --git a/Filtration/Resources/Icons/add_section_icon.png b/Filtration/Resources/Icons/add_section_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..32a34f403f8802484c143200b9498266c772a75c GIT binary patch literal 319 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!7H9Fjv*HQODAmz#b4B-* zl-3fT36@UIZ@Wb9H7_yHoBG@C2lBj2q;?{b4(qbwJo5QiF$MHGjbExNGmv>OSdV;&{#IQUCs=#O95^ zUNy)2F|#m~Y`OO6-g(#bQ}PlQN@cs+S0$Cb+;mFB$s&aLo5&u|l1r>v* LtDnm{r-UW|J$8BY literal 0 HcmV?d00001 diff --git a/Filtration/Resources/Icons/arrow_down_large_icon.png b/Filtration/Resources/Icons/arrow_down_large_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..efdaccd319983b13ac251691b1af18bd91630a61 GIT binary patch literal 238 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP;h~# zi(^Pd+|tP#c@G=#upCwpeIB$@aSpFZmzf9K#hCkA2@Jw!cJiWP4_^KEV`05L=X2Rp zo4&@GsSFQN%D(gTPrvv7X7<{TD`&7W#4U1{H9hDi)MkE<(K~FzJ;(QdwSTJim5uJ3Cj;zQFLdhbdvnNo1a-y$!L-`8lDBioZ@b2JY)b$sVpu~q0iW5(K> zOeQw=3db_IFMPPuuy#rkckp57ZyW(vk2>W@O0vf&F3DlwIdp2q`})Uxrq`WjUP?WC Q2Iw>fPgg&ebxsLQ03xtZmH+?% literal 0 HcmV?d00001 diff --git a/Filtration/Resources/Icons/arrow_up_large_icon.png b/Filtration/Resources/Icons/arrow_up_large_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..09b45f73579517de099c5c03683ba5826b2f36ea GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP;iE) zi(^Pd+|tP#d7Tw`Tn;Wu(qr>9OAs;Ra1JmM*PR$BB>Zwm{GZ7>Iv=V{9z37(&hHRk z#ryvahR3|GOFS-a|K`n_#aoxL_Mbpvf#%Un!%l-8-`BaS9(v$EfrXoaN7d&;bFf$T z)_dnV4m8a9JpFo|XTTxRJ>CIN3?dHZxC%KofBU4ftNqBK1f_#b!e`Q$n4_}aX>H&C ZS=xjxVQ29F#~}AJc)I$ztaD0e0ssf^Ri6L= literal 0 HcmV?d00001 diff --git a/Filtration/Resources/Icons/arrow_up_small_icon.png b/Filtration/Resources/Icons/arrow_up_small_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7394bf0dfa074c46f63e528fe9244987c4c3e7c2 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP;j!R zi(^Pd+|kL7Tt^f{ocAA{`uvl^S2nq$(pQ{!e2K}EWitMMm?Q1sB1XkMlLRtfKbupu z$eZu!|Hfj!zY>odITe@4A5PkL;E*|=&Hkn}4}-cMyz%;@cc(ghUa=czjuQ7YgFSkR z;Ts%!0vY#+eqv%Vh-9>p(BHt2_{a1b?_$=gb~2ZzhemB^Iccmfz4cnl%fI_SGW)*v W*t}%(CRd>I7(8A5T-G@yGywqIhE&@C literal 0 HcmV?d00001 diff --git a/Filtration/Resources/Icons/copy_icon.png b/Filtration/Resources/Icons/copy_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..8ff40a0fc6f034170439f61e6c725774e681c781 GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP_V?) z#WAEJ?&yV$Tnz?1EEl>{GWW0T{x$d2qc})wc@2-deMg_KyHJkORhR`Tc4& z&Y#b7z!ZRKvgGYVny*{W5LuE6Q#KX=eYabj9 z5HV&q_n1gkLohi zm6`EA4%5IqFwAXAw`%*Uj~kUzy~*Gz6h)#DTnTs97)b{Xwe0i=YH20{)~qE%4W3l; zA4E`t3UGcfqO*)FX`*5@jCh|(VMM>fCTKQho%|4!ksJP6jDX85egj#fKn(R^jJp5; N002ovPDHLkV1g=X*X95K literal 0 HcmV?d00001 diff --git a/Filtration/Resources/Icons/new_icon.png b/Filtration/Resources/Icons/new_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..12354ce14e9cedf2c377ae0d7b11f6344e05e741 GIT binary patch literal 270 zcmV+p0rCEcP)zr?|{uKfu|b?JB@I6L?O{zL0>YrGUL9J%6&PCf|X z1>VaeL_q*+Eqan=nSulm5e8o9#kc(g#Oy6PgHR}W(!g(-ZVoJ>PMnZRp~xWIHs3x# z@&K)?g}cw4Z{S5#99_(cqUfrss*$4?w{!;b`q$kU`+D0vx$->6vMg!dkO?PRx~@TMt$YH0p6G$ne-Pup42FWsV|{NxSN;SF5#blS09loe UG8Nz?4*&oF07*qoM6N<$f{3ehNB{r; literal 0 HcmV?d00001 diff --git a/Filtration/Resources/Icons/open_icon.png b/Filtration/Resources/Icons/open_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b9e1d55f3070837fdf2b5411629c2229aa82855b GIT binary patch literal 411 zcmV;M0c8G(P)9HB-P;NgnEBu;qtP&Ox`|4b!U4>T z`%n*&#LW`{74wt5@OosnnO{JcaPwnw0k!BHjq?D$IWpW`W)9PLA{qq4Gc=1zo-Y=E zE`UpF#x|L{+GS?qDq$K0Se3Z8r;UJmKu>JH%*bSgNWU;fMQYiNDKvse<|2q}Y8h?) z+W!MUJf&7p{4jVi^$+G+*ui|cMdAISJb+3} zHnn!7Nw7oy?y&L#&bq7)!VaHC4tnMsB}&g(0q}|j_yQ+{h>cBBshR))002ovPDHLk FV1kwtv0VTF literal 0 HcmV?d00001 diff --git a/Filtration/Resources/Icons/paste_icon.png b/Filtration/Resources/Icons/paste_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..36915a543ab890bfa215337b2071a75032fc824b GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP;j@W zi(^Pd+|!A+d`yZ0t?A|_0dE6s4#_pR>251K|Mn&RjP6`q+X=YmQ+7-$7Y{TZdjt z+>OkBxWV4-;Z4i-XTQT8^8UanMpx{bR z7srr_xV4iv@-i#(xEedTo#431&?%>>yd*)aO6`Qemo*dG7;iMN6}&t$ae{^U#>I2K zXy31H;8lNly?XyS%iGo-iVnQ(0vDoAvslgGEZN}WaMYGNjML)4X8i?%AO5&+ICqEP z!N1K1s{6Nw$t2rcv5jab<|{t8Vjfex;V}<|x6h8fYxHrj7j|K~=zFJsLXgrAP6qLh s(Gk8nOKWDWsOzoixu4Wy`My>B$lGnteMN6&10Bua>FVdQ&MBb@00Dqr<^TWy literal 0 HcmV?d00001 diff --git a/Filtration/Resources/Icons/save_all_icon.png b/Filtration/Resources/Icons/save_all_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..e429cd4447fd7dda17a2ba3d63b195cbf7dd202b GIT binary patch literal 2954 zcmV;53w88~P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY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 HcmV?d00001 diff --git a/Filtration/Resources/Icons/save_icon.png b/Filtration/Resources/Icons/save_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f581e6441c634dbb210ed58440287f8d3002ba61 GIT binary patch literal 2923 zcmV-x3zYPUP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?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-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0001%NklOSp?y63px(l)y?gaA<4 zrIx#4q-k#eC4gP?cQ=gh8GPdPojEL-%sO}m_YK(&{sKP`Fp}1k2>|DuF}Zbq3;=ek VD{`saryBqO002ovPDHLkV1j0RYn}iA literal 0 HcmV?d00001 diff --git a/Filtration/Resources/Icons/speaker_icon.png b/Filtration/Resources/Icons/speaker_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b8c7c021caf6d53e1d627b2589fb23a6314ba738 GIT binary patch literal 1619 zcmaJ>eM}Q~7(PKQaiEAyk)hnq4=U1+YfGgkg>-FMaTKvMTFp@Var6VO*If@=SQ>~T zh={CX$}j>}-PDQV{EQNZT_+5IfjVVkIu|1_7b_!+XvE2`2)IASE_e6)$n!k!`+MIf zzp{+<4?|`}&H?}+BvmF+P$TI7f&!@js|eo_YFJ20Rb(cfP1@813W#*L1_e_wwH{TV zYF+*(ZD=9@1VTooid4zd5G{@|)qV`qj#(%+03;^cEoyBJN`e|xZ!`;`!KP*iH0p%V zhIlz!ZV{sfqpW~HGYis{+JYRdKnEo!fr)m662MSW4cf6>vlX!mp)p;An)|m|5I6=Q zbA-^Fq*U?@P>d5O7|-M~v}_m#`FtkKi|6yiRUAnRp9soQPBup zHlmQEjK`u@LdZap7KFvJ*=$T3mx&X47Az15{2Ck%gF-N@`DRjWXPB)^CKM#7RZAEx zq!BlRenqtg&m)BpmFb%!V3tW)vvs^oRKZwwwS@&U+5RI<0Oj)khho?y+Da7;F`#ia33Gv#)Ivh_#q&Kdv+Xib%fl=j{y>yu@%me8NN&+^hfFDWSo z-xWFII+y+U{%5-*Bf}QNWJjSY2IX@lPW{N|CTPn$-*$T*=ydX2S`F(3OKrow8j1>iRA`H&;@6sCK$}&k7u1r~y4v(}itKS@iG#qse5_>uG7bu0LFmGpj?k^wy0V+kf?V#CxR2ZoA^T&zwJB+)GuY z>B^Os*4B0IzP`SJIj0&MaficUHqZ7IT-^*g6NJK$(R=q6&g3A-8dt{Qn}&+ZT_1CH zxT)F(1_sJD(ZgrbXr(13VP(@#7q9v1mVp->8u$9TraEo8J2nVt^Lo92=G(%F>p58XQT{uYe_?K|MV^m6eqqkLS1k89;5i zo>N1AlvPw$xA+NE-_?5H;hmc|o%ek$-inF}(H2* b is SoundBlockItem) > 0; } } - private void OnCopyConditionCommand() - { - Clipboard.SetText(_translator.TranslateLootFilterBlockToString(Block)); - } - private void OnAddFilterBlockItemCommand(Type blockItemType) { if (!AddBlockItemAllowed(blockItemType)) return; @@ -276,6 +273,17 @@ namespace Filtration.ViewModels IsDirty = true; } + private void OnCopyBlockCommand() + { + _parentScriptViewModel.CopyBlock(this); + } + + private void OnPasteBlockCommand() + { + _parentScriptViewModel.PasteBlock(this); + } + + private void OnAddBlockCommand() { _parentScriptViewModel.AddBlock(this); @@ -310,7 +318,7 @@ namespace Filtration.ViewModels private void OnPlaySoundCommand() { - var soundUri = "Resources/AlertSound" + FilterBlockItems.OfType().First().Value + ".wav"; + var soundUri = "Resources/AlertSounds/AlertSound" + FilterBlockItems.OfType().First().Value + ".wav"; _mediaPlayer.Open(new Uri(soundUri, UriKind.Relative)); _mediaPlayer.Play(); } diff --git a/Filtration/ViewModels/LootFilterScriptViewModel.cs b/Filtration/ViewModels/LootFilterScriptViewModel.cs index c5a258b..e08f59b 100644 --- a/Filtration/ViewModels/LootFilterScriptViewModel.cs +++ b/Filtration/ViewModels/LootFilterScriptViewModel.cs @@ -3,7 +3,9 @@ using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Windows; +using Castle.Core.Internal; using Filtration.Models; +using Filtration.Translators; using GalaSoft.MvvmLight.CommandWpf; namespace Filtration.ViewModels @@ -14,28 +16,34 @@ namespace Filtration.ViewModels bool IsDirty { get; } string Description { get; set; } void Initialise(LootFilterScript lootFilterScript); + ILootFilterBlockViewModel SelectedBlockViewModel { get; set; } void RemoveDirtyFlag(); - void AddSection(ILootFilterBlockViewModel blockViewModel); - void AddBlock(ILootFilterBlockViewModel blockViewModel); + void AddSection(ILootFilterBlockViewModel targetBlockViewModel); + void AddBlock(ILootFilterBlockViewModel targetBlockViewModel); + void CopyBlock(ILootFilterBlockViewModel targetBlockViewModel); + void PasteBlock(ILootFilterBlockViewModel targetBlockViewModel); } internal class LootFilterScriptViewModel : FiltrationViewModelBase, ILootFilterScriptViewModel { private readonly ILootFilterBlockViewModelFactory _lootFilterBlockViewModelFactory; + private readonly ILootFilterBlockTranslator _blockTranslator; private bool _isDirty; private ILootFilterBlockViewModel _selectedBlockViewModel; - public LootFilterScriptViewModel(ILootFilterBlockViewModelFactory lootFilterBlockViewModelFactory ) + public LootFilterScriptViewModel(ILootFilterBlockViewModelFactory lootFilterBlockViewModelFactory, ILootFilterBlockTranslator blockTranslator) { DeleteBlockCommand = new RelayCommand(OnDeleteBlockCommand, () => SelectedBlockViewModel != null); MoveBlockToTopCommand = new RelayCommand(OnMoveBlockToTopCommand, () => SelectedBlockViewModel != null); MoveBlockUpCommand = new RelayCommand(OnMoveBlockUpCommand, () => SelectedBlockViewModel != null); MoveBlockDownCommand = new RelayCommand(OnMoveBlockDownCommand, () => SelectedBlockViewModel != null); MoveBlockToBottomCommand = new RelayCommand(OnMoveBlockToBottomCommand, () => SelectedBlockViewModel != null); - AddBlockCommand = new RelayCommand(OnAddBlockCommand, () => SelectedBlockViewModel != null); + AddBlockCommand = new RelayCommand(OnAddBlockCommand); AddSectionCommand = new RelayCommand(OnAddSectionCommand, () => SelectedBlockViewModel != null); - + CopyBlockCommand = new RelayCommand(OnCopyBlockCommand, () => SelectedBlockViewModel != null); + PasteBlockCommand = new RelayCommand(OnPasteBlockCommand); _lootFilterBlockViewModelFactory = lootFilterBlockViewModelFactory; + _blockTranslator = blockTranslator; LootFilterBlockViewModels = new ObservableCollection(); } @@ -47,6 +55,8 @@ namespace Filtration.ViewModels public RelayCommand MoveBlockToBottomCommand { get; private set; } public RelayCommand AddBlockCommand { get; private set; } public RelayCommand AddSectionCommand { get; private set; } + public RelayCommand CopyBlockCommand { get; private set; } + public RelayCommand PasteBlockCommand { get; private set; } public ObservableCollection LootFilterBlockViewModels { get; private set; } @@ -133,6 +143,48 @@ namespace Filtration.ViewModels } } + private void OnCopyBlockCommand() + { + CopyBlock(SelectedBlockViewModel); + } + + public void CopyBlock(ILootFilterBlockViewModel targetBlockViewModel) + { + Clipboard.SetText(_blockTranslator.TranslateLootFilterBlockToString(SelectedBlockViewModel.Block)); + } + + private void OnPasteBlockCommand() + { + PasteBlock(SelectedBlockViewModel); + } + + public void PasteBlock(ILootFilterBlockViewModel targetBlockViewModel) + { + var clipboardText = Clipboard.GetText(); + if (clipboardText.IsNullOrEmpty()) return; + + var translatedBlock = _blockTranslator.TranslateStringToLootFilterBlock(clipboardText); + if (translatedBlock == null) return; + + var vm = _lootFilterBlockViewModelFactory.Create(); + vm.Initialise(translatedBlock, this); + + if (LootFilterBlockViewModels.Count > 0) + { + Script.LootFilterBlocks.Insert(Script.LootFilterBlocks.IndexOf(targetBlockViewModel.Block) + 1, translatedBlock); + LootFilterBlockViewModels.Insert(LootFilterBlockViewModels.IndexOf(targetBlockViewModel) + 1, vm); + } + else + { + Script.LootFilterBlocks.Add(translatedBlock); + LootFilterBlockViewModels.Add(vm); + } + + SelectedBlockViewModel = vm; + _isDirty = true; + + } + private void OnMoveBlockToTopCommand() { var currentIndex = LootFilterBlockViewModels.IndexOf(SelectedBlockViewModel); @@ -153,13 +205,13 @@ namespace Filtration.ViewModels MoveBlockUp(SelectedBlockViewModel); } - public void MoveBlockUp(ILootFilterBlockViewModel blockViewModel) + public void MoveBlockUp(ILootFilterBlockViewModel targetBlockViewModel) { - var currentIndex = LootFilterBlockViewModels.IndexOf(blockViewModel); + var currentIndex = LootFilterBlockViewModels.IndexOf(targetBlockViewModel); if (currentIndex > 0) { - var block = blockViewModel.Block; + var block = targetBlockViewModel.Block; var blockPos = Script.LootFilterBlocks.IndexOf(block); Script.LootFilterBlocks.RemoveAt(blockPos); Script.LootFilterBlocks.Insert(blockPos - 1, block); @@ -174,13 +226,13 @@ namespace Filtration.ViewModels MoveBlockDown(SelectedBlockViewModel); } - public void MoveBlockDown(ILootFilterBlockViewModel blockViewModel) + public void MoveBlockDown(ILootFilterBlockViewModel targetBlockViewModel) { - var currentIndex = LootFilterBlockViewModels.IndexOf(blockViewModel); + var currentIndex = LootFilterBlockViewModels.IndexOf(targetBlockViewModel); if (currentIndex < LootFilterBlockViewModels.Count - 1) { - var block = blockViewModel.Block; + var block = targetBlockViewModel.Block; var blockPos = Script.LootFilterBlocks.IndexOf(block); Script.LootFilterBlocks.RemoveAt(blockPos); Script.LootFilterBlocks.Insert(blockPos + 1, block); @@ -210,7 +262,7 @@ namespace Filtration.ViewModels AddBlock(SelectedBlockViewModel); } - public void AddBlock(ILootFilterBlockViewModel blockViewModel) + public void AddBlock(ILootFilterBlockViewModel targetBlockViewModel) { var vm = _lootFilterBlockViewModelFactory.Create(); var newBlock = new LootFilterBlock(); @@ -218,8 +270,8 @@ namespace Filtration.ViewModels if (LootFilterBlockViewModels.Count > 0) { - Script.LootFilterBlocks.Insert(Script.LootFilterBlocks.IndexOf(blockViewModel.Block) + 1, newBlock); - LootFilterBlockViewModels.Insert(LootFilterBlockViewModels.IndexOf(blockViewModel) + 1, vm); + Script.LootFilterBlocks.Insert(Script.LootFilterBlocks.IndexOf(targetBlockViewModel.Block) + 1, newBlock); + LootFilterBlockViewModels.Insert(LootFilterBlockViewModels.IndexOf(targetBlockViewModel) + 1, vm); } else { @@ -236,14 +288,14 @@ namespace Filtration.ViewModels AddSection(SelectedBlockViewModel); } - public void AddSection(ILootFilterBlockViewModel blockViewModel) + public void AddSection(ILootFilterBlockViewModel targetBlockViewModel) { var vm = _lootFilterBlockViewModelFactory.Create(); var newSection = new LootFilterSection { Description = "New Section" }; vm.Initialise(newSection, this); - Script.LootFilterBlocks.Insert(Script.LootFilterBlocks.IndexOf(blockViewModel.Block) + 1, newSection); - LootFilterBlockViewModels.Insert(LootFilterBlockViewModels.IndexOf(blockViewModel) + 1, vm); + Script.LootFilterBlocks.Insert(Script.LootFilterBlocks.IndexOf(targetBlockViewModel.Block) + 1, newSection); + LootFilterBlockViewModels.Insert(LootFilterBlockViewModels.IndexOf(targetBlockViewModel) + 1, vm); _isDirty = true; SelectedBlockViewModel = vm; RaisePropertyChanged("LootFilterSectionViewModels"); @@ -254,15 +306,15 @@ namespace Filtration.ViewModels DeleteBlock(SelectedBlockViewModel); } - public void DeleteBlock(ILootFilterBlockViewModel blockViewModel) + public void DeleteBlock(ILootFilterBlockViewModel targetBlockViewModel) { var result = MessageBox.Show("Are you sure you wish to delete this block?", "Delete Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { - Script.LootFilterBlocks.Remove(blockViewModel.Block); - LootFilterBlockViewModels.Remove(blockViewModel); + Script.LootFilterBlocks.Remove(targetBlockViewModel.Block); + LootFilterBlockViewModels.Remove(targetBlockViewModel); _isDirty = true; } SelectedBlockViewModel = null; diff --git a/Filtration/ViewModels/MainWindowViewModel.cs b/Filtration/ViewModels/MainWindowViewModel.cs index 6c6edaf..0ab2008 100644 --- a/Filtration/ViewModels/MainWindowViewModel.cs +++ b/Filtration/ViewModels/MainWindowViewModel.cs @@ -13,6 +13,7 @@ namespace Filtration.ViewModels { internal interface IMainWindowViewModel { + void LoadScriptFromFile(string path); } internal class MainWindowViewModel : FiltrationViewModelBase, IMainWindowViewModel @@ -38,6 +39,8 @@ namespace Filtration.ViewModels SaveScriptCommand = new RelayCommand(OnSaveScriptCommand, () => CurrentScriptViewModel != null); SaveScriptAsCommand = new RelayCommand(OnSaveScriptAsCommand, () => CurrentScriptViewModel != null); CopyScriptCommand = new RelayCommand(OnCopyScriptCommand, () => CurrentScriptViewModel != null); + CopyBlockCommand = new RelayCommand(OnCopyBlockCommand, () => CurrentScriptViewModel != null && CurrentScriptViewModel.SelectedBlockViewModel != null); + PasteCommand = new RelayCommand(OnPasteCommand, () => CurrentScriptViewModel != null); NewScriptCommand = new RelayCommand(OnNewScriptCommand); CloseScriptCommand = new RelayCommand(OnCloseScriptCommand, v => CurrentScriptViewModel != null); @@ -49,6 +52,8 @@ namespace Filtration.ViewModels public RelayCommand OpenScriptCommand { get; private set; } public RelayCommand SaveScriptCommand { get; private set; } public RelayCommand SaveScriptAsCommand { get; private set; } + public RelayCommand CopyBlockCommand { get; private set; } + public RelayCommand PasteCommand { get; private set; } public RelayCommand CopyScriptCommand { get; private set; } public RelayCommand NewScriptCommand { get; private set; } public RelayCommand CloseScriptCommand { get; private set; } @@ -84,7 +89,7 @@ namespace Filtration.ViewModels LoadScriptFromFile(openFileDialog.FileName); } - private void LoadScriptFromFile(string path) + public void LoadScriptFromFile(string path) { try { @@ -200,7 +205,17 @@ namespace Filtration.ViewModels private void OnCopyScriptCommand() { - Clipboard.SetText(_lootFilterScriptTranslator.TranslateLootFilterScriptToString(_loadedScript)); + Clipboard.SetText(_lootFilterScriptTranslator.TranslateLootFilterScriptToString(_currentScriptViewModel.Script)); + } + + private void OnCopyBlockCommand() + { + _currentScriptViewModel.CopyBlock(_currentScriptViewModel.SelectedBlockViewModel); + } + + private void OnPasteCommand() + { + _currentScriptViewModel.PasteBlock(_currentScriptViewModel.SelectedBlockViewModel); } private void OnNewScriptCommand() diff --git a/Filtration/Views/LootFilterBlockDisplaySettingsView.xaml b/Filtration/Views/LootFilterBlockDisplaySettingsView.xaml index d48be38..6a29ab0 100644 --- a/Filtration/Views/LootFilterBlockDisplaySettingsView.xaml +++ b/Filtration/Views/LootFilterBlockDisplaySettingsView.xaml @@ -4,7 +4,6 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" - xmlns:fa="http://schemas.fontawesome.io/icons/" xmlns:userControls="clr-namespace:Filtration.UserControls" xmlns:viewModels="clr-namespace:Filtration.ViewModels" xmlns:blockItemBaseTypes="clr-namespace:Filtration.Models.BlockItemBaseTypes" @@ -93,7 +92,7 @@ diff --git a/Filtration/Views/LootFilterBlockView.xaml b/Filtration/Views/LootFilterBlockView.xaml index 14f980c..1b60f66 100644 --- a/Filtration/Views/LootFilterBlockView.xaml +++ b/Filtration/Views/LootFilterBlockView.xaml @@ -8,7 +8,6 @@ xmlns:views="clr-namespace:Filtration.Views" xmlns:blockItemBaseTypes="clr-namespace:Filtration.Models.BlockItemBaseTypes" xmlns:blockItemTypes="clr-namespace:Filtration.Models.BlockItemTypes" - xmlns:fa="http://schemas.fontawesome.io/icons/" xmlns:enums="clr-namespace:Filtration.Enums" xmlns:extensions="clr-namespace:Filtration.Extensions" mc:Ignorable="d" @@ -39,29 +38,18 @@ - - - - - - - - - - - - - + + - - + + - + - - + + @@ -92,7 +80,7 @@ - + - + -