Should not have used textures category if not having them on top

This commit is contained in:
ZZYZX 2017-01-09 07:00:27 +02:00
parent 819d27885b
commit 36381c51bb
3 changed files with 34 additions and 6 deletions

View file

@ -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();
}
}

View file

@ -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<ImageBrowserItem> Items { get { return items; } }
public List<ImageBrowserItem> 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;

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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 {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap FlatShading {
get {
object obj = ResourceManager.GetObject("FlatShading", resourceCulture);
@ -67,6 +70,9 @@ namespace CodeImp.DoomBuilder.BuilderEffects.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Folder {
get {
object obj = ResourceManager.GetObject("Folder", resourceCulture);
@ -74,6 +80,9 @@ namespace CodeImp.DoomBuilder.BuilderEffects.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Jitter {
get {
object obj = ResourceManager.GetObject("Jitter", resourceCulture);
@ -81,6 +90,9 @@ namespace CodeImp.DoomBuilder.BuilderEffects.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Terrain {
get {
object obj = ResourceManager.GetObject("Terrain", resourceCulture);
@ -88,6 +100,9 @@ namespace CodeImp.DoomBuilder.BuilderEffects.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Update {
get {
object obj = ResourceManager.GetObject("Update", resourceCulture);