0
0
Fork 0
mirror of https://git.do.srb2.org/STJr/UltimateZoneBuilder.git synced 2025-02-27 22:31:23 +00:00

associations coloring now also works for Doom (lines referring to sectors using their own tag)

This commit is contained in:
codeimp 2009-01-07 16:05:17 +00:00
parent 447ad32c57
commit 2839d82df5
24 changed files with 130 additions and 40 deletions

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = "blocksound"; soundlinedefflag = "blocksound";
singlesidedflag = "blocking"; singlesidedflag = "blocking";

View file

@ -30,6 +30,9 @@ skills
5 = "Black plague possesses thee"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Titan / Pope / Archimage"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Bloodbath"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
// See linedefflags // See linedefflags
soundlinedefflag = 64; soundlinedefflag = 64;

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
// See linedefflags // See linedefflags
soundlinedefflag = "blocksound"; soundlinedefflag = "blocksound";

View file

@ -30,6 +30,9 @@ skills
5 = "Black plague possesses thee"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Titan / Pope / Archimage"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Bloodbath"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -30,6 +30,9 @@ skills
5 = "Nightmare!"; 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 // Special linedefs
soundlinedefflag = 64; // See linedefflags soundlinedefflag = 64; // See linedefflags
singlesidedflag = 1; // See linedefflags singlesidedflag = 1; // See linedefflags

View file

@ -83,46 +83,54 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Often we can get away by simply undrawing the previous // Often we can get away by simply undrawing the previous
// highlight and drawing the new highlight. But if associations // highlight and drawing the new highlight. But if associations
// are or were drawn we need to redraw the entire display. // are or were drawn we need to redraw the entire display.
// Previous association highlights something? // Previous association highlights something?
if((highlighted != null) && (highlighted.Tag > 0)) completeredraw = true; if((highlighted != null) && (highlighted.Tag > 0)) completeredraw = true;
// Set highlight association // Set highlight association
if(l != null) if(l != null)
highlightasso.Set(l.Tag, UniversalType.LinedefTag); highlightasso.Set(l.Tag, UniversalType.LinedefTag);
else else
highlightasso.Set(0, 0); highlightasso.Set(0, 0);
// New association highlights something?
if((l != null) && (l.Tag > 0)) completeredraw = true;
if(l != null) 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? // New association highlights something?
if((association[i].type == UniversalType.SectorTag) || if(l.Tag > 0) completeredraw = true;
(association[i].type == UniversalType.LinedefTag) ||
(association[i].type == UniversalType.ThingTag)) 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 // If we're changing associations, then we
// need to redraw the entire display // need to redraw the entire display
if(completeredraw) if(completeredraw)

View file

@ -244,19 +244,35 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Tag must be above zero // Tag must be above zero
if(asso.tag <= 0) return; if(asso.tag <= 0) return;
// Linedefs // Doom style referencing to sectors?
foreach(Linedef l in General.Map.Map.Linedefs) if(General.Map.Config.LineTagIndicatesSectors && (asso.type == UniversalType.SectorTag))
{ {
// Known action on this line? // Linedefs
if((l.Action > 0) && General.Map.Config.LinedefActions.ContainsKey(l.Action)) foreach(Linedef l in General.Map.Map.Linedefs)
{ {
LinedefActionInfo action = General.Map.Config.LinedefActions[l.Action]; // Any action on this line?
if((action.Args[0].Type == (int)asso.type) && (l.Args[0] == asso.tag)) renderer.PlotLinedef(l, General.Colors.Indication); if(l.Action > 0)
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(l.Tag == 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); }
}
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);
}
} }
} }
} }

View file

@ -65,6 +65,7 @@ namespace CodeImp.DoomBuilder.Config
private string makedoortrack; private string makedoortrack;
private int makedooraction; private int makedooraction;
private int[] makedoorargs; private int[] makedoorargs;
private bool linetagindicatesectors;
// Skills // Skills
private List<SkillInfo> skills; private List<SkillInfo> skills;
@ -137,6 +138,7 @@ namespace CodeImp.DoomBuilder.Config
public string MakeDoorTrack { get { return makedoortrack; } } public string MakeDoorTrack { get { return makedoortrack; } }
public int MakeDoorAction { get { return makedooraction; } } public int MakeDoorAction { get { return makedooraction; } }
public int[] MakeDoorArgs { get { return makedoorargs; } } public int[] MakeDoorArgs { get { return makedoorargs; } }
public bool LineTagIndicatesSectors { get { return linetagindicatesectors ; } }
// Skills // Skills
public List<SkillInfo> Skills { get { return skills; } } public List<SkillInfo> Skills { get { return skills; } }
@ -231,6 +233,7 @@ namespace CodeImp.DoomBuilder.Config
testparameters = cfg.ReadSetting("testparameters", ""); testparameters = cfg.ReadSetting("testparameters", "");
makedoortrack = cfg.ReadSetting("makedoortrack", "-"); makedoortrack = cfg.ReadSetting("makedoortrack", "-");
makedooraction = cfg.ReadSetting("makedooraction", 0); 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); 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 // Flags have special (invariant culture) conversion