If multiple Things/linedefs of different types are selected, show generic flag names

This commit is contained in:
MascaraSnake 2016-01-15 18:06:38 +01:00
parent 1e366ff36e
commit 984c021fe0
2 changed files with 20 additions and 11 deletions

View File

@ -177,7 +177,6 @@ namespace CodeImp.DoomBuilder.Windows
// Flags
LinedefActionInfo li = General.Map.Config.GetLinedefActionInfo(fl.Action);
IDictionary<string, string> newFlags = (li == null || li.Flags.Count == 0) ? General.Map.Config.LinedefFlags : li.Flags;
flags.UpdateCheckboxes(newFlags);
foreach (CheckBox c in flags.Checkboxes)
if(fl.Flags.ContainsKey(c.Tag.ToString())) c.Checked = fl.Flags[c.Tag.ToString()];
@ -232,11 +231,15 @@ namespace CodeImp.DoomBuilder.Windows
// Now go for all lines and change the options when a setting is different
////////////////////////////////////////////////////////////////////////
bool allsameaction = true;
// Go for all lines
foreach(Linedef l in lines)
{
if (l.Action != fl.Action) allsameaction = false;
// Flags
foreach(CheckBox c in flags.Checkboxes)
foreach (CheckBox c in flags.Checkboxes)
{
if(c.CheckState == CheckState.Indeterminate) continue; //mxd
if(l.IsFlagSet(c.Tag.ToString()) != c.Checked)
@ -336,6 +339,8 @@ namespace CodeImp.DoomBuilder.Windows
linedefprops.Add(new LinedefProperties(l));
}
if (allsameaction) flags.UpdateCheckboxes(newFlags);
// Refresh controls so that they show their image
backhigh.Refresh();
backmid.Refresh();

View File

@ -192,7 +192,6 @@ namespace CodeImp.DoomBuilder.Windows
// Flags
ThingTypeInfo ti = General.Map.Data.GetThingInfoEx(ft.Type);
IDictionary<string, string> newFlags = (ti == null || ti.Flags.Count == 0) ? General.Map.Config.ThingFlags : ti.Flags;
flags.UpdateCheckboxes(newFlags);
foreach (CheckBox c in flags.Checkboxes)
if(ft.Flags.ContainsKey(c.Tag.ToString())) c.Checked = ft.Flags[c.Tag.ToString()];
@ -229,6 +228,7 @@ namespace CodeImp.DoomBuilder.Windows
////////////////////////////////////////////////////////////////////////
thingprops = new List<ThingProperties>();
bool allsametype = true;
// Go for all things
foreach(Thing t in things)
@ -236,6 +236,8 @@ namespace CodeImp.DoomBuilder.Windows
//mxd. Update sector info
t.DetermineSector();
if (t.Type != ft.Type) allsametype = false;
// Type does not match?
ThingTypeInfo info = thingtype.GetSelectedInfo(); //mxd
@ -280,6 +282,8 @@ namespace CodeImp.DoomBuilder.Windows
thingprops.Add(new ThingProperties(t));
}
if (allsametype) flags.UpdateCheckboxes(newFlags);
preventchanges = false;
//mxd. Trigger updates manually...