mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 04:12:12 +00:00
Texture Browser: added "Show -> By selection type" option. When this option is selected, the browser will show textures or flats based on selected/highlighted surfaces.
This commit is contained in:
parent
bdcaa2b1f2
commit
93ae3e8c7c
3 changed files with 14 additions and 9 deletions
17
Source/Core/Controls/ImageBrowserControl.Designer.cs
generated
17
Source/Core/Controls/ImageBrowserControl.Designer.cs
generated
|
@ -61,7 +61,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// label
|
||||
//
|
||||
this.label.AutoSize = true;
|
||||
this.label.Location = new System.Drawing.Point(127, 9);
|
||||
this.label.Location = new System.Drawing.Point(131, 9);
|
||||
this.label.Name = "label";
|
||||
this.label.Size = new System.Drawing.Size(33, 14);
|
||||
this.label.TabIndex = 0;
|
||||
|
@ -119,7 +119,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(336, 9);
|
||||
this.label2.Location = new System.Drawing.Point(337, 9);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(40, 14);
|
||||
this.label2.TabIndex = 0;
|
||||
|
@ -143,7 +143,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(237, 9);
|
||||
this.label1.Location = new System.Drawing.Point(238, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(37, 14);
|
||||
this.label1.TabIndex = 0;
|
||||
|
@ -171,11 +171,12 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
this.cbMixMode.Items.AddRange(new object[] {
|
||||
"All",
|
||||
"Textures",
|
||||
"Flats"});
|
||||
this.cbMixMode.Location = new System.Drawing.Point(48, 5);
|
||||
"Flats",
|
||||
"By sel. type"});
|
||||
this.cbMixMode.Location = new System.Drawing.Point(43, 5);
|
||||
this.cbMixMode.Margin = new System.Windows.Forms.Padding(3, 3, 6, 3);
|
||||
this.cbMixMode.Name = "cbMixMode";
|
||||
this.cbMixMode.Size = new System.Drawing.Size(70, 22);
|
||||
this.cbMixMode.Size = new System.Drawing.Size(80, 22);
|
||||
this.cbMixMode.TabIndex = 0;
|
||||
this.cbMixMode.TabStop = false;
|
||||
this.cbMixMode.SelectedIndexChanged += new System.EventHandler(this.cbMixMode_SelectedIndexChanged);
|
||||
|
@ -202,10 +203,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// objectname
|
||||
//
|
||||
this.objectname.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
|
||||
this.objectname.Location = new System.Drawing.Point(163, 6);
|
||||
this.objectname.Location = new System.Drawing.Point(166, 6);
|
||||
this.objectname.Margin = new System.Windows.Forms.Padding(3, 3, 6, 3);
|
||||
this.objectname.Name = "objectname";
|
||||
this.objectname.Size = new System.Drawing.Size(69, 20);
|
||||
this.objectname.Size = new System.Drawing.Size(64, 20);
|
||||
this.objectname.TabIndex = 0;
|
||||
this.objectname.TabStop = false;
|
||||
this.objectname.TextChanged += new System.EventHandler(this.objectname_TextChanged);
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// States
|
||||
private bool updating;
|
||||
private int keepselected;
|
||||
private bool browseFlats; //mxd
|
||||
|
||||
// All items
|
||||
private List<ImageBrowserItem> items;
|
||||
|
@ -66,6 +67,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
public bool PreventSelection { get { return preventselection; } set { preventselection = value; } }
|
||||
public bool HideInputBox { get { return splitter.Panel2Collapsed; } set { splitter.Panel2Collapsed = value; } }
|
||||
public bool BrowseFlats { get { return browseFlats; } set { browseFlats = value; } } //mxd
|
||||
//public string LabelText { get { return label.Text; } set { label.Text = value; objectname.Left = label.Right + label.Margin.Right + objectname.Margin.Left; } } //mxd
|
||||
public ListViewItem SelectedItem { get { if(list.SelectedItems.Count > 0) return list.SelectedItems[0]; else return null; } }
|
||||
|
||||
|
@ -506,10 +508,11 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// This validates an item
|
||||
private bool ValidateItem(ImageBrowserItem i)
|
||||
{
|
||||
//mxd. mixMode: 0 = All, 1 = Textures, 2 = Flats
|
||||
//mxd. mixMode: 0 = All, 1 = Textures, 2 = Flats, 3 = Based on BrowseFlats
|
||||
if(!splitter.Panel2Collapsed) {
|
||||
if(mixMode == 1 && i.icon.IsFlat) return false;
|
||||
if(mixMode == 2 && !i.icon.IsFlat) return false;
|
||||
if(mixMode == 3 && (browseFlats != i.icon.IsFlat)) return false;
|
||||
}
|
||||
|
||||
return i.Text.Contains(objectname.Text);
|
||||
|
|
|
@ -59,6 +59,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
string imgType = (browseFlats ? "flats" : "textures");
|
||||
this.Text = "Browse " + imgType;
|
||||
|
||||
browser.BrowseFlats = browseFlats;
|
||||
browser.ApplySettings();
|
||||
|
||||
// Update the used textures
|
||||
|
|
Loading…
Reference in a new issue