Preferences -> Interface: added "Select texture group when opening image browsers" option. When enabled, the group current texture belongs to will be selected when opening image browsers (DB2 behavior). When disabled, "All" texture group will be selected.

Event lines: added event lines for polyobject anchor -> polyobject start spot pairs.
Fixed, Things mode: event lines were not drawn after finishing panning.
This commit is contained in:
MaxED 2015-03-06 19:12:12 +00:00
parent 0993c189ea
commit 1d06e57750
9 changed files with 112 additions and 46 deletions

View file

@ -91,6 +91,7 @@ namespace CodeImp.DoomBuilder.Config
private bool toolbarfile;
private float filteranisotropy;
private bool showtexturesizes;
private bool locatetexturegroup; //mxd
private SplitLineBehavior splitlinebehavior; //mxd
//mxd
@ -175,6 +176,7 @@ namespace CodeImp.DoomBuilder.Config
public bool ToolbarFile { get { return toolbarfile; } internal set { toolbarfile = value; } }
public float FilterAnisotropy { get { return filteranisotropy; } internal set { filteranisotropy = value; } }
public bool ShowTextureSizes { get { return showtexturesizes; } internal set { showtexturesizes = value; } }
public bool LocateTextureGroup { get { return locatetexturegroup; } internal set { locatetexturegroup = value; } } //mxd
public SplitLineBehavior SplitLineBehavior { get { return splitlinebehavior; } set { splitlinebehavior = value; } } //mxd
//mxd
@ -282,6 +284,7 @@ namespace CodeImp.DoomBuilder.Config
toolbarfile = cfg.ReadSetting("toolbarfile", true);
filteranisotropy = cfg.ReadSetting("filteranisotropy", 8.0f);
showtexturesizes = cfg.ReadSetting("showtexturesizes", true);
locatetexturegroup = cfg.ReadSetting("locatetexturegroup", true); //mxd
splitlinebehavior = (SplitLineBehavior) General.Clamp(cfg.ReadSetting("splitlinebehavior", 0), 0, 3); //mxd
//mxd
@ -371,6 +374,7 @@ namespace CodeImp.DoomBuilder.Config
cfg.WriteSetting("toolbarfile", toolbarfile);
cfg.WriteSetting("filteranisotropy", filteranisotropy);
cfg.WriteSetting("showtexturesizes", showtexturesizes);
cfg.WriteSetting("locatetexturegroup", locatetexturegroup); //mxd
cfg.WriteSetting("splitlinebehavior", (int)splitlinebehavior); //mxd
//mxd

View file

@ -16,6 +16,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
public bool ProcessThingsWithGoal;
public bool ProcessCameras;
public bool ProcessActorMovers;
public bool ProcessPolyobjects;
}
public static List<Line3D> GetThingLinks(ICollection<VisualThing> visualThings)
@ -32,7 +33,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
public static List<Line3D> GetThingLinks(ICollection<Thing> things)
{
ThingsCheckResult result = CheckThings(things);
if (result.ProcessPathNodes || result.ProcessInterpolationPoints || result.ProcessThingsWithGoal || result.ProcessCameras)
if (result.ProcessPathNodes || result.ProcessInterpolationPoints || result.ProcessThingsWithGoal || result.ProcessCameras || result.ProcessPolyobjects)
return GetThingLinks(result, false);
return new List<Line3D>();
}
@ -47,6 +48,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
result.ProcessPathNodes = true;
else if(t.Type == 9070) //zdoom camera interpolation point
result.ProcessInterpolationPoints = true;
else if(t.Type > 9299 && t.Type < 9304) //polyobjects
result.ProcessPolyobjects = true;
else if(t.Action == 229 && t.Args[1] != 0) //Thing_SetGoal
result.ProcessThingsWithGoal = true;
else if(t.Type == 9072 && (t.Args[0] != 0 || t.Args[1] != 0)) //camera with a path
@ -55,12 +58,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
result.ProcessActorMovers = true;
}
if(result.ProcessActorMovers || result.ProcessCameras)
result.ProcessInterpolationPoints = true;
if(result.ProcessThingsWithGoal)
result.ProcessPathNodes = true;
if(result.ProcessActorMovers || result.ProcessCameras) result.ProcessInterpolationPoints = true;
if(result.ProcessThingsWithGoal) result.ProcessPathNodes = true;
return result;
}
@ -73,6 +72,8 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
List<Thing> cameras = new List<Thing>();
List<Thing> actorMovers = new List<Thing>();
Dictionary<int, List<Thing>> actorMoverTargets = new Dictionary<int, List<Thing>>();
Dictionary<int, List<Thing>> polyobjectAnchors = new Dictionary<int, List<Thing>>(); //angle, list of PolyobjectAnchor things (9300)
Dictionary<int, List<Thing>> polyobjectStartSpots = new Dictionary<int, List<Thing>>(); //angle, list of PolyobjectStartSpot things (9301-9303)
//collect relevant things
foreach (Thing t in General.Map.Map.Things)
@ -83,18 +84,38 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
pathNodes[t.Tag] = new List<Thing>();
pathNodes[t.Tag].Add(t);
}
if(result.ProcessInterpolationPoints && t.Type == 9070)
{
if(!interpolationPoints.ContainsKey(t.Tag))
interpolationPoints[t.Tag] = new List<Thing>();
interpolationPoints[t.Tag].Add(t);
}
if (result.ProcessThingsWithGoal && t.Action == 229 && t.Args[1] != 0)
thingsWithGoal.Add(t);
if (result.ProcessCameras && t.Type == 9072 && (t.Args[0] != 0 || t.Args[1] != 0))
cameras.Add(t);
if(result.ProcessActorMovers && t.Type == 9074 && (t.Args[0] != 0 || t.Args[1] != 0) && t.Args[3] != 0)
actorMovers.Add(t);
if(result.ProcessPolyobjects)
{
if(t.Type == 9300)
{
if(!polyobjectAnchors.ContainsKey(t.AngleDoom))
polyobjectAnchors[t.AngleDoom] = new List<Thing>();
polyobjectAnchors[t.AngleDoom].Add(t);
}
else if(t.Type > 9300 && t.Type < 9304)
{
if(!polyobjectStartSpots.ContainsKey(t.AngleDoom))
polyobjectStartSpots[t.AngleDoom] = new List<Thing>();
polyobjectStartSpots[t.AngleDoom].Add(t);
}
}
}
if(actorMovers.Count > 0)
@ -250,6 +271,24 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
}
}
//process polyobjects
if(result.ProcessPolyobjects)
{
foreach(KeyValuePair<int, List<Thing>> group in polyobjectAnchors)
{
if(!polyobjectStartSpots.ContainsKey(group.Key)) continue;
foreach(Thing anchor in group.Value)
{
start = anchor.Position;
foreach(Thing startspot in polyobjectStartSpots[group.Key])
{
end = startspot.Position;
lines.Add(new Line3D(start, end, Line3DType.ACTIVATOR));
}
}
}
}
return lines;
}

View file

@ -39,6 +39,7 @@ namespace CodeImp.DoomBuilder.Windows
System.Windows.Forms.Label label20;
System.Windows.Forms.Label label21;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PreferencesForm));
this.locatetexturegroup = new System.Windows.Forms.CheckBox();
this.recentFiles = new Dotnetrix.Controls.TrackBar();
this.labelRecentFiles = new System.Windows.Forms.Label();
this.label25 = new System.Windows.Forms.Label();
@ -241,6 +242,7 @@ namespace CodeImp.DoomBuilder.Windows
//
// groupBox1
//
groupBox1.Controls.Add(this.locatetexturegroup);
groupBox1.Controls.Add(this.recentFiles);
groupBox1.Controls.Add(this.labelRecentFiles);
groupBox1.Controls.Add(this.label25);
@ -268,6 +270,18 @@ namespace CodeImp.DoomBuilder.Windows
groupBox1.TabStop = false;
groupBox1.Text = " Options ";
//
// locatetexturegroup
//
this.locatetexturegroup.AutoSize = true;
this.locatetexturegroup.Location = new System.Drawing.Point(32, 329);
this.locatetexturegroup.Name = "locatetexturegroup";
this.locatetexturegroup.Size = new System.Drawing.Size(267, 17);
this.locatetexturegroup.TabIndex = 49;
this.locatetexturegroup.Text = "Select texture group when opening image browsers";
this.toolTip1.SetToolTip(this.locatetexturegroup, "When enabled, the group current texture belongs to\r\nwill be selected when opening" +
" image browsers.\r\nWhen disabled, \"All\" texture group will be selected.");
this.locatetexturegroup.UseVisualStyleBackColor = true;
//
// recentFiles
//
this.recentFiles.LargeChange = 1;
@ -334,7 +348,7 @@ namespace CodeImp.DoomBuilder.Windows
// cbSynchCameras
//
this.cbSynchCameras.AutoSize = true;
this.cbSynchCameras.Location = new System.Drawing.Point(32, 343);
this.cbSynchCameras.Location = new System.Drawing.Point(32, 349);
this.cbSynchCameras.Name = "cbSynchCameras";
this.cbSynchCameras.Size = new System.Drawing.Size(260, 17);
this.cbSynchCameras.TabIndex = 42;
@ -344,7 +358,7 @@ namespace CodeImp.DoomBuilder.Windows
// showtexturesizes
//
this.showtexturesizes.AutoSize = true;
this.showtexturesizes.Location = new System.Drawing.Point(32, 319);
this.showtexturesizes.Location = new System.Drawing.Point(32, 309);
this.showtexturesizes.Name = "showtexturesizes";
this.showtexturesizes.Size = new System.Drawing.Size(208, 17);
this.showtexturesizes.TabIndex = 41;
@ -354,7 +368,7 @@ namespace CodeImp.DoomBuilder.Windows
// scriptontop
//
this.scriptontop.AutoSize = true;
this.scriptontop.Location = new System.Drawing.Point(32, 295);
this.scriptontop.Location = new System.Drawing.Point(32, 289);
this.scriptontop.Name = "scriptontop";
this.scriptontop.Size = new System.Drawing.Size(227, 17);
this.scriptontop.TabIndex = 40;
@ -2056,5 +2070,6 @@ namespace CodeImp.DoomBuilder.Windows
private Dotnetrix.Controls.TrackBar vertexScale3D;
private System.Windows.Forms.Label vertexScale3DLabel;
private System.Windows.Forms.Label label26;
private System.Windows.Forms.CheckBox locatetexturegroup;
}
}

View file

@ -94,6 +94,7 @@ namespace CodeImp.DoomBuilder.Windows
toolbar_testing.Checked = General.Settings.ToolbarTesting;
showtexturesizes.Checked = General.Settings.ShowTextureSizes;
//mxd
locatetexturegroup.Checked = General.Settings.LocateTextureGroup;
toolbar_gzdoom.Checked = General.Settings.GZToolbarGZDoom;
cbSynchCameras.Checked = General.Settings.GZSynchCameras;
tbDynLightCount.Value = General.Clamp(General.Settings.GZMaxDynamicLights, tbDynLightCount.Minimum, tbDynLightCount.Maximum);
@ -261,6 +262,7 @@ namespace CodeImp.DoomBuilder.Windows
General.Settings.ToolbarTesting = toolbar_testing.Checked;
General.Settings.GZToolbarGZDoom = toolbar_gzdoom.Checked; //mxd
General.Settings.ShowTextureSizes = showtexturesizes.Checked;
General.Settings.LocateTextureGroup = locatetexturegroup.Checked; //mxd
General.Settings.MaxRecentFiles = recentFiles.Value; //mxd
General.Settings.ScreenshotsPath = screenshotsfolderpath.Text.Trim(); //mxd

View file

@ -144,9 +144,6 @@
<metadata name="label21.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="snippetsallmanstyle.ToolTip" xml:space="preserve">
<value>When enabled, the opening brace
will be placed on a new line.

View file

@ -121,45 +121,49 @@ namespace CodeImp.DoomBuilder.Windows
item.ImageIndex = 1;
item.SelectedImageIndex = item.ImageIndex;
//mxd. Get the previously selected texture set
string selectname = General.Settings.ReadSetting("browserwindow.textureset", "");
TreeNode match;
// When texture name is empty, select "All" texture set
if(string.IsNullOrEmpty(selectname) || selectname == "-")
//mxd. Should we bother finding the correct texture set?
if(General.Settings.LocateTextureGroup)
{
match = tvTextureSets.Nodes[tvTextureSets.Nodes.Count - 1];
}
else
{
match = FindNodeByName(tvTextureSets.Nodes, selectname);
}
//mxd. Get the previously selected texture set
string selectname = General.Settings.ReadSetting("browserwindow.textureset", "");
TreeNode match;
if (match != null)
{
IFilledTextureSet set = (match.Tag as IFilledTextureSet);
foreach (ImageData img in set.Textures)
// When texture name is empty, select "All" texture set
if(string.IsNullOrEmpty(selectname) || selectname == "-")
{
if (img.LongName == longname)
match = tvTextureSets.Nodes[tvTextureSets.Nodes.Count - 1];
}
else
{
match = FindNodeByName(tvTextureSets.Nodes, selectname);
}
if(match != null)
{
IFilledTextureSet set = (match.Tag as IFilledTextureSet);
foreach(ImageData img in set.Textures)
{
selectedset = match;
break;
if(img.LongName == longname)
{
selectedset = match;
break;
}
}
}
}
//mxd. If the selected texture was not found in the last-selected set, try finding it in the other sets
if (selectedset == null && selecttexture != "-")
{
foreach (TreeNode n in tvTextureSets.Nodes)
//mxd. If the selected texture was not found in the last-selected set, try finding it in the other sets
if(selectedset == null && selecttexture != "-")
{
selectedset = FindTextureByLongName(n, longname);
if (selectedset != null) break;
foreach(TreeNode n in tvTextureSets.Nodes)
{
selectedset = FindTextureByLongName(n, longname);
if(selectedset != null) break;
}
}
}
//mxd. Texture still not found? Then just select the last used set
if (selectedset == null && match != null)
selectedset = match;
//mxd. Texture still not found? Then just select the last used set
if(selectedset == null && match != null) selectedset = match;
}
//mxd. Select the found set or "All", if none were found
if (tvTextureSets.Nodes.Count > 0)

View file

@ -178,7 +178,7 @@ namespace CodeImp.DoomBuilder.Windows
// Coordination
angle.Text = ft.AngleDoom.ToString();
zlabel.Text = useAbsoluteHeight ? "Abs. Z:" : "Z:"; //mxd
zlabel.Text = useAbsoluteHeight ? "Z:" : "Height:"; //mxd
cbAbsoluteHeight.Checked = useAbsoluteHeight; //mxd
//mxd
@ -535,7 +535,7 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
useAbsoluteHeight = cbAbsoluteHeight.Checked;
zlabel.Text = (useAbsoluteHeight ? "Abs. Z:" : "Z:");
zlabel.Text = (useAbsoluteHeight ? "Z:" : "Height:");
preventchanges = true;

View file

@ -195,7 +195,6 @@ namespace CodeImp.DoomBuilder.Windows
// Coordination
angle.Text = ft.AngleDoom.ToString();
zlabel.Text = useAbsoluteHeight ? "Abs. Z:" : "Z:"; //mxd
cbAbsoluteHeight.Checked = useAbsoluteHeight; //mxd
//mxd
@ -707,7 +706,6 @@ namespace CodeImp.DoomBuilder.Windows
MakeUndo(); //mxd
useAbsoluteHeight = cbAbsoluteHeight.Checked;
zlabel.Text = useAbsoluteHeight ? "Abs. Z:" : "Z:";
preventchanges = true;

View file

@ -450,6 +450,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
base.OnEditEnd();
}
//mxd. Otherwise event lines won't be drawn after panning finishes.
protected override void EndViewPan()
{
base.EndViewPan();
if(General.Settings.GZShowEventLines) General.Interface.RedrawDisplay();
}
//mxd
private void thingEditForm_OnValuesChanged(object sender, EventArgs e)
{