From f9b5399a39b2196de8bbebff7b6cc0744e74c7d7 Mon Sep 17 00:00:00 2001 From: MaxED <j.maxed@gmail.com> Date: Mon, 8 Dec 2014 21:06:08 +0000 Subject: [PATCH] Added AngleByteHandler (type 22). Bit Flags form now changes width to show flags with long names without scrolling. Bit Flags form: flag numbers are now shown as well as names. Game configurations: updated Hexen and ZDoom linedef definitions. Now they (hopefully) fully match ZDoom ones. Action Selector Control: fixed a crash when trying to increase action above maximum value using mouse wheel. Sector/Linedef/Thing tag lists are now handled by corresponding TypeHandlers (and not by dirty hacks as before). Linedef info panel: line peggedness labels were obscured by effect label in Doom/Hexen map formats. --- .../Includes/Hexen_linedefs.cfg | 132 +++-- .../Includes/ZDoom_linedefs.cfg | 488 ++++++++++++------ Build/Configurations/Includes/ZDoom_misc.cfg | 154 ++++-- Source/Core/Builder.csproj | 1 + Source/Core/Config/EnumItem.cs | 9 +- Source/Core/Controls/ActionSelectorControl.cs | 2 +- Source/Core/Controls/ArgumentBox.cs | 148 +----- Source/Core/Controls/CheckboxArrayControl.cs | 19 +- .../Controls/LinedefInfoPanel.Designer.cs | 8 +- Source/Core/Controls/LinedefInfoPanel.cs | 69 +-- Source/Core/Controls/LinedefInfoPanel.resx | 42 -- Source/Core/Controls/SectorInfoPanel.cs | 2 +- Source/Core/Controls/ThingInfoPanel.cs | 14 +- Source/Core/GZBuilder/Controls/TagSelector.cs | 2 +- Source/Core/General/MapManager.cs | 12 +- Source/Core/Types/AngleByteHandler.cs | 23 + Source/Core/Types/AngleDegreesHandler.cs | 2 +- Source/Core/Types/EnumOptionHandler.cs | 8 +- Source/Core/Types/LinedefTagHandler.cs | 36 +- Source/Core/Types/SectorTagHandler.cs | 186 +++++++ Source/Core/Types/ThingTagHandler.cs | 36 +- Source/Core/Types/TypeHandler.cs | 2 +- Source/Core/Types/TypeHandlerAttribute.cs | 6 +- Source/Core/Types/UniversalType.cs | 5 +- Source/Core/Windows/BitFlagsForm.Designer.cs | 2 +- Source/Core/Windows/BitFlagsForm.cs | 14 +- 26 files changed, 888 insertions(+), 534 deletions(-) create mode 100644 Source/Core/Types/AngleByteHandler.cs diff --git a/Build/Configurations/Includes/Hexen_linedefs.cfg b/Build/Configurations/Includes/Hexen_linedefs.cfg index 54fb25582..106417c31 100644 --- a/Build/Configurations/Includes/Hexen_linedefs.cfg +++ b/Build/Configurations/Includes/Hexen_linedefs.cfg @@ -108,8 +108,7 @@ polyobj arg2 { title = "Movement Angle"; - type = 11; - enum = "angles"; + type = 22; } arg3 @@ -167,8 +166,7 @@ polyobj arg2 { title = "Movement Angle"; - type = 11; - enum = "angles"; + type = 22; } arg3 @@ -199,8 +197,7 @@ polyobj arg2 { title = "Movement Angle"; - type = 11; - enum = "angles"; + type = 22; } arg3 @@ -233,8 +230,7 @@ polyobj arg2 { title = "Movement Angle"; - type = 11; - enum = "angles"; + type = 22; } arg3 @@ -264,7 +260,7 @@ polyobj arg1 { - title = "Movement Speed"; + title = "Rotation Speed"; type = 11; enum = "stair_speeds"; default = 16; @@ -290,7 +286,7 @@ polyobj arg1 { - title = "Movement Speed"; + title = "Rotation Speed"; type = 11; enum = "stair_speeds"; default = 16; @@ -325,8 +321,7 @@ polyobj arg2 { title = "Movement Angle"; - type = 11; - enum = "angles"; + type = 22; } arg3 @@ -357,8 +352,7 @@ polyobj arg2 { title = "Movement Angle"; - type = 11; - enum = "angles"; + type = 22; } arg3 @@ -545,7 +539,7 @@ floor arg2 { - title = "Movement Amount"; + title = "Lower by"; } } @@ -610,7 +604,7 @@ floor arg2 { - title = "Movement Amount"; + title = "Raise by"; } } @@ -676,6 +670,7 @@ floor arg2 { title = "Crush Damage"; + default = 100; } } @@ -828,7 +823,7 @@ floor arg2 { - title = "Movement Amount"; + title = "Lower by"; } } @@ -853,7 +848,7 @@ floor arg2 { - title = "Movement Amount"; + title = "Raise by"; } } } @@ -1297,11 +1292,17 @@ platform arg1 { title = "Movement Speed"; + type = 11; + enum = "plat_speeds"; + default = 16; } arg2 { - title = "Reverse Delay"; + title = "Reverse Delay (tics)"; + type = 11; + enum = "delay_tics"; + default = 105; } } @@ -1331,11 +1332,17 @@ platform arg1 { title = "Movement Speed"; + type = 11; + enum = "plat_speeds"; + default = 16; } arg2 { - title = "Reverse Delay"; + title = "Reverse Delay (tics)"; + type = 11; + enum = "delay_tics"; + default = 105; } } @@ -1353,16 +1360,22 @@ platform arg1 { title = "Movement Speed"; + type = 11; + enum = "plat_speeds"; + default = 16; } arg2 { - title = "Reverse Delay"; + title = "Reverse Delay (tics)"; + type = 11; + enum = "delay_tics"; + default = 105; } arg3 { - title = "Movement Amount * 8"; + title = "Lower by (* 8)"; } } @@ -1380,11 +1393,17 @@ platform arg1 { title = "Movement Speed"; + type = 11; + enum = "plat_speeds"; + default = 16; } arg2 { - title = "Reverse Delay"; + title = "Reverse Delay (tics)"; + type = 11; + enum = "delay_tics"; + default = 105; } } @@ -1402,16 +1421,22 @@ platform arg1 { title = "Movement Speed"; + type = 11; + enum = "plat_speeds"; + default = 16; } arg2 { - title = "Reverse Delay"; + title = "Reverse Delay (tics)"; + type = 11; + enum = "delay_tics"; + default = 105; } arg3 { - title = "Movement Amount * 8"; + title = "Lower by (* 8)"; } } } @@ -1452,7 +1477,7 @@ teleport arg1 { - title = "Keep orientation"; + title = "Keep Orientation"; type = 11; enum = "noyes"; } @@ -1488,23 +1513,24 @@ thing 72 { - title = "Thing Thrust"; + title = "Thrust Thing"; id = "ThrustThing"; arg0 { title = "Thrust Angle"; + type = 22; } arg1 { - title = "Thrust Distance"; + title = "Thrust Force (mu. per tic)"; } } 73 { - title = "Thing Damage"; + title = "Damage Thing"; id = "DamageThing"; arg0 @@ -1515,7 +1541,7 @@ thing 130 { - title = "Thing Activate"; + title = "Activate Thing"; id = "Thing_Activate"; arg0 @@ -1527,7 +1553,7 @@ thing 131 { - title = "Thing Deactivate"; + title = "Deactivate Thing"; id = "Thing_Deactivate"; arg0 @@ -1539,7 +1565,7 @@ thing 132 { - title = "Thing Remove"; + title = "Remove Thing"; id = "Thing_Remove"; arg0 @@ -1551,7 +1577,7 @@ thing 133 { - title = "Thing Destroy"; + title = "Destroy Thing"; id = "Thing_Destroy"; arg0 @@ -1561,12 +1587,9 @@ thing } arg1 { - title = "Extreme"; - enum - { - 0 = "No"; - 1 = "Yes"; - } + title = "Extreme Death"; + type = 11; + enum = "noyes"; } arg2 { @@ -1578,7 +1601,7 @@ thing 134 { - title = "Thing Projectile"; + title = "Spawn Projectile"; id = "Thing_Projectile"; arg0 @@ -1589,12 +1612,15 @@ thing arg1 { - title = "Spawn Thing"; + title = "Projectile Type"; + type = 11; + enum = "spawn_projectile"; } arg2 { title = "Movement Angle"; + type = 22; } arg3 @@ -1610,7 +1636,7 @@ thing 135 { - title = "Thing Spawn"; + title = "Spawn Thing"; id = "Thing_Spawn"; arg0 @@ -1621,18 +1647,21 @@ thing arg1 { - title = "Spawn Thing"; + title = "Thing Type"; + type = 11; + enum = "spawnthing"; } arg2 { title = "Thing Angle"; + type = 22; } } 136 { - title = "Thing Projectile with Gravity"; + title = "Spawn Projectile (gravity)"; id = "Thing_ProjectileGravity"; arg0 @@ -1643,12 +1672,15 @@ thing arg1 { - title = "Spawn Thing"; + title = "Projectile Type"; + type = 11; + enum = "spawn_projectile"; } arg2 { title = "Movement Angle"; + type = 22; } arg3 @@ -1664,23 +1696,26 @@ thing 137 { - title = "Thing Spawn (silent)"; + title = "Spawn Thing (silent)"; id = "Thing_SpawnNoFog"; arg0 { - title = "MapSpot Tag"; + title = "Target MapSpot Tag"; type = 14; } arg1 { - title = "Spawn Thing"; + title = "Thing Type"; + type = 11; + enum = "spawnthing"; } arg2 { title = "Thing Angle"; + type = 22; } } } @@ -1933,6 +1968,7 @@ light arg1 { title = "Target Brightness"; + default = 128; } arg2 diff --git a/Build/Configurations/Includes/ZDoom_linedefs.cfg b/Build/Configurations/Includes/ZDoom_linedefs.cfg index 01c98ca42..4d0a3b0e7 100644 --- a/Build/Configurations/Includes/ZDoom_linedefs.cfg +++ b/Build/Configurations/Includes/ZDoom_linedefs.cfg @@ -460,7 +460,7 @@ zdoom { polyobj { - title = "Polyobj"; + title = "Polyobject"; 59 { @@ -472,7 +472,7 @@ zdoom } arg1 { - title = "Speed"; + title = "Speed (mu. per octic)"; type = 11; enum = "stair_speeds"; default = 16; @@ -493,7 +493,7 @@ zdoom } arg1 { - title = "Speed"; + title = "Speed (mu. per octic)"; type = 11; enum = "stair_speeds"; default = 16; @@ -523,7 +523,7 @@ zdoom } arg1 { - title = "Speed"; + title = "Speed (mu. per octic)"; type = 11; enum = "stair_speeds"; default = 16; @@ -547,7 +547,7 @@ zdoom } arg1 { - title = "Speed"; + title = "Speed (mu. per octic)"; type = 11; enum = "stair_speeds"; default = 16; @@ -612,7 +612,7 @@ zdoom arg0 { - title = "Sector tag"; + title = "Sector Tag"; type = 13; } arg1 @@ -821,19 +821,20 @@ zdoom type = 12; enum { - 1 = "Remove effect"; - 2 = "Change texture"; - 3 = "Change special"; - 4 = "Numeric model"; - 8 = "Raise"; - 16 = "Crusher"; + 0 = "No change"; + 1 = "Zero sector's special"; + 2 = "Change sector's floor texture"; + 3 = "Change sector's special"; + 4 = "Use numeric model if set, trigger model if not"; + 8 = "Raise floor if set, lower it if not"; + 16 = "Cause crushing damage"; } } } 235 { - title = "Floor Transfer Trigger"; + title = "Transfer Floor Texture and Special form Back Side"; id = "Floor_TransferTrigger"; arg0 @@ -844,7 +845,7 @@ zdoom } 236 { - title = "Floor Transfer Numeric"; + title = "Transfer Floor Texture and Special using Numeric Change Model"; id = "Floor_TransferNumeric"; arg0 @@ -956,6 +957,7 @@ zdoom arg3 { title = "Force Adjust"; + type = 11; enum = "noyes"; } } @@ -966,19 +968,19 @@ zdoom arg0 { - title = "Sector Tag"; + title = "Center Sector Tag"; type = 13; } arg1 { - title = "Pillar Movement Speed"; + title = "Pillar Lower Speed"; type = 11; enum = "plat_speeds"; default = 16; } arg2 { - title = "Stairs Movement Speed"; + title = "Stairs Raise Speed"; type = 11; enum = "stair_speeds"; default = 4; @@ -997,18 +999,28 @@ zdoom } arg1 { - title = "Floor Movement Speed"; + title = "Floor Lowering Speed"; type = 11; enum = "plat_speeds"; default = 16; } arg2 { - title = "Ceiling Movement Speed"; + title = "Ceiling Raising Speed"; type = 11; enum = "plat_speeds"; default = 16; } + arg3 + { + title = "Emulate Boom Bug"; + type = 11; + enum + { + 0 = "No"; + 1998 = "Yes"; + } + } } } @@ -1033,7 +1045,7 @@ zdoom } arg2 { - title = "Step Amount"; + title = "Step Height"; } arg3 { @@ -1042,18 +1054,20 @@ zdoom enum { 1 = "Upwards"; - 2 = "Ignore textures"; + 2 = "Ignore Floor Texture"; } } arg4 { title = "Reset Delay"; + type = 11; + enum = "reset_tics"; } } 217 { - title = "Stairs Build up Doom"; + title = "Stairs Build up (Doom mode)"; id = "Stairs_BuildUpDoom"; arg0 @@ -1070,15 +1084,20 @@ zdoom } arg2 { - title = "Step Amount"; + title = "Step Height"; } arg3 { title = "Build Step Delay"; + type = 11; + enum = "delay_tics"; + default = 35; } arg4 { title = "Reset Delay"; + type = 11; + enum = "reset_tics"; } } } @@ -1086,9 +1105,14 @@ zdoom pillar { - 94 // Pillar Build and Crush + 94 // Pillar_BuildAndCrush { arg3 + { + title = "Crush Damage"; + default = 100; + } + arg4 { title = "Crush Mode"; type = 11; @@ -1203,11 +1227,12 @@ zdoom arg2 { title = "Crush Damage"; + default = 100; } arg3 { - title = "Stop Distance"; + title = "Lip"; } arg4 @@ -1231,7 +1256,7 @@ zdoom arg1 { - title = "Movement Distance"; + title = "Lip"; } arg2 @@ -1245,6 +1270,7 @@ zdoom arg3 { title = "Crush Damage"; + default = 100; } arg4 @@ -1295,7 +1321,7 @@ zdoom } 169 { - title = "Ceiling Generic Crush Hexen Mode"; + title = "Ceiling Generic Crush (Hexen mode)"; id = "Generic_Crusher2"; arg0 @@ -1305,14 +1331,14 @@ zdoom } arg1 { - title = "Raise Speed"; + title = "Lower Speed"; type = 11; enum = "plat_speeds"; default = 16; } arg2 { - title = "Lower Speed"; + title = "Raise Speed"; type = 11; enum = "plat_speeds"; default = 16; @@ -1326,6 +1352,7 @@ zdoom arg4 { title = "Crush Damage"; + default = 100; } } 192 @@ -1403,6 +1430,7 @@ zdoom arg3 { title = "Crush Damage"; + default = 100; } arg4 { @@ -1439,6 +1467,7 @@ zdoom arg3 { title = "Crush Damage"; + default = 100; } arg4 { @@ -1475,6 +1504,7 @@ zdoom arg3 { title = "Crush Damage"; + default = 100; } arg4 { @@ -1503,7 +1533,7 @@ zdoom } arg2 { - title = "Movement Amount * 8"; + title = "Raise by (* 8)"; } } 199 @@ -1525,7 +1555,7 @@ zdoom } arg2 { - title = "Movement Amount * 8"; + title = "Lower by (* 8)"; } } @@ -1562,18 +1592,19 @@ zdoom type = 12; enum { - 1 = "Remove effect"; - 2 = "Change texture"; - 3 = "Change effect"; - 4 = "Numeric model"; - 8 = "Raise"; - 16 = "Crusher"; + 0 = "No change"; + 1 = "Zero sector's special"; + 2 = "Change sector's ceiling texture"; + 3 = "Change sector's special"; + 4 = "Use numeric model if set, trigger model if not"; + 8 = "Raise ceiling if set, lower it if not"; + 16 = "Cause crushing damage"; } } } 205 { - title = "Ceiling Generic Crush"; + title = "Ceiling Generic Crush (Doom mode)"; id = "Generic_Crusher"; arg0 @@ -1583,14 +1614,14 @@ zdoom } arg1 { - title = "Lower Movement Speed"; + title = "Lowering Speed"; type = 11; enum = "plat_speeds"; default = 16; } arg2 { - title = "Raise Movement Speed"; + title = "Raising Speed"; type = 11; enum = "plat_speeds"; default = 16; @@ -1604,6 +1635,7 @@ zdoom arg4 { title = "Crush Damage"; + default = 100; } } 252 @@ -1626,7 +1658,7 @@ zdoom } 253 { - title = "Ceiling Lower to Lowest Floor"; + title = "Ceiling Lower to Lowest Ceiling"; id = "Ceiling_LowerToLowest"; arg0 @@ -1672,14 +1704,14 @@ zdoom } arg1 { - title = "Lower Movement Speed"; + title = "Lowering Speed"; type = 11; enum = "plat_speeds"; default = 16; } arg2 { - title = "Raise Movement Speed"; + title = "Raising Speed"; type = 11; enum = "plat_speeds"; default = 16; @@ -1687,6 +1719,7 @@ zdoom arg3 { title = "Crush Damage"; + default = 100; } arg4 { @@ -1736,9 +1769,9 @@ zdoom type = 11; enum { - 0 = "From Control Ceiling Down to Type 0"; - 1 = "From Target Ceiling Down to Control Floor"; - 2 = "From Control Ceiling Down to Any"; + 0 = "From control sector's ceiling down to top of another type 0 light"; + 1 = "From ceiling down to the floor of the control sector"; + 2 = "From control sector's ceiling down to the top of another extra light"; } } } @@ -1759,6 +1792,7 @@ zdoom type = 12; enum { + 0 = "Boom mode"; 1 = "Use fake ceiling/floor"; 2 = "Draw fake floor only"; 4 = "Inside sector only"; @@ -1840,7 +1874,10 @@ zdoom } arg2 { - title = "Reverse Delay"; + title = "Reverse Delay (tics)"; + type = 11; + enum = "delay_tics"; + default = 35; } } 203 @@ -1862,7 +1899,10 @@ zdoom } arg2 { - title = "Reverse Delay"; + title = "Reverse Delay (tics)"; + type = 11; + enum = "delay_tics"; + default = 35; } arg3 { @@ -1894,7 +1934,10 @@ zdoom } arg2 { - title = "Reverse Delay"; + title = "Reverse Delay (tics)"; + type = 11; + enum = "delay_tics"; + default = 35; } arg3 { @@ -1902,7 +1945,7 @@ zdoom } arg4 { - title = "Movement sound type"; + title = "Sound Type"; type = 11; enum = "plat_sound"; } @@ -1926,7 +1969,10 @@ zdoom } arg2 { - title = "Reverse Delay"; + title = "Reverse Delay (tics)"; + type = 11; + enum = "delay_tics"; + default = 35; } arg3 { @@ -1981,7 +2027,7 @@ zdoom } arg2 { - title = "Movement Amount * 8"; + title = "Raise by (* 8)"; } } 231 @@ -2021,16 +2067,25 @@ zdoom { arg2 { - title = "Fog"; + title = "Source Fog"; type = 11; enum = "yesno"; } } - 74 // Teleport to Map + 71 // Teleport_NoFog + { + arg3 + { + title = "Keep rel. Height"; + type = 11; + enum = "noyes"; + } + } + 74 // Teleport_NewMap { arg2 { - title = "Keep orientation"; + title = "Keep Orientation"; type = 11; enum = "noyes"; } @@ -2047,14 +2102,14 @@ zdoom } arg1 { - title = "Target Thing Tag"; + title = "Target MapSpot Tag"; type = 14; } arg2 { title = "Fog"; type = 11; - enum = "yesno"; + enum = "noyes"; } } 77 @@ -2064,35 +2119,35 @@ zdoom arg0 { - title = "Group Thing Tag"; + title = "Thing Tag"; type = 14; } arg1 { - title = "Source Thing Tag"; + title = "Source Teleport Dest. Tag"; type = 14; } arg2 { - title = "Target Thing Tag"; + title = "Target Teleport Dest. Tag"; type = 14; } arg3 { - title = "Move source"; + title = "Move Source"; type = 11; - enum = "yesno"; + enum = "noyes"; } arg4 { title = "Fog"; type = 11; - enum = "yesno"; + enum = "noyes"; } } 78 { - title = "Teleport in sector"; + title = "Teleport in Sector"; id = "TeleportInSector"; arg0 @@ -2102,12 +2157,12 @@ zdoom } arg1 { - title = "Source Thing Tag"; + title = "Source MapSpot Tag"; type = 14; } arg2 { - title = "Target Thing Tag"; + title = "Target MapSpot Tag"; type = 14; } arg3 @@ -2124,7 +2179,7 @@ zdoom } 154 { - title = "Teleport (No Stop)"; + title = "Teleport (no Stop)"; id = "Teleport_NoStop"; arg0 @@ -2205,6 +2260,29 @@ zdoom type = 14; } } + 72 // ThrustThing + { + arg2 + { + title = "No Limit"; + type = 11; + enum = "noyes"; + } + arg3 + { + title = "Target Thing Tag"; + type = 14; + } + } + 73 // DamageThing + { + arg1 + { + title = "Death"; + type = 11; + enum = "death_types"; + } + } 79 { title = "Set Conversation"; @@ -2221,7 +2299,7 @@ zdoom } 119 { - title = "Thing Damage"; + title = "Damage Thing"; id = "Thing_Damage"; arg0 @@ -2232,6 +2310,7 @@ zdoom arg1 { title = "Damage"; + default = 100; } arg2 { @@ -2242,7 +2321,7 @@ zdoom } 125 { - title = "Thing Move"; + title = "Move Thing"; id = "Thing_Move"; arg0 @@ -2255,6 +2334,12 @@ zdoom title = "Target Thing Tag"; type = 14; } + arg2 + { + title = "Fog"; + type = 11; + enum = "yesno"; + } } 127 { @@ -2273,15 +2358,15 @@ zdoom } arg2 { - title = "Special arg 1"; + title = "Arg 1"; } arg3 { - title = "Special arg 2"; + title = "Arg 2"; } arg4 { - title = "Special arg 3"; + title = "Arg 3"; } } 128 @@ -2306,46 +2391,30 @@ zdoom } arg3 { - title = "Add/Set"; - type = 11; - enum = "addset"; - } - } - 134 // Thing Projectile - { - arg1 // Spawn Thing - { - type = 11; - enum = "spawnthing"; - } - } - 135 // Thing Spawn - { - arg1 // Spawn Thing - { + title = "Set/Add"; type = 11; - enum = "spawnthing"; + enum = "setadd"; } } - 136 // Thing Projectile with Gravity + 135 // Thing_Spawn { - arg1 // Spawn Thing + arg3 { - type = 11; - enum = "spawnthing"; + title = "New Thing Tag"; + type = 14; } } - 137 // Thing Spawn (silent) + 137 // Thing_SpawnNoFog { - arg1 // Spawn Thing + arg3 { - type = 11; - enum = "spawnthing"; + title = "New Thing Tag"; + type = 14; } } 139 { - title = "Thing Spawn Facing"; + title = "Spawn Thing Facing"; id = "Thing_SpawnFacing"; arg0 @@ -2373,7 +2442,7 @@ zdoom } 175 { - title = "Thing Projectile Intercept"; + title = "Spawn Projectile (Intercept)"; id = "Thing_ProjectileIntercept"; arg0 @@ -2383,9 +2452,9 @@ zdoom } arg1 { - title = "Spawn Thing"; + title = "Projectile Type"; type = 11; - enum = "spawnthing"; + enum = "spawn_projectile"; } arg2 { @@ -2451,7 +2520,7 @@ zdoom } 178 { - title = "Thing Aimed Projectile"; + title = "Spawn Aimed Projectile"; id = "Thing_ProjectileAimed"; arg0 @@ -2461,9 +2530,9 @@ zdoom } arg1 { - title = "Spawn Thing"; + title = "Projectile Type"; type = 11; - enum = "spawnthing"; + enum = "spawn_projectile"; } arg2 { @@ -2482,7 +2551,7 @@ zdoom } 180 { - title = "Thing Set Translation"; + title = "Set Thing Translation"; id = "Thing_SetTranslation"; arg0 @@ -2492,12 +2561,12 @@ zdoom } arg1 { - title = "Translation index"; + title = "Translation Index"; } } 229 { - title = "Thing Goal"; + title = "Thing Set Goal"; id = "Thing_SetGoal"; arg0 @@ -2513,6 +2582,21 @@ zdoom arg2 { title = "Delay"; + type = 11; + enum + { + 0 = "No Delay"; + 1 = "1 Second"; + 2 = "2 Seconds"; + 3 = "3 Seconds"; + 5 = "5 Seconds"; + 10 = "10 Seconds"; + 15 = "15 Seconds"; + 20 = "20 Seconds"; + 25 = "25 Seconds"; + 30 = "30 Seconds"; + 60 = "1 Minute"; + } } arg3 { @@ -2616,6 +2700,7 @@ zdoom arg1 { title = "Side"; + type = 11; enum { 0 = "Both"; @@ -2631,6 +2716,7 @@ zdoom arg3 { title = "Message"; + type = 11; enum { 0 = "Open door"; @@ -2736,41 +2822,41 @@ zdoom } } - 100 + 100 //Scroll_Texture_Left { arg1 { - title = "Sidedef part"; + title = "Sidedef Part"; type = 12; enum = "sidedef_part"; } } - 101 + 101 //Scroll_Texture_Right { arg1 { - title = "Sidedef part"; + title = "Sidedef Part"; type = 12; enum = "sidedef_part"; } } - 102 + 102 //Scroll_Texture_Up { arg1 { - title = "Sidedef part"; + title = "Sidedef Part"; type = 12; enum = "sidedef_part"; } } - 103 + 103 //Scroll_Texture_Down { arg1 { - title = "Sidedef part"; + title = "Sidedef Part"; type = 12; enum = "sidedef_part"; } @@ -2904,17 +2990,6 @@ zdoom 4 = "Scroll by linedef dx/dy"; } } - arg2 - { - title = "Scroll"; - type = 11; - enum - { - 1 = "Texture only"; - 2 = "Things only"; - 4 = "Both"; - } - } arg3 { title = "Horizontal Speed"; @@ -2938,7 +3013,7 @@ zdoom arg0 { - title = "Sidedef part"; + title = "Sidedef Part"; type = 12; enum = "sidedef_part"; } @@ -2950,7 +3025,7 @@ zdoom { 109 { - title = "Lightning control"; + title = "Lightning Control"; id = "Light_ForceLightning"; arg0 @@ -2978,7 +3053,7 @@ zdoom } 232 { - title = "Light Strobe Doom"; + title = "Light Strobe (Doom mode)"; id = "Light_StrobeDoom"; arg0 @@ -3003,7 +3078,7 @@ zdoom } 233 { - title = "Light Change to Darkest"; + title = "Light Change to Darkest Neightbour"; id = "Light_MinNeighbor"; arg0 @@ -3014,7 +3089,7 @@ zdoom } 234 { - title = "Light Change to Brightest"; + title = "Light Change to Brightest Neightbour"; id = "Light_MaxNeighbor"; arg0 @@ -3079,10 +3154,11 @@ zdoom type = 12; enum { - 1 = "Link Target's floor to 'surface'"; - 2 = "Link Target's ceiling to 'surface'"; - 4 = "Floor move at opposite (need bit1)"; - 8 = "Ceiling move at opposite (need bit2)"; + 0 = "Unlink target sector(s) from the control sector"; + 1 = "Link target sector's floor to the specified surface of the control sector"; + 2 = "Link target sector's ceiling to the specified surface of the control sector"; + 4 = "Target floor movement is the opposite direction as the control sector's surface (requires bit 1)"; + 8 = "Target ceiling movement is the opposite direction as the control sector's surface (requires bit 2)"; } } } @@ -3105,12 +3181,11 @@ zdoom } arg2 { - title = "Translucency"; - type = 13; + title = "Opacity"; } arg3 { - title = "Translucency type"; + title = "Translucency Type"; type = 11; enum { @@ -3225,7 +3300,6 @@ zdoom 2 = "Swimmable"; 3 = "Non-Solid"; 4 = "Render-Inside"; - 8 = "Use Arg5 as Line ID"; 16 = "Invert Visibility Rules"; 32 = "Invert Shootability Rules"; } @@ -3251,10 +3325,6 @@ zdoom title = "Alpha"; default = 255; } - arg4 - { - title = "Line ID / Hi-Tag"; - } } 161 { @@ -3488,6 +3558,7 @@ zdoom arg1 { title = "Damage Amount"; + default = 15; } arg2 { @@ -3556,6 +3627,16 @@ zdoom arg1 { title = "Friction Amount"; + type = 11; + enum + { + 0 = "Use Line Length"; + 1 = "Very Sludgy"; + 50 = "Sludgy"; + 100 = "Normal"; + 200 = "Icy"; + 255 = "Very Icy"; + } } } @@ -3615,7 +3696,7 @@ zdoom 174 { - title = "Communicator message"; + title = "Communicator Message"; id = "SendToCommunicator"; arg0 @@ -3624,13 +3705,13 @@ zdoom } arg1 { - title = "Front side only"; + title = "Front Side Only"; type = 11; enum = "noyes"; } arg2 { - title = "Message identification"; + title = "Print Activator Name"; type = 11; enum = "noyes"; } @@ -3872,7 +3953,7 @@ zdoom arg1 { - title = "Transparency Amount"; + title = "Translucency Amount"; } arg2 { @@ -3889,7 +3970,7 @@ zdoom 227 { - title = "Point Pusher and Puller Force"; + title = "Point Pusher/Puller Set Force"; id = "PointPush_SetForce"; arg0 @@ -3972,7 +4053,7 @@ zdoom } 246 { - title = "Elevator Raise to Activated Floor"; + title = "Elevator Move to Activated Floor"; id = "Elevator_MoveToFloor"; arg0 @@ -4018,7 +4099,7 @@ hexen arg3 { title = "Set Line ID"; - type = 15; + type = 0; } } 5 // Polyobj Explicit Line @@ -4026,40 +4107,118 @@ hexen arg4 { title = "Set Line ID"; - type = 15; + type = 0; } } } plane { - 181 + 181 //Plane_Align { arg2 { title = "Set Line ID"; - type = 15; + type = 0; } } } - teleport + scroll { - 215 + 52 //Scroll_Wall { arg0 { title = "Set Line ID"; - type = 15; + type = 0; + } + } + 221 //Scroll_Texture_Both + { + arg0 + { + title = "Line ID"; + type = 0; + } + } + 222 //Scroll_Texture_Model + { + arg0 + { + title = "Set Line ID"; + type = 0; } } } + sector + { + 48 //Sector_Attach3dMidtex + { + arg0 + { + title = "Line ID"; + type = 0; + } + } + 160 //Sector_Set3dFloor + { + arg1 + { + title = "Type"; + type = 12; + enum + { + 0 = "Vavoom-Style"; + 1 = "Solid"; + 2 = "Swimmable"; + 3 = "Non-Solid"; + 4 = "Render-Inside"; + 8 = "Use Arg5 as Line ID"; + 16 = "Invert Visibility Rules"; + 32 = "Invert Shootability Rules"; + } + default = 1; + } + arg4 + { + title = "Line ID / Hi-Tag"; + } + } + } + teleport + { + 215 //Teleport_Line + { + arg0 + { + title = "Line ID"; + type = 0; + } + arg1 + { + title = "Target Line ID"; + type = 0; + } + } + } + transfer + { + 16 //Transfer_WallLight + { + arg0 + { + title = "Line ID"; + type = 0; + } + } + } translucent { - 208 + 208 //TranslucentLine { arg0 { title = "Set Line ID"; - type = 15; + type = 0; } arg3 { @@ -4078,17 +4237,6 @@ hexen } } } - scroll - { - 222 - { - arg0 - { - title = "Set Line ID"; - type = 15; - } - } - } } udmf diff --git a/Build/Configurations/Includes/ZDoom_misc.cfg b/Build/Configurations/Includes/ZDoom_misc.cfg index 86aa1b4fe..d213e3b29 100644 --- a/Build/Configurations/Includes/ZDoom_misc.cfg +++ b/Build/Configurations/Includes/ZDoom_misc.cfg @@ -672,11 +672,11 @@ enums generic_lift_types { - 0 = "Up Stay"; - 1 = "Down Up"; - 2 = "Down to nearest"; - 3 = "Down to lowest"; - 4 = "Perpetual raise"; + 0 = "Up by Value, Stay"; + 1 = "Down, Wait, Up, Stay"; + 2 = "Down to Nearest Floor"; + 3 = "Down to Lowest Ceiling"; + 4 = "Perpetual Raise"; } death_types @@ -774,8 +774,17 @@ enums 75 = "75%"; 100 = "100%"; } + + setadd + { + 0 = "Set"; + 1 = "Add"; + } - puzzle_items {} + puzzle_items + { + 0 = "None"; + } } enums_doom @@ -907,7 +916,43 @@ enums_doom 152 = "Health Bonus"; 153 = "Mancubus Shot"; 154 = "Baron Fireball"; - 216 = "Grenade"; + //216 = "Grenade"; + } + + spawn_projectile + { + 0 = "None"; + 10 = "Imp Fireball"; + 33 = "Super Shotgun"; + 41 = "Rock debris #1"; + 42 = "Rock debris #2"; + 43 = "Rock debris #3"; + 44 = "Dirt #1"; + 45 = "Dirt #2"; + 46 = "Dirt #3"; + 47 = "Dirt #4"; + 48 = "Dirt #5"; + 49 = "Dirt #6"; + 51 = "Plasma Bolt"; + 53 = "Tracer"; + 54 = "Glass shard #1"; + 55 = "Glass shard #2"; + 56 = "Glass shard #3"; + 57 = "Glass shard #4"; + 58 = "Glass shard #5"; + 59 = "Glass shard #6"; + 60 = "Glass shard #7"; + 61 = "Glass shard #8"; + 62 = "Glass shard #9"; + 63 = "Glass shard #10"; + 110 = "Lost Soul"; + 126 = "Cacodemon Shot"; + 127 = "Rocket (Projectile)"; + 128 = "BFG Shot"; + 129 = "Arachnotron Plasma Bolt"; + 131 = "Bullet Puff"; + 153 = "Mancubus Shot"; + 154 = "Baron Fireball"; } } @@ -1039,6 +1084,48 @@ enums_heretic 166 = "Red Glitter Generator"; 167 = "Blue Glitter Generator"; } + + spawn_projectile + { + 10 = "Gargoyle Shot"; + 40 = "Morph Ovum Shot"; + 41 = "Rock debris #1"; + 42 = "Rock debris #2"; + 43 = "Rock debris #3"; + 44 = "Dirt #1"; + 45 = "Dirt #2"; + 46 = "Dirt #3"; + 47 = "Dirt #4"; + 48 = "Dirt #5"; + 49 = "Dirt #6"; + 54 = "Glass shard #1"; + 55 = "Glass shard #2"; + 56 = "Glass shard #3"; + 57 = "Glass shard #4"; + 58 = "Glass shard #5"; + 59 = "Glass shard #6"; + 60 = "Glass shard #7"; + 61 = "Glass shard #8"; + 62 = "Glass shard #9"; + 63 = "Glass shard #10"; + 120 = "Weredragon Shot"; + 123 = "Volcano Blast"; + 124 = "Tiny Volcano Blast"; + 131 = "Golem Shot"; + 138 = "Ophidian Blue Shot"; + 139 = "Ophidian Yellow Shot"; + 140 = "Disciple Shot"; + 141 = "D'Sparil Teleportation Spot"; + 144 = "Chaos Serpent Shot"; + 145 = "D'Sparil Shot"; + 147 = "Main Crossbow Shot"; + 148 = "Tomed Crossbow Shot"; + 149 = "Secondary Crossbow Shot"; + 151 = "Small Goldwand Shot"; + 152 = "Tomed Goldwand Shot"; + 164 = "Iron Lich Ice Shot"; + 165 = "Iron Lich Whirlwind"; + } } enums_hexen @@ -1133,7 +1220,7 @@ enums_hexen 69 = "Falcon Shield"; 70 = "Platinum Helm"; 71 = "Amulet Of Warding"; - 72 = "Fléchette"; + 72 = "Flechette"; 73 = "Torch"; 74 = "Disc of Repulsion"; 75 = "Combined Mana"; @@ -1174,6 +1261,36 @@ enums_hexen 130 = "Blood"; 133 = "Icon of the Defender"; } + + spawn_projectile + { + 10 = "Fireball"; + 40 = "Porkalator Shot"; + 41 = "Rock debris #1"; + 42 = "Rock debris #2"; + 43 = "Rock debris #3"; + 44 = "Dirt #1"; + 45 = "Dirt #2"; + 46 = "Dirt #3"; + 47 = "Dirt #4"; + 48 = "Dirt #5"; + 49 = "Dirt #6"; + 50 = "Arrow"; + 51 = "Dart"; + 52 = "Poison Dart"; + 53 = "Ripper Ball"; + 54 = "Glass shard #1"; + 55 = "Glass shard #2"; + 56 = "Glass shard #3"; + 57 = "Glass shard #4"; + 58 = "Glass shard #5"; + 59 = "Glass shard #6"; + 60 = "Glass shard #7"; + 61 = "Glass shard #8"; + 62 = "Glass shard #9"; + 63 = "Glass shard #10"; + 65 = "Ice Shard"; + } puzzle_items { @@ -1237,30 +1354,9 @@ enums_strife spawnthing { 11 = "Clip Of Bullets"; - 40 = "Morph Ovum Shot"; - 41 = "Rock debris #1"; - 42 = "Rock debris #2"; - 43 = "Rock debris #3"; - 44 = "Dirt #1"; - 45 = "Dirt #2"; - 46 = "Dirt #3"; - 47 = "Dirt #4"; - 48 = "Dirt #5"; - 49 = "Dirt #6"; - 54 = "Glass shard #1"; - 55 = "Glass shard #2"; - 56 = "Glass shard #3"; - 57 = "Glass shard #4"; - 58 = "Glass shard #5"; - 59 = "Glass shard #6"; - 60 = "Glass shard #7"; - 61 = "Glass shard #8"; - 62 = "Glass shard #9"; - 63 = "Glass shard #10"; 68 = "Leather Armor"; 69 = "Metal Armor"; 75 = "Energy Pod"; - 130 = "Blood"; 135 = "Shadow Armor"; 136 = "Environmental Suit"; 137 = "Computer Map"; diff --git a/Source/Core/Builder.csproj b/Source/Core/Builder.csproj index a1865f6a5..2f6b6ca13 100644 --- a/Source/Core/Builder.csproj +++ b/Source/Core/Builder.csproj @@ -865,6 +865,7 @@ <Compile Include="Rendering\SurfaceEntryCollection.cs" /> <Compile Include="Rendering\SurfaceManager.cs" /> <Compile Include="Rendering\SurfaceUpdate.cs" /> + <Compile Include="Types\AngleByteHandler.cs" /> <Compile Include="Types\RandomFloatHandler.cs" /> <Compile Include="Types\RandomIntegerHandler.cs" /> <Compile Include="Types\ThingClassHandler.cs" /> diff --git a/Source/Core/Config/EnumItem.cs b/Source/Core/Config/EnumItem.cs index e354c7323..a7ef50c65 100644 --- a/Source/Core/Config/EnumItem.cs +++ b/Source/Core/Config/EnumItem.cs @@ -30,8 +30,8 @@ namespace CodeImp.DoomBuilder.Config #region ================== Variables - private string value; - private string title; + private readonly string value; + private readonly string title; #endregion @@ -66,10 +66,7 @@ namespace CodeImp.DoomBuilder.Config public int GetIntValue() { int result; - if(int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out result)) - return result; - else - return 0; + return int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out result) ? result : 0; } #endregion diff --git a/Source/Core/Controls/ActionSelectorControl.cs b/Source/Core/Controls/ActionSelectorControl.cs index 8e2ae8b6e..23c845945 100644 --- a/Source/Core/Controls/ActionSelectorControl.cs +++ b/Source/Core/Controls/ActionSelectorControl.cs @@ -280,7 +280,7 @@ namespace CodeImp.DoomBuilder.Controls list.SelectedIndex--; list_SelectionChangeCommitted(list, EventArgs.Empty); } - else if (e.Delta > 0 && list.SelectedIndex < list.Items.Count) + else if (e.Delta > 0 && list.SelectedIndex < list.Items.Count - 1) { list.SelectedIndex++; list_SelectionChangeCommitted(list, EventArgs.Empty); diff --git a/Source/Core/Controls/ArgumentBox.cs b/Source/Core/Controls/ArgumentBox.cs index bf87bc83f..b07d3040b 100644 --- a/Source/Core/Controls/ArgumentBox.cs +++ b/Source/Core/Controls/ArgumentBox.cs @@ -40,7 +40,6 @@ namespace CodeImp.DoomBuilder.Controls private TypeHandler typehandler; private bool ignorebuttonchange; - private bool gotTagArgument; #endregion @@ -89,17 +88,9 @@ namespace CodeImp.DoomBuilder.Controls // When the entered value needs to be validated private void combobox_Validating(object sender, CancelEventArgs e) { - //mxd - if(gotTagArgument && combobox.SelectedItem != null) - { - typehandler.SetValue(((TagInfo)combobox.SelectedItem).Tag); - return; - } - string str = combobox.Text.Trim().ToLowerInvariant(); str = str.TrimStart('+', '-'); - int num; - + // Anything in the box? if(combobox.Text.Trim().Length > 0) { @@ -107,6 +98,7 @@ namespace CodeImp.DoomBuilder.Controls if(CheckIsRelative()) { // Try parsing to number + int num; if(!int.TryParse(str, NumberStyles.Integer, CultureInfo.CurrentCulture, out num)) { // Invalid relative number @@ -192,120 +184,10 @@ namespace CodeImp.DoomBuilder.Controls combobox.SelectedItem = null; combobox.Items.Clear(); - //mxd. Special cases, special cases... - if(typehandler is ThingTagHandler) - { - gotTagArgument = true; - - //collect thing tags - List<int> tags = new List<int>(); - List<TagInfo> infos = new List<TagInfo>(); - - foreach(Thing t in General.Map.Map.Things) - { - if(t.Tag == 0 || tags.Contains(t.Tag)) continue; - tags.Add(t.Tag); - } - - //now sort them - tags.Sort(); - - //create tag infos - foreach(int tag in tags) - { - if(General.Map.Options.TagLabels.ContainsKey(tag)) //tag labels - infos.Add(new TagInfo(tag, General.Map.Options.TagLabels[tag])); - else - infos.Add(new TagInfo(tag, string.Empty)); - } - - // Show the combobox - button.Visible = false; - scrollbuttons.Visible = false; - combobox.DropDownStyle = ComboBoxStyle.DropDown; - - foreach(TagInfo info in infos) - combobox.Items.Add(info); - - combobox.DropDownWidth = Tools.GetDropDownWidth(combobox); - } - else if(typehandler is LinedefTagHandler) - { - gotTagArgument = true; - - //collect linedef tags - List<int> tags = new List<int>(); - List<TagInfo> infos = new List<TagInfo>(); - - foreach(Linedef t in General.Map.Map.Linedefs) - { - if(t.Tag == 0 || tags.Contains(t.Tag)) continue; - tags.Add(t.Tag); - } - - //now sort them - tags.Sort(); - - //create tag infos - foreach(int tag in tags) - { - if(General.Map.Options.TagLabels.ContainsKey(tag)) //tag labels - infos.Add(new TagInfo(tag, General.Map.Options.TagLabels[tag])); - else - infos.Add(new TagInfo(tag, string.Empty)); - } - - // Show the combobox - button.Visible = false; - scrollbuttons.Visible = false; - combobox.DropDownStyle = ComboBoxStyle.DropDown; - - foreach(TagInfo info in infos) - combobox.Items.Add(info); - - combobox.DropDownWidth = Tools.GetDropDownWidth(combobox); - } - else if(typehandler is SectorTagHandler) - { - gotTagArgument = true; - - //collect sector tags - List<int> tags = new List<int>(); - List<TagInfo> infos = new List<TagInfo>(); - - foreach(Sector t in General.Map.Map.Sectors) - { - if(t.Tag == 0 || tags.Contains(t.Tag)) continue; - tags.Add(t.Tag); - } - - //now sort them - tags.Sort(); - - //create tag infos - foreach(int tag in tags) - { - if(General.Map.Options.TagLabels.ContainsKey(tag)) //tag labels - infos.Add(new TagInfo(tag, General.Map.Options.TagLabels[tag])); - else - infos.Add(new TagInfo(tag, string.Empty)); - } - - // Show the combobox - button.Visible = false; - scrollbuttons.Visible = false; - combobox.DropDownStyle = ComboBoxStyle.DropDown; - - foreach(TagInfo info in infos) - combobox.Items.Add(info); - - combobox.DropDownWidth = Tools.GetDropDownWidth(combobox); - } // Check if this supports enumerated options - else if(typehandler.IsEnumerable) + if(typehandler.IsEnumerable) { // Show the combobox - gotTagArgument = false; //mxd button.Visible = false; scrollbuttons.Visible = false; combobox.DropDownStyle = ComboBoxStyle.DropDown; @@ -316,7 +198,6 @@ namespace CodeImp.DoomBuilder.Controls else if(typehandler.IsBrowseable) { // Show the button - gotTagArgument = false; //mxd button.Visible = true; button.Image = typehandler.BrowseImage; scrollbuttons.Visible = false; @@ -325,14 +206,13 @@ namespace CodeImp.DoomBuilder.Controls else { // Show textbox with scroll buttons - gotTagArgument = false; //mxd button.Visible = false; scrollbuttons.Visible = true; combobox.DropDownStyle = ComboBoxStyle.Simple; } //mxd - if(gotTagArgument) + if(typehandler.IsEnumerable) { combobox.AutoCompleteMode = AutoCompleteMode.Suggest; combobox.AutoCompleteSource = AutoCompleteSource.ListItems; @@ -354,20 +234,6 @@ namespace CodeImp.DoomBuilder.Controls public void SetValue(int value) { typehandler.SetValue(value); - - if(gotTagArgument) //mxd - { - foreach(object item in combobox.Items) - { - TagInfo info = (TagInfo)item; - if(info.Tag == value) - { - combobox.SelectedItem = item; - return; - } - } - } - combobox.SelectedItem = null; combobox.Text = typehandler.GetStringValue(); combobox_Validating(this, new CancelEventArgs()); @@ -376,8 +242,6 @@ namespace CodeImp.DoomBuilder.Controls //mxd. this sets default value public void SetDefaultValue() { - if(gotTagArgument) return; //default tag sounds a bit silly - typehandler.SetDefaultValue(); combobox.SelectedItem = null; combobox.Text = typehandler.GetStringValue(); @@ -402,10 +266,6 @@ namespace CodeImp.DoomBuilder.Controls // This returns the selected value public int GetResult(int original) { - //mxd - if(gotTagArgument && combobox.SelectedItem != null) - return General.Clamp(((TagInfo)combobox.SelectedItem).Tag, General.Map.FormatInterface.MinArgument, General.Map.FormatInterface.MaxArgument); - int result; // Strip prefixes diff --git a/Source/Core/Controls/CheckboxArrayControl.cs b/Source/Core/Controls/CheckboxArrayControl.cs index 653ddb224..aa576cafd 100644 --- a/Source/Core/Controls/CheckboxArrayControl.cs +++ b/Source/Core/Controls/CheckboxArrayControl.cs @@ -71,11 +71,23 @@ namespace CodeImp.DoomBuilder.Controls return c; } + //mxd + public int GetWidth() + { + if(columns < 1 || checkboxes.Count < 1) return 0; + int maxwidth = 0; + foreach (CheckBox cb in checkboxes) + { + if (cb.Width > maxwidth) maxwidth = cb.Width; + } + + return maxwidth * columns; + } + //mxd public int GetHeight() { - if(columns < 1) return 0; - if(checkboxes.Count < 1) return 0; + if(columns < 1 || checkboxes.Count < 1) return 0; int col = (int)Math.Ceiling(checkboxes.Count / (float)columns); return col * checkboxes[0].Height + (col * spacingY + spacingY); } @@ -88,8 +100,7 @@ namespace CodeImp.DoomBuilder.Controls int col = 0; // Checks - if(columns < 1) return; - if(checkboxes.Count < 1) return; + if(columns < 1 || checkboxes.Count < 1) return; // Calculate column width int columnwidth = this.ClientSize.Width / columns; diff --git a/Source/Core/Controls/LinedefInfoPanel.Designer.cs b/Source/Core/Controls/LinedefInfoPanel.Designer.cs index ad0b4fac1..a8cf93d43 100644 --- a/Source/Core/Controls/LinedefInfoPanel.Designer.cs +++ b/Source/Core/Controls/LinedefInfoPanel.Designer.cs @@ -214,11 +214,11 @@ namespace CodeImp.DoomBuilder.Controls // // activation // - this.activation.AutoEllipsis = true; + this.activation.AutoSize = true; this.activation.BackColor = System.Drawing.Color.Transparent; this.activation.Location = new System.Drawing.Point(66, 34); this.activation.Name = "activation"; - this.activation.Size = new System.Drawing.Size(205, 14); + this.activation.Size = new System.Drawing.Size(168, 14); this.activation.TabIndex = 31; this.activation.Text = "0 - When player does a barrel roll"; this.activation.UseMnemonic = false; @@ -417,11 +417,11 @@ namespace CodeImp.DoomBuilder.Controls // // action // - this.action.AutoEllipsis = true; + this.action.AutoSize = true; this.action.BackColor = System.Drawing.Color.Transparent; this.action.Location = new System.Drawing.Point(66, 19); this.action.Name = "action"; - this.action.Size = new System.Drawing.Size(205, 14); + this.action.Size = new System.Drawing.Size(190, 14); this.action.TabIndex = 1; this.action.Text = "0 - Big Door that goes Wobbly Wobbly"; this.action.UseMnemonic = false; diff --git a/Source/Core/Controls/LinedefInfoPanel.cs b/Source/Core/Controls/LinedefInfoPanel.cs index f8554a7f1..3e6e7bad6 100644 --- a/Source/Core/Controls/LinedefInfoPanel.cs +++ b/Source/Core/Controls/LinedefInfoPanel.cs @@ -35,7 +35,6 @@ namespace CodeImp.DoomBuilder.Controls { private readonly int hexenformatwidth; private readonly int doomformatwidth; - private readonly int[] labelPositionsY = new[] { 39, 58, 77 }; //mxd // Constructor public LinedefInfoPanel() @@ -110,22 +109,8 @@ namespace CodeImp.DoomBuilder.Controls } } - activation.Top = labelPositionsY[0]; - activationlabel.Top = labelPositionsY[0]; activation.Enabled = (l.Activate != 0); //mxd activationlabel.Enabled = (l.Activate != 0); //mxd - unpegged.Top = labelPositionsY[0]; - peglabel.Top = labelPositionsY[0]; - - length.Top = labelPositionsY[1]; - lengthlabel.Top = labelPositionsY[1]; - frontoffset.Top = labelPositionsY[1]; - frontoffsetlabel.Top = labelPositionsY[1]; - - angle.Top = labelPositionsY[2]; - anglelabel.Top = labelPositionsY[2]; - backoffset.Top = labelPositionsY[2]; - backoffsetlabel.Top = labelPositionsY[2]; } else { @@ -135,24 +120,9 @@ namespace CodeImp.DoomBuilder.Controls tag.Visible = true; //set tag - tag.Text = l.Tag + (General.Map.Options.TagLabels.ContainsKey(l.Tag) ? " (" + General.Map.Options.TagLabels[l.Tag] + ")" : string.Empty); + tag.Text = l.Tag + (General.Map.Options.TagLabels.ContainsKey(l.Tag) ? " - " + General.Map.Options.TagLabels[l.Tag] : string.Empty); tag.Enabled = (l.Tag != 0); taglabel.Enabled = (l.Tag != 0); - - length.Top = labelPositionsY[0]; - lengthlabel.Top = labelPositionsY[0]; - unpegged.Top = labelPositionsY[0]; - peglabel.Top = labelPositionsY[0]; - - angle.Top = labelPositionsY[1]; - anglelabel.Top = labelPositionsY[1]; - frontoffset.Top = labelPositionsY[1]; - frontoffsetlabel.Top = labelPositionsY[1]; - - tag.Top = labelPositionsY[2]; - taglabel.Top = labelPositionsY[2]; - backoffset.Top = labelPositionsY[2]; - backoffsetlabel.Top = labelPositionsY[2]; } // Get line action information @@ -176,6 +146,8 @@ namespace CodeImp.DoomBuilder.Controls length.Text = l.Length.ToString("0.##"); angle.Text = l.AngleDeg + "\u00B0"; unpegged.Text = peggedness; + unpegged.Enabled = (peggedness != "None"); //mxd + peglabel.Enabled = (peggedness != "None"); //mxd action.Enabled = (act.Index != 0); actionlabel.Enabled = (act.Index != 0); @@ -262,9 +234,18 @@ namespace CodeImp.DoomBuilder.Controls else { frontoffsetlabel.Text = "Front offset:"; - frontoffset.Text = l.Front.OffsetX + ", " + l.Front.OffsetY; - frontoffsetlabel.Enabled = true; - frontoffset.Enabled = true; + if (l.Front.OffsetX != 0 || l.Front.OffsetY != 0) + { + frontoffset.Text = l.Front.OffsetX + ", " + l.Front.OffsetY; + frontoffsetlabel.Enabled = true; + frontoffset.Enabled = true; + } + else + { + frontoffset.Text = "--, --"; + frontoffsetlabel.Enabled = false; + frontoffset.Enabled = false; + } //mxd. Sector index frontpanel.Text += ". Sector " + l.Front.Sector.Index + " "; @@ -364,9 +345,18 @@ namespace CodeImp.DoomBuilder.Controls else { backoffsetlabel.Text = "Back offset:"; - backoffset.Text = l.Back.OffsetX + ", " + l.Back.OffsetY; - backoffsetlabel.Enabled = true; - backoffset.Enabled = true; + if (l.Back.OffsetX != 0 || l.Back.OffsetY != 0) + { + backoffset.Text = l.Back.OffsetX + ", " + l.Back.OffsetY; + backoffsetlabel.Enabled = true; + backoffset.Enabled = true; + } + else + { + backoffset.Text = "--, --"; + backoffsetlabel.Enabled = false; + backoffset.Enabled = false; + } // Sector index backpanel.Text += ". Sector " + l.Back.Sector.Index + " "; @@ -526,11 +516,6 @@ namespace CodeImp.DoomBuilder.Controls TypeHandler th = General.Types.GetArgumentHandler(info); th.SetValue(value); label.Text = th.GetStringValue(); - - if(value < 1 || !General.Map.Options.TagLabels.ContainsKey(value)) return; - - if(th is ThingTagHandler || th is LinedefTagHandler || th is SectorTagHandler) - label.Text += " (" + General.Map.Options.TagLabels[value] + ")"; } // When visible changed diff --git a/Source/Core/Controls/LinedefInfoPanel.resx b/Source/Core/Controls/LinedefInfoPanel.resx index 0a562bbd1..4e6c021e2 100644 --- a/Source/Core/Controls/LinedefInfoPanel.resx +++ b/Source/Core/Controls/LinedefInfoPanel.resx @@ -159,46 +159,4 @@ <metadata name="frontoffset.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> - <metadata name="unpegged.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="peglabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="arg5.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="arglbl5.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="arglbl4.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="arg4.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="arglbl3.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="arglbl2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="arg3.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="arglbl1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="arg2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="backoffset.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="arg1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="frontoffset.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> </root> \ No newline at end of file diff --git a/Source/Core/Controls/SectorInfoPanel.cs b/Source/Core/Controls/SectorInfoPanel.cs index 2a1b61004..063455df4 100644 --- a/Source/Core/Controls/SectorInfoPanel.cs +++ b/Source/Core/Controls/SectorInfoPanel.cs @@ -64,7 +64,7 @@ namespace CodeImp.DoomBuilder.Controls effect.Text = effectinfo; ceiling.Text = s.CeilHeight.ToString(); floor.Text = s.FloorHeight.ToString(); - tag.Text = s.Tag + (General.Map.Options.TagLabels.ContainsKey(s.Tag) ? " (" + General.Map.Options.TagLabels[s.Tag] + ")" : string.Empty); + tag.Text = s.Tag + (General.Map.Options.TagLabels.ContainsKey(s.Tag) ? " - " + General.Map.Options.TagLabels[s.Tag] : string.Empty); height.Text = sheight.ToString(); brightness.Text = s.Brightness.ToString(); floorname.Text = s.FloorTexture; diff --git a/Source/Core/Controls/ThingInfoPanel.cs b/Source/Core/Controls/ThingInfoPanel.cs index 3a2abf25b..f5f63c94b 100644 --- a/Source/Core/Controls/ThingInfoPanel.cs +++ b/Source/Core/Controls/ThingInfoPanel.cs @@ -68,9 +68,8 @@ namespace CodeImp.DoomBuilder.Controls infopanel.Width = (hasArgs ? hexenformatwidth : doomformatwidth); //mxd - bool hasAction = General.Map.FormatInterface.HasThingAction; - action.Visible = hasAction; - labelaction.Visible = hasAction; + action.Visible = General.Map.FormatInterface.HasThingAction; + labelaction.Visible = General.Map.FormatInterface.HasThingAction; // Move panel spritepanel.Left = infopanel.Left + infopanel.Width + infopanel.Margin.Right + spritepanel.Margin.Left; @@ -125,7 +124,7 @@ namespace CodeImp.DoomBuilder.Controls type.Text = t.Type + " - " + ti.Title; action.Text = actioninfo; position.Text = t.Position.x + ", " + t.Position.y + ", " + zinfo; - tag.Text = t.Tag + (General.Map.Options.TagLabels.ContainsKey(t.Tag) ? " (" + General.Map.Options.TagLabels[t.Tag] + ")" : string.Empty); + tag.Text = t.Tag + (General.Map.Options.TagLabels.ContainsKey(t.Tag) ? " - " + General.Map.Options.TagLabels[t.Tag] : string.Empty); angle.Text = t.AngleDoom + "\u00B0"; anglecontrol.Angle = t.AngleDoom; anglecontrol.Left = angle.Right + 1; @@ -217,13 +216,6 @@ namespace CodeImp.DoomBuilder.Controls TypeHandler th = General.Types.GetArgumentHandler(info); th.SetValue(value); label.Text = th.GetStringValue(); - - if(value < 1 || !General.Map.Options.TagLabels.ContainsKey(value)) return; - - if (th is ThingTagHandler || th is LinedefTagHandler || th is SectorTagHandler) - { - label.Text += " (" + General.Map.Options.TagLabels[value] + ")"; - } } // When visible changed diff --git a/Source/Core/GZBuilder/Controls/TagSelector.cs b/Source/Core/GZBuilder/Controls/TagSelector.cs index 78de3fdc0..ea229046c 100644 --- a/Source/Core/GZBuilder/Controls/TagSelector.cs +++ b/Source/Core/GZBuilder/Controls/TagSelector.cs @@ -18,7 +18,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Controls public TagInfo(int tag, string label) { - Label = (string.IsNullOrEmpty(label) ? tag.ToString() : tag + " (" + label + ")"); + Label = (string.IsNullOrEmpty(label) ? tag.ToString() : tag + " - " + label); Tag = tag; } diff --git a/Source/Core/General/MapManager.cs b/Source/Core/General/MapManager.cs index 5b2bc65cf..9ddac7580 100644 --- a/Source/Core/General/MapManager.cs +++ b/Source/Core/General/MapManager.cs @@ -418,11 +418,7 @@ namespace CodeImp.DoomBuilder { grid.TranslateBackgroundName(config.UseLongTextureNames); //mxd. Sector textures may've been changed - if (nameschanged) - { - data.UpdateUsedTextures(); - General.Map.IsChanged = true; - } + if (nameschanged) data.UpdateUsedTextures(); // Update structures options.ApplyGridSettings(); @@ -1940,11 +1936,7 @@ namespace CodeImp.DoomBuilder { grid.TranslateBackgroundName(config.UseLongTextureNames); //mxd. Sector textures may've been changed - if (nameschanged) - { - data.UpdateUsedTextures(); - General.Map.IsChanged = true; - } + if (nameschanged) data.UpdateUsedTextures(); // Done General.MainWindow.DisplayReady(); diff --git a/Source/Core/Types/AngleByteHandler.cs b/Source/Core/Types/AngleByteHandler.cs new file mode 100644 index 000000000..bfc8dc9d6 --- /dev/null +++ b/Source/Core/Types/AngleByteHandler.cs @@ -0,0 +1,23 @@ +#region ================== Namespaces + +using System; +using System.Windows.Forms; +using CodeImp.DoomBuilder.Windows; + +#endregion + +namespace CodeImp.DoomBuilder.Types +{ + [TypeHandler(UniversalType.AngleByte, "Byte Angle", true)] + internal class AngleByteHandler : AngleDegreesHandler + { + #region ================== Methods + + public override void Browse(IWin32Window parent) + { + value = (int)Math.Round((float)AngleForm.ShowDialog(parent, (int)Math.Round((float)value / 256 * 360)) / 360 * 256); + } + + #endregion + } +} diff --git a/Source/Core/Types/AngleDegreesHandler.cs b/Source/Core/Types/AngleDegreesHandler.cs index 22ff2f630..3c0b6652c 100644 --- a/Source/Core/Types/AngleDegreesHandler.cs +++ b/Source/Core/Types/AngleDegreesHandler.cs @@ -35,7 +35,7 @@ namespace CodeImp.DoomBuilder.Types #region ================== Variables - private int value; + protected int value; #endregion diff --git a/Source/Core/Types/EnumOptionHandler.cs b/Source/Core/Types/EnumOptionHandler.cs index d61432ecd..d9fad0b26 100644 --- a/Source/Core/Types/EnumOptionHandler.cs +++ b/Source/Core/Types/EnumOptionHandler.cs @@ -35,7 +35,7 @@ namespace CodeImp.DoomBuilder.Types private EnumList list; private EnumItem value; - private EnumItem defaultValue; //mxd + private EnumItem defaultvalue; //mxd #endregion @@ -46,12 +46,12 @@ namespace CodeImp.DoomBuilder.Types #endregion - #region ================== Constructor + #region ================== Setup // When set up for an argument public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo) { - defaultValue = new EnumItem(arginfo.DefaultValue.ToString(), arginfo.DefaultValue.ToString());//mxd + defaultvalue = new EnumItem(arginfo.DefaultValue.ToString(), arginfo.DefaultValue.ToString());//mxd base.SetupArgument(attr, arginfo); // Keep enum list reference @@ -142,7 +142,7 @@ namespace CodeImp.DoomBuilder.Types //mxd public override void SetDefaultValue() { - value = defaultValue; + value = defaultvalue; } public override object GetValue() diff --git a/Source/Core/Types/LinedefTagHandler.cs b/Source/Core/Types/LinedefTagHandler.cs index cd5766946..3561db88a 100644 --- a/Source/Core/Types/LinedefTagHandler.cs +++ b/Source/Core/Types/LinedefTagHandler.cs @@ -16,12 +16,46 @@ #region ================== Namespaces +using System.Collections.Generic; +using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.Map; + #endregion namespace CodeImp.DoomBuilder.Types { [TypeHandler(UniversalType.LinedefTag, "Linedef Tag", true)] - internal class LinedefTagHandler : IntegerHandler + internal class LinedefTagHandler : SectorTagHandler { + #region ================== Setup + + protected override EnumList CreateTagList() + { + //collect tags + List<int> tags = new List<int>(); + EnumList taglist = new EnumList(); + + foreach(Linedef t in General.Map.Map.Linedefs) + { + if(t.Tag == 0 || tags.Contains(t.Tag)) continue; + tags.Add(t.Tag); + } + + //now sort them + tags.Sort(); + + //create enum items + foreach(int tag in tags) + { + if(General.Map.Options.TagLabels.ContainsKey(tag)) //tag labels + taglist.Add(new EnumItem(tag.ToString(), General.Map.Options.TagLabels[tag])); + else + taglist.Add(new EnumItem(tag.ToString(), tag.ToString())); + } + + return taglist; + } + + #endregion } } diff --git a/Source/Core/Types/SectorTagHandler.cs b/Source/Core/Types/SectorTagHandler.cs index 4a54d21f5..10ec7f162 100644 --- a/Source/Core/Types/SectorTagHandler.cs +++ b/Source/Core/Types/SectorTagHandler.cs @@ -16,6 +16,12 @@ #region ================== Namespaces +using System; +using System.Collections.Generic; +using System.Globalization; +using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.Map; + #endregion namespace CodeImp.DoomBuilder.Types @@ -23,5 +29,185 @@ namespace CodeImp.DoomBuilder.Types [TypeHandler(UniversalType.SectorTag, "Sector Tag", true)] internal class SectorTagHandler : IntegerHandler { + #region ================== Variables + + private EnumList list; + private EnumItem value; + private EnumItem defaultvalue; + + #endregion + + #region ================== Properties + + public override bool IsEnumerable { get { return true; } } + + #endregion + + #region ================== Setup + + // When set up for an argument + public override void SetupArgument(TypeHandlerAttribute attr, ArgumentInfo arginfo) + { + defaultvalue = new EnumItem("0", "0: No Tag"); + base.SetupArgument(attr, arginfo); + + // Create enum list reference + list = CreateTagList(); + + // Add default value + list.Insert(0, defaultvalue); + } + + // When set up for a universal field + public override void SetupField(TypeHandlerAttribute attr, UniversalFieldInfo fieldinfo) + { + base.SetupField(attr, fieldinfo); + + // Create enum list reference + list = CreateTagList(); + } + + //mxd + protected virtual EnumList CreateTagList() + { + //collect tags + List<int> tags = new List<int>(); + EnumList taglist = new EnumList(); + + foreach(Sector t in General.Map.Map.Sectors) + { + if(t.Tag == 0 || tags.Contains(t.Tag)) continue; + tags.Add(t.Tag); + } + + //now sort them + tags.Sort(); + + //create enum items + foreach(int tag in tags) + { + if(General.Map.Options.TagLabels.ContainsKey(tag)) //tag labels + taglist.Add(new EnumItem(tag.ToString(), tag + ": " + General.Map.Options.TagLabels[tag])); + else + taglist.Add(new EnumItem(tag.ToString(), tag.ToString())); + } + + return taglist; + } + + #endregion + + #region ================== Methods + + public override void SetValue(object value) + { + this.value = null; + + // Input null? + if(value == null) + { + this.value = new EnumItem("0", "0: No Tag"); + } + else + { + // Compatible type? + if((value is int) || (value is float) || (value is bool)) + { + int intvalue = Convert.ToInt32(value); + + // First try to match the value against the enum values + foreach(EnumItem item in list) + { + // Matching value? + if(item.GetIntValue() == intvalue) + { + // Set this value + this.value = item; + } + } + } + + // No match found yet? + if(this.value == null) + { + // First try to match the value against the enum values + foreach(EnumItem item in list) + { + // Matching value? + if(item.Value == value.ToString()) + { + // Set this value + this.value = item; + } + } + } + + // No match found yet? + if(this.value == null) + { + // Try to match against the titles + foreach(EnumItem item in list) + { + // Matching value? + if(item.Title.ToLowerInvariant() == value.ToString().ToLowerInvariant()) + { + // Set this value + this.value = item; + } + } + } + + // Still no match found? + if(this.value == null) + { + // Make a dummy value + this.value = new EnumItem(value.ToString(), value.ToString()); + this.value = new EnumItem(this.value.GetIntValue().ToString(CultureInfo.InvariantCulture), value.ToString()); + } + } + } + + //mxd + public override void SetDefaultValue() + { + value = defaultvalue; + } + + public override object GetValue() + { + return GetIntValue(); + } + + public override int GetIntValue() + { + if(this.value != null) + { + // Parse the value to integer + int result; + return (int.TryParse(this.value.Value, NumberStyles.Integer, + CultureInfo.InvariantCulture, out result) ? result : 0); + } + return 0; + } + + public override string GetStringValue() + { + return (this.value != null ? this.value.Title : "0: No Tag"); + } + + // This returns an enum list + public override EnumList GetEnumList() + { + return list; + } + + // This returns the type to display for fixed fields + // Must be a custom usable type + public override TypeHandlerAttribute GetDisplayType() + { + return General.Types.GetAttribute((int)UniversalType.Integer); + } + + #endregion } } diff --git a/Source/Core/Types/ThingTagHandler.cs b/Source/Core/Types/ThingTagHandler.cs index 5acfb2ee9..8fb2c120a 100644 --- a/Source/Core/Types/ThingTagHandler.cs +++ b/Source/Core/Types/ThingTagHandler.cs @@ -16,12 +16,46 @@ #region ================== Namespaces +using System.Collections.Generic; +using CodeImp.DoomBuilder.Config; +using CodeImp.DoomBuilder.Map; + #endregion namespace CodeImp.DoomBuilder.Types { [TypeHandler(UniversalType.ThingTag, "Thing Tag", true)] - internal class ThingTagHandler : IntegerHandler + internal class ThingTagHandler : SectorTagHandler { + #region ================== Setup + + protected override EnumList CreateTagList() + { + //collect tags + List<int> tags = new List<int>(); + EnumList taglist = new EnumList(); + + foreach(Thing t in General.Map.Map.Things) + { + if(t.Tag == 0 || tags.Contains(t.Tag)) continue; + tags.Add(t.Tag); + } + + //now sort them + tags.Sort(); + + //create enum items + foreach(int tag in tags) + { + if(General.Map.Options.TagLabels.ContainsKey(tag)) //tag labels + taglist.Add(new EnumItem(tag.ToString(), General.Map.Options.TagLabels[tag])); + else + taglist.Add(new EnumItem(tag.ToString(), tag.ToString())); + } + + return taglist; + } + + #endregion } } diff --git a/Source/Core/Types/TypeHandler.cs b/Source/Core/Types/TypeHandler.cs index 9c8bab8e8..2811ed9f1 100644 --- a/Source/Core/Types/TypeHandler.cs +++ b/Source/Core/Types/TypeHandler.cs @@ -148,7 +148,7 @@ namespace CodeImp.DoomBuilder.Types // This must returns an enum list when IsEnumerable is true public virtual EnumList GetEnumList() { - return null; + return new EnumList(); //mxd } // String representation diff --git a/Source/Core/Types/TypeHandlerAttribute.cs b/Source/Core/Types/TypeHandlerAttribute.cs index 4bf3d6fec..a5679eb5a 100644 --- a/Source/Core/Types/TypeHandlerAttribute.cs +++ b/Source/Core/Types/TypeHandlerAttribute.cs @@ -30,10 +30,10 @@ namespace CodeImp.DoomBuilder.Types #region ================== Variables - private int index; - private string name; + private readonly int index; + private readonly string name; private Type type; - private bool customusable; + private readonly bool customusable; #endregion diff --git a/Source/Core/Types/UniversalType.cs b/Source/Core/Types/UniversalType.cs index f9ab8851f..263b667ac 100644 --- a/Source/Core/Types/UniversalType.cs +++ b/Source/Core/Types/UniversalType.cs @@ -20,7 +20,7 @@ namespace CodeImp.DoomBuilder.Types { - public enum UniversalType : int + public enum UniversalType { Integer = 0, Float = 1, @@ -43,6 +43,7 @@ namespace CodeImp.DoomBuilder.Types ThingType = 18, ThingClass = 19, RandomInteger = 20, //mxd - RandomFloat = 21 //mxd + RandomFloat = 21, //mxd + AngleByte = 22, //mxd } } diff --git a/Source/Core/Windows/BitFlagsForm.Designer.cs b/Source/Core/Windows/BitFlagsForm.Designer.cs index be192ca74..59477245e 100644 --- a/Source/Core/Windows/BitFlagsForm.Designer.cs +++ b/Source/Core/Windows/BitFlagsForm.Designer.cs @@ -84,7 +84,7 @@ namespace CodeImp.DoomBuilder.Windows this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "BitFlagsForm"; - this.Opacity = 0; + this.Opacity = 1; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; diff --git a/Source/Core/Windows/BitFlagsForm.cs b/Source/Core/Windows/BitFlagsForm.cs index 6aa31e1eb..77a8f5d98 100644 --- a/Source/Core/Windows/BitFlagsForm.cs +++ b/Source/Core/Windows/BitFlagsForm.cs @@ -30,7 +30,6 @@ namespace CodeImp.DoomBuilder.Windows private bool setup; private int value; - private readonly int initialFlagsHeight; //mxd #endregion @@ -47,9 +46,6 @@ namespace CodeImp.DoomBuilder.Windows { // Initialize InitializeComponent(); - - //mxd - initialFlagsHeight = options.Height; } #endregion @@ -122,12 +118,14 @@ namespace CodeImp.DoomBuilder.Windows { setup = true; this.value = value; + int optionsheight = options.Height; // Make a checkbox for each item foreach(EnumItem item in flags) { // Make the checkbox - CheckBox box = options.Add(item.Title, item.GetIntValue()); + int flag = item.GetIntValue(); //mxd + CheckBox box = options.Add(flag + ": " + item.Title, item.GetIntValue()); // Bind checking event box.CheckedChanged += box_CheckedChanged; @@ -154,8 +152,10 @@ namespace CodeImp.DoomBuilder.Windows } } - //mxd - this.Height -= initialFlagsHeight - options.GetHeight(); + //mxd. Update window size + this.Height -= (optionsheight - options.GetHeight()); + int targetwidth = options.GetWidth(); + if(targetwidth > options.Width) this.Width += (targetwidth - options.Width); setup = false; } -- GitLab