Visual mode: some parts of 3d floor were shown even when it was above real ceiling/below real floor.

Visual mode: real floor was colored by 3d floor's color even when it was below real floor.
Action Browser form: keyboard focus is now set to Filter text box by default.
This commit is contained in:
MaxED 2014-07-18 11:25:08 +00:00
parent 4cb81b8025
commit 3d7cceaae4
5 changed files with 28 additions and 22 deletions

View file

@ -505,6 +505,7 @@ namespace CodeImp.DoomBuilder.Windows
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Action";
this.Shown += new System.EventHandler(this.ActionBrowserForm_Shown);
groupBox1.ResumeLayout(false);
groupBox1.PerformLayout();
groupBox2.ResumeLayout(false);

View file

@ -32,9 +32,9 @@ namespace CodeImp.DoomBuilder.Windows
// Variables
private int selectedaction;
private ComboBox[] options;
private Label[] optionlbls;
private TreeNode[] allNodes; //mxd
private readonly ComboBox[] options;
private readonly Label[] optionlbls;
private readonly TreeNode[] allNodes; //mxd
// Properties
public int SelectedAction { get { return selectedaction; } }
@ -109,7 +109,7 @@ namespace CodeImp.DoomBuilder.Windows
tabs.TabPages.Remove(tabgeneralized);
}
actions.Focus(); //mxd
//tbFilter.Focus(); //mxd
}
// This browses for an action
@ -301,5 +301,10 @@ namespace CodeImp.DoomBuilder.Windows
private void btnClearFilter_Click(object sender, EventArgs e) {
tbFilter.Clear();
}
//mxd
private void ActionBrowserForm_Shown(object sender, EventArgs e) {
tbFilter.Focus();
}
}
}

View file

@ -1025,7 +1025,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Camera below floor level?
Vector3D feetposition = General.Map.VisualCamera.Position;
SectorLevel floorlevel = sd.GetFloorBelow(feetposition) ?? sd.LightLevels[0];
SectorLevel floorlevel = sd.GetFloorBelow(feetposition) ?? sd.Floor;
float floorheight = floorlevel.plane.GetZ(General.Map.VisualCamera.Position);
if(General.Map.VisualCamera.Position.z < (floorheight + cameraflooroffset + 0.1f))
{
@ -1059,7 +1059,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Camera above ceiling?
feetposition = General.Map.VisualCamera.Position - new Vector3D(0, 0, cameraflooroffset - 7.0f);
SectorLevel ceillevel = sd.GetCeilingAbove(feetposition) ?? sd.LightLevels[sd.LightLevels.Count - 1];
SectorLevel ceillevel = sd.GetCeilingAbove(feetposition) ?? sd.Ceiling;
float ceilheight = ceillevel.plane.GetZ(General.Map.VisualCamera.Position);
if(General.Map.VisualCamera.Position.z > (ceilheight - cameraceilingoffset - 0.01f))
{

View file

@ -218,10 +218,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
bool ceilingRequired = ef.VavoomType; //mxd
if(ef.VavoomType || !ef.IgnoreBottomHeight) {
//mxd. if normals match - check the offsets
//mxd. check if 3d floor is between real floor and ceiling
if(!ef.VavoomType) {
if(ef.Ceiling.plane.Normal == floor.Level.plane.Normal) {
if(-floor.Level.plane.Offset < ef.Ceiling.plane.Offset) {
if(ef.Ceiling.plane.GetInverted().Normal == floor.Level.plane.Normal) {
if(-floor.Level.plane.Offset < ef.Ceiling.plane.Offset && ceiling.Level.plane.Offset > ef.Ceiling.plane.Offset) {
floorRequired = true;
} else if(-floor.Level.plane.Offset == ef.Ceiling.plane.Offset) {
//mxd. check if 3d floor is higher than real one at any vertex
@ -253,11 +253,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
}
//mxd. check if 3d ceiling is lower than real one at any vertex
//mxd. check if 3d ceiling is between real floor and ceiling
if(!ef.VavoomType) {
if(ef.Floor.plane.Normal == ceiling.Level.plane.Normal) {
if(-ceiling.Level.plane.Offset > ef.Floor.plane.Offset) {
floorRequired = true;
if(ef.Floor.plane.GetInverted().Normal == ceiling.Level.plane.Normal) {
if(ceiling.Level.plane.Offset > -ef.Floor.plane.Offset && -floor.Level.plane.Offset < -ef.Floor.plane.Offset) {
ceilingRequired = true;
} else if(-ceiling.Level.plane.Offset == ef.Floor.plane.Offset) {
//mxd. check if 3d floor is higher than real one at any vertex
ceilingRequired = checkCeilingVertices(ceiling.Vertices, ef.Floor.plane);

View file

@ -14,10 +14,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
#region ================== Variables
// VisualMode
private BaseVisualMode mode;
private readonly BaseVisualMode mode;
// Sector for which this data is
private Sector sector;
private readonly Sector sector;
// Levels have been updated?
private bool updated;
@ -26,20 +26,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
private bool isupdating;
// All planes in the sector that cast or are affected by light
private List<SectorLevel> lightlevels;
private readonly List<SectorLevel> lightlevels;
// Effects
private List<SectorEffect> alleffects;
private List<Effect3DFloor> extrafloors;
private readonly List<SectorEffect> alleffects;
private readonly List<Effect3DFloor> extrafloors;
// Sectors that must be updated when this sector is changed
// The boolean value is the 'includeneighbours' of the UpdateSectorGeometry function which
// indicates if the sidedefs of neighbouring sectors should also be rebuilt.
private Dictionary<Sector, bool> updatesectors;
private readonly Dictionary<Sector, bool> updatesectors;
// Original floor and ceiling levels
private SectorLevel floor;
private SectorLevel ceiling;
private readonly SectorLevel floor;
private readonly SectorLevel ceiling;
// This helps keeping track of changes
// otherwise we update ceiling/floor too much
@ -258,7 +258,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Sort the levels (but not the first and the last)
SectorLevelComparer comparer = new SectorLevelComparer(sector);
lightlevels.Sort(1, lightlevels.Count - 2, comparer);
lightlevels.Sort(0, lightlevels.Count, comparer); //mxd. Was lightlevels.Sort(1, lightlevels.Count - 2, comparer);
// Now that we know the levels in this sector (and in the right order) we
// can determine the lighting in between and on the levels.