Changed, Thing, Linedef, Sector info panels: flags are now shown in the same order as in corresponding Edit forms.

Changed, Linedef info panel: activation flags are now displayed before "regular" flags and using different color.
Added, Linedef info panel: sidedef flags are now displayed.
This commit is contained in:
MaxED 2015-04-12 21:05:09 +00:00
parent c7d61c22ba
commit ddd057950f
3 changed files with 41 additions and 34 deletions

View file

@ -418,26 +418,40 @@ namespace CodeImp.DoomBuilder.Controls
backpanel.Visible = false; //mxd
}
//mxd. Flags
Dictionary<string, string> activations = new Dictionary<string, string>(StringComparer.Ordinal);
foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates)
activations.Add(ai.Key, ai.Title);
//mxd. Flags and activations
flags.Items.Clear();
foreach(KeyValuePair<string, bool> group in l.Flags)
// Add activations
foreach(LinedefActivateInfo ai in General.Map.Config.LinedefActivates)
{
if(group.Value)
{
ListViewItem item;
if (General.Map.Config.LinedefFlags.ContainsKey(group.Key))
item = new ListViewItem(General.Map.Config.LinedefFlags[group.Key]);
else if (activations.ContainsKey(group.Key))
item = new ListViewItem(activations[group.Key]);
else
item = new ListViewItem(group.Key);
if(l.Flags.ContainsKey(ai.Key) && l.Flags[ai.Key])
flags.Items.Add(new ListViewItem(ai.Title) { Checked = true, ForeColor = SystemColors.HotTrack });
}
item.Checked = true;
flags.Items.Add(item);
// And flags
foreach(KeyValuePair<string, string> group in General.Map.Config.LinedefFlags)
{
if(l.Flags.ContainsKey(group.Key) && l.Flags[group.Key])
flags.Items.Add(new ListViewItem(group.Value) { Checked = true });
}
// And front flags
if(l.Front != null)
{
foreach(KeyValuePair<string, string> group in General.Map.Config.SidedefFlags)
{
if(l.Front.Flags.ContainsKey(group.Key) && l.Front.Flags[group.Key])
flags.Items.Add(new ListViewItem("Front: " + group.Value) { Checked = true });
}
}
// And back flags
if(l.Back != null)
{
foreach(KeyValuePair<string, string> group in General.Map.Config.SidedefFlags)
{
if(l.Back.Flags.ContainsKey(group.Key) && l.Back.Flags[group.Key])
flags.Items.Add(new ListViewItem("Back: " + group.Value) { Checked = true });
}
}

View file

@ -284,14 +284,10 @@ namespace CodeImp.DoomBuilder.Controls
//Flags
flags.Items.Clear();
foreach(KeyValuePair<string, bool> group in s.Flags)
foreach(KeyValuePair<string, string> group in General.Map.Config.SectorFlags)
{
if(group.Value)
{
ListViewItem item = new ListViewItem(General.Map.Config.SectorFlags.ContainsKey(group.Key) ? General.Map.Config.SectorFlags[group.Key] : group.Key);
item.Checked = true;
flags.Items.Add(item);
}
if(s.Flags.ContainsKey(group.Key) && s.Flags[group.Key])
flags.Items.Add(new ListViewItem(group.Value) { Checked = true });
}
//mxd. Flags panel visibility and size

View file

@ -121,9 +121,10 @@ namespace CodeImp.DoomBuilder.Controls
infopanel.Text = " Thing " + t.Index + " ";
type.Text = t.Type + " - " + ti.Title;
action.Text = actioninfo;
labelclass.Enabled = !string.IsNullOrEmpty(ti.ClassName); //mxd
classname.Enabled = labelclass.Enabled; //mxd
classname.Text = (!string.IsNullOrEmpty(ti.ClassName) ? ti.ClassName : "--"); //mxd
bool displayclassname = !string.IsNullOrEmpty(ti.ClassName) && !ti.ClassName.StartsWith("$"); //mxd
labelclass.Enabled = displayclassname; //mxd
classname.Enabled = displayclassname; //mxd
classname.Text = (displayclassname ? ti.ClassName : "--"); //mxd
position.Text = t.Position.x.ToString(CultureInfo.InvariantCulture) + ", " + t.Position.y.ToString(CultureInfo.InvariantCulture) + ", " + zinfo;
tag.Text = t.Tag + (General.Map.Options.TagLabels.ContainsKey(t.Tag) ? " - " + General.Map.Options.TagLabels[t.Tag] : string.Empty);
angle.Text = t.AngleDoom + "\u00B0";
@ -186,14 +187,10 @@ namespace CodeImp.DoomBuilder.Controls
//mxd. Flags
flags.Items.Clear();
foreach(KeyValuePair<string, bool> group in t.Flags)
foreach(KeyValuePair<string, string> group in General.Map.Config.ThingFlags)
{
if(group.Value)
{
ListViewItem item = new ListViewItem(General.Map.Config.ThingFlags.ContainsKey(group.Key) ? General.Map.Config.ThingFlags[group.Key] : group.Key);
item.Checked = true;
flags.Items.Add(item);
}
if(t.Flags.ContainsKey(group.Key) && t.Flags[group.Key])
flags.Items.Add(new ListViewItem(group.Value) { Checked = true });
}
//mxd. Flags panel visibility and size