mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +00:00
Fixed, Texture Browser: in some cases the control was unable to select proper texture by short name when long texture names support was enabled.
Sound Environments mode: sound environments list is now sorted.
This commit is contained in:
parent
3924ae5a33
commit
66eef4410a
3 changed files with 10 additions and 9 deletions
|
@ -317,8 +317,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
}
|
||||
}
|
||||
|
||||
// This selects an item by name
|
||||
public void SelectItem(string name, ListViewGroup preferredgroup)
|
||||
// This selects an item by longname (mxd - changed from name to longname)
|
||||
public void SelectItem(long longname, ListViewGroup preferredgroup)
|
||||
{
|
||||
ImageBrowserItem lvi = null; //mxd
|
||||
|
||||
|
@ -331,7 +331,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
foreach(ListViewItem item in list.Items)
|
||||
{
|
||||
ImageBrowserItem curitem = item as ImageBrowserItem;
|
||||
if(curitem != null && string.Compare(curitem.Icon.Name, name, true) == 0)
|
||||
if(curitem != null && longname == curitem.Icon.LongName) //mxd
|
||||
{
|
||||
lvi = curitem;
|
||||
if(item.Group == preferredgroup) break;
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private readonly ListViewGroup usedgroup;
|
||||
private readonly ListViewGroup availgroup;
|
||||
private TreeNode selectedset; //mxd
|
||||
private string selecttextureonfill;
|
||||
private long selecttextureonfill; //mxd. Was string, which wasn't reliable whem dealing with long texture names
|
||||
private readonly bool usedgroupcollapsed; //mxd
|
||||
private readonly bool browseflats; //mxd
|
||||
|
||||
|
@ -76,8 +76,8 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
|
||||
tvTextureSets.BeginUpdate(); //mxd
|
||||
|
||||
// Texture to select when list is filled
|
||||
selecttextureonfill = selecttexture;
|
||||
//mxd. Texture longname to select when list is filled
|
||||
selecttextureonfill = longname;
|
||||
|
||||
// Make groups
|
||||
usedgroup = browser.AddGroup("Used " + imagetype + ":");
|
||||
|
@ -145,7 +145,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
if(match != null)
|
||||
{
|
||||
IFilledTextureSet set = (match.Tag as IFilledTextureSet);
|
||||
foreach(ImageData img in set.Textures)
|
||||
foreach(ImageData img in (browseflats ? set.Flats : set.Textures))
|
||||
{
|
||||
if(img.LongName == longname)
|
||||
{
|
||||
|
@ -547,10 +547,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
FillImagesList();
|
||||
|
||||
// Select texture
|
||||
if(!string.IsNullOrEmpty(selecttextureonfill))
|
||||
if(selecttextureonfill != 0)
|
||||
{
|
||||
browser.SelectItem(selecttextureonfill, (usedgroupcollapsed ? availgroup : usedgroup)); //mxd. availgroup/usedgroup switch.
|
||||
selecttextureonfill = null;
|
||||
selecttextureonfill = 0;
|
||||
}
|
||||
|
||||
//mxd. Focus the textbox. Calling this from TextureBrowserForm_Activated (like it's done in DB2) fails when the form is maximized. Again, I've no idea why...
|
||||
|
|
|
@ -59,6 +59,7 @@ namespace CodeImp.DoomBuilder.SoundPropagationMode
|
|||
else
|
||||
{
|
||||
treeisupdating = false;
|
||||
soundenvironments.Sort();
|
||||
soundenvironments.EndUpdate();
|
||||
|
||||
// Update the checkbox
|
||||
|
|
Loading…
Reference in a new issue