diff --git a/Source/Core/Controls/ImageBrowserControl.cs b/Source/Core/Controls/ImageBrowserControl.cs index 697889fe..6b36de94 100644 --- a/Source/Core/Controls/ImageBrowserControl.cs +++ b/Source/Core/Controls/ImageBrowserControl.cs @@ -119,7 +119,7 @@ namespace CodeImp.DoomBuilder.Controls this.browseflats = browseflats; uselongtexturenames = General.Map.Options.UseLongTextureNames; texturetype = General.Settings.ReadSetting(settingpath + ".texturetype", 0); - usedtexturesfirst.Checked = General.Settings.ReadSetting(settingpath + ".showusedtexturesfirst", false); + list.UsedTexturesFirst = usedtexturesfirst.Checked = General.Settings.ReadSetting(settingpath + ".showusedtexturesfirst", false); list.ClassicView = classicview.Checked = General.Settings.ReadSetting(settingpath + ".classicview", false); int imagesize = General.Settings.ReadSetting(settingpath + ".imagesize", 128); @@ -364,7 +364,8 @@ namespace CodeImp.DoomBuilder.Controls { if(!blockupdate) { - RefillList(false); + list.UsedTexturesFirst = usedtexturesfirst.Checked; + RefillList(false); list.Focus(); } } diff --git a/Source/Core/Controls/ImageSelectorPanel.cs b/Source/Core/Controls/ImageSelectorPanel.cs index 569f0376..9a26c725 100644 --- a/Source/Core/Controls/ImageSelectorPanel.cs +++ b/Source/Core/Controls/ImageSelectorPanel.cs @@ -28,6 +28,7 @@ namespace CodeImp.DoomBuilder.Controls private ImageBrowserItem lastselecteditem; private int imagesize = 128; private bool classicview = false; + private bool usedtexturesfirst = false; private string contenttype = "Textures"; private string title; private int titleheight = SystemFonts.MessageBoxFont.Height + 6; @@ -125,6 +126,17 @@ namespace CodeImp.DoomBuilder.Controls } } + public bool UsedTexturesFirst + { + get { return usedtexturesfirst; } + set + { + usedtexturesfirst = value; + UpdateRectangles(); + if (selection.Count > 0) ScrollToItem(selection[0]); + } + } + public List Items { get { return items; } } public List SelectedItems { get { return selection; } } public string Title { get { return title; } set { title = value; } } @@ -498,7 +510,7 @@ namespace CodeImp.DoomBuilder.Controls foreach (var ti in items) { Image preview = GetPreview(ti, imagesize); - if (classicview && (ti == firstItem || (currentType == ImageBrowserItemType.IMAGE && ti.ItemType != ImageBrowserItemType.IMAGE) || currentUsedInMap != ti.Icon.UsedInMap)) + if (classicview && (ti == firstItem || (currentType == ImageBrowserItemType.IMAGE && ti.ItemType != ImageBrowserItemType.IMAGE) || (usedtexturesfirst && currentUsedInMap != ti.Icon.UsedInMap))) { // new row, also provide space for category name. cx = 0; @@ -597,7 +609,7 @@ namespace CodeImp.DoomBuilder.Controls for (var i = 0; i < items.Count; i++) { - if (classicview && (i == 0 || (currentType == ImageBrowserItemType.IMAGE && items[i].ItemType != ImageBrowserItemType.IMAGE) || currentUsedInMap != items[i].Icon.UsedInMap)) + if (classicview && (i == 0 || (currentType == ImageBrowserItemType.IMAGE && items[i].ItemType != ImageBrowserItemType.IMAGE) || (usedtexturesfirst && currentUsedInMap != items[i].Icon.UsedInMap))) { // draw corresponding title right above this item. string hdrname; diff --git a/Source/Plugins/BuilderEffects/Properties/Resources.Designer.cs b/Source/Plugins/BuilderEffects/Properties/Resources.Designer.cs index abda0bd3..ca67f6dc 100644 --- a/Source/Plugins/BuilderEffects/Properties/Resources.Designer.cs +++ b/Source/Plugins/BuilderEffects/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.5485 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -19,7 +19,7 @@ namespace CodeImp.DoomBuilder.BuilderEffects.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -60,6 +60,9 @@ namespace CodeImp.DoomBuilder.BuilderEffects.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap FlatShading { get { object obj = ResourceManager.GetObject("FlatShading", resourceCulture); @@ -67,6 +70,9 @@ namespace CodeImp.DoomBuilder.BuilderEffects.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap Folder { get { object obj = ResourceManager.GetObject("Folder", resourceCulture); @@ -74,6 +80,9 @@ namespace CodeImp.DoomBuilder.BuilderEffects.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap Jitter { get { object obj = ResourceManager.GetObject("Jitter", resourceCulture); @@ -81,6 +90,9 @@ namespace CodeImp.DoomBuilder.BuilderEffects.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap Terrain { get { object obj = ResourceManager.GetObject("Terrain", resourceCulture); @@ -88,6 +100,9 @@ namespace CodeImp.DoomBuilder.BuilderEffects.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// internal static System.Drawing.Bitmap Update { get { object obj = ResourceManager.GetObject("Update", resourceCulture);