Floor and ceiling brightness levels of 3d-floors can now be edited properly in GZDoom Visual mode.

Updated to Doom Builder 2 r1604:
Stuck thing error checker now also regards thing flags.
This commit is contained in:
MaxED 2012-08-27 11:39:14 +00:00
parent 4d26e1acdc
commit a45b1dd3b9
19 changed files with 2680 additions and 2290 deletions

View file

@ -32,6 +32,30 @@ thingflagstranslation
64 = "!coop";
}
// How thing flags should be compared (for the stuck thing error check)
thingflagscompare
{
skills {
1;
2;
4;
}
gamemodes {
16 {
invert = true;
}
32 {
invert = true;
}
64 {
invert = true;
}
}
}
/*
TEXTURES AND FLAT SOURCES

View file

@ -45,6 +45,23 @@ defaultthingflags
}
// How thing flags should be compared (for the stuck thing error check)
thingflagscompare
{
skills {
1;
2;
4;
}
gamemodes {
16 {
comparemethod = "equal";
}
}
}
// Mask for the thing flags which indicates the options
// that make the same thing appear in the same modes
thingflagsmasks

View file

@ -43,6 +43,27 @@ defaultthingflags
1024;
}
// How thing flags should be compared (for the stuck thing error check)
thingflagscompare
{
skills {
1;
2;
4;
}
classes {
32;
64;
128;
}
gamemodes {
256;
512;
1024;
}
}
// Mask for the thing flags which indicates the options
// that make the same thing appear in the same modes

View file

@ -36,6 +36,31 @@ defaultthingflags
}
// How thing flags should be compared (for the stuck thing error check)
thingflagscompare
{
skills {
skill1;
skill2;
skill3;
skill4;
skill5;
}
gamemodes {
single;
dm;
coop;
}
classes {
class1;
class2;
class3;
}
}
linedefflags
{
blocking = "Impassable";

View file

@ -357,6 +357,14 @@ mapformat_udmf
include("UDMF_misc.cfg", "thingflags");
include("ZDoom_misc.cfg", "thingflags_udmf");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("UDMF_misc.cfg", "thingflagscompare");
include("ZDoom_misc.cfg", "thingflagscompare_udmf");
}
// Things flags masks
include("Hexen_misc.cfg", "thingflagsmasks");
@ -401,6 +409,12 @@ game_doom
{
include("Doom_misc.cfg", "thingsfilters");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Doom_misc.cfg", "thingflagscompare");
}
// Default texture sets
// (these are not required, but useful for new users)
@ -440,6 +454,12 @@ game_heretic
{
include("Doom_misc.cfg", "thingsfilters");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Hexen_misc.cfg", "thingflagscompare");
}
// Default texture sets
// (these are not required, but useful for new users)
@ -481,6 +501,12 @@ game_hexen
include("Hexen_misc.cfg", "thingsfilters");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Hexen_misc.cfg", "thingflagscompare");
}
// Default texture sets
// (these are not required, but useful for new users)
texturesets
@ -520,6 +546,12 @@ game_strife
{
include("Strife_misc.cfg", "thingsfilters");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Doom_misc.cfg", "thingflagscompare");
}
// Default texture sets
// (these are not required, but useful for new users)
@ -558,6 +590,12 @@ game_chex
{
include("Doom_misc.cfg", "thingsfilters");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Doom_misc.cfg", "thingflagscompare");
}
// Default texture sets
// (these are not required, but useful for new users)
@ -596,6 +634,12 @@ game_chex3
{
include("Doom_misc.cfg", "thingsfilters");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Doom_misc.cfg", "thingflagscompare");
}
// Default texture sets
// (these are not required, but useful for new users)
@ -634,6 +678,12 @@ game_harmony
{
include("Doom_misc.cfg", "thingsfilters");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Doom_misc.cfg", "thingflagscompare");
}
// Default texture sets
// (these are not required, but useful for new users)
@ -672,6 +722,12 @@ game_action2
{
include("Doom_misc.cfg", "thingsfilters");
}
// How to compare thing flags (for the stuck things error checker)
thingflagscompare
{
include("Doom_misc.cfg", "thingflagscompare");
}
// Default texture sets
// (these are not required, but useful for new users)

View file

@ -125,6 +125,23 @@ defaultthingflags_udmf
class8;
}
// How thing flags should be compared (for the stuck thing error check)
thingflagscompare_udmf
{
skills {
skill6;
skill7;
skill8;
}
classes {
class4;
class5;
class6;
class7;
class8;
}
}
// Default sector brightness levels
sectorbrightness

View file

@ -160,6 +160,7 @@ keywords
A_SetShootable = "A_SetShootable";
A_SetSolid = "A_SetSolid";
A_SetSpecial = "A_SetSpecial(int special, int arg0, int arg1, int arg2, int arg3, int arg4)";
A_SetTics = "A_SetTics(int tics)";
A_SetTranslucent = "A_SetTranslucent(float alpha, int mode)";
A_SetUserVar = "A_SetUserVar(string name, int value)";
A_TransferPointer = "A_TransferPointer(pointer source, pointer recipient, pointer sourcefield, pointer recipientfield[, int flags])";

View file

@ -657,6 +657,7 @@
<Compile Include="Config\AllTexturesSet.cs" />
<Compile Include="Config\FlagTranslation.cs" />
<Compile Include="Config\PasteOptions.cs" />
<Compile Include="Config\ThingsFlagsCompare.cs" />
<Compile Include="Controls\ButtonsNumericTextboxDesigner.cs" />
<Compile Include="Controls\Docker.cs" />
<Compile Include="Controls\DockersControl.cs">

View file

@ -7,10 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuilderModes", "..\Plugins\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GZDoomEditing", "..\Plugins\GZDoomEditing\GZDoomEditing.csproj", "{760A9BC7-CB73-4C36-858B-994C14996FCD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDMFControls", "..\Plugins\UMDFControls\UDMFControls.csproj", "{2D11C828-295C-463A-8545-CA1AD6D51518}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorPicker", "..\Plugins\ColorPicker\ColorPicker.csproj", "{A4761900-0EA3-4FE4-A919-847FD5080EFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDMFControls", "..\Plugins\UMDFControls\UDMFControls.csproj", "{2D11C828-295C-463A-8545-CA1AD6D51518}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TagExplorer", "..\Plugins\TagExplorer\TagExplorer.csproj", "{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}"
EndProject
Global
@ -53,16 +53,6 @@ Global
{760A9BC7-CB73-4C36-858B-994C14996FCD}.Release|Mixed Platforms.Build.0 = Release|x86
{760A9BC7-CB73-4C36-858B-994C14996FCD}.Release|x86.ActiveCfg = Release|x86
{760A9BC7-CB73-4C36-858B-994C14996FCD}.Release|x86.Build.0 = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|Any CPU.ActiveCfg = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|Mixed Platforms.Build.0 = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|x86.ActiveCfg = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|x86.Build.0 = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|Any CPU.ActiveCfg = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|Mixed Platforms.ActiveCfg = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|Mixed Platforms.Build.0 = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|x86.ActiveCfg = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|x86.Build.0 = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Any CPU.ActiveCfg = Debug|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Mixed Platforms.Build.0 = Debug|x86
@ -73,6 +63,16 @@ Global
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|Mixed Platforms.Build.0 = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|x86.ActiveCfg = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|x86.Build.0 = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|Any CPU.ActiveCfg = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|Mixed Platforms.Build.0 = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|x86.ActiveCfg = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|x86.Build.0 = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|Any CPU.ActiveCfg = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|Mixed Platforms.ActiveCfg = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|Mixed Platforms.Build.0 = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|x86.ActiveCfg = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|x86.Build.0 = Release|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|Any CPU.ActiveCfg = Debug|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|Mixed Platforms.Build.0 = Debug|x86

View file

@ -103,6 +103,7 @@ namespace CodeImp.DoomBuilder.Config
private List<ThingCategory> thingcategories;
private Dictionary<int, ThingTypeInfo> things;
private List<FlagTranslation> thingflagstranslation;
private List<ThingFlagsCompare> thingflagscompare;
// Linedefs
private Dictionary<string, string> linedefflags;
@ -196,6 +197,7 @@ namespace CodeImp.DoomBuilder.Config
public ICollection<string> DefaultThingFlags { get { return defaultthingflags; } }
public IDictionary<string, string> ThingFlags { get { return thingflags; } }
public List<FlagTranslation> ThingFlagsTranslation { get { return thingflagstranslation; } }
public List<ThingFlagsCompare> ThingFlagsCompare { get { return thingflagscompare; } }
// Linedefs
public IDictionary<string, string> LinedefFlags { get { return linedefflags; } }
@ -263,6 +265,7 @@ namespace CodeImp.DoomBuilder.Config
this.thingflagstranslation = new List<FlagTranslation>();
this.linedefflagstranslation = new List<FlagTranslation>();
this.thingfilters = new List<ThingsFilter>();
this.thingflagscompare = new List<ThingFlagsCompare>();
this.brightnesslevels = new StepsList();
this.makedoorflags = new Dictionary<string, bool>();
@ -371,6 +374,7 @@ namespace CodeImp.DoomBuilder.Config
{
foreach(ThingCategory tc in thingcategories) tc.Dispose();
foreach(LinedefActionCategory ac in actioncategories) ac.Dispose();
foreach (ThingFlagsCompare tfc in thingflagscompare) tfc.Dispose();
}
#endregion
@ -712,6 +716,18 @@ namespace CodeImp.DoomBuilder.Config
dic = cfg.ReadSetting("thingflagstranslation", new Hashtable());
foreach(DictionaryEntry de in dic)
thingflagstranslation.Add(new FlagTranslation(de));
// Get thing compare flag info (for the stuck thing error checker
dic = cfg.ReadSetting("thingflagscompare", new Hashtable());
foreach (DictionaryEntry de in dic)
{
IDictionary gdic = cfg.ReadSetting("thingflagscompare." + de.Key, new Hashtable());
foreach (DictionaryEntry gde in gdic)
{
thingflagscompare.Add(new ThingFlagsCompare(cfg, de.Key.ToString(), gde.Key.ToString()));
}
}
// Sort the translation flags, because they must be compared highest first!
thingflagstranslation.Sort();

View file

@ -0,0 +1,142 @@
#region ================== Copyright (c) 2007 Pascal vd Heiden
/*
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#endregion
#region ================== Namespaces
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Data;
using System.IO;
using System.Diagnostics;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Map;
#endregion
namespace CodeImp.DoomBuilder.Config
{
public class ThingFlagsCompare
{
public enum CompareMethod
{
Equal,
And
};
#region ================== Constants
#endregion
#region ================== Variables
private string flag;
private CompareMethod comparemethod;
private bool invert;
private string group;
// Disposing
private bool isdisposed = false;
#endregion
#region ================== Properties
public string Flag { get { return flag; } }
public string Group { get { return group; } }
public bool IsDisposed { get { return isdisposed; } }
#endregion
#region ================== Constructor / Disposer
// Constructor
public ThingFlagsCompare(Configuration cfg, string group, string flag)
{
string cfgpath = "thingflagscompare." + group + "." + flag;
this.flag = flag;
this.group = group;
string cm = cfg.ReadSetting(cfgpath + ".comparemethod", "and");
switch (cm)
{
default:
General.ErrorLogger.Add(ErrorType.Warning, "Unrecognized value \"" + cm + "\" for comparemethod in " + cfgpath + " in game configuration " + cfg.ReadSetting("game", "<unnamed game>") + ". Defaulting to \"and\".");
goto case "and";
case "and":
comparemethod = CompareMethod.And;
break;
case "equal":
comparemethod = CompareMethod.Equal;
break;
}
invert = cfg.ReadSetting(cfgpath + ".invert", false);
// We have no destructor
GC.SuppressFinalize(this);
}
// Disposer
internal void Dispose()
{
// Not already disposed?
if (!isdisposed)
{
// Done
isdisposed = true;
}
}
#endregion
#region ================== Methods
// Compares the flag of the two things.
// Returns:
// -1 if the flag does not overlap
// 0 if the flag should be ignored
// 1 if the flag overlaps
public int Compare(Thing t1, Thing t2)
{
bool t1flag;
bool t2flag;
// Check if the flags exist
if (!t1.Flags.ContainsKey(flag) || !t2.Flags.ContainsKey(flag))
return 0;
// tag flag inversion into account
t1flag = invert ? !t1.Flags[flag] : t1.Flags[flag];
t2flag = invert ? !t2.Flags[flag] : t2.Flags[flag];
if (comparemethod == CompareMethod.And && (t1flag && t2flag))
return 1;
else if (comparemethod == CompareMethod.Equal && (t1flag == t2flag))
return 1;
return 0;
}
#endregion
}
}

View file

@ -33,7 +33,7 @@ namespace CodeImp.DoomBuilder.GZBuilder
//version
public const float Version = 1.12f;
public const char Revision = 'e';
public const char Revision = 'f';
//debug console
#if DEBUG

File diff suppressed because it is too large Load diff

View file

@ -254,7 +254,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA4
CAAAAk1TRnQBSQFMAwEBAAEEAQABBAEAARMBAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
CAAAAk1TRnQBSQFMAwEBAAEMAQABDAEAARMBAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
AUwDAAEQAwABAQEAAQgFAAHAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View file

@ -361,7 +361,7 @@ namespace CodeImp.DoomBuilder.Windows
// Generic event that invokes the tagged action
public void InvokeTaggedAction(object sender, EventArgs e)
{
string asmname;
//string asmname;
this.Update();

File diff suppressed because it is too large Load diff

View file

@ -151,7 +151,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
Dictionary<string, bool> flags2 = ot.GetFlags();
*/
if (ThingsOverlap(t, ot))
if (FlagsOverlap(t, ot) && ThingsOverlap(t, ot))
{
stuck = true;
stucktype = StuckType.Thing;
@ -247,6 +247,37 @@ namespace CodeImp.DoomBuilder.BuilderModes
return true;
}
// Checks if the flags of two things overlap (i.e. if they show up at the same time)
private bool FlagsOverlap(Thing t1, Thing t2) {
Dictionary<string, List<ThingFlagsCompare>> groups = new Dictionary<string, List<ThingFlagsCompare>>();
int overlappinggroups = 0;
// Create a summary which flags belong to which groups
foreach (ThingFlagsCompare tfc in General.Map.Config.ThingFlagsCompare) {
if (!groups.ContainsKey(tfc.Group))
groups[tfc.Group] = new List<ThingFlagsCompare>();
groups[tfc.Group].Add(tfc);
}
// Go through all flags in all groups and check if they overlap
foreach (string g in groups.Keys) {
foreach (ThingFlagsCompare tfc in groups[g]) {
if (tfc.Compare(t1, t2) > 0) {
overlappinggroups++;
break;
}
}
}
// All groups have to overlap for the things to show up
// at the same time
if (overlappinggroups == groups.Count)
return true;
return false;
}
#endregion
}
}

View file

@ -215,6 +215,32 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
level.sector.CeilHeight += amount;
mode.SetActionResult("Changed ceiling height to " + level.sector.CeilHeight + ".");
}
//mxd. Sector brightness change
public override void OnChangeTargetBrightness(bool up) {
if (level != null && level.sector != Sector.Sector) {
int index = -1;
for (int i = 0; i < Sector.ExtraCeilings.Count; i++) {
if (Sector.ExtraCeilings[i] == this) {
index = i + 1;
break;
}
}
if (index > -1 && index < Sector.ExtraCeilings.Count) {
Sector.ExtraCeilings[index].changeControlSectorBrightness(up);
} else {
base.OnChangeTargetBrightness(up);
}
} else {
base.OnChangeTargetBrightness(up);
}
}
//mxd
private void changeControlSectorBrightness(bool up) {
((BaseVisualSector)mode.GetVisualSector(level.sector)).Ceiling.OnChangeTargetBrightness(up);
}
// This performs a fast test in object picking
public override bool PickFastReject(Vector3D from, Vector3D to, Vector3D dir)

View file

@ -216,6 +216,21 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
mode.SetActionResult("Changed floor height to " + level.sector.FloorHeight + ".");
}
//mxd. Sector brightness change
public override void OnChangeTargetBrightness(bool up) {
if (level != null) {
if (level.sector != Sector.Sector) {
((BaseVisualSector)mode.GetVisualSector(level.sector)).Ceiling.OnChangeTargetBrightness(up);
} else if (Sector.ExtraFloors.Count > 0) {
Sector.ExtraFloors[0].OnChangeTargetBrightness(up);
} else {
base.OnChangeTargetBrightness(up);
}
} else {
base.OnChangeTargetBrightness(up);
}
}
// This performs a fast test in object picking
public override bool PickFastReject(Vector3D from, Vector3D to, Vector3D dir)
{