diff --git a/Build/Configurations/Boom.cfg b/Build/Configurations/Boom.cfg index a1481c03..89e0ee94 100644 --- a/Build/Configurations/Boom.cfg +++ b/Build/Configurations/Boom.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Doom.cfg b/Build/Configurations/Doom.cfg index 80527970..2572c88b 100644 --- a/Build/Configurations/Doom.cfg +++ b/Build/Configurations/Doom.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Doom2.cfg b/Build/Configurations/Doom2.cfg index a95f1619..191d830a 100644 --- a/Build/Configurations/Doom2.cfg +++ b/Build/Configurations/Doom2.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Edge.cfg b/Build/Configurations/Edge.cfg index 92ca1dcb..70855d12 100644 --- a/Build/Configurations/Edge.cfg +++ b/Build/Configurations/Edge.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Eternity_Doom.cfg b/Build/Configurations/Eternity_Doom.cfg index c01d1f26..21dcd07b 100644 --- a/Build/Configurations/Eternity_Doom.cfg +++ b/Build/Configurations/Eternity_Doom.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Eternity_DoomUDMF.cfg b/Build/Configurations/Eternity_DoomUDMF.cfg index 2f4fc7d6..5dd21ab6 100644 --- a/Build/Configurations/Eternity_DoomUDMF.cfg +++ b/Build/Configurations/Eternity_DoomUDMF.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = "blocksound"; singlesidedflag = "blocking"; diff --git a/Build/Configurations/Heretic.cfg b/Build/Configurations/Heretic.cfg index 29f193d7..741767dd 100644 --- a/Build/Configurations/Heretic.cfg +++ b/Build/Configurations/Heretic.cfg @@ -30,6 +30,9 @@ skills 5 = "Black plague possesses thee"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Hexen.cfg b/Build/Configurations/Hexen.cfg index 303c6f1f..28877eef 100644 --- a/Build/Configurations/Hexen.cfg +++ b/Build/Configurations/Hexen.cfg @@ -30,6 +30,9 @@ skills 5 = "Titan / Pope / Archimage"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = false; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Legacy.cfg b/Build/Configurations/Legacy.cfg index b86ff9fd..05a0beb1 100644 --- a/Build/Configurations/Legacy.cfg +++ b/Build/Configurations/Legacy.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Risen3D.cfg b/Build/Configurations/Risen3D.cfg index 4ed7b3f8..7bd06fa2 100644 --- a/Build/Configurations/Risen3D.cfg +++ b/Build/Configurations/Risen3D.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Skulltag_Doom.cfg b/Build/Configurations/Skulltag_Doom.cfg index 2938db20..ed338921 100644 --- a/Build/Configurations/Skulltag_Doom.cfg +++ b/Build/Configurations/Skulltag_Doom.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Skulltag_DoomHexen.cfg b/Build/Configurations/Skulltag_DoomHexen.cfg index 3ba15343..7ffb7414 100644 --- a/Build/Configurations/Skulltag_DoomHexen.cfg +++ b/Build/Configurations/Skulltag_DoomHexen.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = false; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/Strife.cfg b/Build/Configurations/Strife.cfg index efb24f87..11d882cf 100644 --- a/Build/Configurations/Strife.cfg +++ b/Build/Configurations/Strife.cfg @@ -30,6 +30,9 @@ skills 5 = "Bloodbath"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/UltDoom.cfg b/Build/Configurations/UltDoom.cfg index 81ba53dc..c54d0a22 100644 --- a/Build/Configurations/UltDoom.cfg +++ b/Build/Configurations/UltDoom.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/ZDoom_Doom.cfg b/Build/Configurations/ZDoom_Doom.cfg index 2232ef00..ba2dbe4a 100644 --- a/Build/Configurations/ZDoom_Doom.cfg +++ b/Build/Configurations/ZDoom_Doom.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/ZDoom_DoomHexen.cfg b/Build/Configurations/ZDoom_DoomHexen.cfg index 3ba6f4cd..58830293 100644 --- a/Build/Configurations/ZDoom_DoomHexen.cfg +++ b/Build/Configurations/ZDoom_DoomHexen.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = false; + // Special linedefs // See linedefflags soundlinedefflag = 64; diff --git a/Build/Configurations/ZDoom_DoomUDMF.cfg b/Build/Configurations/ZDoom_DoomUDMF.cfg index 3325ac89..cb6bd9e2 100644 --- a/Build/Configurations/ZDoom_DoomUDMF.cfg +++ b/Build/Configurations/ZDoom_DoomUDMF.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = false; + // Special linedefs // See linedefflags soundlinedefflag = "blocksound"; diff --git a/Build/Configurations/ZDoom_HereticHexen.cfg b/Build/Configurations/ZDoom_HereticHexen.cfg index 0ff8d14c..62e2daa4 100644 --- a/Build/Configurations/ZDoom_HereticHexen.cfg +++ b/Build/Configurations/ZDoom_HereticHexen.cfg @@ -30,6 +30,9 @@ skills 5 = "Black plague possesses thee"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = false; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/ZDoom_Hexen.cfg b/Build/Configurations/ZDoom_Hexen.cfg index 49885d79..49eadc6c 100644 --- a/Build/Configurations/ZDoom_Hexen.cfg +++ b/Build/Configurations/ZDoom_Hexen.cfg @@ -30,6 +30,9 @@ skills 5 = "Titan / Pope / Archimage"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = false; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/ZDoom_StrifeHexen.cfg b/Build/Configurations/ZDoom_StrifeHexen.cfg index 1087c5aa..2e2040f8 100644 --- a/Build/Configurations/ZDoom_StrifeHexen.cfg +++ b/Build/Configurations/ZDoom_StrifeHexen.cfg @@ -30,6 +30,9 @@ skills 5 = "Bloodbath"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = false; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Build/Configurations/jDoom.cfg b/Build/Configurations/jDoom.cfg index 3f0d8865..214ee4ca 100644 --- a/Build/Configurations/jDoom.cfg +++ b/Build/Configurations/jDoom.cfg @@ -30,6 +30,9 @@ skills 5 = "Nightmare!"; } +// When this is set to true, sectors with the same tag will light up when a line is highlighted +linetagindicatesectors = true; + // Special linedefs soundlinedefflag = 64; // See linedefflags singlesidedflag = 1; // See linedefflags diff --git a/Source/BuilderModes/ClassicModes/LinedefsMode.cs b/Source/BuilderModes/ClassicModes/LinedefsMode.cs index 9ac8dcdd..60dd6240 100644 --- a/Source/BuilderModes/ClassicModes/LinedefsMode.cs +++ b/Source/BuilderModes/ClassicModes/LinedefsMode.cs @@ -83,46 +83,54 @@ namespace CodeImp.DoomBuilder.BuilderModes // Often we can get away by simply undrawing the previous // highlight and drawing the new highlight. But if associations // are or were drawn we need to redraw the entire display. - + // Previous association highlights something? if((highlighted != null) && (highlighted.Tag > 0)) completeredraw = true; - + // Set highlight association if(l != null) highlightasso.Set(l.Tag, UniversalType.LinedefTag); else highlightasso.Set(0, 0); - - // New association highlights something? - if((l != null) && (l.Tag > 0)) completeredraw = true; - + if(l != null) { - // Check if we can find the linedefs action - if((l.Action > 0) && General.Map.Config.LinedefActions.ContainsKey(l.Action)) - action = General.Map.Config.LinedefActions[l.Action]; - } - - // Determine linedef associations - for(int i = 0; i < Linedef.NUM_ARGS; i++) - { - // Previous association highlights something? - if((association[i].type == UniversalType.SectorTag) || - (association[i].type == UniversalType.LinedefTag) || - (association[i].type == UniversalType.ThingTag)) completeredraw = true; - - // Make new association - if(action != null) - association[i].Set(l.Args[i], action.Args[i].Type); - else - association[i].Set(0, 0); - // New association highlights something? - if((association[i].type == UniversalType.SectorTag) || - (association[i].type == UniversalType.LinedefTag) || - (association[i].type == UniversalType.ThingTag)) completeredraw = true; - } + if(l.Tag > 0) completeredraw = true; + + // Use the line tag to highlight sectors (Doom style) + if(General.Map.Config.LineTagIndicatesSectors) + { + association[0].Set(l.Tag, UniversalType.SectorTag); + } + else + { + // Check if we can find the linedefs action + if((l.Action > 0) && General.Map.Config.LinedefActions.ContainsKey(l.Action)) + action = General.Map.Config.LinedefActions[l.Action]; + + // Determine linedef associations + for(int i = 0; i < Linedef.NUM_ARGS; i++) + { + // Previous association highlights something? + if((association[i].type == UniversalType.SectorTag) || + (association[i].type == UniversalType.LinedefTag) || + (association[i].type == UniversalType.ThingTag)) completeredraw = true; + // Make new association + if(action != null) + association[i].Set(l.Args[i], action.Args[i].Type); + else + association[i].Set(0, 0); + + // New association highlights something? + if((association[i].type == UniversalType.SectorTag) || + (association[i].type == UniversalType.LinedefTag) || + (association[i].type == UniversalType.ThingTag)) completeredraw = true; + } + } + } + // If we're changing associations, then we // need to redraw the entire display if(completeredraw) diff --git a/Source/BuilderModes/General/BuilderPlug.cs b/Source/BuilderModes/General/BuilderPlug.cs index 260fadf0..b0b577e1 100644 --- a/Source/BuilderModes/General/BuilderPlug.cs +++ b/Source/BuilderModes/General/BuilderPlug.cs @@ -244,19 +244,35 @@ namespace CodeImp.DoomBuilder.BuilderModes { // Tag must be above zero if(asso.tag <= 0) return; - - // Linedefs - foreach(Linedef l in General.Map.Map.Linedefs) + + // Doom style referencing to sectors? + if(General.Map.Config.LineTagIndicatesSectors && (asso.type == UniversalType.SectorTag)) { - // Known action on this line? - if((l.Action > 0) && General.Map.Config.LinedefActions.ContainsKey(l.Action)) + // Linedefs + foreach(Linedef l in General.Map.Map.Linedefs) { - LinedefActionInfo action = General.Map.Config.LinedefActions[l.Action]; - if((action.Args[0].Type == (int)asso.type) && (l.Args[0] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); - if((action.Args[1].Type == (int)asso.type) && (l.Args[1] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); - if((action.Args[2].Type == (int)asso.type) && (l.Args[2] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); - if((action.Args[3].Type == (int)asso.type) && (l.Args[3] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); - if((action.Args[4].Type == (int)asso.type) && (l.Args[4] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); + // Any action on this line? + if(l.Action > 0) + { + if(l.Tag == asso.tag) renderer.PlotLinedef(l, General.Colors.Indication); + } + } + } + else + { + // Linedefs + foreach(Linedef l in General.Map.Map.Linedefs) + { + // Known action on this line? + if((l.Action > 0) && General.Map.Config.LinedefActions.ContainsKey(l.Action)) + { + LinedefActionInfo action = General.Map.Config.LinedefActions[l.Action]; + if((action.Args[0].Type == (int)asso.type) && (l.Args[0] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); + if((action.Args[1].Type == (int)asso.type) && (l.Args[1] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); + if((action.Args[2].Type == (int)asso.type) && (l.Args[2] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); + if((action.Args[3].Type == (int)asso.type) && (l.Args[3] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); + if((action.Args[4].Type == (int)asso.type) && (l.Args[4] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); + } } } } diff --git a/Source/Config/GameConfiguration.cs b/Source/Config/GameConfiguration.cs index a793898e..786d5bce 100644 --- a/Source/Config/GameConfiguration.cs +++ b/Source/Config/GameConfiguration.cs @@ -65,6 +65,7 @@ namespace CodeImp.DoomBuilder.Config private string makedoortrack; private int makedooraction; private int[] makedoorargs; + private bool linetagindicatesectors; // Skills private List skills; @@ -137,6 +138,7 @@ namespace CodeImp.DoomBuilder.Config public string MakeDoorTrack { get { return makedoortrack; } } public int MakeDoorAction { get { return makedooraction; } } public int[] MakeDoorArgs { get { return makedoorargs; } } + public bool LineTagIndicatesSectors { get { return linetagindicatesectors ; } } // Skills public List Skills { get { return skills; } } @@ -231,6 +233,7 @@ namespace CodeImp.DoomBuilder.Config testparameters = cfg.ReadSetting("testparameters", ""); makedoortrack = cfg.ReadSetting("makedoortrack", "-"); makedooraction = cfg.ReadSetting("makedooraction", 0); + linetagindicatesectors = cfg.ReadSetting("linetagindicatesectors", false); for(int i = 0; i < Linedef.NUM_ARGS; i++) makedoorargs[i] = cfg.ReadSetting("makedoorarg" + i.ToString(CultureInfo.InvariantCulture), 0); // Flags have special (invariant culture) conversion