Merge remote-tracking branch 'origin/master' into arching

This commit is contained in:
biwa 2020-06-08 20:58:45 +02:00
commit 6e4bb04516
5 changed files with 32 additions and 25 deletions

View file

@ -140,7 +140,7 @@ namespace CodeImp.DoomBuilder.Config
internal bool AddTexture(ImageData image)
{
// Check against regex
if(regex.IsMatch(image.Name.ToUpperInvariant()))
if(regex.IsMatch(image.ShortName.ToUpperInvariant()))
{
// Matches! Add it.
textures.Add(image);
@ -158,7 +158,7 @@ namespace CodeImp.DoomBuilder.Config
internal bool AddFlat(ImageData image)
{
// Check against regex
if(regex.IsMatch(image.Name.ToUpperInvariant()))
if(regex.IsMatch(image.ShortName.ToUpperInvariant()))
{
// Matches! Add it.
flats.Add(image);
@ -174,7 +174,7 @@ namespace CodeImp.DoomBuilder.Config
// This only checks if the given image is a match
internal bool IsMatch(ImageData image)
{
return regex.IsMatch(image.Name.ToUpperInvariant());
return regex.IsMatch(image.ShortName.ToUpperInvariant());
}
// This only checks if the given texture name is a match (mxd)

View file

@ -32,7 +32,7 @@ namespace CodeImp.DoomBuilder.Types
#region ================== Variables
private float value;
private double value;
#endregion
@ -47,25 +47,25 @@ namespace CodeImp.DoomBuilder.Types
// Null?
if(value == null)
{
this.value = 0.0f;
this.value = 0.0;
}
// Compatible type?
else if((value is int) || (value is float) || (value is bool))
else if((value is int) || (value is float) || (value is double) || (value is bool))
{
// Set directly
this.value = Convert.ToSingle(value);
this.value = Convert.ToDouble(value);
}
else
{
// Try parsing as string
float result;
if(float.TryParse(value.ToString(), NumberStyles.Float, CultureInfo.CurrentCulture, out result))
double result;
if(double.TryParse(value.ToString(), NumberStyles.Float, CultureInfo.CurrentCulture, out result))
{
this.value = result;
}
else
{
this.value = 0.0f;
this.value = 0.0;
}
}
}
@ -87,7 +87,7 @@ namespace CodeImp.DoomBuilder.Types
public override object GetDefaultValue()
{
return 0f;
return 0.0;
}
#endregion

View file

@ -929,6 +929,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
try
{
newtag = BuilderPlug.Me.ControlSectorArea.GetNewSectorTag(tagblacklist);
tagblacklist.Add(newtag);
}
catch (Exception e)
{

View file

@ -257,8 +257,11 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
// With multiple tag support in UDMF only one tag is needed, so bind it right away
if (General.Map.UDMF == true)
{
if(isnew)
if (isnew)
{
udmftag = BuilderPlug.Me.ControlSectorArea.GetNewSectorTag(tagblacklist);
tagblacklist.Add(udmftag);
}
BindTag(udmftag);
}

View file

@ -111,12 +111,17 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
threeDFloorPanel.ScrollControlIntoView(dup);
}
/// <summary>
/// Splits the 3D floor, creating a new 3D floor for every checked sector
/// </summary>
/// <param name="ctrl">The control for the 3D floor that's to be split</param>
public void SplitThreeDFloor(ThreeDFloorHelperControl ctrl)
{
var items = new List<int>();
var controls = new List<ThreeDFloorHelperControl>();
List<int> items = new List<int>();
List<ThreeDFloorHelperControl> controls = new List<ThreeDFloorHelperControl>() { ctrl };
int numsplits = 0;
// Create a list of all checked sectors
for (int i = 0; i < ctrl.checkedListBoxSectors.Items.Count; i++)
{
if(ctrl.checkedListBoxSectors.GetItemCheckState(i) == CheckState.Checked)
@ -134,39 +139,37 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
have to add exactly one additional control
*/
controls.Add(ctrl);
if (items.Count == 1)
{
numsplits = 1;
}
else
{
numsplits = items.Count - 1;
}
// Get new controls for the additional 3D floors
for (int i = 0; i < numsplits; i++)
{
var newctrl = GetThreeDFloorControl();
newctrl.Update(ctrl);
newctrl.Show();
controls.Add(newctrl);
}
// Update the ckeckboxes of the controls to reflect the split 3D floors
for (int i = controls.Count - 1; i >= 0 ; i--)
{
// Uncheck all sectors...
for (int j = 0; j < items.Count; j++)
{
controls[i].checkedListBoxSectors.SetItemChecked(j, false);
}
controls[i].checkedListBoxSectors.SetItemChecked(items[j], false);
// ... and only check a single one
if (useitem >= 0)
controls[i].checkedListBoxSectors.SetItemChecked(items[useitem], true);
useitem--;
}
// Show the new controls
foreach (Control c in controls)
c.Show();
}
public void DetachThreeDFloor(ThreeDFloorHelperControl ctrl)