diff --git a/Source/Core/Controls/FlatSelectorControl.cs b/Source/Core/Controls/FlatSelectorControl.cs index e043199b..c1b48847 100644 --- a/Source/Core/Controls/FlatSelectorControl.cs +++ b/Source/Core/Controls/FlatSelectorControl.cs @@ -62,7 +62,7 @@ namespace CodeImp.DoomBuilder.Controls ImageData texture = General.Map.Data.GetFlatImage(imagename); //mxd UpdateToggleImageNameButton(texture); //mxd - if(string.IsNullOrEmpty(texture.FullName) || texture is UnknownImage) DisplayImageSize(0, 0); //mxd + if(string.IsNullOrEmpty(texture.FilePathName) || texture is UnknownImage) DisplayImageSize(0, 0); //mxd else DisplayImageSize(texture.ScaledWidth, texture.ScaledHeight); //mxd if(usepreviews ? !texture.IsPreviewLoaded : !texture.IsImageLoaded) timer.Start(); //mxd diff --git a/Source/Core/Controls/ImageBrowserControl.cs b/Source/Core/Controls/ImageBrowserControl.cs index 706640b6..3b775d31 100644 --- a/Source/Core/Controls/ImageBrowserControl.cs +++ b/Source/Core/Controls/ImageBrowserControl.cs @@ -303,6 +303,7 @@ namespace CodeImp.DoomBuilder.Controls { if(list.SelectedItems.Count > 0) { + list.Focus(); //mxd ListViewItem selected = list.SelectedItems[0]; //mxd diff --git a/Source/Core/Controls/TextureSelectorControl.cs b/Source/Core/Controls/TextureSelectorControl.cs index 712245ef..b1990372 100644 --- a/Source/Core/Controls/TextureSelectorControl.cs +++ b/Source/Core/Controls/TextureSelectorControl.cs @@ -72,7 +72,7 @@ namespace CodeImp.DoomBuilder.Controls ImageData texture = General.Map.Data.GetTextureImage(imagename); //mxd UpdateToggleImageNameButton(texture); //mxd - if(string.IsNullOrEmpty(texture.FullName) || texture is UnknownImage) DisplayImageSize(0, 0); //mxd + if(string.IsNullOrEmpty(texture.FilePathName) || texture is UnknownImage) DisplayImageSize(0, 0); //mxd else DisplayImageSize(texture.ScaledWidth, texture.ScaledHeight); //mxd if(usepreviews ? !texture.IsPreviewLoaded : !texture.IsImageLoaded) timer.Start(); //mxd diff --git a/Source/Core/Data/FileImage.cs b/Source/Core/Data/FileImage.cs index 5f10bc36..aa484b7e 100644 --- a/Source/Core/Data/FileImage.cs +++ b/Source/Core/Data/FileImage.cs @@ -128,7 +128,7 @@ namespace CodeImp.DoomBuilder.Data } this.longname = Lump.MakeLongName(this.name, uselongtexturenames); - this.fullname = filepathname; + this.filepathname = filepathname; this.level = virtualname.Split(new[] { Path.AltDirectorySeparatorChar }).Length - 1; if(General.Settings.CapitalizeTextureNames && !string.IsNullOrEmpty(this.displayname)) @@ -153,7 +153,7 @@ namespace CodeImp.DoomBuilder.Data // Load file data if(bitmap != null) bitmap.Dispose(); bitmap = null; - MemoryStream filedata = new MemoryStream(File.ReadAllBytes(fullname)); + MemoryStream filedata = new MemoryStream(File.ReadAllBytes(filepathname)); // Get a reader for the data IImageReader reader = ImageDataFormat.GetImageReader(filedata, probableformat, General.Map.Data.Palette); @@ -172,7 +172,7 @@ namespace CodeImp.DoomBuilder.Data // Not loaded? if(bitmap == null) { - General.ErrorLogger.Add(ErrorType.Error, "Image file '" + fullname + "' data format could not be read, while loading image '" + this.Name + "'. Is this a valid picture file at all?"); + General.ErrorLogger.Add(ErrorType.Error, "Image file '" + filepathname + "' data format could not be read, while loading image '" + this.Name + "'. Is this a valid picture file at all?"); loadfailed = true; } else diff --git a/Source/Core/Data/ImageData.cs b/Source/Core/Data/ImageData.cs index 593e73e5..47bebab6 100644 --- a/Source/Core/Data/ImageData.cs +++ b/Source/Core/Data/ImageData.cs @@ -49,7 +49,7 @@ namespace CodeImp.DoomBuilder.Data protected Vector2D scale; protected bool worldpanning; private bool usecolorcorrection; - protected string fullname; //mxd. name with path; + protected string filepathname; //mxd. Absolute path to the image; protected string shortname; //mxd. Name in uppercase and clamped to DataManager.CLASIC_IMAGE_NAME_LENGTH protected string virtualname; //mxd. Path of this name is used in TextureBrowserForm protected string displayname; //mxd. Name to display in TextureBrowserForm @@ -92,7 +92,7 @@ namespace CodeImp.DoomBuilder.Data public string Name { get { return name; } } public long LongName { get { return longname; } } public string ShortName { get { return shortname; } } //mxd - public string FullName { get { return fullname; } } //mxd + public string FilePathName { get { return filepathname; } } //mxd public string VirtualName { get { return virtualname; } } //mxd public string DisplayName { get { return displayname; } } //mxd public bool IsFlat { get { return isFlat; } } //mxd @@ -198,7 +198,7 @@ namespace CodeImp.DoomBuilder.Data protected virtual void SetName(string name) { this.name = name; - this.fullname = name; //mxd + this.filepathname = name; //mxd this.shortname = name; //mxd this.virtualname = name; //mxd this.displayname = name; //mxd @@ -346,7 +346,7 @@ namespace CodeImp.DoomBuilder.Data { BitmapData bmpdata = null; try { bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); } - catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image '" + this.fullname + "' for glow color calculation. " + e.GetType().Name + ": " + e.Message); } + catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image '" + this.filepathname + "' for glow color calculation. " + e.GetType().Name + ": " + e.Message); } if(bmpdata != null) { @@ -400,7 +400,7 @@ namespace CodeImp.DoomBuilder.Data { BitmapData bmpdata = null; try { bmpdata = bitmap.LockBits(new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); } - catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image '" + this.fullname + "' for translucency check. " + e.GetType().Name + ": " + e.Message); } + catch(Exception e) { General.ErrorLogger.Add(ErrorType.Error, "Cannot lock image '" + this.filepathname + "' for translucency check. " + e.GetType().Name + ": " + e.Message); } if(bmpdata != null) { diff --git a/Source/Core/Data/PK3FileImage.cs b/Source/Core/Data/PK3FileImage.cs index 50bea90f..3cc26d29 100644 --- a/Source/Core/Data/PK3FileImage.cs +++ b/Source/Core/Data/PK3FileImage.cs @@ -71,7 +71,7 @@ namespace CodeImp.DoomBuilder.Data if(!General.Map.Config.UseLongTextureNames || string.IsNullOrEmpty(Path.GetDirectoryName(filepathname))) { this.name = Path.GetFileNameWithoutExtension(filepathname.ToUpperInvariant()); - if (this.name.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH) + if(this.name.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH) { this.name = this.name.Substring(0, DataManager.CLASIC_IMAGE_NAME_LENGTH); } @@ -83,7 +83,7 @@ namespace CodeImp.DoomBuilder.Data this.name = filepathname.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); this.displayname = Path.GetFileNameWithoutExtension(name); this.shortname = this.displayname.ToUpperInvariant(); - if (this.shortname.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH) + if(this.shortname.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH) { this.shortname = this.shortname.Substring(0, DataManager.CLASIC_IMAGE_NAME_LENGTH); } @@ -92,7 +92,7 @@ namespace CodeImp.DoomBuilder.Data this.longname = Lump.MakeLongName(this.name); this.virtualname = filepathname.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - this.fullname = filepathname; + this.filepathname = filepathname; this.level = virtualname.Split(new[] { Path.AltDirectorySeparatorChar }).Length - 1; if(General.Settings.CapitalizeTextureNames && !string.IsNullOrEmpty(this.displayname)) @@ -116,7 +116,7 @@ namespace CodeImp.DoomBuilder.Data { // Load file data if(bitmap != null) bitmap.Dispose(); bitmap = null; - MemoryStream filedata = datareader.LoadFile(fullname); //mxd + MemoryStream filedata = datareader.LoadFile(filepathname); //mxd if(filedata != null) { @@ -140,7 +140,7 @@ namespace CodeImp.DoomBuilder.Data // Not loaded? if(bitmap == null) { - General.ErrorLogger.Add(ErrorType.Error, "Image file '" + fullname + "' data format could not be read, while loading texture '" + this.Name + "'"); + General.ErrorLogger.Add(ErrorType.Error, "Image file '" + filepathname + "' data format could not be read, while loading texture '" + this.Name + "'"); loadfailed = true; } else diff --git a/Source/Core/Windows/TextureBrowserForm.cs b/Source/Core/Windows/TextureBrowserForm.cs index ea090e25..ed6a49c6 100644 --- a/Source/Core/Windows/TextureBrowserForm.cs +++ b/Source/Core/Windows/TextureBrowserForm.cs @@ -227,7 +227,7 @@ namespace CodeImp.DoomBuilder.Windows //mxd private static int SortImageData(ImageData img1, ImageData img2) { - return img1.FullName.CompareTo(img2.FullName); + return String.Compare(img1.FilePathName, img2.FilePathName, StringComparison.Ordinal); } //mxd diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs index bc28d607..4a68a0a6 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySector.cs @@ -754,7 +754,7 @@ namespace CodeImp.DoomBuilder.BuilderModes public virtual void OnCopyTexture() { //mxd. When UseLongTextureNames is disabled, use texture name as stored in Sidedef, otherwise use full name. - string texturename = ((General.Map.Options.UseLongTextureNames && Texture != null && Texture.UsedInMap) ? Texture.FullName : GetTextureName()); + string texturename = ((General.Map.Options.UseLongTextureNames && Texture != null && Texture.UsedInMap) ? Texture.Name : GetTextureName()); BuilderPlug.Me.CopiedFlat = texturename; if(General.Map.Config.MixTexturesFlats) BuilderPlug.Me.CopiedTexture = texturename; mode.SetActionResult("Copied flat '" + texturename + "'."); diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs index 739447bd..fa3fdb3f 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualGeometrySidedef.cs @@ -1197,7 +1197,7 @@ namespace CodeImp.DoomBuilder.BuilderModes public virtual void OnCopyTexture() { //mxd. When UseLongTextureNames is disabled, use texture name as stored in Sidedef, otherwise use full name. - string texturename = ((General.Map.Options.UseLongTextureNames && Texture != null && Texture.UsedInMap) ? Texture.FullName : GetTextureName()); + string texturename = ((General.Map.Options.UseLongTextureNames && Texture != null && Texture.UsedInMap) ? Texture.Name : GetTextureName()); BuilderPlug.Me.CopiedTexture = texturename; if(General.Map.Config.MixTexturesFlats) BuilderPlug.Me.CopiedFlat = texturename; mode.SetActionResult("Copied texture '" + texturename + "'.");