mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 12:50:52 +00:00
fixed problem with editing UDMF fields on multiple selected elements
This commit is contained in:
parent
4bbf14dde9
commit
1db48fd9e8
2 changed files with 20 additions and 23 deletions
|
@ -141,6 +141,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
if(!frow.TypeHandler.GetValue().Equals(f.Value.Value))
|
if(!frow.TypeHandler.GetValue().Equals(f.Value.Value))
|
||||||
{
|
{
|
||||||
// Clear the value in the row
|
// Clear the value in the row
|
||||||
|
frow.Define(f.Value.Value);
|
||||||
frow.Clear();
|
frow.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,11 +232,8 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
{
|
{
|
||||||
FieldsEditorRow frow = row as FieldsEditorRow;
|
FieldsEditorRow frow = row as FieldsEditorRow;
|
||||||
|
|
||||||
// Field is defined?
|
// Field is defined and not empty?
|
||||||
if(frow.IsDefined)
|
if(frow.IsDefined && !frow.IsEmpty)
|
||||||
{
|
|
||||||
// Only apply when not empty
|
|
||||||
if(!frow.IsEmpty)
|
|
||||||
{
|
{
|
||||||
// Apply field
|
// Apply field
|
||||||
object oldvalue = null;
|
object oldvalue = null;
|
||||||
|
@ -252,7 +250,6 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
|
|
||||||
public bool IsFixed { get { return isfixed; } }
|
public bool IsFixed { get { return isfixed; } }
|
||||||
public bool IsDefined { get { return isdefined; } }
|
public bool IsDefined { get { return isdefined; } }
|
||||||
public bool IsEmpty { get { return (this.Cells[2].Value.ToString().Length == 0); } }
|
public bool IsEmpty { get { return (this.Cells[2].Value == null) || (this.Cells[2].Value.ToString().Length == 0); } }
|
||||||
public string Name { get { return this.Cells[0].Value.ToString(); } }
|
public string Name { get { return this.Cells[0].Value.ToString(); } }
|
||||||
public TypeHandler TypeHandler { get { return fieldtype; } }
|
public TypeHandler TypeHandler { get { return fieldtype; } }
|
||||||
public UniversalFieldInfo Info { get { return fieldinfo; } }
|
public UniversalFieldInfo Info { get { return fieldinfo; } }
|
||||||
|
@ -193,7 +193,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
}
|
}
|
||||||
|
|
||||||
// Anything in the box?
|
// Anything in the box?
|
||||||
if(this.Cells[2].Value.ToString().Length > 0)
|
if((this.Cells[2].Value != null) && (this.Cells[2].Value.ToString().Length > 0))
|
||||||
{
|
{
|
||||||
// Validate value
|
// Validate value
|
||||||
fieldtype.SetValue(this.Cells[2].Value);
|
fieldtype.SetValue(this.Cells[2].Value);
|
||||||
|
@ -263,7 +263,7 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
public object GetResult(object value)
|
public object GetResult(object value)
|
||||||
{
|
{
|
||||||
// Anything in the box?
|
// Anything in the box?
|
||||||
if(this.Cells[2].Value.ToString().Length > 0)
|
if((this.Cells[2].Value != null) && (this.Cells[2].Value.ToString().Length > 0))
|
||||||
{
|
{
|
||||||
// Return validated value
|
// Return validated value
|
||||||
fieldtype.SetValue(this.Cells[2].Value);
|
fieldtype.SetValue(this.Cells[2].Value);
|
||||||
|
|
Loading…
Reference in a new issue