Merge branch 'master' into slimgl_merge

This commit is contained in:
ZZYZX 2019-12-14 23:50:40 +02:00
commit f0aee1e174
124 changed files with 15305 additions and 2886 deletions

View file

@ -1,4 +1,6 @@
// Version: 2017-02-13
// Version: 2019-07-24
// Flags and Railgun taken from zdaemon.wad.
// Thanks to ZDaemon team for the sprites.
redteam
{
@ -19,7 +21,7 @@ redteam
5131
{
title = "Red Flag";
sprite = "internal:ZandFlagRed";
sprite = "internal:ZDFlagRed";
height = 55;
}
}
@ -43,7 +45,7 @@ blueteam
5130
{
title = "Blue Flag";
sprite = "internal:ZandFlagBlue";
sprite = "internal:ZDFlagBlue";
height = 55;
}
}
@ -67,7 +69,7 @@ greenteam
5133
{
title = "Green Flag";
sprite = "internal:ZandFlagGreen";
sprite = "internal:ZDFlagGreen";
}
}
@ -90,7 +92,7 @@ whiteteam
5134
{
title = "White Flag";
sprite = "internal:ZandFlagWhite";
sprite = "internal:ZDFlagWhite";
}
}
@ -127,5 +129,6 @@ weapons
5012
{
title = "Railgun";
sprite = "internal:ZDRailgun";
}
}

View file

@ -3278,6 +3278,7 @@ zdoom
{
title = "Sector Set Link";
id = "Sector_SetLink";
requiresactivation = false;
arg0
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
Build/Sprites/ZDFlagRed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
Build/Sprites/ZDRailgun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -40,242 +40,312 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vpo_dll", "Source\Plugins\v
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BuilderNative", "Source\Native\BuilderNative.vcxproj", "{78938655-9807-485E-9D4B-46226DC7AD27}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThreeDFloorMode", "Source\Plugins\3DFloorMode\ThreeDFloorMode.csproj", "{88CFD996-027B-4CBE-9828-26B2728B6127}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug + Profiler|Any CPU = Debug + Profiler|Any CPU
Debug + Profiler|x64 = Debug + Profiler|x64
Debug + Profiler|x86 = Debug + Profiler|x86
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release + Profiler|Any CPU = Release + Profiler|Any CPU
Release + Profiler|x64 = Release + Profiler|x64
Release + Profiler|x86 = Release + Profiler|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|Any CPU.ActiveCfg = Debug|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|x64.ActiveCfg = Debug|x64
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|x64.Build.0 = Debug|x64
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|x86.ActiveCfg = Debug|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Debug|x86.Build.0 = Debug|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|Any CPU.ActiveCfg = Release|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|x64.ActiveCfg = Release|x64
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|x64.Build.0 = Release|x64
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|x86.ActiveCfg = Release|x86
{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}.Release|x86.Build.0 = Release|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|Any CPU.ActiveCfg = Debug|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|x64.ActiveCfg = Debug|x64
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|x64.Build.0 = Debug|x64
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|x86.ActiveCfg = Debug|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Debug|x86.Build.0 = Debug|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|Any CPU.ActiveCfg = Release|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|x64.ActiveCfg = Release|x64
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|x64.Build.0 = Release|x64
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|x86.ActiveCfg = Release|x86
{B42D5AA0-F9A6-4234-9C4B-A05B11A64851}.Release|x86.Build.0 = Release|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|Any CPU.ActiveCfg = Debug|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|x64.ActiveCfg = Debug|x64
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|x64.Build.0 = Debug|x64
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|x86.ActiveCfg = Debug|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Debug|x86.Build.0 = Debug|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|Any CPU.ActiveCfg = Release|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|x64.ActiveCfg = Release|x64
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|x64.Build.0 = Release|x64
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|x86.ActiveCfg = Release|x86
{B859BE0F-A992-476D-A642-FA8EFE94AAA5}.Release|x86.Build.0 = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Any CPU.ActiveCfg = Debug|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|x64.ActiveCfg = Debug|x64
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|x64.Build.0 = Debug|x64
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|x86.ActiveCfg = Debug|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|x86.Build.0 = Debug|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|Any CPU.ActiveCfg = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|x64.ActiveCfg = Release|x64
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|x64.Build.0 = Release|x64
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|x86.ActiveCfg = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|x86.Build.0 = Release|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|Any CPU.ActiveCfg = Debug|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|x64.ActiveCfg = Debug|x64
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|x64.Build.0 = Debug|x64
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|x86.ActiveCfg = Debug|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Debug|x86.Build.0 = Debug|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|Any CPU.ActiveCfg = Release|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|x64.ActiveCfg = Release|x64
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|x64.Build.0 = Release|x64
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|x86.ActiveCfg = Release|x86
{BE7917F3-E6FE-4D5B-8FA9-B8E7668AC731}.Release|x86.Build.0 = Release|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|Any CPU.ActiveCfg = Debug|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|x64.ActiveCfg = Debug|x64
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|x64.Build.0 = Debug|x64
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|x86.ActiveCfg = Debug|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Debug|x86.Build.0 = Debug|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|Any CPU.ActiveCfg = Release|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|x64.ActiveCfg = Release|x64
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|x64.Build.0 = Release|x64
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|x86.ActiveCfg = Release|x86
{58BD8A5B-1B48-435D-8473-A92F27D06C49}.Release|x86.Build.0 = Release|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|Any CPU.ActiveCfg = Debug|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|x64.ActiveCfg = Debug|x64
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|x64.Build.0 = Debug|x64
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|x86.ActiveCfg = Debug|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Debug|x86.Build.0 = Debug|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|Any CPU.ActiveCfg = Release|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|x64.ActiveCfg = Release|x64
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|x64.Build.0 = Release|x64
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|x86.ActiveCfg = Release|x86
{9F244231-6A0C-42A6-87C5-ED9620DEE096}.Release|x86.Build.0 = Release|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|Any CPU.ActiveCfg = Debug|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|x64.ActiveCfg = Debug|x64
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|x64.Build.0 = Debug|x64
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|x86.ActiveCfg = Debug|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Debug|x86.Build.0 = Debug|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|Any CPU.ActiveCfg = Release|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|x64.ActiveCfg = Release|x64
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|x64.Build.0 = Release|x64
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|x86.ActiveCfg = Release|x86
{F49EFF6D-51CB-4E49-8223-AAE653C5B62F}.Release|x86.Build.0 = Release|x86
{CF670175-7099-4090-A330-EE25C7230139}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{CF670175-7099-4090-A330-EE25C7230139}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{CF670175-7099-4090-A330-EE25C7230139}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{CF670175-7099-4090-A330-EE25C7230139}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{CF670175-7099-4090-A330-EE25C7230139}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{CF670175-7099-4090-A330-EE25C7230139}.Debug|Any CPU.ActiveCfg = Debug|x86
{CF670175-7099-4090-A330-EE25C7230139}.Debug|x64.ActiveCfg = Debug|x64
{CF670175-7099-4090-A330-EE25C7230139}.Debug|x64.Build.0 = Debug|x64
{CF670175-7099-4090-A330-EE25C7230139}.Debug|x86.ActiveCfg = Debug|x86
{CF670175-7099-4090-A330-EE25C7230139}.Debug|x86.Build.0 = Debug|x86
{CF670175-7099-4090-A330-EE25C7230139}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{CF670175-7099-4090-A330-EE25C7230139}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{CF670175-7099-4090-A330-EE25C7230139}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{CF670175-7099-4090-A330-EE25C7230139}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{CF670175-7099-4090-A330-EE25C7230139}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{CF670175-7099-4090-A330-EE25C7230139}.Release|Any CPU.ActiveCfg = Release|x86
{CF670175-7099-4090-A330-EE25C7230139}.Release|x64.ActiveCfg = Release|x64
{CF670175-7099-4090-A330-EE25C7230139}.Release|x64.Build.0 = Release|x64
{CF670175-7099-4090-A330-EE25C7230139}.Release|x86.ActiveCfg = Release|x86
{CF670175-7099-4090-A330-EE25C7230139}.Release|x86.Build.0 = Release|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|Any CPU.ActiveCfg = Debug|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|x64.ActiveCfg = Debug|x64
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|x64.Build.0 = Debug|x64
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|x86.ActiveCfg = Debug|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Debug|x86.Build.0 = Debug|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|Any CPU.ActiveCfg = Release|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|x64.ActiveCfg = Release|x64
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|x64.Build.0 = Release|x64
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|x86.ActiveCfg = Release|x86
{F59B344C-DD50-4DB7-ADDD-56AAD66450AF}.Release|x86.Build.0 = Release|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug + Profiler|Any CPU.ActiveCfg = Debug + Profiler|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug + Profiler|x64.ActiveCfg = Debug + Profiler|x64
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug + Profiler|x64.Build.0 = Debug + Profiler|x64
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug + Profiler|x86.ActiveCfg = Debug + Profiler|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug + Profiler|x86.Build.0 = Debug + Profiler|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug|Any CPU.ActiveCfg = Debug|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug|x64.ActiveCfg = Debug|x64
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug|x64.Build.0 = Debug|x64
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug|x86.ActiveCfg = Debug|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Debug|x86.Build.0 = Debug|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release + Profiler|Any CPU.ActiveCfg = Release + Profiler|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release + Profiler|x64.ActiveCfg = Release + Profiler|x64
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release + Profiler|x64.Build.0 = Release + Profiler|x64
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release + Profiler|x86.ActiveCfg = Release + Profiler|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release + Profiler|x86.Build.0 = Release + Profiler|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release|Any CPU.ActiveCfg = Release|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release|x64.ActiveCfg = Release|x64
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release|x64.Build.0 = Release|x64
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release|x86.ActiveCfg = Release|x86
{3F365121-906B-409D-BB1E-37E0A78056C2}.Release|x86.Build.0 = Release|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug + Profiler|Any CPU.ActiveCfg = Release|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug + Profiler|Any CPU.Build.0 = Release|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug + Profiler|x64.ActiveCfg = Debug|x64
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug + Profiler|x64.Build.0 = Debug|x64
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug + Profiler|x86.ActiveCfg = Debug|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug + Profiler|x86.Build.0 = Debug|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug|Any CPU.ActiveCfg = Debug|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug|x64.ActiveCfg = Debug|x64
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug|x64.Build.0 = Debug|x64
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug|x86.ActiveCfg = Debug|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Debug|x86.Build.0 = Debug|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release + Profiler|Any CPU.ActiveCfg = Release|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release + Profiler|Any CPU.Build.0 = Release|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release + Profiler|x64.ActiveCfg = Release|x64
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release + Profiler|x64.Build.0 = Release|x64
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release + Profiler|x86.ActiveCfg = Release|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release + Profiler|x86.Build.0 = Release|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release|Any CPU.ActiveCfg = Release|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release|x64.ActiveCfg = Release|x64
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release|x64.Build.0 = Release|x64
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release|x86.ActiveCfg = Release|x86
{B33F68D5-1335-400C-A1D7-7F5602A030EF}.Release|x86.Build.0 = Release|x86
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|Any CPU.ActiveCfg = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|Any CPU.Build.0 = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|x64.ActiveCfg = Debug|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|x64.Build.0 = Debug|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|x86.ActiveCfg = Debug|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug + Profiler|x86.Build.0 = Debug|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug|Any CPU.ActiveCfg = Debug|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug|x64.ActiveCfg = Debug|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug|x64.Build.0 = Debug|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug|x86.ActiveCfg = Debug|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Debug|x86.Build.0 = Debug|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|Any CPU.ActiveCfg = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|Any CPU.Build.0 = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|x64.ActiveCfg = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|x64.Build.0 = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|x86.ActiveCfg = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release + Profiler|x86.Build.0 = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release|Any CPU.ActiveCfg = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release|x64.ActiveCfg = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release|x64.Build.0 = Release|x64
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release|x86.ActiveCfg = Release|Win32
{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}.Release|x86.Build.0 = Release|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug + Profiler|x64.ActiveCfg = Debug|x64
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug + Profiler|x64.Build.0 = Debug|x64
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug + Profiler|x86.ActiveCfg = Debug|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug + Profiler|x86.Build.0 = Debug|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug|x64.ActiveCfg = Debug|x64
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug|x64.Build.0 = Debug|x64
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug|x86.ActiveCfg = Debug|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Debug|x86.Build.0 = Debug|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Release + Profiler|x64.ActiveCfg = Release|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Release + Profiler|x64.Build.0 = Release|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Release + Profiler|x86.ActiveCfg = Release|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Release + Profiler|x86.Build.0 = Release|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Release|x64.ActiveCfg = Release|x64
{78938655-9807-485E-9D4B-46226DC7AD27}.Release|x64.Build.0 = Release|x64
{78938655-9807-485E-9D4B-46226DC7AD27}.Release|x86.ActiveCfg = Release|Win32
{78938655-9807-485E-9D4B-46226DC7AD27}.Release|x86.Build.0 = Release|Win32
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug + Profiler|Any CPU.ActiveCfg = Debug|Any CPU
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug + Profiler|Any CPU.Build.0 = Debug|Any CPU
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug + Profiler|x64.ActiveCfg = Debug|x64
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug + Profiler|x64.Build.0 = Debug|x64
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug + Profiler|x86.ActiveCfg = Debug|x86
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug + Profiler|x86.Build.0 = Debug|x86
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug|x64.ActiveCfg = Debug|x64
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug|x64.Build.0 = Debug|x64
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug|x86.ActiveCfg = Debug|x86
{88CFD996-027B-4CBE-9828-26B2728B6127}.Debug|x86.Build.0 = Debug|x86
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release + Profiler|Any CPU.ActiveCfg = Release|Any CPU
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release + Profiler|Any CPU.Build.0 = Release|Any CPU
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release + Profiler|x64.ActiveCfg = Release|x64
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release + Profiler|x64.Build.0 = Release|x64
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release + Profiler|x86.ActiveCfg = Release|x86
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release + Profiler|x86.Build.0 = Release|x86
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release|Any CPU.Build.0 = Release|Any CPU
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release|x64.ActiveCfg = Release|x64
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release|x64.Build.0 = Release|x64
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release|x86.ActiveCfg = Release|x86
{88CFD996-027B-4CBE-9828-26B2728B6127}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -354,6 +354,14 @@
<param name="Name" value="Sound Environment Mode">
<param name="Local" value="gzdb\features\classic_modes\mode_soundenvironment.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="3D Floor Mode">
<param name="Local" value="gzdb\features\classic_modes\mode_3dfloor.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Draw Slope Mode/Slope Mode">
<param name="Local" value="gzdb\features\classic_modes\mode_slopes.html">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Randomize mode">
<param name="Local" value="gzdb\features\all_modes\jitter.html">

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View file

@ -0,0 +1,155 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Template</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="../../../default.css" media="screen" title="Default" />
</head>
<body>
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="keyword" value="3D Floor Mode">
</object>
<div id="gz_title"><h1>3D Floor Mode</h1></div>
<div id="contents">
<p>
This mode lets you manage the 3D floors. Available in Hexen format and UDMF<br>
<b>Menu path:</b> Mode -&gt; 3D Floor Mode<br>
<b>Action category:</b> 3D Floor Plugin.<br>
<b>Default key:</b> None.<br>
<table border="0" cellspacing="3" cellpadding="3">
<tr>
<th>Action</th>
<th>Default key</th>
<th>UI button</th>
<th>Description</th>
</tr>
<tr>
<td>3D floor editing mode</td>
<td><i>none</i></td>
<td><img align="texttop" src="ThreeDFloorIcon.png" /></td>
<td>Enters the 3D floor editing mode</td>
</tr>
<tr>
<td>Cycle highlighted 3D floor down</td>
<td>Shift+ScrollDown</td>
<td><i>none</i></td>
<td>Cycles down through the 3D floors present in the highlighted sector</td>
</tr>
<tr>
<td>Cycle highlighted 3D floor up</td>
<td>Shift+ScrollUp</td>
<td><i>none</i></td>
<td>Cycles up through the 3D floors present in the highlighted sector</td>
</tr>
<tr>
<td>Select 3D floor control sector</td>
<td>Shift+S</td>
<td><i>none</i></td>
<td>Selects the control sector of the highlighted 3D floor</td>
</tr>
<tr>
<td>Relocate 3D floor control sectors</td>
<td><i>none</i></td>
<td>Text button</td>
<td>Relocates the 3D floor control sectors to the current position of the control sector area</td>
</tr>
<tr>
<td></td>
<td><i>none</i></td>
<td><img align="texttop" src="" /></td>
<td></td>
</tr>
</table>
<h1>The Control Sector Area</h1>
Upon entering the 3D floor mode you will see a green square:<br>
<img src="csa.png" /><br>
This is the control sector area (CSA). All 3D floor control sectors will be created in this area. If there is not enough space in the CSA you will not be able to create more 3D floors.<br>
<h2>Modifying The Control Sector Area</h2>
You can resize and move the CSA. Resizing is done by simply dragging the edges or corners by holding the right mouse button. Moving is done by pointing the cursor inside the CSA and then drag it around by holding the right mouse button.<br>
<h2>Tag Ranges</h2>
You can define a range of tags that should be used for the 3D floor control sectors. This is done by pointing the cursor inside the CSA and then pressing the right mouse button. This will open the following dialog:<br>
<br>
<img src="csaoptions.png" /><br>
<br>
To set a range of tags to use first check the <i>Use tag range</i> checkbox and then set the desired first and last tag. <b>Note:</b> if you run out of tags you will not be able to create more 3D floors.<br>
<h1>Managing 3D Floors</h1>
3D floor mode works similar to sectors mode. You can select and deselect sectors, but when you edit them (default: right mouse button) the 3D floor editing dialog will show up:<br>
<br>
<img src="no3dfloors.png" /><br>
<br>
To add a new 3D floor press either one of the *Add 3D floor* buttons. After doing so a widget will be shown in the window that lets you set the properties of the 3D floor. The green bar on the left side indicates that this 3D floor was newly added.<br>
<br>
<b>Note:</b> you can have many 3D floors in the same sectors. Just keep pressing the <b>Add 3D floor</b> button.<br>
<br>
<img src="new3dfloor.png" /><br>
<br>
On the left side you can set bottom (control sector floor) height and texture, the border texture and the top (control sector ceiling) height and texture of the 3D floor. The border height, or thickness, is calculated automatically.<br>
<br>
In the center let's you set commonly used properties, like the type and flags of the 3D floor, as well as it's alpha and the brightness <i>below</i> the 3D floor. It also shows the tags of the control sector, as well as a button to edit the all properties of the control sector.<br>
<br>
On the right a list of sectors is displayed. This list indicates which sectors this 3D floor is applied to. Currently selected sectors are shown at the top, currently not selected sectors at the bottom, grayed out. You can check or uncheck the selected sectors to apply or remove a 3D floor from this sector.<br>
<br>
On the very right are several buttons to speed up common workflows:
<table border="0" cellspacing="3" cellpadding="3">
<tr>
<th>Button</th>
<th>Action</th>
</tr>
<tr>
<td>Duplicate</td>
<td>creates an exact copy of the 3D floor and adds it to all checked sectors</td>
</tr>
<tr>
<td>Split</td>
<td>creates a new 3D floor for each checked sector, so that each sector has its unique 3D floor</td>
</tr>
<tr>
<td>Detach</td>
<td>creates a copy of the 3D floor, remocing the checked sectors from the source 3D floor, adding them to the newly created one</td>
</tr>
<tr>
<td>Check all</td>
<td>checks all sectors, applying the 3D floor to them</td>
</tr>
<tr>
<td>Uncheck all</td>
<td>unchecks all sectors, removing the 3D floor from them</td>
</tr>
</table>
<h1>Using The Docker</h1>
The plugin comes with a docker for the 3D floor editing mode. Make sure the dockers are always expanded by pressing the <img src="DockerExpand.png" /> icon at the top of the docker if necessary. The docker will be selected by default when entering the 3D floor editing mode.<br>
<br>
When highlighting a sector the docker will show basic information about the 3D floors in this sector:<br>
<br>
<img src="docker1.png" /><br>
<br>
You can use the <i>cycle highlighted 3D floor up</i> (default: Shift+ScrollUp) and <i>cycle highlighted 3D floor down</i> (default: Shift+ScrollDown) actions to cycle through the 3D floors in the docker. A green bar on the left side will indicate which 3D floor is highlighted. All sectors the highlighted 3D floor is applied to will be shown with a green tint.<br>
<br>
<img src="docker2.png" /><br>
<br>
You can use the <i>Select 3D floor control sector</i> action (default: Shift+S) to select the control sector of the highlighted 3D floor. This is useful if you want to apply a slope to this 3D floor.
</p>
</div>
</body>

View file

@ -0,0 +1,120 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Template</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="../../../default.css" media="screen" title="Default" />
</head>
<body>
<object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="keyword" value="3D Floor Mode">
</object>
<div id="gz_title"><h1>Draw Slope Mode, Slope Mode</h1></div>
<div id="contents">
<p>
<ul>
<li><b>Draw slope mode:</b> draws slope definitions (slope vertex groups, SVG), that slope a sector using UDMF sector properties. Primary use it to make sloping 3D floors easy, but works on any sector. Only available in UDMF</li>
<li><b>Slope mode:</b> modify the slope vertex groups created by draw slope mode. Only available in UDMF</li>
</ul>
<br>
<b>Menu path:</b> Mode -&gt; Draw Slope Mode<br>
<b>Action category:</b> 3D Floor Plugin.<br>
<b>Default key:</b> None.<br>
<table border="0" cellspacing="3" cellpadding="3">
<tr>
<th>Action</th>
<th>Default key</th>
<th>UI button</th>
<th>Description</th>
</tr>
<tr>
<td>Draw slope mode</td>
<td><i>none</i></td>
<td><img align="texttop" src="DrawSlopeModeIcon.png" /></td>
<td>Lets you draw a lope vertex group</td>
</tr>
<tr>
<td>Slope mode</td>
<td><i>none</i></td>
<td><img align="texttop" src="SlopeModeIcon.png" /></td>
<td>Enters slope mode that lets you edit slope vertex groups</td>
</tr>
<tr>
<td>Draw slope vertex</td>
<td>Left mouse button</td>
<td><i>none</i></td>
<td>Draws a slope vertex</td>
</tr>
<tr>
<td>Finish slope drawing</td>
<td>Right mouse button</td>
<td><i>none</i></td>
<td>Finishes drawing a slope vertex group</td>
</tr>
</table>
<h1>Slope Data Sector</h1>
The plugin needs a <i>slope data sector</i> to store custom UDMF fields that describe the slope vertex groups. This is required for undo/redo purposes and to keep the slope vertex groups saved between mapping sessions. When you enter Draw Slope Mode and no <i>slope data sector</i> is defined, you will get a pop-up asking you what to do.<br>
<br>
<img src="slopedatasector.png" /><br>
<br>
The easiest and recommended way is to let the plugin create the <i>slope data sector</i> in the Control Sector Area. <b>Note:</b> it is important that you do not edit or delete this sector.
<h1>Draw Slope Mode</h1>
Draw Slope Mode allows you to draw slope vertex groups, that define a slope. If any sectors are selected the drawn slope will be assigned to them.
<h2>Drawing A Slope</h2>
Drawing slopes works similar to drawing geometry. You always have to draw either two or three slope vertices, forming a slope vertex group. The slope vertices in the group define the plane of your slope.<br>
<br>
When you start drawing a slope you will see a yellow square with a black center at the mouse cursor. This is a <i>slope vertex</i>. You can place it anywhere by pressing the left mouse button. Repeat this with the second and optional third slope vertex. If you only want to use two slope vertices you can finish drawing by pressing the right mouse button.<br>
<br>
<img src="drawslope_2sv.gif" /> <img src="drawslope_3sv.gif" /><br>
<br>
It is important to understand that the the slope vertex group only defines a plane - it does not say if it slopes a floor or ceiling of a sector. That also means that you can slope both floors and ceilings with a single slope vertex group, which can come in handy when sloping both normal sectors and 3D floors at the same time.
<h3>Assigning A Slope While Drawing A Slope</h3>
When you have one or more sectors selected when drawing a slope, this slope will immediately be assigned to those sectors. Wile drawing the slope you will see three buttons in the menu bar, depicting <i>F</i>, <i>C</i>, and <i>FC</i>.<br>
<br>
<img src="drawslopefloorceiling.png" /><br>
<br>
If <i>F</i> is enabled (indicated by the blue border), the floor of the sectors will be sloped. If <i>C</i> is enabled, the ceiling of the sectors will be sloped. If <i>FC</i> is on, both the floor and ceiling of the sectors will be sloped.
<h1>Slope Mode</h1>
Slope Mode lets you modify existing slope vertex groups, and assign the slopes to sectors.
<h2>Modifying Slope Vertices</h2>
<h3>Moving Slope Vertices</h3>
Moving slope vertices works just like moving normal vertices - you can simple drag them around while holding the right mouse button. You can also select multiple vertices, either be left-clicking on them while holding the shift key, or by drawing a multi-selection around them. All selected slope vertices (indicated by their red color) will move simultaneously when being dragged around, just like any other geometry.
<h3>Editing Slope Vertices</h3>
Slope vertices can be edited by hovering the mouse cursor over one and clicking the right mouse button. This will open the <i>Edit Slope Vertex</i> dialog.<br>
<br>
<img src="editslopevertexdialog.png" /><br>
<br>
In this dialog you can modify the position of the slope vertex - most notably its Z position (height). The input boxes allow relative values (like <i>++128</i> to add 128 to the current value). Having multiple slope vertices selected will modify all of them.<br>
<br>
You can also add or remove the slope from sectors, more on that in the following sections.<br>
<h3>Deleting A Slope Vertex / Slope Vertex Group</h3>
You can not delete a single slope vertex - you can only remove a whole slope vertex group. To do so hover the mouse over one slope vertex of the slope vertex group and press the delete key.
</p>
</div>
</body>

View file

@ -19,7 +19,7 @@
<div id="contents">
<p>
<span class="fat">This mode is based on <a href="http://forum.zdoom.org/viewtopic.php?f=3&amp;t=47464">Sound Propagation Mode Plugin</a> by Boris Iwansky (<a href="https://github.com/biwa/soundpropagationmode">https://github.com/biwa/soundpropagationmode</a>).</span><br>
<span class="fat">This mode is based on <a href="http://forum.zdoom.org/viewtopic.php?f=3&amp;t=47464">Sound Propagation Mode Plugin</a> by Boris Iwanski (<a href="https://github.com/biwa/soundpropagationmode">https://github.com/biwa/soundpropagationmode</a>).</span><br>
<br>
<b>Action category:</b> Modes.<br>
<b>Default key:</b> none.<br><br>

View file

@ -19,7 +19,7 @@
<div id="contents">
<p>
<span class="fat">This mode is based on <a href="http://forum.zdoom.org/viewtopic.php?f=3&amp;t=47464">Sound Propagation Mode Plugin</a> by Boris Iwansky (<a href="https://github.com/biwa/soundpropagationmode">https://github.com/biwa/soundpropagationmode</a>).</span><br>
<span class="fat">This mode is based on <a href="http://forum.zdoom.org/viewtopic.php?f=3&amp;t=47464">Sound Propagation Mode Plugin</a> by Boris Iwanski (<a href="https://github.com/biwa/soundpropagationmode">https://github.com/biwa/soundpropagationmode</a>).</span><br>
<br>
<b>Action category:</b> Modes.<br>
<b>Default key:</b> none.<br><br>

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View file

@ -71,6 +71,7 @@ namespace CodeImp.DoomBuilder.Config
private bool bright; //mxd
private bool arrow;
private float radius;
private float renderradius;
private float height;
private int distancechecksq; //mxd. Contains squared value or int.MaxValue when not set
private bool hangs;
@ -120,6 +121,7 @@ namespace CodeImp.DoomBuilder.Config
public bool Bright { get { return bright; } } //mxd
public bool Arrow { get { return arrow; } }
public float Radius { get { return radius; } }
public float RenderRadius { get { return renderradius; } }
public float Height { get { return height; } }
public int DistanceCheckSq { get { return distancechecksq; } } //mxd
public bool Hangs { get { return hangs; } }
@ -177,6 +179,7 @@ namespace CodeImp.DoomBuilder.Config
this.bright = false; //mxd
this.arrow = true;
this.radius = 10f;
this.renderradius = 10f;
this.height = 20f;
this.distancechecksq = int.MaxValue; //mxd
this.hangs = false;
@ -552,6 +555,9 @@ namespace CodeImp.DoomBuilder.Config
// Size
if(actor.HasPropertyWithValue("radius")) radius = actor.GetPropertyValueInt("radius", 0);
if(actor.HasPropertyWithValue("height")) height = actor.GetPropertyValueInt("height", 0);
if (actor.HasPropertyWithValue("renderradius")) renderradius = actor.GetPropertyValueInt("renderradius", 0);
if (renderradius == 0)
renderradius = radius;
//mxd. DistanceCheck. The value is CVAR. Also we'll need squared value
if(actor.HasPropertyWithValue("distancecheck"))

View file

@ -241,6 +241,12 @@ namespace CodeImp.DoomBuilder.Controls
}
}
// biwa
public void ResetIncrementStep()
{
textbox.ResetIncrementStep();
}
#endregion
}
}

View file

@ -481,9 +481,11 @@ namespace CodeImp.DoomBuilder.Controls
// biwa. Removes all duplicates. That was done each time in AddItem before. Much faster
// to do it in one go. Not sure when there are actually duplicates
// Depending on whether a floor or a wall is selected the corrosponding images come first
// in the list, so alawys keep the first occurence
public void MakeTexturesUnique()
{
items = items.GroupBy(item => item.TextureName).Select(item => item.Last()).ToList();
items = items.GroupBy(item => item.TextureName).Select(item => item.First()).ToList();
}
// This fills the list based on the objectname filter

View file

@ -445,6 +445,12 @@ namespace CodeImp.DoomBuilder.Controls
}
}
// biwa
public void ResetIncrementStep()
{
incrementstep = 1;
}
#endregion
}
}

View file

@ -1366,15 +1366,8 @@ namespace CodeImp.DoomBuilder.Data
// This checks if a flat is known
public bool GetFlatExists(long longname)
{
// [ZZ] return nonexistent name for bad flats.
if (flats.ContainsKey(longname))
{
// [ZZ] long name is long. a doom flat with a long name is invalid.
ImageData id = flats[longname];
if (id is PK3FileImage && ((PK3FileImage)id).IsBadForLongTextureNames)
return false;
return true;
}
return flatnamesshorttofull.ContainsKey(longname);
}
@ -1396,14 +1389,7 @@ namespace CodeImp.DoomBuilder.Data
if(flatnamesshorttofull.ContainsKey(longname))
return flats[flatnamesshorttofull[longname]]; //mxd
if (flats.ContainsKey(longname))
{
// [ZZ] long name is long. a doom flat with a long name is invalid.
ImageData id = flats[longname];
if (id is PK3FileImage && ((PK3FileImage)id).IsBadForLongTextureNames)
return unknownimage;
return id;
}
return flats[longname];
// Return null image
return unknownimage; //mxd

View file

@ -30,9 +30,6 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Variables
private readonly int probableformat;
private readonly string _c_name;
private readonly string _c_filepathname;
private readonly bool isinternal = false;
#endregion
@ -42,8 +39,6 @@ namespace CodeImp.DoomBuilder.Data
public FileImage(string name, string filepathname, bool asflat)
{
// Initialize
_c_name = name; // this is used to call SetName later
_c_filepathname = filepathname; // this is used to call SetName later
this.isFlat = asflat; //mxd
if (asflat)
@ -69,8 +64,6 @@ namespace CodeImp.DoomBuilder.Data
public FileImage(string name, string filepathname, bool asflat, float scalex, float scaley)
{
// Initialize
_c_name = name; // this is used to call SetName later
_c_filepathname = filepathname; // this is used to call SetName later
this.scale.x = scalex;
this.scale.y = scaley;
this.isFlat = asflat; //mxd
@ -86,12 +79,7 @@ namespace CodeImp.DoomBuilder.Data
//mxd. Constructor for loading internal images
internal FileImage(string name, string filepathname)
{
// Initialize
_c_name = name; // this is used to call SetName later
_c_filepathname = filepathname; // this is used to call SetName later
probableformat = ImageDataFormat.DOOMPICTURE;
isinternal = true;
SetName(name, filepathname, true, 1);
@ -108,9 +96,11 @@ namespace CodeImp.DoomBuilder.Data
//mxd: also, zdoom uses '/' as directory separator char.
//mxd: and doesn't recognize long texture names in a root folder / pk3/7 root
//[ZZ] and doesn't work with flats in Doom format (added SetName call to post-load to validate this)
// biwa. It works (again?) with Doom flat format
private void SetName(string name, string filepathname)
{
SetName(name, filepathname, General.Map.Config.UseLongTextureNames, (probableformat == ImageDataFormat.DOOMFLAT) ? -1 : 0);
//SetName(name, filepathname, General.Map.Config.UseLongTextureNames, (probableformat == ImageDataFormat.DOOMFLAT) ? -1 : 0);
SetName(name, filepathname, General.Map.Config.UseLongTextureNames, 0);
}
// prevent long texture names by forcelongtexturename=-1
@ -160,8 +150,6 @@ namespace CodeImp.DoomBuilder.Data
// Load file data
if (bitmap != null) bitmap.Dispose(); bitmap = null;
bool isBadForLongTextureNames = false;
MemoryStream filedata = null;
try
{
@ -179,9 +167,6 @@ namespace CodeImp.DoomBuilder.Data
IImageReader reader = ImageDataFormat.GetImageReader(filedata, probableformat, General.Map.Data.Palette);
if (!(reader is UnknownImageReader))
{
// [ZZ] check for doom flat, always short name for these
if (reader is DoomFlatReader)
isBadForLongTextureNames = true;
// Load the image
filedata.Seek(0, SeekOrigin.Begin);
try { bitmap = reader.ReadAsBitmap(filedata); }
@ -208,9 +193,6 @@ namespace CodeImp.DoomBuilder.Data
filedata.Dispose();
}
// [ZZ] validate disabled long texture names for flats. (and enabled for everything else, if our guessed format was wrong)
SetName(_c_name, _c_filepathname, General.Map.Config.UseLongTextureNames, isBadForLongTextureNames ? -1 : (isinternal ? 1 : 0));
// Pass on to base
base.LocalLoadImage();
}

View file

@ -128,10 +128,6 @@ namespace CodeImp.DoomBuilder.Data
IImageReader reader = ImageDataFormat.GetImageReader(filedata, probableformat, General.Map.Data.Palette);
if(!(reader is UnknownImageReader))
{
// [ZZ] check for flat type
if (reader is DoomFlatReader)
isBadForLongTextureNames = true;
// Load the image
filedata.Seek(0, SeekOrigin.Begin);
try

View file

@ -1606,12 +1606,12 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
face.Add(int.Parse(vertexdata[0], CultureInfo.InvariantCulture) - 1);
if (vertexdata.Length >= 1 && vertexdata[1] != "")
if (vertexdata.Length > 1 && vertexdata[1] != "")
texcoords.Add(int.Parse(vertexdata[1], CultureInfo.InvariantCulture) - 1);
else
texcoords.Add(-1);
if (vertexdata.Length >= 2 && vertexdata[2] != "")
if (vertexdata.Length > 2 && vertexdata[2] != "")
normals.Add(int.Parse(vertexdata[2], CultureInfo.InvariantCulture) - 1);
else
normals.Add(-1);

View file

@ -534,6 +534,9 @@ namespace CodeImp.DoomBuilder.IO
}
catch(Exception e)
{
// Remove last error from the stack. Workaround for https://github.com/jewalky/GZDoom-Builder-Bugfix/issues/295
ilGetError();
// [ZZ] try to make a guessed reader
switch (guesstype)
{

View file

@ -1010,11 +1010,15 @@ namespace CodeImp.DoomBuilder.Map
// Limit intersection offset to the line
if (bounded)
{
if (General.Map.UDMF)
// We really don't want u to be 0 or 1, because that'd mean the distance will be measured
// from the vertices, which will result in linedefs being equally far away. We still need
// special handling for linedefs that are shorter than 1 mu (which is possible in UDMF)
// Detailed explanation here: https://github.com/jewalky/GZDoom-Builder-Bugfix/issues/307
if (lengthinv > 1.0f)
{
u = Math.Max(0f, Math.Min(1f, u));
}
else // restore old way for visplane explorer (which doesn't work for UDMF anyway)
else
{
u = Math.Max(lengthinv, Math.Min(1f - lengthinv, u));
}

View file

@ -80,6 +80,7 @@ namespace CodeImp.DoomBuilder.Map
// Configuration
private float size;
private float rendersize;
private float height; //mxd
private PixelColor color;
private bool fixedsize;
@ -106,6 +107,7 @@ namespace CodeImp.DoomBuilder.Map
public int Action { get { return action; } set { BeforePropsChange(); action = value; } }
public int[] Args { get { return args; } }
public float Size { get { return size; } }
public float RenderSize { get { return rendersize; } }
public float Height { get { return height; } } //mxd
public PixelColor Color { get { return color; } }
public bool FixedSize { get { return fixedsize; } }
@ -242,6 +244,7 @@ namespace CodeImp.DoomBuilder.Map
t.action = action;
t.args = (int[])args.Clone();
t.size = size;
t.rendersize = rendersize;
t.height = height; //mxd
t.color = color;
t.directional = directional;
@ -532,6 +535,7 @@ namespace CodeImp.DoomBuilder.Map
dynamiclighttype = ti.DynamicLightType;
//General.ErrorLogger.Add(ErrorType.Warning, string.Format("thing dynamiclighttype is {0}; class is {1}", dynamiclighttype, ti.Actor.ClassName));
size = ti.Radius;
rendersize = ti.RenderRadius;
height = ti.Height; //mxd
fixedsize = ti.FixedSize;
spritescale = ti.SpriteScale; //mxd

View file

@ -306,6 +306,10 @@ namespace CodeImp.DoomBuilder.Map
// Which means this vertex is removed and the other is kept!
public void Join(Vertex other)
{
// biwa. Preserve z coords in a smart way
if (float.IsNaN(other.ZCeiling)) other.ZCeiling = zceiling;
if (float.IsNaN(other.ZFloor)) other.ZFloor = zfloor;
// If either of the two vertices was selected, keep the other selected
if(this.Selected) other.Selected = true;
if(this.marked) other.marked = true;

View file

@ -1889,7 +1889,7 @@ namespace CodeImp.DoomBuilder.Rendering
public void AddThingGeometry(VisualThing t)
{
//mxd. Gather lights
if (General.Settings.GZDrawLightsMode != LightRenderMode.NONE && !fullbrightness && t.LightType != null && t.LightType.LightInternal)
if (General.Settings.GZDrawLightsMode != LightRenderMode.NONE && !fullbrightness && t.LightType != null)
{
t.UpdateLightRadius();
if (t.LightRadius > 0)

View file

@ -21,6 +21,8 @@ using System.Collections.Generic;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Geometry;
using System.Drawing;
using System.Diagnostics;
using System.Linq;
#endregion
@ -105,15 +107,13 @@ namespace CodeImp.DoomBuilder.VisualModes
public VisualBlockEntry GetBlock(Point p)
{
ulong k = GetBlockKey(p);
if(blockmap.ContainsKey(k))
{
return blockmap[k];
}
VisualBlockEntry vbe;
if (blockmap.TryGetValue(k, out vbe))
return vbe;
else
{
return (blockmap[k] = new VisualBlockEntry());
}
}
// This clears the blockmap
public void Clear()
@ -148,18 +148,54 @@ namespace CodeImp.DoomBuilder.VisualModes
{
// Make square range from frustum circle
// This will be the range in which we will test blocks
Point lt = GetBlockCoordinates(frustum.Center - frustum.Radius);
Point rb = GetBlockCoordinates(frustum.Center + frustum.Radius);
Point lb = GetBlockCoordinates(frustum.Center - frustum.Radius);
Point rt = GetBlockCoordinates(frustum.Center + frustum.Radius);
Vector2D maplb = new Vector2D();
Vector2D maprt = new Vector2D();
Vertex firstvertex = General.Map.Map.Vertices.OfType<Vertex>().FirstOrDefault();
if (firstvertex != null)
maplb = maprt = firstvertex.Position;
// Get maximum dimensions of the map. First vertices...
foreach (Vertex v in General.Map.Map.Vertices)
{
if (v.Position.x < maplb.x) maplb.x = v.Position.x;
if (v.Position.y < maplb.y) maplb.y = v.Position.y;
if (v.Position.x > maprt.x) maprt.x = v.Position.x;
if (v.Position.y > maprt.y) maprt.y = v.Position.y;
}
// ... then things
foreach (Thing t in General.Map.Map.Things)
{
if (t.Position.x < maplb.x) maplb.x = t.Position.x;
if (t.Position.y < maplb.y) maplb.y = t.Position.y;
if (t.Position.x > maprt.x) maprt.x = t.Position.x;
if (t.Position.y > maprt.y) maprt.y = t.Position.y;
}
Point mlb = GetBlockCoordinates(maplb);
Point mrt = GetBlockCoordinates(maprt);
// Make sure that the checked region does not exceed the dimensions where something is to be displayed
if (lb.X < mlb.X) lb.X = mlb.X;
if (lb.Y < mlb.Y) lb.Y = mlb.Y;
if (rt.X > mrt.X) rt.X = mrt.X;
if (rt.Y > mrt.Y) rt.Y = mrt.Y;
// Constants we need
float blockfrustumdistance2 = (frustum.Radius * frustum.Radius) + (BLOCK_RADIUS * BLOCK_RADIUS);
// Go through the range to make a list
int entriescount = (rb.X - lt.X) * (rb.Y - lt.Y);
int entriescount = (rt.X - lb.X) * (rt.Y - lb.Y);
List<VisualBlockEntry> entries = new List<VisualBlockEntry>(entriescount);
for(int x = lt.X; x <= rb.X; x++)
for (int x = lb.X; x <= rt.X; x++)
{
for(int y = lt.Y; y <= rb.Y; y++)
for(int y = lb.Y; y <= rt.Y; y++)
{
// First check if the block circle is intersecting the frustum circle
Point block = new Point(x, y);
@ -266,8 +302,8 @@ namespace CodeImp.DoomBuilder.VisualModes
public void AddThing(Thing t)
{
//mxd
Point p1 = GetBlockCoordinates(new Vector2D(t.Position.x - t.Size, t.Position.y - t.Size));
Point p2 = GetBlockCoordinates(new Vector2D(t.Position.x + t.Size, t.Position.y + t.Size));
Point p1 = GetBlockCoordinates(new Vector2D(t.Position.x - t.RenderSize, t.Position.y - t.RenderSize));
Point p2 = GetBlockCoordinates(new Vector2D(t.Position.x + t.RenderSize, t.Position.y + t.RenderSize));
for(int x = p1.X; x <= p2.X; x++)
{
for(int y = p1.Y; y <= p2.Y; y++)

View file

@ -341,13 +341,13 @@ namespace CodeImp.DoomBuilder.Windows
//
// recentFiles
//
this.recentFiles.BackColor = System.Drawing.SystemColors.Control;
this.recentFiles.BackColor = System.Drawing.Color.Transparent;
this.recentFiles.LargeChange = 1;
this.recentFiles.Location = new System.Drawing.Point(127, 156);
this.recentFiles.Maximum = 25;
this.recentFiles.Minimum = 8;
this.recentFiles.Name = "recentFiles";
this.recentFiles.Size = new System.Drawing.Size(116, 42);
this.recentFiles.Size = new System.Drawing.Size(116, 45);
this.recentFiles.TabIndex = 5;
this.recentFiles.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.recentFiles.Value = 8;
@ -393,12 +393,12 @@ namespace CodeImp.DoomBuilder.Windows
//
// vertexScale
//
this.vertexScale.BackColor = System.Drawing.SystemColors.Control;
this.vertexScale.BackColor = System.Drawing.Color.Transparent;
this.vertexScale.LargeChange = 1;
this.vertexScale.Location = new System.Drawing.Point(127, 119);
this.vertexScale.Minimum = 1;
this.vertexScale.Name = "vertexScale";
this.vertexScale.Size = new System.Drawing.Size(116, 42);
this.vertexScale.Size = new System.Drawing.Size(116, 45);
this.vertexScale.TabIndex = 4;
this.vertexScale.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.vertexScale.Value = 1;
@ -436,12 +436,12 @@ namespace CodeImp.DoomBuilder.Windows
//
// zoomfactor
//
this.zoomfactor.BackColor = System.Drawing.SystemColors.Control;
this.zoomfactor.BackColor = System.Drawing.Color.Transparent;
this.zoomfactor.LargeChange = 1;
this.zoomfactor.Location = new System.Drawing.Point(127, 82);
this.zoomfactor.Minimum = 1;
this.zoomfactor.Name = "zoomfactor";
this.zoomfactor.Size = new System.Drawing.Size(116, 42);
this.zoomfactor.Size = new System.Drawing.Size(116, 45);
this.zoomfactor.TabIndex = 3;
this.zoomfactor.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.zoomfactor.Value = 3;
@ -467,12 +467,12 @@ namespace CodeImp.DoomBuilder.Windows
//
// autoscrollspeed
//
this.autoscrollspeed.BackColor = System.Drawing.SystemColors.Control;
this.autoscrollspeed.BackColor = System.Drawing.Color.Transparent;
this.autoscrollspeed.LargeChange = 1;
this.autoscrollspeed.Location = new System.Drawing.Point(127, 45);
this.autoscrollspeed.Maximum = 5;
this.autoscrollspeed.Name = "autoscrollspeed";
this.autoscrollspeed.Size = new System.Drawing.Size(116, 42);
this.autoscrollspeed.Size = new System.Drawing.Size(116, 45);
this.autoscrollspeed.TabIndex = 2;
this.autoscrollspeed.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.autoscrollspeed.ValueChanged += new System.EventHandler(this.autoscrollspeed_ValueChanged);
@ -1052,13 +1052,13 @@ namespace CodeImp.DoomBuilder.Windows
//
// vertexScale3D
//
this.vertexScale3D.BackColor = System.Drawing.SystemColors.Control;
this.vertexScale3D.BackColor = System.Drawing.Color.Transparent;
this.vertexScale3D.LargeChange = 1;
this.vertexScale3D.Location = new System.Drawing.Point(116, 133);
this.vertexScale3D.Maximum = 15;
this.vertexScale3D.Minimum = 2;
this.vertexScale3D.Name = "vertexScale3D";
this.vertexScale3D.Size = new System.Drawing.Size(150, 42);
this.vertexScale3D.Size = new System.Drawing.Size(150, 45);
this.vertexScale3D.TabIndex = 3;
this.vertexScale3D.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.vertexScale3D.Value = 10;
@ -1075,13 +1075,13 @@ namespace CodeImp.DoomBuilder.Windows
//
// viewdistance
//
this.viewdistance.BackColor = System.Drawing.SystemColors.Control;
this.viewdistance.BackColor = System.Drawing.Color.Transparent;
this.viewdistance.LargeChange = 2;
this.viewdistance.Location = new System.Drawing.Point(116, 169);
this.viewdistance.Maximum = 45;
this.viewdistance.Maximum = 128;
this.viewdistance.Minimum = 1;
this.viewdistance.Name = "viewdistance";
this.viewdistance.Size = new System.Drawing.Size(150, 42);
this.viewdistance.Size = new System.Drawing.Size(150, 45);
this.viewdistance.TabIndex = 4;
this.viewdistance.TickFrequency = 2;
this.viewdistance.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
@ -1090,12 +1090,12 @@ namespace CodeImp.DoomBuilder.Windows
//
// movespeed
//
this.movespeed.BackColor = System.Drawing.SystemColors.Control;
this.movespeed.BackColor = System.Drawing.Color.Transparent;
this.movespeed.Location = new System.Drawing.Point(116, 96);
this.movespeed.Maximum = 20;
this.movespeed.Minimum = 1;
this.movespeed.Name = "movespeed";
this.movespeed.Size = new System.Drawing.Size(150, 42);
this.movespeed.Size = new System.Drawing.Size(150, 45);
this.movespeed.TabIndex = 2;
this.movespeed.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.movespeed.Value = 1;
@ -1103,12 +1103,12 @@ namespace CodeImp.DoomBuilder.Windows
//
// mousespeed
//
this.mousespeed.BackColor = System.Drawing.SystemColors.Control;
this.mousespeed.BackColor = System.Drawing.Color.Transparent;
this.mousespeed.Location = new System.Drawing.Point(116, 57);
this.mousespeed.Maximum = 20;
this.mousespeed.Minimum = 1;
this.mousespeed.Name = "mousespeed";
this.mousespeed.Size = new System.Drawing.Size(150, 42);
this.mousespeed.Size = new System.Drawing.Size(150, 45);
this.mousespeed.TabIndex = 1;
this.mousespeed.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.mousespeed.Value = 1;
@ -1116,13 +1116,13 @@ namespace CodeImp.DoomBuilder.Windows
//
// fieldofview
//
this.fieldofview.BackColor = System.Drawing.SystemColors.Control;
this.fieldofview.BackColor = System.Drawing.Color.Transparent;
this.fieldofview.LargeChange = 1;
this.fieldofview.Location = new System.Drawing.Point(116, 20);
this.fieldofview.Maximum = 17;
this.fieldofview.Minimum = 5;
this.fieldofview.Name = "fieldofview";
this.fieldofview.Size = new System.Drawing.Size(150, 42);
this.fieldofview.Size = new System.Drawing.Size(150, 45);
this.fieldofview.TabIndex = 0;
this.fieldofview.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.fieldofview.Value = 5;
@ -1471,11 +1471,11 @@ namespace CodeImp.DoomBuilder.Windows
//
// activethingsalpha
//
this.activethingsalpha.BackColor = System.Drawing.SystemColors.Control;
this.activethingsalpha.BackColor = System.Drawing.Color.Transparent;
this.activethingsalpha.LargeChange = 3;
this.activethingsalpha.Location = new System.Drawing.Point(199, 57);
this.activethingsalpha.Name = "activethingsalpha";
this.activethingsalpha.Size = new System.Drawing.Size(154, 42);
this.activethingsalpha.Size = new System.Drawing.Size(154, 45);
this.activethingsalpha.TabIndex = 1;
this.activethingsalpha.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.activethingsalpha.ValueChanged += new System.EventHandler(this.activethingsalpha_ValueChanged);
@ -1509,12 +1509,12 @@ namespace CodeImp.DoomBuilder.Windows
//
// antialiasing
//
this.antialiasing.BackColor = System.Drawing.SystemColors.Control;
this.antialiasing.BackColor = System.Drawing.Color.Transparent;
this.antialiasing.LargeChange = 1;
this.antialiasing.Location = new System.Drawing.Point(199, 327);
this.antialiasing.Maximum = 3;
this.antialiasing.Name = "antialiasing";
this.antialiasing.Size = new System.Drawing.Size(154, 42);
this.antialiasing.Size = new System.Drawing.Size(154, 45);
this.antialiasing.TabIndex = 9;
this.antialiasing.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.antialiasing.Value = 3;
@ -1531,12 +1531,12 @@ namespace CodeImp.DoomBuilder.Windows
//
// anisotropicfiltering
//
this.anisotropicfiltering.BackColor = System.Drawing.SystemColors.Control;
this.anisotropicfiltering.BackColor = System.Drawing.Color.Transparent;
this.anisotropicfiltering.LargeChange = 1;
this.anisotropicfiltering.Location = new System.Drawing.Point(199, 282);
this.anisotropicfiltering.Maximum = 4;
this.anisotropicfiltering.Name = "anisotropicfiltering";
this.anisotropicfiltering.Size = new System.Drawing.Size(154, 42);
this.anisotropicfiltering.Size = new System.Drawing.Size(154, 45);
this.anisotropicfiltering.TabIndex = 8;
this.anisotropicfiltering.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.anisotropicfiltering.Value = 4;
@ -1582,13 +1582,13 @@ namespace CodeImp.DoomBuilder.Windows
//
// tbDynLightCount
//
this.tbDynLightCount.BackColor = System.Drawing.SystemColors.Control;
this.tbDynLightCount.BackColor = System.Drawing.Color.Transparent;
this.tbDynLightCount.LargeChange = 1;
this.tbDynLightCount.Location = new System.Drawing.Point(199, 237);
this.tbDynLightCount.Maximum = 16;
this.tbDynLightCount.Minimum = 1;
this.tbDynLightCount.Name = "tbDynLightCount";
this.tbDynLightCount.Size = new System.Drawing.Size(154, 42);
this.tbDynLightCount.Size = new System.Drawing.Size(154, 45);
this.tbDynLightCount.TabIndex = 5;
this.tbDynLightCount.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.tbDynLightCount.Value = 1;
@ -1596,11 +1596,11 @@ namespace CodeImp.DoomBuilder.Windows
//
// imagebrightness
//
this.imagebrightness.BackColor = System.Drawing.SystemColors.Control;
this.imagebrightness.BackColor = System.Drawing.Color.Transparent;
this.imagebrightness.LargeChange = 3;
this.imagebrightness.Location = new System.Drawing.Point(199, 192);
this.imagebrightness.Name = "imagebrightness";
this.imagebrightness.Size = new System.Drawing.Size(154, 42);
this.imagebrightness.Size = new System.Drawing.Size(154, 45);
this.imagebrightness.TabIndex = 4;
this.imagebrightness.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.imagebrightness.ValueChanged += new System.EventHandler(this.imagebrightness_ValueChanged);
@ -1617,33 +1617,33 @@ namespace CodeImp.DoomBuilder.Windows
//
// hiddenthingsalpha
//
this.hiddenthingsalpha.BackColor = System.Drawing.SystemColors.Control;
this.hiddenthingsalpha.BackColor = System.Drawing.Color.Transparent;
this.hiddenthingsalpha.LargeChange = 3;
this.hiddenthingsalpha.Location = new System.Drawing.Point(199, 147);
this.hiddenthingsalpha.Name = "hiddenthingsalpha";
this.hiddenthingsalpha.Size = new System.Drawing.Size(154, 42);
this.hiddenthingsalpha.Size = new System.Drawing.Size(154, 45);
this.hiddenthingsalpha.TabIndex = 3;
this.hiddenthingsalpha.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.hiddenthingsalpha.ValueChanged += new System.EventHandler(this.hiddenthingsalpha_ValueChanged);
//
// inactivethingsalpha
//
this.inactivethingsalpha.BackColor = System.Drawing.SystemColors.Control;
this.inactivethingsalpha.BackColor = System.Drawing.Color.Transparent;
this.inactivethingsalpha.LargeChange = 3;
this.inactivethingsalpha.Location = new System.Drawing.Point(199, 102);
this.inactivethingsalpha.Name = "inactivethingsalpha";
this.inactivethingsalpha.Size = new System.Drawing.Size(154, 42);
this.inactivethingsalpha.Size = new System.Drawing.Size(154, 45);
this.inactivethingsalpha.TabIndex = 2;
this.inactivethingsalpha.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.inactivethingsalpha.ValueChanged += new System.EventHandler(this.inactivethingsalpha_ValueChanged);
//
// doublesidedalpha
//
this.doublesidedalpha.BackColor = System.Drawing.SystemColors.Control;
this.doublesidedalpha.BackColor = System.Drawing.Color.Transparent;
this.doublesidedalpha.LargeChange = 3;
this.doublesidedalpha.Location = new System.Drawing.Point(199, 12);
this.doublesidedalpha.Name = "doublesidedalpha";
this.doublesidedalpha.Size = new System.Drawing.Size(154, 42);
this.doublesidedalpha.Size = new System.Drawing.Size(154, 45);
this.doublesidedalpha.TabIndex = 0;
this.doublesidedalpha.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.doublesidedalpha.ValueChanged += new System.EventHandler(this.doublesidedalpha_ValueChanged);
@ -1843,7 +1843,7 @@ namespace CodeImp.DoomBuilder.Windows
this.tabscripteditor.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabscripteditor.Location = new System.Drawing.Point(4, 22);
this.tabscripteditor.Name = "tabscripteditor";
this.tabscripteditor.Size = new System.Drawing.Size(662, 484);
this.tabscripteditor.Size = new System.Drawing.Size(680, 501);
this.tabscripteditor.TabIndex = 4;
this.tabscripteditor.Text = "Script Editor";
this.tabscripteditor.UseVisualStyleBackColor = true;
@ -2336,7 +2336,7 @@ namespace CodeImp.DoomBuilder.Windows
this.tabpasting.Location = new System.Drawing.Point(4, 22);
this.tabpasting.Name = "tabpasting";
this.tabpasting.Padding = new System.Windows.Forms.Padding(5);
this.tabpasting.Size = new System.Drawing.Size(662, 484);
this.tabpasting.Size = new System.Drawing.Size(680, 501);
this.tabpasting.TabIndex = 3;
this.tabpasting.Text = "Pasting ";
this.tabpasting.UseVisualStyleBackColor = true;

View file

@ -33,6 +33,12 @@ namespace CodeImp.DoomBuilder.Windows
{
internal partial class PreferencesForm : DelayedForm
{
#region ================== Constants
private const float VIEW_DISTANCE_STEP_SIZE = 500.0f;
#endregion
#region ================== Variables
private PreferencesController controller;
@ -71,7 +77,7 @@ namespace CodeImp.DoomBuilder.Windows
mousespeed.Value = General.Clamp(General.Settings.MouseSpeed / 100, mousespeed.Minimum, mousespeed.Maximum);
movespeed.Value = General.Clamp(General.Settings.MoveSpeed / 100, movespeed.Minimum, movespeed.Maximum);
vertexScale3D.Value = General.Clamp((int)(General.Settings.GZVertexScale3D * 10), vertexScale3D.Minimum, vertexScale3D.Maximum); //mxd
viewdistance.Value = General.Clamp((int)(General.Settings.ViewDistance / 200.0f), viewdistance.Minimum, viewdistance.Maximum);
viewdistance.Value = General.Clamp((int)(General.Settings.ViewDistance / VIEW_DISTANCE_STEP_SIZE), viewdistance.Minimum, viewdistance.Maximum);
invertyaxis.Checked = General.Settings.InvertYAxis;
autoscrollspeed.Value = General.Clamp(General.Settings.AutoScrollSpeed, autoscrollspeed.Minimum, autoscrollspeed.Maximum);
zoomfactor.Value = General.Clamp(General.Settings.ZoomFactor, zoomfactor.Minimum, zoomfactor.Maximum);
@ -301,7 +307,7 @@ namespace CodeImp.DoomBuilder.Windows
General.Settings.MouseSpeed = mousespeed.Value * 100;
General.Settings.MoveSpeed = movespeed.Value * 100;
General.Settings.GZVertexScale3D = vertexScale3D.Value * 0.1f; //mxd
General.Settings.ViewDistance = viewdistance.Value * 200.0f;
General.Settings.ViewDistance = viewdistance.Value * VIEW_DISTANCE_STEP_SIZE;
General.Settings.InvertYAxis = invertyaxis.Checked;
General.Settings.AutoScrollSpeed = autoscrollspeed.Value;
General.Settings.ZoomFactor = zoomfactor.Value;
@ -500,7 +506,7 @@ namespace CodeImp.DoomBuilder.Windows
private void viewdistance_ValueChanged(object sender, EventArgs e)
{
int value = viewdistance.Value * 200;
int value = viewdistance.Value * (int)VIEW_DISTANCE_STEP_SIZE;
viewdistancelabel.Text = value + " mp";
}

View file

@ -112,33 +112,33 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="groupBox1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="groupBox1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="label7.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="label7.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label5.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="label5.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label29.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="label29.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label27.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="label27.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label18.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="label18.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<data name="scriptallmanstyle.ToolTip" xml:space="preserve">
@ -152,7 +152,7 @@ markers in snippets will be replaced
with newline characters, otherwise
they will be replaced with tabs/spaces.</value>
</data>
<metadata name="browseScreenshotsFolderDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="browseScreenshotsFolderDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>114, 17</value>
</metadata>
</root>

View file

@ -229,21 +229,30 @@ namespace CodeImp.DoomBuilder.Windows
}
else
{
offset = heightoffset.GetResult(0);
// Reset increment steps, otherwise it's just keep counting and counting
heightoffset.ResetIncrementStep();
//restore values
if (string.IsNullOrEmpty(ceilingheight.Text))
{
foreach (Sector s in sectors)
{
// To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
offset = heightoffset.GetResult(0);
s.CeilHeight = sectorprops[i++].CeilHeight + offset;
}
}
else //update values
{
foreach (Sector s in sectors)
{
// To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
offset = heightoffset.GetResult(0);
s.CeilHeight = ceilingheight.GetResult(sectorprops[i++].CeilHeight) + offset;
}
}
}
}
//mxd
private void UpdateFloorHeight()
@ -264,21 +273,30 @@ namespace CodeImp.DoomBuilder.Windows
}
else
{
offset = heightoffset.GetResult(0);
// Reset increment steps, otherwise it's just keep counting and counting
heightoffset.ResetIncrementStep();
//restore values
if (string.IsNullOrEmpty(floorheight.Text))
{
foreach (Sector s in sectors)
{
// To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
offset = heightoffset.GetResult(0);
s.FloorHeight = sectorprops[i++].FloorHeight + offset;
}
}
else //update values
{
foreach (Sector s in sectors)
{
// To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
offset = heightoffset.GetResult(0);
s.FloorHeight = floorheight.GetResult(sectorprops[i++].FloorHeight) + offset;
}
}
}
}
#endregion

View file

@ -751,21 +751,29 @@ namespace CodeImp.DoomBuilder.Windows
}
else
{
offset = heightoffset.GetResult(0);
//restore values
if(string.IsNullOrEmpty(ceilingheight.Text))
{
// Reset increment steps, otherwise it's just keep counting and counting
heightoffset.ResetIncrementStep();
foreach (Sector s in sectors)
{
// To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
offset = heightoffset.GetResult(0);
s.CeilHeight = sectorprops[s].CeilHeight + offset;
SynchCeilSlopeOffsetToHeight(s);
}
}
else //update values
{
// Reset increment steps, otherwise it's just keep counting and counting
heightoffset.ResetIncrementStep();
foreach (Sector s in sectors)
{
// To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
offset = heightoffset.GetResult(0);
s.CeilHeight = ceilingheight.GetResult(sectorprops[s].CeilHeight) + offset;
SynchCeilSlopeOffsetToHeight(s);
}
@ -790,13 +798,16 @@ namespace CodeImp.DoomBuilder.Windows
}
else
{
offset = heightoffset.GetResult(0);
// Reset increment steps, otherwise it's just keep counting and counting
heightoffset.ResetIncrementStep();
//restore values
if(string.IsNullOrEmpty(floorheight.Text))
{
foreach(Sector s in sectors)
{
// To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
offset = heightoffset.GetResult(0);
s.FloorHeight = sectorprops[s].FloorHeight + offset;
SynchFloorSlopeOffsetToHeight(s);
}
@ -805,6 +816,8 @@ namespace CodeImp.DoomBuilder.Windows
{
foreach(Sector s in sectors)
{
// To get the steps for ---/+++ into effect the offset has to be retrieved again for each sector
offset = heightoffset.GetResult(0);
s.FloorHeight = floorheight.GetResult(sectorprops[s].FloorHeight) + offset;
SynchFloorSlopeOffsetToHeight(s);
}

View file

@ -9,11 +9,20 @@ namespace CodeImp.DoomBuilder.ZDoom
{
public sealed class ZScriptActorStructure : ActorStructure
{
// privates
#region ================== Variables
private ZScriptParser parser;
private Stream stream;
private ZScriptTokenizer tokenizer;
// ========
private List<string> mixins;
#endregion
#region ================== Properties
public List<string> Mixins { get { return mixins; } }
#endregion
internal static bool ParseGZDBComment(Dictionary<string, List<string>> props, string text)
{
@ -373,6 +382,30 @@ namespace CodeImp.DoomBuilder.ZDoom
return true;
}
private bool ParseMixin()
{
// mixin identifier;
tokenizer.SkipWhitespace();
ZScriptToken token = tokenizer.ExpectToken(ZScriptTokenType.Identifier);
if (token == null || !token.IsValid)
{
parser.ReportError("Expected mixin class name, got " + ((Object)token ?? "<null>").ToString());
return false;
}
mixins.Add(token.Value.ToLowerInvariant());
tokenizer.SkipWhitespace();
token = tokenizer.ExpectToken(ZScriptTokenType.Semicolon);
if (token == null || !token.IsValid)
{
parser.ReportError("Expected semicolon, got " + ((Object)token ?? "<null>").ToString());
return false;
}
return true;
}
private bool ParseProperty()
{
// property identifier: identifier, identifier, identifier, ...;
@ -464,6 +497,8 @@ namespace CodeImp.DoomBuilder.ZDoom
replaceclass = _replacesname;
//baseclass = parser.GetArchivedActorByName(_parentname); // this is not guaranteed to work here
mixins = new List<string>();
ZScriptToken cls_open = tokenizer.ExpectToken(ZScriptTokenType.OpenCurly);
if (cls_open == null || !cls_open.IsValid)
{
@ -531,7 +566,7 @@ namespace CodeImp.DoomBuilder.ZDoom
// apparently we can have a struct inside a class, but not another class.
case "struct":
if (!parser.ParseClassOrStruct(true, false, null))
if (!parser.ParseClassOrStruct(true, false, false, null))
return;
continue;
@ -547,6 +582,12 @@ namespace CodeImp.DoomBuilder.ZDoom
return;
continue;
// mixins
case "mixin":
if (!ParseMixin())
return;
continue;
default:
stream.Position = ocpos;
break;

View file

@ -21,6 +21,7 @@ namespace CodeImp.DoomBuilder.ZDoom
public string ParentName { get; internal set; }
public ZScriptActorStructure Actor { get; internal set; }
internal DecorateCategoryInfo Region;
public bool IsMixin { get; internal set; }
// these are used for parsing and error reporting
public ZScriptParser Parser { get; internal set; }
@ -33,7 +34,7 @@ namespace CodeImp.DoomBuilder.ZDoom
// textresourcepath
public string TextResourcePath { get; internal set; }
internal ZScriptClassStructure(ZScriptParser parser, string classname, string replacesname, string parentname, DecorateCategoryInfo region)
internal ZScriptClassStructure(ZScriptParser parser, string classname, string replacesname, string parentname, bool ismixin, DecorateCategoryInfo region)
{
Parser = parser;
@ -49,6 +50,8 @@ namespace CodeImp.DoomBuilder.ZDoom
ParentName = parentname;
Actor = null;
Region = region;
IsMixin = ismixin;
}
internal void RestoreStreamData()
@ -87,7 +90,7 @@ namespace CodeImp.DoomBuilder.ZDoom
if (ReplacementName != null) log_inherits += ((log_inherits.Length > 0) ? ", " : "") + "replaces " + ReplacementName;
if (log_inherits.Length > 0) log_inherits = " (" + log_inherits + ")";
if (isactor)
if (isactor || IsMixin)
{
Actor = new ZScriptActorStructure(Parser, Region, ClassName, ReplacementName, ParentName);
if (Parser.HasError)
@ -156,6 +159,10 @@ namespace CodeImp.DoomBuilder.ZDoom
private Dictionary<string, ZScriptClassStructure> allclasses;
private List<ZScriptClassStructure> allclasseslist;
// Mixin classes
private Dictionary<string, ZScriptClassStructure> mixinclasses;
private List<ZScriptClassStructure> mixinclasseslist;
//mxd. Includes tracking
private HashSet<string> parsedlumps;
@ -309,6 +316,10 @@ namespace CodeImp.DoomBuilder.ZDoom
return null;
}
// biwa. Report a recoverable parsing problem
if (!string.IsNullOrEmpty(token.WarningMessage))
LogWarning(token.WarningMessage);
if ((token.Type == ZScriptTokenType.Semicolon ||
token.Type == ZScriptTokenType.Comma) && nestingLevel == 0 && !betweenparen)
{
@ -571,7 +582,7 @@ namespace CodeImp.DoomBuilder.ZDoom
return name;
}
internal bool ParseClassOrStruct(bool isstruct, bool extend, DecorateCategoryInfo region)
internal bool ParseClassOrStruct(bool isstruct, bool extend, bool mixin, DecorateCategoryInfo region)
{
// 'class' keyword is already parsed
tokenizer.SkipWhitespace();
@ -730,9 +741,9 @@ namespace CodeImp.DoomBuilder.ZDoom
if (log_inherits.Length > 0) log_inherits = " (" + log_inherits + ")";
// now if we are a class, and we inherit actor, parse this entry as an actor. don't process extensions.
if (!isstruct && !extend)
if (!isstruct && !extend && !mixin)
{
ZScriptClassStructure cls = new ZScriptClassStructure(this, tok_classname.Value, (tok_replacename != null) ? tok_replacename.Value : null, (tok_parentname != null) ? tok_parentname.Value : null, region);
ZScriptClassStructure cls = new ZScriptClassStructure(this, tok_classname.Value, (tok_replacename != null) ? tok_replacename.Value : null, (tok_parentname != null) ? tok_parentname.Value : null, false, region);
cls.Position = cpos;
string clskey = cls.ClassName.ToLowerInvariant();
if (allclasses.ContainsKey(clskey))
@ -744,6 +755,22 @@ namespace CodeImp.DoomBuilder.ZDoom
allclasses.Add(cls.ClassName.ToLowerInvariant(), cls);
allclasseslist.Add(cls);
}
else if (mixin)
{
// This is a bit ugly. We're treating mixin classes as actors, even though they aren't. But otherwise the parser
// doesn't parse all the actor info we need
ZScriptClassStructure cls = new ZScriptClassStructure(this, tok_classname.Value, null, null, true, region);
cls.Position = cpos;
string clskey = cls.ClassName.ToLowerInvariant();
if(mixinclasses.ContainsKey(clskey))
{
ReportError("Mixin class " + cls.ClassName + " is double-defines");
return false;
}
mixinclasses.Add(cls.ClassName.ToLowerInvariant(), cls);
mixinclasseslist.Add(cls);
}
//LogWarning(string.Format("Parsed {0} {1}{2}", (isstruct ? "struct" : "class"), tok_classname.Value, log_inherits));
@ -890,17 +917,28 @@ namespace CodeImp.DoomBuilder.ZDoom
ReportError("Expected class or struct, got " + ((Object)token ?? "<null>").ToString());
return false;
}
if (!ParseClassOrStruct((token.Value.ToLowerInvariant() == "struct"), true, (regions.Count > 0 ? regions.Last() : null)))
if (!ParseClassOrStruct((token.Value.ToLowerInvariant() == "struct"), true, false, (regions.Count > 0 ? regions.Last() : null)))
return false;
break;
case "mixin":
tokenizer.SkipWhitespace();
token = tokenizer.ExpectToken(ZScriptTokenType.Identifier);
if(token == null || !token.IsValid ||((token.Value.ToLower() != "class")))
{
ReportError("Expected class, got " + ((Object)token ?? "<null>").ToString());
return false;
}
if (!ParseClassOrStruct(false, false, true, (regions.Count > 0 ? regions.Last() : null)))
return false;
break;
case "class":
// todo parse class
if (!ParseClassOrStruct(false, false, (regions.Count > 0 ? regions.Last() : null)))
if (!ParseClassOrStruct(false, false, false, (regions.Count > 0 ? regions.Last() : null)))
return false;
break;
case "struct":
// todo parse struct
if (!ParseClassOrStruct(true, false, null))
if (!ParseClassOrStruct(true, false, false, null))
return false;
break;
case "const":
@ -944,16 +982,26 @@ namespace CodeImp.DoomBuilder.ZDoom
return false;
}
// Parse mixin class data
foreach(ZScriptClassStructure cls in mixinclasseslist)
{
if (!cls.Process())
return false;
}
// set datastream to null so that log messages aren't output using incorrect line numbers
Stream odatastream = datastream;
datastream = null;
// inject superclasses, since everything is parsed by now
// inject superclasses, and mixins, since everything is parsed by now
Dictionary<int, ThingTypeInfo> things = General.Map.Config.GetThingTypes();
foreach (ZScriptClassStructure cls in allclasseslist)
{
ActorStructure actor = cls.Actor;
if (actor != null && cls.ParentName != null && cls.ParentName.ToLowerInvariant() != "thinker") // don't try to inherit this one
if (actor != null)
{
// Inheritance
if (cls.ParentName != null && cls.ParentName.ToLowerInvariant() != "thinker") // don't try to inherit this one)
{
actor.baseclass = GetArchivedActorByName(cls.ParentName, true);
string inheritclass = cls.ParentName;
@ -1021,6 +1069,44 @@ namespace CodeImp.DoomBuilder.ZDoom
LogWarning("Unable to find \"" + inheritclass + "\" class to inherit from, while parsing \"" + cls.ClassName + "\"");
}
}
// Mixins. https://zdoom.org/wiki/ZScript_mixins
if (((ZScriptActorStructure)actor).Mixins.Count > 0)
{
foreach(string mixinclassname in ((ZScriptActorStructure)actor).Mixins)
{
if(!mixinclasses.ContainsKey(mixinclassname))
{
LogWarning("Unable to find \"" + mixinclassname + "\" mixin class while parsing \"" + actor.ClassName + "\"");
continue;
}
ZScriptClassStructure mixincls = mixinclasses[mixinclassname];
// States
if(actor.states.Count == 0 && mixincls.Actor.states.Count != 0)
{
// Can't use HasState and GetState here, because it does some magic that will not work for mixins
if (!actor.states.ContainsKey("spawn") && mixincls.Actor.states.ContainsKey("spawn"))
actor.states.Add("spawn", mixincls.Actor.GetState("spawn"));
}
// Properties
if (!actor.props.ContainsKey("height") && mixincls.Actor.props.ContainsKey("height"))
actor.props["height"] = new List<string>(mixincls.Actor.props["height"]);
if (!actor.props.ContainsKey("radius") && mixincls.Actor.props.ContainsKey("radius"))
actor.props["radius"] = new List<string>(mixincls.Actor.props["radius"]);
// Flags
if (!actor.flags.ContainsKey("spawnceiling") && mixincls.Actor.flags.ContainsKey("spawnceiling"))
actor.flags["spawnceiling"] = true;
if (!actor.flags.ContainsKey("solid") && mixincls.Actor.flags.ContainsKey("solid"))
actor.flags["solid"] = true;
}
}
}
}
// validate user variables (no variables should shadow parent variables)
@ -1097,6 +1183,8 @@ namespace CodeImp.DoomBuilder.ZDoom
parsedlumps = new HashSet<string>(StringComparer.OrdinalIgnoreCase); //mxd
allclasses = new Dictionary<string, ZScriptClassStructure>();
allclasseslist = new List<ZScriptClassStructure>();
mixinclasses = new Dictionary<string, ZScriptClassStructure>();
mixinclasseslist = new List<ZScriptClassStructure>();
}
#endregion

View file

@ -101,6 +101,7 @@ namespace CodeImp.DoomBuilder.ZDoom
public ZScriptToken()
{
IsValid = true;
WarningMessage = String.Empty;
}
public ZScriptTokenType Type { get; internal set; }
@ -108,6 +109,7 @@ namespace CodeImp.DoomBuilder.ZDoom
public int ValueInt { get; internal set; }
public double ValueDouble { get; internal set; }
public bool IsValid { get; internal set; }
public string WarningMessage { get; internal set; }
public override string ToString()
{
@ -330,6 +332,31 @@ namespace CodeImp.DoomBuilder.ZDoom
tok.ValueInt = (int)tok.ValueDouble;
}
}
catch (OverflowException) // biwa. If the value is too small or too big set it to the min or max, and set a warning message
{
tok.WarningMessage = "Number " + tok.Value + " too " + (tok.Value[0] == '-' ? "small" : "big") + ". Set to ";
if (ishex || isoctal || !isdouble)
{
if (tok.Value[0] == '-')
tok.ValueInt = Int32.MinValue;
else
tok.ValueInt = Int32.MaxValue;
tok.ValueDouble = tok.ValueInt;
tok.WarningMessage += tok.ValueInt;
}
else if (isdouble)
{
if (tok.Value[0] == '-')
tok.ValueDouble = Double.MinValue;
else
tok.ValueDouble = Double.MaxValue;
tok.ValueInt = (int)tok.ValueDouble;
tok.WarningMessage += tok.ValueDouble;
}
}
catch (Exception)
{
// throw new Exception(tok.ToString());

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,568 @@
#region ================== Copyright (c) 2014 Boris Iwanski
/*
* Copyright (c) 2014 Boris Iwanski
* 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
using System;
using System.Windows.Forms;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Diagnostics;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public class ControlSectorArea
{
#region ================== Enums
public enum Highlight
{
None,
OuterLeft,
OuterRight,
OuterTop,
OuterBottom,
OuterTopLeft,
OuterTopRight,
OuterBottomLeft,
OuterBottomRight,
Body
};
#endregion
#region ================== Variables
private RectangleF outerborder;
private PixelColor bordercolor = new PixelColor(255, 0, 192, 0);
private PixelColor fillcolor = new PixelColor(128, 0, 128, 0);
private PixelColor borderhighlightcolor = new PixelColor(255, 0, 192, 0);
private PixelColor fillhighlightcolor = new PixelColor(128, 0, 192, 0);
private Dictionary<Highlight, Line2D> lines;
private Dictionary<Highlight, Vector2D> points;
private float gridsize;
private float gridsizeinv;
private float sectorsize;
private float outerleft;
private float outerright;
private float outertop;
private float outerbottom;
private bool usecustomtagrange;
private int firsttag;
private int lasttag;
#endregion
#region ================== Properties
public float GridSize { get { return gridsize; } }
public float SectorSize { get { return sectorsize; } }
public RectangleF OuterBorder { get { return outerborder; } }
public float OuterLeft
{
get { return outerleft; }
set { outerleft = value; UpdateLinesAndPoints(); }
}
public float OuterRight
{
get { return outerright; }
set { outerright = value; UpdateLinesAndPoints(); }
}
public float OuterTop
{
get { return outertop; }
set { outertop = value; UpdateLinesAndPoints(); }
}
public float OuterBottom
{
get { return outerbottom; }
set { outerbottom = value; UpdateLinesAndPoints(); }
}
public bool UseCustomTagRnage { get { return usecustomtagrange; } set { usecustomtagrange = value; } }
public int FirstTag { get { return firsttag; } set { firsttag = value; } }
public int LastTag { get { return lasttag; } set { lasttag = value; } }
#endregion
#region ================== Constructor / Disposer
public ControlSectorArea(float outerleft, float outerright, float outertop, float outerbottom, float gridsize, float sectorsize)
{
this.outerleft = outerleft;
this.outerright = outerright;
this.outertop = outertop;
this.outerbottom = outerbottom;
lines = new Dictionary<Highlight, Line2D>();
points = new Dictionary<Highlight, Vector2D>();
this.gridsize = gridsize;
gridsizeinv = 1.0f / gridsize;
this.sectorsize = sectorsize;
UpdateLinesAndPoints();
}
#endregion
#region ================== Methods
public void UpdateLinesAndPoints()
{
lines[Highlight.OuterLeft] = new Line2D(outerleft, outertop, outerleft, outerbottom);
lines[Highlight.OuterRight] = new Line2D(outerright, outertop, outerright, outerbottom);
lines[Highlight.OuterTop] = new Line2D(outerleft, outertop, outerright, outertop);
lines[Highlight.OuterBottom] = new Line2D(outerleft, outerbottom, outerright, outerbottom);
points[Highlight.OuterTopLeft] = new Vector2D(outerleft, outertop);
points[Highlight.OuterTopRight] = new Vector2D(outerright, outertop);
points[Highlight.OuterBottomLeft] = new Vector2D(outerleft, outerbottom);
points[Highlight.OuterBottomRight] = new Vector2D(outerright, outerbottom);
outerborder = new RectangleF(outerleft, outertop, outerright - outerleft, outerbottom - outertop);
}
public void Draw(IRenderer2D renderer, Highlight highlight)
{
PixelColor fcolor = highlight == Highlight.Body ? fillhighlightcolor : fillcolor;
renderer.RenderRectangleFilled(
new RectangleF(outerleft, outertop, outerright - outerleft, outerbottom - outertop),
fcolor,
true
);
// Draw the borders
renderer.RenderRectangle(outerborder, 1.0f, bordercolor, true);
// Highlight a border if necessary
if (highlight >= Highlight.OuterLeft && highlight <= Highlight.OuterBottom)
renderer.RenderLine(lines[highlight].v1, lines[highlight].v2, 1.0f, borderhighlightcolor, true);
else
{
// Highlight the corners
switch (highlight)
{
// Outer corners
case Highlight.OuterTopLeft:
renderer.RenderLine(lines[Highlight.OuterTop].v1, lines[Highlight.OuterTop].v2, 1.0f, borderhighlightcolor, true);
renderer.RenderLine(lines[Highlight.OuterLeft].v1, lines[Highlight.OuterLeft].v2, 1.0f, borderhighlightcolor, true);
break;
case Highlight.OuterTopRight:
renderer.RenderLine(lines[Highlight.OuterTop].v1, lines[Highlight.OuterTop].v2, 1.0f, borderhighlightcolor, true);
renderer.RenderLine(lines[Highlight.OuterRight].v1, lines[Highlight.OuterRight].v2, 1.0f, borderhighlightcolor, true);
break;
case Highlight.OuterBottomLeft:
renderer.RenderLine(lines[Highlight.OuterBottom].v1, lines[Highlight.OuterBottom].v2, 1.0f, borderhighlightcolor, true);
renderer.RenderLine(lines[Highlight.OuterLeft].v1, lines[Highlight.OuterLeft].v2, 1.0f, borderhighlightcolor, true);
break;
case Highlight.OuterBottomRight:
renderer.RenderLine(lines[Highlight.OuterBottom].v1, lines[Highlight.OuterBottom].v2, 1.0f, borderhighlightcolor, true);
renderer.RenderLine(lines[Highlight.OuterRight].v1, lines[Highlight.OuterRight].v2, 1.0f, borderhighlightcolor, true);
break;
}
}
}
public Highlight CheckHighlight(Vector2D pos, float scale)
{
float distance = float.MaxValue;
float d;
Highlight highlight = Highlight.None;
// Find a line to highlight
foreach (Highlight h in (Highlight[])Enum.GetValues(typeof(Highlight)))
{
if (h >= Highlight.OuterLeft && h <= Highlight.OuterBottom)
{
d = Line2D.GetDistanceToLine(lines[h].v1, lines[h].v2, pos, true);
if (d <= BuilderModes.BuilderPlug.Me.HighlightRange / scale && d < distance)
{
distance = d;
highlight = h;
}
}
}
distance = float.MaxValue;
// Find a corner to highlight
foreach (Highlight h in (Highlight[])Enum.GetValues(typeof(Highlight)))
{
if (h >= Highlight.OuterTopLeft && h <= Highlight.OuterBottomRight)
{
d = Vector2D.Distance(pos, points[h]);
if (d <= BuilderModes.BuilderPlug.Me.HighlightRange / scale && d < distance)
{
distance = d;
highlight = h;
}
}
}
if (highlight != Highlight.None)
return highlight;
if (OuterLeft < pos.x && OuterRight > pos.x && OuterTop > pos.y && OuterBottom < pos.y)
return Highlight.Body;
return Highlight.None;
}
public void SnapToGrid(Highlight highlight, Vector2D pos, Vector2D lastpos)
{
Vector2D newpos = GridSetup.SnappedToGrid(pos, gridsize, gridsizeinv);
switch (highlight)
{
case Highlight.Body:
Vector2D diff = GridSetup.SnappedToGrid(pos, gridsize, gridsizeinv) - GridSetup.SnappedToGrid(lastpos, gridsize, gridsizeinv);
Debug.WriteLine("diff: " + (diff).ToString());
outerleft += diff.x;
outerright += diff.x;
outertop += diff.y;
outerbottom += diff.y;
break;
// Outer border
case Highlight.OuterLeft:
if (newpos.x < outerright) outerleft = newpos.x;
break;
case Highlight.OuterRight:
if(newpos.x > outerleft) outerright = newpos.x;
break;
case Highlight.OuterTop:
if (newpos.y > outerbottom) outertop = newpos.y;
break;
case Highlight.OuterBottom:
if (newpos.y < outertop) outerbottom = newpos.y;
break;
// Outer corners
case Highlight.OuterTopLeft:
if (newpos.x < outerright) outerleft = newpos.x;
if (newpos.y > outerbottom) outertop = newpos.y;
break;
case Highlight.OuterTopRight:
if (newpos.x > outerleft) outerright = newpos.x;
if (newpos.y > outerbottom) outertop = newpos.y;
break;
case Highlight.OuterBottomLeft:
if (newpos.x < outerright) outerleft = newpos.x;
if (newpos.y < outertop) outerbottom = newpos.y;
break;
case Highlight.OuterBottomRight:
if (newpos.x > outerleft) outerright = newpos.x;
if (newpos.y < outertop) outerbottom = newpos.y;
break;
}
UpdateLinesAndPoints();
}
public List<Vector2D> GetRelocatePositions(int numsectors)
{
List<Vector2D> positions = new List<Vector2D>();
BlockMap<BlockEntry> blockmap = CreateBlockmap(true);
int margin = (int)((gridsize - sectorsize) / 2);
for (int x = (int)outerleft; x < (int)outerright; x += (int)gridsize)
{
for (int y = (int)outertop; y > (int)outerbottom; y -= (int)gridsize)
{
List<BlockEntry> blocks = blockmap.GetLineBlocks(
new Vector2D(x + 1, y - 1),
new Vector2D(x + gridsize - 1, y - gridsize + 1)
);
// The way our blockmap is built and queried we will always get exactly one block
if (blocks[0].Sectors.Count == 0)
{
positions.Add(new Vector2D(x + margin, y - margin));
numsectors--;
}
if (numsectors == 0)
return positions;
}
}
throw new Exception("Not enough space for control sector relocation");
}
public List<DrawnVertex> GetNewControlSectorVertices()
{
BlockMap<BlockEntry> blockmap = CreateBlockmap();
int margin = (int)((gridsize - sectorsize) / 2);
// find position for new control sector
for (int x = (int)outerleft; x < (int)outerright; x += (int)gridsize)
{
for (int y = (int)outertop; y > (int)outerbottom; y -= (int)gridsize)
{
List<BlockEntry> blocks = blockmap.GetLineBlocks(
new Vector2D(x + 1, y - 1),
new Vector2D(x + gridsize - 1, y - gridsize + 1)
);
// The way our blockmap is built and queried we will always get exactly one block
if (blocks[0].Sectors.Count == 0)
{
List<DrawnVertex> dv = new List<DrawnVertex>();
Point p = new Point(x + margin, y - margin);
dv.Add(SectorVertex(p.X, p.Y));
dv.Add(SectorVertex(p.X + BuilderPlug.Me.ControlSectorArea.SectorSize, p.Y));
dv.Add(SectorVertex(p.X + BuilderPlug.Me.ControlSectorArea.SectorSize, p.Y - BuilderPlug.Me.ControlSectorArea.SectorSize));
dv.Add(SectorVertex(p.X, p.Y - BuilderPlug.Me.ControlSectorArea.SectorSize));
dv.Add(SectorVertex(p.X, p.Y));
return dv;
}
}
}
throw new Exception("No space left for control sectors");
}
public bool Inside(float x, float y)
{
return Inside(new Vector2D(x, y));
}
public bool Inside(Vector2D pos)
{
if (pos.x > outerleft && pos.x < outerright && pos.y < outertop && pos.y > outerbottom)
return true;
return false;
}
public bool OutsideOuterBounds(float x, float y)
{
return OutsideOuterBounds(new Vector2D(x, y));
}
public bool OutsideOuterBounds(Vector2D pos)
{
if(pos.x < outerleft || pos.x > outerright || pos.y > outertop || pos.y < outerbottom)
return true;
return false;
}
// Aligns the area to the grid, expanding the area if necessary
private RectangleF AlignAreaToGrid(RectangleF area)
{
List<float> f = new List<float>
{
area.Left,
area.Top,
area.Right,
area.Bottom
};
for (int i = 0; i < f.Count; i++)
{
if (f[i] < 0)
f[i] = (float)Math.Floor(f[i] / gridsize) * gridsize;
else
f[i] = (float)Math.Ceiling(f[i] / gridsize) * gridsize;
}
float l = f[0];
float t = f[1];
float r = f[2];
float b = f[3];
return new RectangleF(l, t, r - l, b - t);
}
private BlockMap<BlockEntry> CreateBlockmap()
{
return CreateBlockmap(false);
}
private BlockMap<BlockEntry> CreateBlockmap(bool ignorecontrolsectors)
{
// Make blockmap
RectangleF area = MapSet.CreateArea(General.Map.Map.Vertices);
area = MapSet.IncreaseArea(area, new Vector2D(outerleft, outertop));
area = MapSet.IncreaseArea(area, new Vector2D(outerright, outerbottom));
area = AlignAreaToGrid(area);
BlockMap<BlockEntry> blockmap = new BlockMap<BlockEntry>(area, (int)gridsize);
if (ignorecontrolsectors)
{
foreach (Sector s in General.Map.Map.Sectors)
{
// Managed control sectors have the custom UDMF field "user_managed_3d_floor" set to true
// So if the field is NOT set, add the sector to the blockmap
bool managed = s.Fields.GetValue("user_managed_3d_floor", false);
if (managed == false)
blockmap.AddSector(s);
else // When a tag was manually removed a control sector still might have the user_managed_3d_floor field, but not be
{ // recognized as a 3D floor control sector. In that case also add the sector to the blockmap
bool orphaned = true;
foreach(ThreeDFloor tdf in ((ThreeDFloorHelperMode)General.Editing.Mode).ThreeDFloors)
{
if(tdf.Sector == s)
{
orphaned = false;
break;
}
}
if (orphaned)
blockmap.AddSector(s);
}
}
}
else
{
blockmap.AddSectorsSet(General.Map.Map.Sectors);
}
return blockmap;
}
public void Edit()
{
ControlSectorAreaConfig csacfg = new ControlSectorAreaConfig(this);
csacfg.ShowDialog((Form)General.Interface);
}
// When OK is pressed on the preferences dialog
// Prevent inlining, otherwise there are unexpected interactions with Assembly.GetCallingAssembly
// See https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getcallingassembly?view=netframework-4.6.1#remarks
[MethodImplAttribute(MethodImplOptions.NoInlining)]
public void SaveConfig()
{
ListDictionary config = new ListDictionary();
config.Add("usecustomtagrange", usecustomtagrange);
if (usecustomtagrange)
{
config.Add("firsttag", firsttag);
config.Add("lasttag", lasttag);
}
config.Add("outerleft", outerleft);
config.Add("outerright", outerright);
config.Add("outertop", outertop);
config.Add("outerbottom", outerbottom);
General.Map.Options.WritePluginSetting("controlsectorarea", config);
}
// When OK is pressed on the preferences dialog
// Prevent inlining, otherwise there are unexpected interactions with Assembly.GetCallingAssembly
// See https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getcallingassembly?view=netframework-4.6.1#remarks
[MethodImplAttribute(MethodImplOptions.NoInlining)]
public void LoadConfig()
{
ListDictionary config = (ListDictionary)General.Map.Options.ReadPluginSetting("controlsectorarea", new ListDictionary());
usecustomtagrange = General.Map.Options.ReadPluginSetting("controlsectorarea.usecustomtagrange", false);
firsttag = General.Map.Options.ReadPluginSetting("controlsectorarea.firsttag", 0);
lasttag = General.Map.Options.ReadPluginSetting("controlsectorarea.lasttag", 0);
outerleft = General.Map.Options.ReadPluginSetting("controlsectorarea.outerleft", outerleft);
outerright = General.Map.Options.ReadPluginSetting("controlsectorarea.outerright", outerright);
outertop = General.Map.Options.ReadPluginSetting("controlsectorarea.outertop", outertop);
outerbottom = General.Map.Options.ReadPluginSetting("controlsectorarea.outerbottom", outerbottom);
UpdateLinesAndPoints();
}
public int GetNewSectorTag(List<int> tagblacklist)
{
List<int> usedtags = new List<int>();
if (usecustomtagrange)
{
for (int i = firsttag; i <= lasttag; i++)
{
if (!tagblacklist.Contains(i) && General.Map.Map.GetSectorsByTag(i).Count == 0)
return i;
}
throw new Exception("No free tags in the custom range between " + firsttag.ToString() + " and " + lasttag.ToString() + ".");
}
return General.Map.Map.GetNewTag(tagblacklist);
}
public int GetNewLineID()
{
return General.Map.Map.GetNewTag();
}
// Turns a position into a DrawnVertex and returns it
private DrawnVertex SectorVertex(float x, float y)
{
DrawnVertex v = new DrawnVertex();
v.stitch = true;
v.stitchline = true;
v.pos = new Vector2D((float)Math.Round(x, General.Map.FormatInterface.VertexDecimals), (float)Math.Round(y, General.Map.FormatInterface.VertexDecimals));
return v;
}
private DrawnVertex SectorVertex(Vector2D v)
{
return SectorVertex(v.x, v.y);
}
static int GCD(int[] numbers)
{
return numbers.Aggregate(GCD);
}
static int GCD(int a, int b)
{
return b == 0 ? a : GCD(b, a % b);
}
#endregion
}
}

View file

@ -0,0 +1,421 @@
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
partial class ThreeDFloorHelperControl
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.sectorTopFlat = new CodeImp.DoomBuilder.Controls.FlatSelectorControl();
this.sectorBorderTexture = new CodeImp.DoomBuilder.Controls.TextureSelectorControl();
this.sectorBottomFlat = new CodeImp.DoomBuilder.Controls.FlatSelectorControl();
this.sectorCeilingHeight = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.sectorFloorHeight = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.checkedListBoxSectors = new System.Windows.Forms.CheckedListBox();
this.buttonDuplicate = new System.Windows.Forms.Button();
this.buttonSplit = new System.Windows.Forms.Button();
this.buttonCheckAll = new System.Windows.Forms.Button();
this.buttonUncheckAll = new System.Windows.Forms.Button();
this.borderHeightLabel = new System.Windows.Forms.Label();
this.typeArgument = new CodeImp.DoomBuilder.Controls.ArgumentBox();
this.flagsArgument = new CodeImp.DoomBuilder.Controls.ArgumentBox();
this.buttonEditSector = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.alphaArgument = new CodeImp.DoomBuilder.Controls.ArgumentBox();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.sectorBrightness = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.tagsLabel = new System.Windows.Forms.Label();
this.buttonDetach = new System.Windows.Forms.Button();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// sectorTopFlat
//
this.sectorTopFlat.Location = new System.Drawing.Point(10, 30);
this.sectorTopFlat.MultipleTextures = false;
this.sectorTopFlat.Name = "sectorTopFlat";
this.sectorTopFlat.Size = new System.Drawing.Size(115, 136);
this.sectorTopFlat.TabIndex = 4;
this.sectorTopFlat.TextureName = "";
//
// sectorBorderTexture
//
this.sectorBorderTexture.Location = new System.Drawing.Point(131, 30);
this.sectorBorderTexture.MultipleTextures = false;
this.sectorBorderTexture.Name = "sectorBorderTexture";
this.sectorBorderTexture.Required = false;
this.sectorBorderTexture.Size = new System.Drawing.Size(115, 136);
this.sectorBorderTexture.TabIndex = 3;
this.sectorBorderTexture.TextureName = "";
//
// sectorBottomFlat
//
this.sectorBottomFlat.Location = new System.Drawing.Point(252, 30);
this.sectorBottomFlat.MultipleTextures = false;
this.sectorBottomFlat.Name = "sectorBottomFlat";
this.sectorBottomFlat.Size = new System.Drawing.Size(115, 136);
this.sectorBottomFlat.TabIndex = 2;
this.sectorBottomFlat.TextureName = "";
//
// sectorCeilingHeight
//
this.sectorCeilingHeight.AllowDecimal = false;
this.sectorCeilingHeight.AllowExpressions = false;
this.sectorCeilingHeight.AllowNegative = true;
this.sectorCeilingHeight.AllowRelative = true;
this.sectorCeilingHeight.BackColor = System.Drawing.Color.Transparent;
this.sectorCeilingHeight.ButtonStep = 8;
this.sectorCeilingHeight.ButtonStepBig = 10F;
this.sectorCeilingHeight.ButtonStepFloat = 1F;
this.sectorCeilingHeight.ButtonStepSmall = 0.1F;
this.sectorCeilingHeight.ButtonStepsUseModifierKeys = false;
this.sectorCeilingHeight.ButtonStepsWrapAround = false;
this.sectorCeilingHeight.Location = new System.Drawing.Point(55, 0);
this.sectorCeilingHeight.Name = "sectorCeilingHeight";
this.sectorCeilingHeight.Size = new System.Drawing.Size(70, 24);
this.sectorCeilingHeight.StepValues = null;
this.sectorCeilingHeight.TabIndex = 1;
this.sectorCeilingHeight.WhenTextChanged += new System.EventHandler(this.RecomputeBorderHeight);
//
// sectorFloorHeight
//
this.sectorFloorHeight.AllowDecimal = false;
this.sectorFloorHeight.AllowExpressions = false;
this.sectorFloorHeight.AllowNegative = true;
this.sectorFloorHeight.AllowRelative = true;
this.sectorFloorHeight.BackColor = System.Drawing.Color.Transparent;
this.sectorFloorHeight.ButtonStep = 8;
this.sectorFloorHeight.ButtonStepBig = 10F;
this.sectorFloorHeight.ButtonStepFloat = 1F;
this.sectorFloorHeight.ButtonStepSmall = 0.1F;
this.sectorFloorHeight.ButtonStepsUseModifierKeys = false;
this.sectorFloorHeight.ButtonStepsWrapAround = false;
this.sectorFloorHeight.Location = new System.Drawing.Point(297, 0);
this.sectorFloorHeight.Name = "sectorFloorHeight";
this.sectorFloorHeight.Size = new System.Drawing.Size(70, 24);
this.sectorFloorHeight.StepValues = null;
this.sectorFloorHeight.TabIndex = 0;
this.sectorFloorHeight.WhenTextChanged += new System.EventHandler(this.RecomputeBorderHeight);
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Location = new System.Drawing.Point(7, 5);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(26, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Top";
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Location = new System.Drawing.Point(251, 5);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(40, 13);
this.label2.TabIndex = 6;
this.label2.Text = "Bottom";
//
// label3
//
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.Location = new System.Drawing.Point(131, 5);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 13);
this.label3.TabIndex = 7;
this.label3.Text = "Border";
//
// groupBox2
//
this.groupBox2.BackColor = System.Drawing.Color.Transparent;
this.groupBox2.Controls.Add(this.checkedListBoxSectors);
this.groupBox2.Location = new System.Drawing.Point(503, 0);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(124, 166);
this.groupBox2.TabIndex = 6;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Sectors";
//
// checkedListBoxSectors
//
this.checkedListBoxSectors.CheckOnClick = true;
this.checkedListBoxSectors.FormattingEnabled = true;
this.checkedListBoxSectors.Location = new System.Drawing.Point(6, 19);
this.checkedListBoxSectors.Name = "checkedListBoxSectors";
this.checkedListBoxSectors.Size = new System.Drawing.Size(110, 139);
this.checkedListBoxSectors.TabIndex = 0;
this.checkedListBoxSectors.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBoxSectors_ItemCheck);
//
// buttonDuplicate
//
this.buttonDuplicate.Location = new System.Drawing.Point(633, 5);
this.buttonDuplicate.Name = "buttonDuplicate";
this.buttonDuplicate.Size = new System.Drawing.Size(75, 23);
this.buttonDuplicate.TabIndex = 7;
this.buttonDuplicate.Text = "Duplicate";
this.buttonDuplicate.UseVisualStyleBackColor = true;
this.buttonDuplicate.Click += new System.EventHandler(this.buttonDuplicate_Click);
//
// buttonSplit
//
this.buttonSplit.Location = new System.Drawing.Point(633, 34);
this.buttonSplit.Name = "buttonSplit";
this.buttonSplit.Size = new System.Drawing.Size(75, 23);
this.buttonSplit.TabIndex = 8;
this.buttonSplit.Text = "Split";
this.buttonSplit.UseVisualStyleBackColor = true;
this.buttonSplit.Click += new System.EventHandler(this.buttonSplit_Click);
//
// buttonCheckAll
//
this.buttonCheckAll.Location = new System.Drawing.Point(633, 92);
this.buttonCheckAll.Name = "buttonCheckAll";
this.buttonCheckAll.Size = new System.Drawing.Size(75, 23);
this.buttonCheckAll.TabIndex = 9;
this.buttonCheckAll.Text = "Check all";
this.buttonCheckAll.UseVisualStyleBackColor = true;
this.buttonCheckAll.Click += new System.EventHandler(this.buttonCheckAll_Click);
//
// buttonUncheckAll
//
this.buttonUncheckAll.Location = new System.Drawing.Point(633, 121);
this.buttonUncheckAll.Name = "buttonUncheckAll";
this.buttonUncheckAll.Size = new System.Drawing.Size(75, 23);
this.buttonUncheckAll.TabIndex = 10;
this.buttonUncheckAll.Text = "Uncheck all";
this.buttonUncheckAll.UseVisualStyleBackColor = true;
this.buttonUncheckAll.Click += new System.EventHandler(this.buttonUncheckAll_Click);
//
// borderHeightLabel
//
this.borderHeightLabel.Location = new System.Drawing.Point(196, 5);
this.borderHeightLabel.Name = "borderHeightLabel";
this.borderHeightLabel.Size = new System.Drawing.Size(50, 13);
this.borderHeightLabel.TabIndex = 17;
this.borderHeightLabel.Text = "0";
this.borderHeightLabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// typeArgument
//
this.typeArgument.BackColor = System.Drawing.Color.Transparent;
this.typeArgument.Location = new System.Drawing.Point(438, 0);
this.typeArgument.Name = "typeArgument";
this.typeArgument.Size = new System.Drawing.Size(59, 24);
this.typeArgument.TabIndex = 18;
//
// flagsArgument
//
this.flagsArgument.BackColor = System.Drawing.Color.Transparent;
this.flagsArgument.Location = new System.Drawing.Point(438, 30);
this.flagsArgument.Name = "flagsArgument";
this.flagsArgument.Size = new System.Drawing.Size(59, 24);
this.flagsArgument.TabIndex = 19;
//
// buttonEditSector
//
this.buttonEditSector.Location = new System.Drawing.Point(376, 143);
this.buttonEditSector.Name = "buttonEditSector";
this.buttonEditSector.Size = new System.Drawing.Size(121, 23);
this.buttonEditSector.TabIndex = 24;
this.buttonEditSector.Text = "Edit control sector";
this.buttonEditSector.UseVisualStyleBackColor = true;
this.buttonEditSector.Click += new System.EventHandler(this.buttonEditSector_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.Location = new System.Drawing.Point(395, 65);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(37, 13);
this.label6.TabIndex = 23;
this.label6.Text = "Alpha:";
//
// alphaArgument
//
this.alphaArgument.BackColor = System.Drawing.Color.Transparent;
this.alphaArgument.Location = new System.Drawing.Point(438, 60);
this.alphaArgument.Name = "alphaArgument";
this.alphaArgument.Size = new System.Drawing.Size(59, 24);
this.alphaArgument.TabIndex = 20;
//
// label4
//
this.label4.AutoSize = true;
this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.Location = new System.Drawing.Point(396, 5);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(34, 13);
this.label4.TabIndex = 21;
this.label4.Text = "Type:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.BackColor = System.Drawing.Color.Transparent;
this.label5.Location = new System.Drawing.Point(395, 35);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(35, 13);
this.label5.TabIndex = 22;
this.label5.Text = "Flags:";
//
// label7
//
this.label7.AutoSize = true;
this.label7.BackColor = System.Drawing.Color.Transparent;
this.label7.Location = new System.Drawing.Point(373, 95);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(59, 13);
this.label7.TabIndex = 25;
this.label7.Text = "Brightness:";
//
// label8
//
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.Transparent;
this.label8.Location = new System.Drawing.Point(390, 125);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(40, 13);
this.label8.TabIndex = 26;
this.label8.Text = "Tag(s):";
//
// sectorBrightness
//
this.sectorBrightness.AllowDecimal = false;
this.sectorBrightness.AllowExpressions = false;
this.sectorBrightness.AllowNegative = true;
this.sectorBrightness.AllowRelative = true;
this.sectorBrightness.BackColor = System.Drawing.Color.Transparent;
this.sectorBrightness.ButtonStep = 8;
this.sectorBrightness.ButtonStepBig = 10F;
this.sectorBrightness.ButtonStepFloat = 1F;
this.sectorBrightness.ButtonStepSmall = 0.1F;
this.sectorBrightness.ButtonStepsUseModifierKeys = false;
this.sectorBrightness.ButtonStepsWrapAround = false;
this.sectorBrightness.Location = new System.Drawing.Point(438, 90);
this.sectorBrightness.Name = "sectorBrightness";
this.sectorBrightness.Size = new System.Drawing.Size(59, 24);
this.sectorBrightness.StepValues = null;
this.sectorBrightness.TabIndex = 27;
//
// tagsLabel
//
this.tagsLabel.AutoSize = true;
this.tagsLabel.Location = new System.Drawing.Point(436, 125);
this.tagsLabel.Name = "tagsLabel";
this.tagsLabel.Size = new System.Drawing.Size(35, 13);
this.tagsLabel.TabIndex = 28;
this.tagsLabel.Text = "label9";
//
// buttonDetach
//
this.buttonDetach.Location = new System.Drawing.Point(633, 63);
this.buttonDetach.Name = "buttonDetach";
this.buttonDetach.Size = new System.Drawing.Size(75, 23);
this.buttonDetach.TabIndex = 29;
this.buttonDetach.Text = "Detach";
this.buttonDetach.UseVisualStyleBackColor = true;
this.buttonDetach.Click += new System.EventHandler(this.buttonDetach_Click);
//
// ThreeDFloorHelperControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.buttonDetach);
this.Controls.Add(this.tagsLabel);
this.Controls.Add(this.sectorBrightness);
this.Controls.Add(this.label8);
this.Controls.Add(this.label7);
this.Controls.Add(this.typeArgument);
this.Controls.Add(this.flagsArgument);
this.Controls.Add(this.buttonEditSector);
this.Controls.Add(this.label6);
this.Controls.Add(this.alphaArgument);
this.Controls.Add(this.label4);
this.Controls.Add(this.label5);
this.Controls.Add(this.borderHeightLabel);
this.Controls.Add(this.buttonUncheckAll);
this.Controls.Add(this.buttonCheckAll);
this.Controls.Add(this.buttonSplit);
this.Controls.Add(this.buttonDuplicate);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.sectorFloorHeight);
this.Controls.Add(this.sectorCeilingHeight);
this.Controls.Add(this.sectorBottomFlat);
this.Controls.Add(this.sectorBorderTexture);
this.Controls.Add(this.sectorTopFlat);
this.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.Name = "ThreeDFloorHelperControl";
this.Size = new System.Drawing.Size(714, 172);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.ThreeDFloorHelperControl_Paint);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
public CodeImp.DoomBuilder.Controls.TextureSelectorControl sectorBorderTexture;
public CodeImp.DoomBuilder.Controls.FlatSelectorControl sectorTopFlat;
public CodeImp.DoomBuilder.Controls.FlatSelectorControl sectorBottomFlat;
public CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox sectorCeilingHeight;
public CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox sectorFloorHeight;
private System.Windows.Forms.GroupBox groupBox2;
public System.Windows.Forms.CheckedListBox checkedListBoxSectors;
private System.Windows.Forms.Button buttonDuplicate;
private System.Windows.Forms.Button buttonSplit;
private System.Windows.Forms.Button buttonCheckAll;
private System.Windows.Forms.Button buttonUncheckAll;
private System.Windows.Forms.Label borderHeightLabel;
public Controls.ArgumentBox typeArgument;
public Controls.ArgumentBox flagsArgument;
private System.Windows.Forms.Button buttonEditSector;
private System.Windows.Forms.Label label6;
public Controls.ArgumentBox alphaArgument;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
public Controls.ButtonsNumericTextbox sectorBrightness;
private System.Windows.Forms.Label tagsLabel;
private System.Windows.Forms.Button buttonDetach;
}
}

View file

@ -0,0 +1,347 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.Plugins;
using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Data;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public partial class ThreeDFloorHelperControl : UserControl
{
private ThreeDFloor threeDFloor;
public Linedef linedef;
private bool isnew;
private Sector sector;
private List<int> checkedsectors;
private bool used;
public ThreeDFloor ThreeDFloor { get { return threeDFloor; } }
public bool IsNew { get { return isnew; } }
public Sector Sector { get { return sector; } }
public List<int> CheckedSectors { get { return checkedsectors; } }
public bool Used { get { return used; } set { used = value; } }
// Create the control from an existing linedef
public ThreeDFloorHelperControl(ThreeDFloor threeDFloor)
{
InitializeComponent();
Update(threeDFloor);
}
// Create a duplicate of the given control
public ThreeDFloorHelperControl(ThreeDFloorHelperControl ctrl) : this()
{
Update(ctrl);
}
// Create a blank control for a new 3D floor
public ThreeDFloorHelperControl()
{
InitializeComponent();
SetDefaults();
}
public void SetDefaults()
{
isnew = true;
threeDFloor = new ThreeDFloor();
sectorBorderTexture.TextureName = General.Settings.DefaultTexture;
sectorTopFlat.TextureName = General.Settings.DefaultCeilingTexture;
sectorBottomFlat.TextureName = General.Settings.DefaultFloorTexture;
sectorCeilingHeight.Text = General.Settings.DefaultCeilingHeight.ToString();
sectorFloorHeight.Text = General.Settings.DefaultFloorHeight.ToString();
typeArgument.Setup(General.Map.Config.LinedefActions[160].Args[1]);
flagsArgument.Setup(General.Map.Config.LinedefActions[160].Args[2]);
alphaArgument.Setup(General.Map.Config.LinedefActions[160].Args[3]);
typeArgument.SetDefaultValue();
flagsArgument.SetDefaultValue();
alphaArgument.SetDefaultValue();
tagsLabel.Text = "0";
AddSectorCheckboxes();
for (int i = 0; i < checkedListBoxSectors.Items.Count; i++)
checkedListBoxSectors.SetItemChecked(i, true);
//When creating a NEW 3d sector, find information about what is selected to populate the defaults
int FloorHeight = int.MinValue;
int SectorDarkest = int.MaxValue;
foreach (Sector s in BuilderPlug.TDFEW.SelectedSectors)
{
if (s.FloorHeight > FloorHeight)
FloorHeight = s.FloorHeight;
if (s.Brightness < SectorDarkest)
SectorDarkest = s.Brightness;
}
//set the floor height to match the lowest sector selected, then offset the height by the configured default
if (FloorHeight != int.MinValue)
{
int DefaultHeight = General.Settings.DefaultCeilingHeight - General.Settings.DefaultFloorHeight;
sectorFloorHeight.Text = FloorHeight.ToString();
sectorCeilingHeight.Text = (FloorHeight + DefaultHeight).ToString();
}
//set the brightness to match the darkest of all the selected sectors by default
if (SectorDarkest != int.MaxValue) {
sectorBrightness.Text = SectorDarkest.ToString();
} else {
sectorBrightness.Text = General.Settings.DefaultBrightness.ToString();
}
sector = General.Map.Map.CreateSector();
}
public void Update(ThreeDFloorHelperControl ctrl)
{
sectorBorderTexture.TextureName = threeDFloor.BorderTexture = ctrl.threeDFloor.BorderTexture;
sectorTopFlat.TextureName = threeDFloor.TopFlat = ctrl.threeDFloor.TopFlat;
sectorBottomFlat.TextureName = threeDFloor.BottomFlat = ctrl.threeDFloor.BottomFlat;
sectorCeilingHeight.Text = ctrl.threeDFloor.TopHeight.ToString();
sectorFloorHeight.Text = ctrl.threeDFloor.BottomHeight.ToString();
borderHeightLabel.Text = (ctrl.threeDFloor.TopHeight - ctrl.threeDFloor.BottomHeight).ToString();
threeDFloor.TopHeight = ctrl.threeDFloor.TopHeight;
threeDFloor.BottomHeight = ctrl.threeDFloor.BottomHeight;
typeArgument.SetValue(ctrl.threeDFloor.Type);
flagsArgument.SetValue(ctrl.threeDFloor.Flags);
alphaArgument.SetValue(ctrl.threeDFloor.Alpha);
sectorBrightness.Text = ctrl.threeDFloor.Brightness.ToString();
for (int i = 0; i < checkedListBoxSectors.Items.Count; i++)
checkedListBoxSectors.SetItemChecked(i, ctrl.checkedListBoxSectors.GetItemChecked(i));
}
public void Update(ThreeDFloor threeDFloor)
{
isnew = false;
this.threeDFloor = threeDFloor;
sectorBorderTexture.TextureName = threeDFloor.BorderTexture;
sectorTopFlat.TextureName = threeDFloor.TopFlat;
sectorBottomFlat.TextureName = threeDFloor.BottomFlat;
sectorCeilingHeight.Text = threeDFloor.TopHeight.ToString();
sectorFloorHeight.Text = threeDFloor.BottomHeight.ToString();
borderHeightLabel.Text = (threeDFloor.TopHeight - threeDFloor.BottomHeight).ToString();
typeArgument.Setup(General.Map.Config.LinedefActions[160].Args[1]);
flagsArgument.Setup(General.Map.Config.LinedefActions[160].Args[2]);
alphaArgument.Setup(General.Map.Config.LinedefActions[160].Args[3]);
typeArgument.SetValue(threeDFloor.Type);
flagsArgument.SetValue(threeDFloor.Flags);
alphaArgument.SetValue(threeDFloor.Alpha);
sectorBrightness.Text = threeDFloor.Brightness.ToString();
AddSectorCheckboxes();
if(sector == null || sector.IsDisposed)
sector = General.Map.Map.CreateSector();
if (threeDFloor.Sector != null)
{
threeDFloor.Sector.CopyPropertiesTo(sector);
tagsLabel.Text = String.Join(", ", sector.Tags.Select(o => o.ToString()).ToArray());
}
if (sector != null && !sector.IsDisposed)
sector.Selected = false;
}
public void ApplyToThreeDFloor()
{
Regex r = new Regex(@"\d+");
threeDFloor.TopHeight = sectorCeilingHeight.GetResult(threeDFloor.TopHeight);
threeDFloor.BottomHeight = sectorFloorHeight.GetResult(threeDFloor.BottomHeight);
threeDFloor.TopFlat = sectorTopFlat.TextureName;
threeDFloor.BottomFlat = sectorBottomFlat.TextureName;
threeDFloor.BorderTexture = sectorBorderTexture.TextureName;
threeDFloor.Type = int.Parse(typeArgument.Text);
threeDFloor.Flags = int.Parse(flagsArgument.Text);
threeDFloor.Alpha = int.Parse(alphaArgument.Text);
threeDFloor.Brightness = sectorBrightness.GetResult(threeDFloor.Brightness);
threeDFloor.Tags = sector.Tags;
threeDFloor.IsNew = isnew;
if (threeDFloor.Sector != null)
{
sector.CopyPropertiesTo(threeDFloor.Sector);
tagsLabel.Text = String.Join(", ", sector.Tags.Select(o => o.ToString()).ToArray());
}
threeDFloor.TaggedSectors = new List<Sector>();
for (int i = 0; i < checkedListBoxSectors.Items.Count; i++)
{
string text = checkedListBoxSectors.Items[i].ToString();
bool ischecked = !(checkedListBoxSectors.GetItemCheckState(i) == CheckState.Unchecked);
if (ischecked)
{
var matches = r.Matches(text);
Sector s = General.Map.Map.GetSectorByIndex(int.Parse(matches[0].ToString()));
threeDFloor.TaggedSectors.Add(s);
}
}
}
private void AddSectorCheckboxes()
{
List<Sector> sectors = new List<Sector>(BuilderPlug.TDFEW.SelectedSectors.OrderBy(o => o.Index));
checkedsectors = new List<int>();
checkedListBoxSectors.Items.Clear();
foreach (Sector s in ThreeDFloor.TaggedSectors)
{
if (!sectors.Contains(s))
sectors.Add(s);
}
if (sectors == null)
return;
foreach (Sector s in sectors)
{
int i = checkedListBoxSectors.Items.Add("Sector " + s.Index.ToString(), ThreeDFloor.TaggedSectors.Contains(s));
if(ThreeDFloor.TaggedSectors.Contains(s))
checkedsectors.Add(s.Index);
if (!BuilderPlug.TDFEW.SelectedSectors.Contains(s))
{
checkedListBoxSectors.SetItemCheckState(i, CheckState.Indeterminate);
}
}
}
private void buttonDuplicate_Click(object sender, EventArgs e)
{
((ThreeDFloorEditorWindow)this.ParentForm).DuplicateThreeDFloor(this);
}
private void buttonSplit_Click(object sender, EventArgs e)
{
((ThreeDFloorEditorWindow)this.ParentForm).SplitThreeDFloor(this);
}
private void buttonCheckAll_Click(object sender, EventArgs e)
{
for (int i = 0; i < checkedListBoxSectors.Items.Count; i++)
checkedListBoxSectors.SetItemChecked(i, true);
}
private void buttonUncheckAll_Click(object sender, EventArgs e)
{
for (int i = 0; i < checkedListBoxSectors.Items.Count; i++)
checkedListBoxSectors.SetItemChecked(i, false);
}
private void buttonEditSector_Click(object sender, EventArgs e)
{
sector.SetCeilTexture(sectorTopFlat.TextureName);
sector.SetFloorTexture(sectorBottomFlat.TextureName);
sector.CeilHeight = sectorCeilingHeight.GetResult(sector.CeilHeight);
sector.FloorHeight = sectorFloorHeight.GetResult(sector.FloorHeight);
sector.Brightness = sectorBrightness.GetResult(sector.Brightness);
DialogResult result = General.Interface.ShowEditSectors(new List<Sector> { sector });
if (result == DialogResult.OK)
{
sectorTopFlat.TextureName = sector.CeilTexture;
sectorBottomFlat.TextureName = sector.FloorTexture;
sectorCeilingHeight.Text = sector.CeilHeight.ToString();
sectorFloorHeight.Text = sector.FloorHeight.ToString();
sectorBrightness.Text = sector.Brightness.ToString();
tagsLabel.Text = String.Join(", ", sector.Tags.Select(o => o.ToString()).ToArray());
}
}
private void checkedListBoxSectors_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.CurrentValue == CheckState.Indeterminate)
{
e.NewValue = CheckState.Indeterminate;
}
else
{
Regex r = new Regex(@"\d+");
if (((ListBox)sender).SelectedItem == null)
return;
var matches = r.Matches(((ListBox)sender).SelectedItem.ToString());
int sectornum = int.Parse(matches[0].ToString());
if (e.NewValue == CheckState.Checked)
checkedsectors.Add(sectornum);
else
checkedsectors.Remove(sectornum);
}
}
private void ThreeDFloorHelperControl_Paint(object sender, PaintEventArgs e)
{
Color c = Color.FromArgb(0, 192, 0); // Color.FromArgb(255, Color.Green);
if (isnew)
ControlPaint.DrawBorder(
e.Graphics,
this.ClientRectangle,
c, // leftColor
5, // leftWidth
ButtonBorderStyle.Solid, // leftStyle
c, // topColor
0, // topWidth
ButtonBorderStyle.None, // topStyle
c, // rightColor
0, // rightWidth
ButtonBorderStyle.None, // rightStyle
c, // bottomColor
0, // bottomWidth
ButtonBorderStyle.None // bottomStyle
);
}
private void RecomputeBorderHeight(object sender, EventArgs e)
{
borderHeightLabel.Text = (sectorCeilingHeight.GetResult(threeDFloor.TopHeight) - sectorFloorHeight.GetResult(threeDFloor.BottomHeight)).ToString();
}
private void buttonDetach_Click(object sender, EventArgs e)
{
((ThreeDFloorEditorWindow)this.ParentForm).DetachThreeDFloor(this);
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,165 @@
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
partial class ThreeDFloorHelperTooltipElementControl
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.sectorTopFlat = new System.Windows.Forms.Panel();
this.sectorBorderTexture = new System.Windows.Forms.Panel();
this.sectorBottomFlat = new System.Windows.Forms.Panel();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.bottomHeight = new System.Windows.Forms.Label();
this.topHeight = new System.Windows.Forms.Label();
this.borderHeight = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// sectorTopFlat
//
this.sectorTopFlat.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.sectorTopFlat.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.sectorTopFlat.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.sectorTopFlat.Location = new System.Drawing.Point(12, 16);
this.sectorTopFlat.Name = "sectorTopFlat";
this.sectorTopFlat.Size = new System.Drawing.Size(65, 65);
this.sectorTopFlat.TabIndex = 22;
//
// sectorBorderTexture
//
this.sectorBorderTexture.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.sectorBorderTexture.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.sectorBorderTexture.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.sectorBorderTexture.Location = new System.Drawing.Point(83, 16);
this.sectorBorderTexture.Name = "sectorBorderTexture";
this.sectorBorderTexture.Size = new System.Drawing.Size(65, 65);
this.sectorBorderTexture.TabIndex = 21;
//
// sectorBottomFlat
//
this.sectorBottomFlat.BackColor = System.Drawing.SystemColors.AppWorkspace;
this.sectorBottomFlat.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.sectorBottomFlat.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.sectorBottomFlat.Location = new System.Drawing.Point(154, 16);
this.sectorBottomFlat.Name = "sectorBottomFlat";
this.sectorBottomFlat.Size = new System.Drawing.Size(65, 65);
this.sectorBottomFlat.TabIndex = 20;
//
// label3
//
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Transparent;
this.label3.Location = new System.Drawing.Point(80, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 13);
this.label3.TabIndex = 19;
this.label3.Text = "Border";
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Transparent;
this.label2.Location = new System.Drawing.Point(151, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(40, 13);
this.label2.TabIndex = 18;
this.label2.Text = "Bottom";
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.Location = new System.Drawing.Point(9, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(26, 13);
this.label1.TabIndex = 17;
this.label1.Text = "Top";
//
// bottomHeight
//
this.bottomHeight.BackColor = System.Drawing.Color.Transparent;
this.bottomHeight.Location = new System.Drawing.Point(189, 0);
this.bottomHeight.Name = "bottomHeight";
this.bottomHeight.Size = new System.Drawing.Size(30, 13);
this.bottomHeight.TabIndex = 23;
this.bottomHeight.Text = "X";
this.bottomHeight.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// topHeight
//
this.topHeight.BackColor = System.Drawing.Color.Transparent;
this.topHeight.Location = new System.Drawing.Point(47, 0);
this.topHeight.Name = "topHeight";
this.topHeight.Size = new System.Drawing.Size(30, 13);
this.topHeight.TabIndex = 24;
this.topHeight.Text = "X";
this.topHeight.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// borderHeight
//
this.borderHeight.BackColor = System.Drawing.Color.Transparent;
this.borderHeight.Location = new System.Drawing.Point(114, 0);
this.borderHeight.Name = "borderHeight";
this.borderHeight.Size = new System.Drawing.Size(30, 13);
this.borderHeight.TabIndex = 25;
this.borderHeight.Text = "X";
this.borderHeight.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// ThreeDFloorHelperTooltipElementControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.borderHeight);
this.Controls.Add(this.topHeight);
this.Controls.Add(this.bottomHeight);
this.Controls.Add(this.sectorTopFlat);
this.Controls.Add(this.sectorBorderTexture);
this.Controls.Add(this.sectorBottomFlat);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "ThreeDFloorHelperTooltipElementControl";
this.Size = new System.Drawing.Size(222, 82);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.ThreeDFloorHelperTooltipElementControl_Paint);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
public System.Windows.Forms.Panel sectorBorderTexture;
public System.Windows.Forms.Panel sectorTopFlat;
public System.Windows.Forms.Panel sectorBottomFlat;
public System.Windows.Forms.Label bottomHeight;
public System.Windows.Forms.Label topHeight;
public System.Windows.Forms.Label borderHeight;
}
}

View file

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public partial class ThreeDFloorHelperTooltipElementControl : UserControl
{
private bool highlighted;
public bool Highlighted { get { return highlighted; } set { highlighted = value; } }
public ThreeDFloorHelperTooltipElementControl()
{
highlighted = false;
InitializeComponent();
}
private void ThreeDFloorHelperTooltipElementControl_Paint(object sender, PaintEventArgs e)
{
Color c = Color.FromArgb(0, 192, 0); // Color.FromArgb(255, Color.Green);
ControlPaint.DrawBorder(
e.Graphics,
this.ClientRectangle,
c, // leftColor
5, // leftWidth
highlighted ? ButtonBorderStyle.Solid : ButtonBorderStyle.None, // leftStyle
c, // topColor
0, // topWidth
ButtonBorderStyle.None, // topStyle
c, // rightColor
0, // rightWidth
ButtonBorderStyle.None, // rightStyle
c, // bottomColor
0, // bottomWidth
ButtonBorderStyle.None // bottomStyle
);
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,892 @@

#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 System.Windows.Forms;
using System.IO;
using System.Reflection;
using System.Linq;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.Geometry;
using System.Drawing;
using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.Actions;
#endregion
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
enum SlopeDrawingMode { Floor, Ceiling, FloorAndCeiling };
[EditMode(DisplayName = "Draw Slopes Mode",
SwitchAction = "drawslopesmode",
ButtonImage = "DrawSlopeModeIcon.png", // Image resource name for the button
ButtonOrder = int.MinValue + 501, // Position of the button (lower is more to the left)
ButtonGroup = "000_editing",
AllowCopyPaste = false,
SupportedMapFormats = new[] { "UniversalMapSetIO" },
Volatile = true,
UseByDefault = true,
Optional = false)]
public class DrawSlopesMode : ClassicMode
{
#region ================== Constants
private const float LINE_THICKNESS = 0.8f;
#endregion
#region ================== Variables
// Drawing points
private List<DrawnVertex> points;
// Keep track of view changes
private float lastoffsetx;
private float lastoffsety;
private float lastscale;
// Options
private bool snaptogrid; // SHIFT to toggle
private bool snaptonearest; // CTRL to enable
private FlatVertex[] overlayGeometry;
private List<TextLabel> labels;
private static SlopeDrawingMode slopedrawingmode = SlopeDrawingMode.Floor;
#endregion
#region ================== Properties
// Just keep the base mode button checked
public override string EditModeButtonName { get { return General.Editing.PreviousStableMode.Name; } }
#endregion
#region ================== Constructor / Disposer
// Constructor
public DrawSlopesMode()
{
// Initialize
points = new List<DrawnVertex>();
// No selection in this mode
//General.Map.Map.ClearAllSelected();
//General.Map.Map.ClearAllMarks(false);
// We have no destructor
GC.SuppressFinalize(this);
}
// Disposer
public override void Dispose()
{
// Not already disposed?
if (!isdisposed)
{
// Dispose old labels
if (labels != null)
foreach (TextLabel l in labels)
l.Dispose();
// Done
base.Dispose();
}
}
#endregion
#region ================== Methods
// This checks if the view offset/zoom changed and updates the check
protected bool CheckViewChanged()
{
bool viewchanged = false;
// View changed?
if (renderer.OffsetX != lastoffsetx) viewchanged = true;
if (renderer.OffsetY != lastoffsety) viewchanged = true;
if (renderer.Scale != lastscale) viewchanged = true;
// Keep view information
lastoffsetx = renderer.OffsetX;
lastoffsety = renderer.OffsetY;
lastscale = renderer.Scale;
// Return result
return viewchanged;
}
// This sets up new labels
/*
private void SetupLabels()
{
if (labels != null)
{
// Dispose old labels
foreach (KeyValuePair<Sector, TextLabel[]> lbl in labels)
foreach (TextLabel l in lbl.Value) l.Dispose();
}
// Make text labels for sectors
labels = new Dictionary<Sector, TextLabel[]>(General.Map.Map.Sectors.Count);
foreach (Sector s in General.Map.Map.Sectors)
{
// Setup labels
TextLabel[] labelarray = new TextLabel[s.Labels.Count];
for (int i = 0; i < s.Labels.Count; i++)
{
Vector2D v = s.Labels[i].position;
labelarray[i] = new TextLabel(20);
labelarray[i].TransformCoords = true;
labelarray[i].Rectangle = new RectangleF(v.x, v.y, 0.0f, 0.0f);
labelarray[i].AlignX = TextAlignmentX.Center;
labelarray[i].AlignY = TextAlignmentY.Middle;
labelarray[i].Scale = 14f;
labelarray[i].Color = General.Colors.Highlight.WithAlpha(255);
labelarray[i].Backcolor = General.Colors.Background.WithAlpha(255);
}
labels.Add(s, labelarray);
}
}
*/
private void SetupLabels()
{
labels = new List<TextLabel>();
PixelColor white = new PixelColor(255, 255, 255, 255);
foreach (SlopeVertexGroup svg in BuilderPlug.Me.SlopeVertexGroups)
{
for (int i = 0; i < svg.Vertices.Count; i++)
{
if (BuilderPlug.Me.SlopeVertexLabelDisplayOption == LabelDisplayOption.Always || General.Interface.AltState == true)
{
SlopeVertex sv = svg.Vertices[i];
float scale = 1 / renderer.Scale;
float x = sv.Pos.x;
float y = sv.Pos.y - 14 * scale;
string value = String.Format("Z: {0}", sv.Z);
bool showlabel = true;
// Rearrange labels if they'd be (exactly) on each other
foreach (TextLabel l in labels)
{
if (l.Location.x == x && l.Location.y == y) {
// Reduce visual clutter by de-duping stacked labels, when "show all labels" is enabled
if (l.Text == value) {
showlabel = false; //dedupe
} else {
// Adjust the label position down one line
y -= l.TextSize.Height * scale;
}
}
}
// Only proceed if the label was not deduped
if (showlabel)
{
TextLabel label = new TextLabel();
label.TransformCoords = true;
label.Location = new Vector2D(x, y);
label.AlignX = TextAlignmentX.Center;
label.AlignY = TextAlignmentY.Middle;
label.BackColor = General.Colors.Background.WithAlpha(128);
label.Text = value;
label.Color = white;
labels.Add(label);
}
}
}
}
}
// This updates the dragging
private void Update()
{
PixelColor stitchcolor = General.Colors.Highlight;
PixelColor losecolor = General.Colors.Selection;
PixelColor color;
snaptogrid = General.Interface.ShiftState ^ General.Interface.SnapToGrid;
snaptonearest = General.Interface.CtrlState ^ General.Interface.AutoMerge;
DrawnVertex lastp = new DrawnVertex();
DrawnVertex curp = GetCurrentPosition();
float vsize = ((float)renderer.VertexSize + 1.0f) / renderer.Scale;
float vsizeborder = ((float)renderer.VertexSize + 3.0f) / renderer.Scale;
SetupLabels();
// Render drawing lines
if (renderer.StartOverlay(true))
{
float size = 9 / renderer.Scale;
if (BuilderPlug.Me.UseHighlight)
{
renderer.RenderHighlight(overlayGeometry, General.Colors.Selection.WithAlpha(64).ToInt());
}
List<SlopeVertex> vertices = new List<SlopeVertex>();
// Store all slope vertices and draw the lines between them
foreach (SlopeVertexGroup svg in BuilderPlug.Me.SlopeVertexGroups)
{
for (int i = 0; i < svg.Vertices.Count; i++)
{
vertices.Add(svg.Vertices[i]);
if (i < svg.Vertices.Count - 1)
renderer.RenderLine(svg.Vertices[0].Pos, svg.Vertices[i + 1].Pos, 1, new PixelColor(255, 255, 255, 255), true);
}
}
// Sort the slope vertex list and draw them. The sorting ensures that selected vertices are always drawn on top
foreach (SlopeVertex sv in vertices.OrderBy(o => o.Selected))
{
PixelColor c = General.Colors.Indication;
Vector3D v = sv.Pos;
renderer.RenderRectangleFilled(new RectangleF(v.x - size / 2, v.y - size / 2, size, size), General.Colors.Background, true);
renderer.RenderRectangle(new RectangleF(v.x - size / 2, v.y - size / 2, size, size), 2, c, true);
}
// Go for all points to draw lines
if (points.Count > 0)
{
// Render lines
lastp = points[0];
for (int i = 1; i < points.Count; i++)
{
// Determine line color
if (lastp.stitchline && points[i].stitchline) color = stitchcolor;
else color = losecolor;
// Render line
renderer.RenderLine(points[0].pos, points[i].pos, LINE_THICKNESS, color, true);
lastp = points[i];
}
// Determine line color
if (lastp.stitchline && snaptonearest) color = stitchcolor;
else color = losecolor;
// Render line to cursor
renderer.RenderLine(points[0].pos, curp.pos, LINE_THICKNESS, color, true);
// Render vertices
for (int i = 0; i < points.Count; i++)
{
// Determine vertex color
if (points[i].stitch) color = stitchcolor;
else color = losecolor;
// Render vertex
//renderer.RenderRectangleFilled(new RectangleF(points[i].pos.x - vsize, points[i].pos.y - vsize, vsize * 2.0f, vsize * 2.0f), color, true);
renderer.RenderRectangleFilled(new RectangleF(points[i].pos.x - size / 2, points[i].pos.y - size / 2, size, size), General.Colors.Background, true);
renderer.RenderRectangle(new RectangleF(points[i].pos.x - size / 2, points[i].pos.y - size / 2, size, size), 2, General.Colors.Indication, true);
}
}
foreach (TextLabel l in labels)
renderer.RenderText(l);
// Determine point color
if (snaptonearest) color = stitchcolor;
else color = losecolor;
// Render vertex at cursor
//renderer.RenderRectangleFilled(new RectangleF(curp.pos.x - vsize, curp.pos.y - vsize, vsize * 2.0f, vsize * 2.0f), color, true);
renderer.RenderRectangleFilled(new RectangleF(curp.pos.x - size / 2, curp.pos.y - size / 2, size, size), General.Colors.Background, true);
renderer.RenderRectangle(new RectangleF(curp.pos.x - size / 2, curp.pos.y - size / 2, size, size), 2, General.Colors.Indication, true);
// Done
renderer.Finish();
}
// Done
renderer.Present();
}
private void updateOverlaySurfaces()
{
ICollection<Sector> orderedselection = General.Map.Map.GetSelectedSectors(true);
List<FlatVertex> vertsList = new List<FlatVertex>();
// Go for all selected sectors
foreach (Sector s in orderedselection) vertsList.AddRange(s.FlatVertices);
overlayGeometry = vertsList.ToArray();
}
// This returns the aligned and snapped draw position
public static DrawnVertex GetCurrentPosition(Vector2D mousemappos, bool snaptonearest, bool snaptogrid, IRenderer2D renderer, List<DrawnVertex> points)
{
DrawnVertex p = new DrawnVertex();
Vector2D vm = mousemappos;
float vrange = BuilderPlug.Me.StitchRange / renderer.Scale;
// Snap to nearest?
if (snaptonearest)
{
// Go for all drawn points
foreach (DrawnVertex v in points)
{
if (Vector2D.DistanceSq(mousemappos, v.pos) < (vrange * vrange))
{
p.pos = v.pos;
p.stitch = true;
p.stitchline = true;
return p;
}
}
// Try the nearest vertex
Vertex nv = General.Map.Map.NearestVertexSquareRange(mousemappos, vrange);
if (nv != null)
{
p.pos = nv.Position;
p.stitch = true;
p.stitchline = true;
return p;
}
// Try the nearest linedef
Linedef nl = General.Map.Map.NearestLinedefRange(mousemappos, BuilderPlug.Me.StitchRange / renderer.Scale);
if (nl != null)
{
// Snap to grid?
if (snaptogrid)
{
// Get grid intersection coordinates
List<Vector2D> coords = nl.GetGridIntersections();
// Find nearest grid intersection
bool found = false;
float found_distance = float.MaxValue;
Vector2D found_coord = new Vector2D();
foreach (Vector2D v in coords)
{
Vector2D delta = mousemappos - v;
if (delta.GetLengthSq() < found_distance)
{
found_distance = delta.GetLengthSq();
found_coord = v;
found = true;
}
}
if (found)
{
// Align to the closest grid intersection
p.pos = found_coord;
p.stitch = true;
p.stitchline = true;
return p;
}
}
else
{
// Aligned to line
p.pos = nl.NearestOnLine(mousemappos);
p.stitch = true;
p.stitchline = true;
return p;
}
}
}
else
{
// Always snap to the first drawn vertex so that the user can finish a complete sector without stitching
if (points.Count > 0)
{
if (Vector2D.DistanceSq(mousemappos, points[0].pos) < (vrange * vrange))
{
p.pos = points[0].pos;
p.stitch = true;
p.stitchline = false;
return p;
}
}
}
// if the mouse cursor is outside the map bondaries check if the line between the last set point and the
// mouse cursor intersect any of the boundary lines. If it does, set the position to this intersection
if (points.Count > 0 &&
(mousemappos.x < General.Map.Config.LeftBoundary || mousemappos.x > General.Map.Config.RightBoundary ||
mousemappos.y > General.Map.Config.TopBoundary || mousemappos.y < General.Map.Config.BottomBoundary))
{
Line2D dline = new Line2D(mousemappos, points[points.Count - 1].pos);
bool foundintersection = false;
float u = 0.0f;
List<Line2D> blines = new List<Line2D>();
// lines for left, top, right and bottom bondaries
blines.Add(new Line2D(General.Map.Config.LeftBoundary, General.Map.Config.BottomBoundary, General.Map.Config.LeftBoundary, General.Map.Config.TopBoundary));
blines.Add(new Line2D(General.Map.Config.LeftBoundary, General.Map.Config.TopBoundary, General.Map.Config.RightBoundary, General.Map.Config.TopBoundary));
blines.Add(new Line2D(General.Map.Config.RightBoundary, General.Map.Config.TopBoundary, General.Map.Config.RightBoundary, General.Map.Config.BottomBoundary));
blines.Add(new Line2D(General.Map.Config.RightBoundary, General.Map.Config.BottomBoundary, General.Map.Config.LeftBoundary, General.Map.Config.BottomBoundary));
// check for intersections with boundaries
for (int i = 0; i < blines.Count; i++)
{
if (!foundintersection)
{
// only check for intersection if the last set point is not on the
// line we are checking against
if (blines[i].GetSideOfLine(points[points.Count - 1].pos) != 0.0f)
{
foundintersection = blines[i].GetIntersection(dline, out u);
}
}
}
// if there was no intersection set the position to the last set point
if (!foundintersection)
vm = points[points.Count - 1].pos;
else
vm = dline.GetCoordinatesAt(u);
}
// Snap to grid?
if (snaptogrid)
{
// Aligned to grid
p.pos = General.Map.Grid.SnappedToGrid(vm);
// special handling
if (p.pos.x > General.Map.Config.RightBoundary) p.pos.x = General.Map.Config.RightBoundary;
if (p.pos.y < General.Map.Config.BottomBoundary) p.pos.y = General.Map.Config.BottomBoundary;
p.stitch = snaptonearest;
p.stitchline = snaptonearest;
return p;
}
else
{
// Normal position
p.pos = vm;
p.stitch = snaptonearest;
p.stitchline = snaptonearest;
return p;
}
}
// This gets the aligned and snapped draw position
private DrawnVertex GetCurrentPosition()
{
return GetCurrentPosition(mousemappos, snaptonearest, snaptogrid, renderer, points);
}
// This draws a point at a specific location
public bool DrawPointAt(DrawnVertex p)
{
return DrawPointAt(p.pos, p.stitch, p.stitchline);
}
// This draws a point at a specific location
public bool DrawPointAt(Vector2D pos, bool stitch, bool stitchline)
{
if (pos.x < General.Map.Config.LeftBoundary || pos.x > General.Map.Config.RightBoundary ||
pos.y > General.Map.Config.TopBoundary || pos.y < General.Map.Config.BottomBoundary)
return false;
DrawnVertex newpoint = new DrawnVertex();
newpoint.pos = pos;
newpoint.stitch = stitch;
newpoint.stitchline = stitchline;
points.Add(newpoint);
updateOverlaySurfaces();
Update();
if (points.Count == 3)
FinishDraw();
return true;
}
private bool IsControlSector(Sector s)
{
//Determine whether or not the sector is actually a control sector for a 3D floor
foreach (Sidedef sd in s.Sidedefs)
{
if (sd.Line.Action == 160)
return true;
}
return false;
}
#endregion
#region ================== Events
public override void OnHelp()
{
General.ShowHelp("gzdb/features/classic_modes/mode_slopes.html");
}
// Engaging
public override void OnEngage()
{
base.OnEngage();
if (BuilderPlug.Me.SlopeDataSector == null || BuilderPlug.Me.SlopeDataSector.IsDisposed)
{
General.Map.UndoRedo.CreateUndo("Set up slope data sector");
SlopeDataSectorDialog sdsd = new SlopeDataSectorDialog();
DialogResult dr = sdsd.ShowDialog();
if (dr == DialogResult.Cancel)
{
General.Map.UndoRedo.WithdrawUndo();
General.Editing.CancelMode();
return;
}
if (dr == DialogResult.OK)
{
BuilderPlug.Me.SlopeDataSector = General.Map.Map.GetMarkedSectors(true)[0];
BuilderPlug.Me.StoreSlopeVertexGroupsInSector();
}
}
else
{
BuilderPlug.Me.LoadSlopeVertexGroupsFromSector();
}
EnableAutoPanning();
renderer.SetPresentation(Presentation.Standard);
// Convert geometry selection to sectors only
General.Map.Map.ConvertSelection(SelectionType.Sectors);
General.Interface.AddButton(BuilderPlug.Me.MenusForm.FloorSlope);
General.Interface.AddButton(BuilderPlug.Me.MenusForm.CeilingSlope);
General.Interface.AddButton(BuilderPlug.Me.MenusForm.FloorAndCeilingSlope);
BuilderPlug.Me.MenusForm.FloorSlope.Checked = false;
BuilderPlug.Me.MenusForm.CeilingSlope.Checked = false;
BuilderPlug.Me.MenusForm.FloorAndCeilingSlope.Checked = false;
if (slopedrawingmode == SlopeDrawingMode.Floor)
BuilderPlug.Me.MenusForm.FloorSlope.Checked = true;
else if (slopedrawingmode == SlopeDrawingMode.Ceiling)
BuilderPlug.Me.MenusForm.CeilingSlope.Checked = true;
else
BuilderPlug.Me.MenusForm.FloorAndCeilingSlope.Checked = true;
// Make text labels for sectors
SetupLabels();
updateOverlaySurfaces();
Update();
// Set cursor
General.Interface.SetCursor(Cursors.Cross);
}
// Disengaging
public override void OnDisengage()
{
base.OnDisengage();
General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.FloorSlope);
General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.CeilingSlope);
General.Interface.RemoveButton(BuilderPlug.Me.MenusForm.FloorAndCeilingSlope);
DisableAutoPanning();
}
// Cancelled
public override void OnCancel()
{
// Cancel base class
base.OnCancel();
// Return to previous stable mode
General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name);
}
// Accepted
public override void OnAccept()
{
Cursor.Current = Cursors.AppStarting;
General.Settings.FindDefaultDrawSettings();
// When points have been drawn
if (points.Count > 1)
{
// Make undo for the draw
General.Map.UndoRedo.CreateUndo("Draw slope");
List<SlopeVertex> sv_floor = new List<SlopeVertex>();
List<SlopeVertex> sv_ceiling = new List<SlopeVertex>();
// Fills the slope vertex list for both floor and ceiling slopes. Alos tried
// to determine the default z position of the vertex
List<Sector> selected = (List<Sector>)General.Map.Map.GetSelectedSectors(true);
if (selected.Count == 1 && IsControlSector(selected[0]))
{
//If a 3D floor control sector is selected, then just use the height of it directly
float zf = selected[0].FloorHeight;
float zc = selected[0].CeilHeight;
for (int i = 0; i < points.Count; i++)
{
sv_floor.Add(new SlopeVertex(points[i].pos, zf));
sv_ceiling.Add(new SlopeVertex(points[i].pos, zc));
}
} else {
//For normal sectors, grab the height of the sector each control handle lies within
for (int i = 0; i < points.Count; i++)
{
float zf = 0;
float zc = 0;
Sector s = General.Map.Map.GetSectorByCoordinates(points[i].pos);
if (s != null)
{
foreach (Sidedef sd in s.Sidedefs)
{
if (sd.Line.Line.GetSideOfLine(points[i].pos) == 0)
{
if (sd.Line.Back != null && !selected.Contains(sd.Line.Back.Sector))
{
zf = sd.Line.Back.Sector.FloorHeight;
zc = sd.Line.Back.Sector.CeilHeight;
}
else
{
zf = sd.Line.Front.Sector.FloorHeight;
zc = sd.Line.Front.Sector.CeilHeight;
}
}
}
}
sv_floor.Add(new SlopeVertex(points[i].pos, zf));
sv_ceiling.Add(new SlopeVertex(points[i].pos, zc));
}
}
// Create the floor slope vertex group and add it to all selected sectors
if (slopedrawingmode == SlopeDrawingMode.Floor || slopedrawingmode == SlopeDrawingMode.FloorAndCeiling)
{
int id = -1;
SlopeVertexGroup svg = BuilderPlug.Me.AddSlopeVertexGroup(sv_floor, out id);
svg.Sectors.Clear();
foreach (Sector s in selected)
{
// Make sure the field work with undo/redo
s.Fields.BeforeFieldsChange();
if (s.Fields.ContainsKey("user_floorplane_id"))
s.Fields.Remove("user_floorplane_id");
s.Fields.Add("user_floorplane_id", new UniValue(UniversalType.Integer, id));
// svg.Sectors.Add(s);
svg.AddSector(s, PlaneType.Floor);
}
}
// Create the ceiling slope vertex group and add it to all selected sectors
if (slopedrawingmode == SlopeDrawingMode.Ceiling || slopedrawingmode == SlopeDrawingMode.FloorAndCeiling)
{
int id = -1;
SlopeVertexGroup svg = BuilderPlug.Me.AddSlopeVertexGroup(sv_ceiling, out id);
svg.Sectors.Clear();
foreach (Sector s in selected)
{
// Make sure the field work with undo/redo
s.Fields.BeforeFieldsChange();
if (s.Fields.ContainsKey("user_ceilingplane_id"))
s.Fields.Remove("user_ceilingplane_id");
s.Fields.Add("user_ceilingplane_id", new UniValue(UniversalType.Integer, id));
// svg.Sectors.Add(s);
svg.AddSector(s, PlaneType.Ceiling);
}
}
BuilderPlug.Me.StoreSlopeVertexGroupsInSector();
// BuilderPlug.Me.UpdateSlopes();
// Clear selection
General.Map.Map.ClearAllSelected();
// Update cached values
General.Map.Map.Update();
// Map is changed
General.Map.IsChanged = true;
}
// Done
Cursor.Current = Cursors.Default;
// Return to original mode
General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name);
}
// This redraws the display
public override void OnRedrawDisplay()
{
renderer.RedrawSurface();
// Render lines
if (renderer.StartPlotter(true))
{
renderer.PlotLinedefSet(General.Map.Map.Linedefs);
renderer.PlotVerticesSet(General.Map.Map.Vertices);
renderer.Finish();
}
// Render things
if (renderer.StartThings(true))
{
renderer.RenderThingSet(General.Map.Map.Things, 1.0f);
renderer.Finish();
}
// Normal update
updateOverlaySurfaces();
Update();
}
// Mouse moving
public override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
updateOverlaySurfaces();
Update();
}
// When a key is released
public override void OnKeyUp(KeyEventArgs e)
{
base.OnKeyUp(e);
if ((snaptogrid != (General.Interface.ShiftState ^ General.Interface.SnapToGrid)) ||
(snaptonearest != (General.Interface.CtrlState ^ General.Interface.AutoMerge))) Update();
}
// When a key is pressed
public override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
if ((snaptogrid != (General.Interface.ShiftState ^ General.Interface.SnapToGrid)) ||
(snaptonearest != (General.Interface.CtrlState ^ General.Interface.AutoMerge))) Update();
}
#endregion
#region ================== Actions
[BeginAction("drawfloorslope")]
public void DrawFloorSlope()
{
slopedrawingmode = SlopeDrawingMode.Floor;
BuilderPlug.Me.MenusForm.CeilingSlope.Checked = false;
BuilderPlug.Me.MenusForm.FloorSlope.Checked = true;
BuilderPlug.Me.MenusForm.FloorAndCeilingSlope.Checked = false;
General.Interface.DisplayStatus(StatusType.Info, "Applying drawn slope to floor");
}
[BeginAction("drawceilingslope")]
public void DrawCeilingSlope()
{
slopedrawingmode = SlopeDrawingMode.Ceiling;
BuilderPlug.Me.MenusForm.CeilingSlope.Checked = true;
BuilderPlug.Me.MenusForm.FloorSlope.Checked = false;
BuilderPlug.Me.MenusForm.FloorAndCeilingSlope.Checked = false;
General.Interface.DisplayStatus(StatusType.Info, "Applying drawn slope to ceiling");
}
[BeginAction("drawfloorandceilingslope")]
public void DrawFloorAndCeilingSlope()
{
slopedrawingmode = SlopeDrawingMode.FloorAndCeiling;
BuilderPlug.Me.MenusForm.CeilingSlope.Checked = false;
BuilderPlug.Me.MenusForm.FloorSlope.Checked = false;
BuilderPlug.Me.MenusForm.FloorAndCeilingSlope.Checked = true;
General.Interface.DisplayStatus(StatusType.Info, "Applying drawn slope to floor and ceiling");
}
// Drawing a point
[BeginAction("drawslopepoint")]
public void DrawPoint()
{
// Mouse inside window?
if (General.Interface.MouseInDisplay)
{
DrawnVertex newpoint = GetCurrentPosition();
if (!DrawPointAt(newpoint)) General.Interface.DisplayStatus(StatusType.Warning, "Failed to draw point: outside of map boundaries.");
}
}
// Remove a point
//[BeginAction("removepoint")]
public void RemovePoint()
{
if (points.Count > 0) points.RemoveAt(points.Count - 1);
updateOverlaySurfaces();
Update();
}
// Finish drawing
[BeginAction("finishslopedraw")]
public void FinishDraw()
{
// Accept the changes
General.Editing.AcceptMode();
}
#endregion
}
}

View file

@ -0,0 +1,163 @@
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
partial class PreferencesForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tabs = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.sectorlabels = new System.Windows.Forms.ComboBox();
this.slopevertexlabels = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.tabs.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// tabs
//
this.tabs.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabs.Controls.Add(this.tabPage1);
this.tabs.Location = new System.Drawing.Point(12, 12);
this.tabs.Name = "tabs";
this.tabs.SelectedIndex = 0;
this.tabs.Size = new System.Drawing.Size(677, 454);
this.tabs.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox1);
this.tabPage1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(669, 428);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "3D Floor Plugin";
this.tabPage1.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.slopevertexlabels);
this.groupBox1.Controls.Add(this.sectorlabels);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(6, 6);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(305, 94);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Slope Mode";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(34, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(99, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Show sector labels:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(6, 49);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(127, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Show slope vertex labels:";
//
// sectorlabels
//
this.sectorlabels.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.sectorlabels.FormattingEnabled = true;
this.sectorlabels.Items.AddRange(new object[] {
"Always",
"Never",
"On slope vertex highlight"});
this.sectorlabels.Location = new System.Drawing.Point(139, 19);
this.sectorlabels.Name = "sectorlabels";
this.sectorlabels.Size = new System.Drawing.Size(155, 21);
this.sectorlabels.TabIndex = 2;
//
// slopevertexlabels
//
this.slopevertexlabels.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.slopevertexlabels.FormattingEnabled = true;
this.slopevertexlabels.Items.AddRange(new object[] {
"Always",
"Never",
"On slope vertex highlight"});
this.slopevertexlabels.Location = new System.Drawing.Point(139, 46);
this.slopevertexlabels.Name = "slopevertexlabels";
this.slopevertexlabels.Size = new System.Drawing.Size(155, 21);
this.slopevertexlabels.TabIndex = 3;
//
// label3
//
this.label3.Dock = System.Windows.Forms.DockStyle.Bottom;
this.label3.Location = new System.Drawing.Point(3, 68);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(299, 23);
this.label3.TabIndex = 4;
this.label3.Text = "Holding the Alt key will always show the labels";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// PreferencesForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(701, 478);
this.Controls.Add(this.tabs);
this.Name = "PreferencesForm";
this.Text = "PreferencesForm";
this.tabs.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabs;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox slopevertexlabels;
private System.Windows.Forms.ComboBox sectorlabels;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label3;
}
}

View file

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Windows;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public partial class PreferencesForm : DelayedForm
{
public PreferencesForm()
{
InitializeComponent();
sectorlabels.SelectedIndex = (int)BuilderPlug.Me.SectorLabelDisplayOption;
slopevertexlabels.SelectedIndex = (int)BuilderPlug.Me.SlopeVertexLabelDisplayOption;
}
#region ================== Methods
// When OK is pressed on the preferences dialog
// Prevent inlining, otherwise there are unexpected interactions with Assembly.GetCallingAssembly
// See https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getcallingassembly?view=netframework-4.6.1#remarks
[MethodImplAttribute(MethodImplOptions.NoInlining)]
public void OnAccept(PreferencesController controller)
{
// Write preferred settings
General.Settings.WritePluginSetting("sectorlabeldisplayoption", sectorlabels.SelectedIndex);
General.Settings.WritePluginSetting("slopevertexlabeldisplayoption", slopevertexlabels.SelectedIndex);
}
// This sets up the form with the preferences controller
public void Setup(PreferencesController controller)
{
// Add tab pages
foreach (TabPage p in tabs.TabPages)
{
controller.AddTab(p);
}
// Bind events
controller.OnAccept += OnAccept;
}
#endregion
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,63 @@
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
partial class ThreeDFloorPanel
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Komponenten-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.SuspendLayout();
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.flowLayoutPanel1.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flowLayoutPanel1.Location = new System.Drawing.Point(4, 4);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(242, 593);
this.flowLayoutPanel1.TabIndex = 0;
//
// ThreeDFloorPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.flowLayoutPanel1);
this.Name = "ThreeDFloorPanel";
this.Size = new System.Drawing.Size(249, 600);
this.ResumeLayout(false);
}
#endregion
public System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
}
}

View file

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.Plugins;
using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Data;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public partial class ThreeDFloorPanel : UserControl
{
public ThreeDFloorPanel()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,79 @@
#region ================== Copyright (c) 2014 Boris Iwanski
/*
* Copyright (c) 2014 Boris Iwanski
* 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
using System.Collections.Generic;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public class MergePoint
{
private Vector2D position;
private int floorheight;
private int ceilingheight;
private string floortexture;
private string ceilingtexture;
private List<ThreeDFloor> threedfloors;
public Vector2D Position { get { return position; } set { position = value; } }
public int FloorHeight { get { return floorheight; } set { floorheight = value; } }
public int CeilingHeight { get { return ceilingheight; } set { ceilingheight = value; } }
public string FloorTexture { get { return floortexture; } set { floortexture = value; } }
public string CeilingTexture { get { return ceilingtexture; } set { ceilingtexture = value; } }
public List<ThreeDFloor> ThreeDFloors { get { return threedfloors; } }
public MergePoint(Vector2D position)
{
this.position = position;
threedfloors = new List<ThreeDFloor>();
}
public void Update()
{
List<Sector> sectors = new List<Sector>();
foreach (Sector s in General.Map.Map.Sectors)
{
if (s.Intersect(position))
sectors.Add(s);
}
if (sectors.Count == 0)
return;
floorheight = sectors[0].FloorHeight;
ceilingheight = sectors[0].CeilHeight;
floortexture = sectors[0].FloorTexture;
ceilingtexture = sectors[0].CeilTexture;
foreach (Sector s in sectors)
{
if (s.FloorHeight < floorheight)
{
floorheight = s.FloorHeight;
floortexture = s.FloorTexture;
}
if (s.CeilHeight > ceilingheight)
{
ceilingheight = s.CeilHeight;
ceilingtexture = s.CeilTexture;
}
}
}
}
}

View file

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("ThreeDFloorMode")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ThreeDFloorMode")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("626ea88b-7e0f-4486-acca-32027c4133de")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]

View file

@ -0,0 +1,93 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ThreeDFloorMode.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ThreeDFloorMode.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Ceiling {
get {
object obj = ResourceManager.GetObject("Ceiling", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Floor {
get {
object obj = ResourceManager.GetObject("Floor", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap FloorAndCeiling {
get {
object obj = ResourceManager.GetObject("FloorAndCeiling", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View file

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Ceiling" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Ceiling.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Floor" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Floor.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FloorAndCeiling" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\FloorAndCeiling.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -0,0 +1,156 @@
//
// This file defines which actions there are, what description they have and
// some behaviour options. The Doom Builder core will bind to these actions
// with delegates (function pointers) where you use the BeginAction and
// EndAction attributes. This file must be named Actions.cfg and must be
// included in the plugin project as "Embedded Resource".
//
//
// Options:
//
// allowkeys: Allows the user to bind standard keys to this action.
// allowmouse: Allows the user to bind mouse buttons to this action.
// allowscroll: Allows the user to bind the scrollwheel to this action.
// disregardshift: This action will trigger regardless if Shift or Control is used.
// repeat: BeginAction will be called for automatic key repetition.
// default: Default key is only used when the action is loaded for the first
// time and the default key is not used by any other action.
//
// allowkeys and allowmouse are true by default, the others are false by default.
//
categories
{
threedfloorplugin = "3D Floor Plugin";
}
threedfloorhelpermode
{
title = "3D floor editing mode";
category = "threedfloorplugin";
description = "Edits 3D floors";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
threedslopemode
{
title = "Slope mode";
category = "threedfloorplugin";
description = "Edits slope vertex groups";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
drawslopesmode
{
title = "Draw slope mode";
category = "threedfloorplugin";
description = "Draws a slope vertex group";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
drawslopepoint
{
title = "Draw slope vertex";
category = "threedfloorplugin";
description = "Draws a slope vertex at the mousecursor position.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
disregardshift = true;
disregardcontrol = true;
}
drawfloorslope
{
title = "Draw Floor Slope";
category = "threedfloorplugin";
description = "The drawn slope will be applied to the floor";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
drawceilingslope
{
title = "Draw Ceiling Slope";
category = "threedfloorplugin";
description = "The drawn slope will be applied to the ceiling";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
drawfloorandceilingslope
{
title = "Draw Floor and Ceiling Slope";
category = "threedfloorplugin";
description = "The drawn slope will be applied to the floor and ceiling";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
finishslopedraw
{
title = "Finish Slope Drawing";
category = "threedfloorplugin";
description = "Finishes the slope drawing.";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
threedflipslope
{
title = "Flip 3D slope";
category = "threedfloorplugin";
}
cyclehighlighted3dfloorup
{
title = "Cycle highlighted 3D floor up";
category = "threedfloorplugin";
description = "Cycles up through the 3D floors of the currently highlighted sector";
allowkeys = true;
allowmouse = true;
allowscroll = true;
default = 131066;
}
cyclehighlighted3dfloordown
{
title = "Cycle highlighted 3D floor down";
category = "threedfloorplugin";
description = "Cycles down through the 3D floors of the currently highlighted sector";
allowkeys = true;
allowmouse = true;
allowscroll = true;
default = 131067;
}
relocate3dfloorcontrolsectors
{
title = "Relocate 3D floor control sectors";
category = "threedfloorplugin";
description = "Relocates the managed 3D floor control sectors to the current position of the control sector area";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}
select3dfloorcontrolsector
{
title = "Select 3D floor control sector";
category = "threedfloorplugin";
description = "Selects the control sector of the currently highlighted 3D floor. Removes all other selections";
allowkeys = true;
allowmouse = true;
allowscroll = true;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

View file

@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Geometry;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
class SectorLabelInfo
{
public bool Floor { get { return (planetypes & PlaneType.Floor) == PlaneType.Floor; } }
public bool Ceiling { get { return (planetypes & PlaneType.Ceiling) == PlaneType.Ceiling; } }
public bool Bottom { get { return (planetypes & PlaneType.Bottom) == PlaneType.Bottom; } }
public bool Top { get { return (planetypes & PlaneType.Top) == PlaneType.Top; } }
private PlaneType planetypes;
private Dictionary<PlaneType, List<SlopeVertexGroup>> slopevertexgroups;
public SectorLabelInfo()
{
planetypes = 0;
slopevertexgroups = new Dictionary<PlaneType, List<SlopeVertexGroup>>();
foreach (PlaneType pt in Enum.GetValues(typeof(PlaneType)))
slopevertexgroups.Add(pt, new List<SlopeVertexGroup>());
}
public void AddSlopeVertexGroup(PlaneType pt, SlopeVertexGroup svg)
{
if (!slopevertexgroups[pt].Contains(svg))
slopevertexgroups[pt].Add(svg);
planetypes |= pt;
}
public TextLabel[] CreateLabels(Sector sector, SlopeVertex slopevertex, float scale)
{
int numlabels = 0;
int loopcounter = 0;
PixelColor white = new PixelColor(255, 255, 255, 255);
// Count how many actual labels we have to create at each label position
foreach (PlaneType pt in Enum.GetValues(typeof(PlaneType)))
if ((planetypes & pt) == pt)
numlabels++;
// Split sectors can have multiple label positions, so we have to create
// numlabels labels for each position
TextLabel[] labels = new TextLabel[sector.Labels.Count * numlabels];
foreach (PlaneType pt in Enum.GetValues(typeof(PlaneType)))
{
if ((planetypes & pt) != pt)
continue;
bool highlighted = false;
foreach (SlopeVertexGroup svg in slopevertexgroups[pt])
if (svg.Vertices.Contains(slopevertex))
highlighted = true;
for (int i = 0; i < sector.Labels.Count; i++)
{
int apos = sector.Labels.Count * loopcounter + i;
Vector2D location = sector.Labels[i].position;
location.x += ((-6 * (numlabels-1)) + (loopcounter * 12)) * (1/scale);
labels[apos] = new TextLabel();
labels[apos].TransformCoords = true;
labels[apos].AlignX = TextAlignmentX.Center;
labels[apos].AlignY = TextAlignmentY.Middle;
labels[apos].BackColor = General.Colors.Background.WithAlpha(128);
labels[apos].Location = location;
if (highlighted)
labels[apos].Color = General.Colors.Highlight.WithAlpha(255);
else
labels[apos].Color = white;
if (pt == PlaneType.Floor)
labels[apos].Text = "F";
else if (pt == PlaneType.Ceiling)
labels[apos].Text = "C";
else if (pt == PlaneType.Bottom)
labels[apos].Text = "B";
else if (pt == PlaneType.Top)
labels[apos].Text = "T";
}
loopcounter++;
}
return labels;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,99 @@
#region ================== Namespaces
using System;
using System.Reflection;
using System.Collections.Generic;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Types;
#endregion
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public class SlopeVertex
{
#region ================== Variables
// private Vector2D pos;
private float x;
private float y;
private float z;
private bool selected;
#endregion
#region ================== Constructors
public SlopeVertex(Sector sector, int svgid, int vertexid)
{
string identifier;
List<string> list = new List<string> { "x", "y", "z" };
Type type = typeof(SlopeVertex);
this.x = 0;
this.y = 0;
this.z = 0;
this.selected = false;
// Read the x, y and z values
foreach (string str in list)
{
identifier = String.Format("user_svg{0}_v{1}_{2}", svgid, vertexid, str);
// Use reflection to set the variable to the value
type.GetField(str, BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this, sector.Fields.GetValue(identifier, 0.0f));
}
}
public SlopeVertex(Vector2D p, float z)
{
// this.pos = new Vector2D(p);
this.x = p.x;
this.y = p.y;
this.z = z;
this.selected = false;
}
#endregion
#region ================== Properties
public Vector2D Pos { get { return new Vector2D(x, y); } set { x = value.x; y = value.y; } }
public float Z { get { return z; } set { z = value; } }
public bool Selected { get { return selected; } set { selected = value; } }
#endregion
#region ================== Methods
public void StoreInSector(Sector sector, int svgid, int vertexid)
{
string identifier;
Dictionary<String, float> dict = new Dictionary<string, float>
{
{ "x", x },
{ "y", y },
{ "z", z }
};
// Make sure the field work with undo/redo
sector.Fields.BeforeFieldsChange();
// Process the x, y and z fields
foreach (KeyValuePair<string, float> kvp in dict)
{
identifier = String.Format("user_svg{0}_v{1}_{2}", svgid, vertexid, kvp.Key);
// Add or update the vertex field
if (sector.Fields.ContainsKey(identifier))
sector.Fields[identifier] = new UniValue(UniversalType.Float, kvp.Value);
else
sector.Fields.Add(identifier, new UniValue(UniversalType.Float, kvp.Value));
}
}
#endregion
}
}

View file

@ -0,0 +1,477 @@
#region ================== Namespaces
using System;
using System.Reflection;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Linq;
using System.Diagnostics;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Types;
#endregion
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public class SlopeVertexGroup
{
#region ================== Variables
private List<SlopeVertex> vertices;
private List<Sector> sectors;
private Dictionary<Sector, PlaneType> sectorplanes;
private List<Sector> taggedsectors; // For highlighting 3D floors
private int id;
private int height;
private Vertex anchorvertex;
private Vector2D anchor;
private bool reposition;
private bool spline;
#endregion
#region ================== Enums
#endregion
#region ================== Properties
public List<SlopeVertex> Vertices { get { return vertices; } set { vertices = value; ComputeHeight(); } }
public List<Sector> Sectors { get { return sectors; } set { sectors = value; } }
public Dictionary<Sector, PlaneType> SectorPlanes { get { return sectorplanes; } }
public List<Sector> TaggedSectors { get { return taggedsectors; } set { taggedsectors = value; } }
public int Id { get { return id; } }
public int Height { get { return height; } set { height = value; } }
public bool Reposition { get { return reposition; } set { reposition = value; } }
public bool Spline { get { return spline; }set { spline = value; } }
#endregion
#region ================== Constructors
public SlopeVertexGroup(int id, Sector sector)
{
List<string> list = new List<string> { "floor", "ceiling" };
Type type = typeof(SlopeVertexGroup);
this.id = id;
sectors = new List<Sector>();
sectorplanes = new Dictionary<Sector, PlaneType>();
taggedsectors = new List<Sector>();
vertices = new List<SlopeVertex>();
anchorvertex = null;
// There will always be at least two slope vertices, so add them here
vertices.Add(new SlopeVertex(sector, id, 0));
vertices.Add(new SlopeVertex(sector, id, 1));
// Check if there's a third slope vertex, and add it if there is
string vertexidentifier = String.Format("user_svg{0}_v2_x", id);
foreach (KeyValuePair<string, UniValue> kvp in sector.Fields)
{
if (kvp.Key == vertexidentifier)
{
vertices.Add(new SlopeVertex(sector, id, 2));
break;
}
}
// Get reposition value
reposition = sector.Fields.GetValue(String.Format("user_svg{0}_reposition", id), true);
// Get spline value
spline = sector.Fields.GetValue(String.Format("user_svg{0}_spline", id), false);
spline = false;
ComputeHeight();
FindSectors();
}
public SlopeVertexGroup(int id, List<SlopeVertex> vertices)
{
this.vertices = vertices;
this.id = id;
sectors = new List<Sector>();
sectorplanes = new Dictionary<Sector, PlaneType>();
taggedsectors = new List<Sector>();
anchorvertex = null;
height = 0;
ComputeHeight();
}
#endregion
#region ================== Methods
public void FindSectors()
{
if (sectors == null)
sectors = new List<Sector>();
else
sectors.Clear();
if (taggedsectors == null)
taggedsectors = new List<Sector>();
else
taggedsectors.Clear();
sectorplanes.Clear();
foreach (Sector s in General.Map.Map.Sectors)
{
bool onfloor = s.Fields.GetValue("user_floorplane_id", -1) == id;
bool onceiling = s.Fields.GetValue("user_ceilingplane_id", -1) == id;
PlaneType pt = 0;
if (!onfloor && !onceiling)
continue;
sectors.Add(s);
if (onfloor && onceiling)
pt = PlaneType.Floor | PlaneType.Ceiling;
else if (onfloor)
pt = PlaneType.Floor;
else if (onceiling)
pt = PlaneType.Ceiling;
sectorplanes.Add(s, pt);
GetTaggesSectors(s, pt);
}
}
public void RemovePlanes()
{
foreach (Sector s in sectors.ToList())
{
RemoveSector(s, this.sectorplanes[s]);
}
}
public void RemoveFromSectors()
{
foreach (Sector s in sectors.ToList())
{
RemoveSector(s, PlaneType.Floor);
RemoveSector(s, PlaneType.Ceiling);
}
}
private void GetTaggesSectors(Sector s, PlaneType pt)
{
// Check if the current sector is a 3D floor control sector. If that's the case also store the
// tagged sector(s). They will be used for highlighting in slope mode
foreach (Sidedef sd in s.Sidedefs)
{
if (sd.Line.Action == 160)
{
foreach (Sector ts in General.Map.Map.GetSectorsByTag(sd.Line.Args[0]))
{
if (!taggedsectors.Contains(ts))
taggedsectors.Add(ts);
if(!sectorplanes.ContainsKey(ts))
sectorplanes.Add(ts, pt);
}
}
}
}
public void AddSector(Sector s, PlaneType pt)
{
if (sectorplanes.ContainsKey(s))
{
pt |= sectorplanes[s];
sectorplanes.Remove(s);
}
if (sectors.Contains(s))
sectors.Remove(s);
sectorplanes.Add(s, pt);
sectors.Add(s);
GetTaggesSectors(s, pt);
ApplyToSectors();
}
public void RemoveSector(Sector s, PlaneType pt)
{
Debug.WriteLine("Removing from Sector " + s.Index.ToString() + ": " + pt.ToString());
if (sectorplanes.ContainsKey(s))
{
if (sectors.Contains(s) && sectorplanes[s] == pt)
{
sectors.Remove(s);
sectorplanes.Remove(s);
}
else
sectorplanes[s] &= ~pt;
}
if ((pt & PlaneType.Floor) == PlaneType.Floor)
{
s.FloorSlope = new Vector3D();
s.FloorSlopeOffset = 0;
s.Fields.Remove("user_floorplane_id");
}
if ((pt & PlaneType.Ceiling) == PlaneType.Ceiling)
{
s.CeilSlope = new Vector3D();
s.CeilSlopeOffset = 0;
s.Fields.Remove("user_ceilingplane_id");
}
}
public void RemoveUndoRedoUDMFFields(Sector s)
{
string fieldname = "";
string[] comp = new string[] { "x", "y", "z" };
if (s == null || s.IsDisposed)
return;
s.Fields.BeforeFieldsChange();
for (int i = 0; i < 3; i++)
{
foreach (string c in comp)
{
fieldname = string.Format("user_svg{0}_v{1}_{2}", id, i, c);
if (s.Fields.ContainsKey(fieldname))
s.Fields.Remove(fieldname);
}
}
// Remove reposition field
fieldname = string.Format("user_svg{0}_reposition", id);
if (s.Fields.ContainsKey(fieldname))
s.Fields.Remove(fieldname);
}
public void ApplyToSectors()
{
List<Sector> removesectors = new List<Sector>();
ComputeHeight();
foreach (Sector s in sectors)
{
bool hasplane = false;
if (sectorplanes.ContainsKey(s) && (sectorplanes[s] & PlaneType.Floor) == PlaneType.Floor)
{
hasplane = true;
if (s.Fields.ContainsKey("user_floorplane_id"))
s.Fields["user_floorplane_id"] = new UniValue(UniversalType.Integer, id);
else
s.Fields.Add("user_floorplane_id", new UniValue(UniversalType.Integer, id));
}
else if (s.Fields.ContainsKey("user_floorplane_id") && s.Fields.GetValue("user_floorplane_id", -1) == id)
{
s.Fields.Remove("user_floorplane_id");
}
if (sectorplanes.ContainsKey(s) && (sectorplanes[s] & PlaneType.Ceiling) == PlaneType.Ceiling)
{
hasplane = true;
if (s.Fields.ContainsKey("user_ceilingplane_id"))
s.Fields["user_ceilingplane_id"] = new UniValue(UniversalType.Integer, id);
else
s.Fields.Add("user_ceilingplane_id", new UniValue(UniversalType.Integer, id));
}
else if (s.Fields.ContainsKey("user_ceilingplane_id") && s.Fields.GetValue("user_ceilingplane_id", -1) == id)
{
s.Fields.Remove("user_ceilingplane_id");
}
if (!hasplane)
removesectors.Add(s);
}
foreach (Sector s in removesectors)
sectors.Remove(s);
foreach (Sector s in sectors)
BuilderPlug.Me.UpdateSlopes(s);
}
public void StoreInSector(Sector sector)
{
// Make sure the field work with undo/redo
sector.Fields.BeforeFieldsChange();
// Also store all slope vertices in the sector
for (int i = 0; i < vertices.Count; i++)
vertices[i].StoreInSector(sector, id, i);
string identifier = String.Format("user_svg{0}_reposition", id);
// Add, update, or delete the reposition field
if (reposition)
{
//default action
if (sector.Fields.ContainsKey(identifier))
sector.Fields.Remove(identifier);
}
else
{
if (sector.Fields.ContainsKey(identifier))
sector.Fields[identifier] = new UniValue(UniversalType.Boolean, reposition);
else
sector.Fields.Add(identifier, new UniValue(UniversalType.Boolean, reposition));
}
// Spline
identifier = String.Format("user_svg{0}_spline", id);
if (!spline && sector.Fields.ContainsKey(identifier))
sector.Fields.Remove(identifier);
else if (spline)
{
if (sector.Fields.ContainsKey(identifier))
sector.Fields[identifier] = new UniValue(UniversalType.Boolean, spline);
else
sector.Fields.Add(identifier, new UniValue(UniversalType.Boolean, spline));
}
}
public void SelectVertices(bool select)
{
foreach (SlopeVertex sv in vertices)
sv.Selected = select;
}
public bool GetAnchor()
{
anchorvertex = null;
if (sectors.Count == 0)
return false;
// Try to find a sector that contains a SV
/*
foreach (Sector s in sectors)
{
foreach (SlopeVertex sv in vertices)
{
if (s.Intersect(sv.Pos))
{
anchorvertex = s.Sidedefs.First().Line.Start;
anchor = new Vector2D(anchorvertex.Position);
return true;
}
}
}
*/
// Just grab the next best vertex
foreach (Sector s in sectors)
{
foreach (Sidedef sd in s.Sidedefs)
{
anchorvertex = sd.Line.Start;
anchor = new Vector2D(anchorvertex.Position);
return true;
}
}
return false;
}
public void RepositionByAnchor()
{
if (anchorvertex == null || !reposition)
return;
Vector2D diff = anchorvertex.Position - anchor;
if (diff.x == 0.0f && diff.y == 0.0f)
return;
foreach (SlopeVertex sv in vertices)
{
sv.Pos += diff;
}
anchorvertex = null;
}
public void ComputeHeight()
{
List<Vector3D> sp = new List<Vector3D>();
for (int i = 0; i < vertices.Count; i++)
{
sp.Add(new Vector3D(vertices[i].Pos.x, vertices[i].Pos.y,vertices[i].Z));
}
if (vertices.Count == 2)
{
float z = sp[0].z;
Line2D line = new Line2D(sp[0], sp[1]);
Vector3D perpendicular = line.GetPerpendicular();
Vector2D v = sp[0] + perpendicular;
sp.Add(new Vector3D(v.x, v.y, z));
}
Plane p = new Plane(sp[0], sp[1], sp[2], true);
float fheight = p.GetZ(GetCircumcenter(sp));
// If something went wrong with computing the height use the height
// of the first vertex as a workaround
if (float.IsNaN(fheight))
height = Convert.ToInt32(sp[0].z);
else
height = Convert.ToInt32(fheight);
}
private Vector2D GetCircumcenter(List<Vector3D> points)
{
float u_ray;
Line2D line1 = new Line2D(points[0], points[1]);
Line2D line2 = new Line2D(points[2], points[0]);
// Perpendicular bisectors
Line2D bisector1 = new Line2D(line1.GetCoordinatesAt(0.5f), line1.GetCoordinatesAt(0.5f) + line1.GetPerpendicular());
Line2D bisector2 = new Line2D(line2.GetCoordinatesAt(0.5f), line2.GetCoordinatesAt(0.5f) + line2.GetPerpendicular());
bisector1.GetIntersection(bisector2, out u_ray);
return bisector1.GetCoordinatesAt(u_ray);
}
public bool VerticesAreValid()
{
if (vertices.Count == 2 && vertices[0].Pos == vertices[1].Pos)
return false;
if (vertices.Count == 3)
{
float side = Line2D.GetSideOfLine(vertices[0].Pos, vertices[1].Pos, vertices[3].Pos);
if (side == 0.0f)
return false;
}
return true;
}
#endregion
}
}

View file

@ -0,0 +1,351 @@
#region ================== Copyright (c) 2014 Boris Iwanski
/*
* Copyright (c) 2014 Boris Iwanski
* 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.Plugins;
using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Data;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public class ThreeDFloor
{
private Sector sector;
private List<Sector> taggedsectors;
private List<Sector> sectorstotag;
private List<Sector> sectorstountag;
private string bordertexture;
private string topflat;
private string bottomflat;
private int type;
private int flags;
private int alpha;
private int brightness;
private int topheight;
private int bottomheight;
private bool isnew;
private bool rebuild;
private int udmftag;
private List<int> tags;
public static Rectangle controlsectorarea = new Rectangle(-512, 512, 512, -512);
public Sector Sector { get { return sector; } }
public List<Sector> TaggedSectors { get { return taggedsectors; } set { taggedsectors = value; } }
public List<Sector> SectorsToTag { get { return sectorstotag; } set { sectorstotag = value; } }
public List<Sector> SectorsToUntag { get { return sectorstountag; } set { sectorstountag = value; } }
public string BorderTexture { get { return bordertexture; } set { bordertexture = value; } }
public string TopFlat { get { return topflat; } set { topflat = value; } }
public string BottomFlat { get { return bottomflat; } set { bottomflat = value; } }
public int Type { get { return type; } set { type = value; } }
public int Flags { get { return flags; } set { flags = value; } }
public int Alpha { get { return alpha; } set { alpha = value; } }
public int Brightness { get { return brightness; }set { brightness = value; } }
public int TopHeight { get { return topheight; } set { topheight = value; } }
public int BottomHeight { get { return bottomheight; } set { bottomheight = value; } }
public bool IsNew { get { return isnew; } set { isnew = value; } }
public bool Rebuild { get { return rebuild; } set { rebuild = value; } }
public int UDMFTag { get { return udmftag; } set { udmftag = value; } }
public List<int> Tags { get { return tags; } set { tags = value; } }
public ThreeDFloor()
{
sector = null;
taggedsectors = new List<Sector>();
topflat = General.Settings.DefaultCeilingTexture;
bottomflat = General.Settings.DefaultFloorTexture;
topheight = General.Settings.DefaultCeilingHeight;
bottomheight = General.Settings.DefaultFloorHeight;
bordertexture = General.Settings.DefaultTexture;
type = 1;
flags = 0;
tags = new List<int>();
alpha = 255;
}
public ThreeDFloor(Sector sector)
{
if (sector == null)
throw new Exception("Sector can't be null");
this.sector = sector;
taggedsectors = new List<Sector>();
topflat = sector.CeilTexture;
bottomflat = sector.FloorTexture;
topheight = sector.CeilHeight;
bottomheight = sector.FloorHeight;
brightness = sector.Brightness;
tags = new List<int>();
foreach (Sidedef sd in sector.Sidedefs)
{
if (sd.Line.Action == 160)
{
bordertexture = sd.MiddleTexture;
udmftag = sd.Line.Args[0];
type = sd.Line.Args[1];
flags = sd.Line.Args[2];
alpha = sd.Line.Args[3];
foreach (Sector s in General.Map.Map.GetSectorsByTag(sd.Line.Args[0]))
{
if(!taggedsectors.Contains(s))
taggedsectors.Add(s);
}
}
}
}
public void BindTag(int tag)
{
Linedef line = null;
// try to find an line without an action
foreach (Sidedef sd in sector.Sidedefs)
{
if (sd.Line.Action == 0 && sd.Line.Tag == 0 && line == null)
line = sd.Line;
// if a line of the control sector already has the tag
// nothing has to be done
if (sd.Line.Args[0] == tag)
{
return;
}
}
// no lines without an action, so a line has to get split
// find the longest line to split
if (line == null)
{
line = sector.Sidedefs.First().Line;
foreach (Sidedef sd in sector.Sidedefs)
{
if (sd.Line.Length > line.Length)
line = sd.Line;
}
// Lines may not have a length of less than 1 after splitting
if (line.Length / 2 < 1)
throw new Exception("Can't split more lines in Sector " + line.Front.Sector.Index.ToString() + ".");
Vertex v = General.Map.Map.CreateVertex(line.Line.GetCoordinatesAt(0.5f));
v.SnapToAccuracy();
line = line.Split(v);
General.Map.Map.Update();
General.Interface.RedrawDisplay();
}
line.Action = 160;
line.Args[0] = tag;
line.Args[1] = type;
line.Args[2] = flags;
line.Args[3] = alpha;
}
public void UpdateGeometry()
{
if (sector == null)
throw new Exception("3D floor has no geometry");
sector.CeilHeight = topheight;
sector.FloorHeight = bottomheight;
sector.SetCeilTexture(topflat);
sector.SetFloorTexture(bottomflat);
sector.Brightness = brightness;
sector.Tags = tags;
foreach (Sidedef sd in sector.Sidedefs)
{
sd.SetTextureMid(bordertexture);
if (sd.Line.Action == 160)
{
sd.Line.Args[1] = type;
sd.Line.Args[2] = flags;
sd.Line.Args[3] = alpha;
}
}
}
public bool CreateGeometry(List<int> tagblacklist)
{
List<DrawnVertex> drawnvertices = new List<DrawnVertex>();
List<Vertex> vertices = new List<Vertex>();
Vector3D slopetopthingpos = new Vector3D(0, 0, 0);
Vector3D slopebottomthingpos = new Vector3D(0, 0, 0);
Line2D slopeline = new Line2D(0, 0, 0, 0);
drawnvertices = BuilderPlug.Me.ControlSectorArea.GetNewControlSectorVertices();
if (Tools.DrawLines(drawnvertices) == false)
{
General.Interface.DisplayStatus(StatusType.Warning, "Could not draw new sector");
return false;
}
sector = General.Map.Map.GetMarkedSectors(true)[0];
sector.FloorHeight = bottomheight;
sector.CeilHeight = topheight;
sector.SetFloorTexture(bottomflat);
sector.SetCeilTexture(topflat);
foreach (Sidedef sd in sector.Sidedefs)
{
sd.Line.Front.SetTextureMid(bordertexture);
}
if (!sector.Fields.ContainsKey("user_managed_3d_floor"))
sector.Fields.Add("user_managed_3d_floor", new UniValue(UniversalType.Boolean, true));
sector.Fields["comment"] = new UniValue(UniversalType.String, "[!]DO NOT DELETE! This sector is managed by the 3D floor plugin.");
// With multiple tag support in UDMF only one tag is needed, so bind it right away
if (General.Map.UDMF == true)
{
if(isnew)
udmftag = BuilderPlug.Me.ControlSectorArea.GetNewSectorTag(tagblacklist);
BindTag(udmftag);
}
// Snap to map format accuracy
General.Map.Map.SnapAllToAccuracy();
General.Map.Map.BeginAddRemove();
//MapSet.JoinVertices(vertices, vertices, false, MapSet.STITCH_DISTANCE);
General.Map.Map.EndAddRemove();
// Update textures
General.Map.Data.UpdateUsedTextures();
// Update caches
General.Map.Map.Update();
General.Interface.RedrawDisplay();
General.Map.IsChanged = true;
return true;
}
public void Cleanup()
{
int taggedLines = 0;
foreach (Sidedef sd in sector.Sidedefs)
{
if (sd.Line.Action == 160 && General.Map.Map.GetSectorsByTag(sd.Line.Args[0]).Count == 0)
{
sd.Line.Action = 0;
for (int i = 0; i < 5; i++)
sd.Line.Args[i] = 0;
}
if (sd.Line.Action != 0)
taggedLines++;
}
if (taggedLines == 0)
{
DeleteControlSector(sector);
}
}
private void DeleteControlSector(Sector sector)
{
if (sector == null)
return;
General.Map.Map.BeginAddRemove();
// Get all the linedefs
List<Linedef> lines = new List<Linedef>(sector.Sidedefs.Count);
foreach (Sidedef side in sector.Sidedefs) lines.Add(side.Line);
// Dispose the sector
sector.Dispose();
// Check all the lines
for (int i = lines.Count - 1; i >= 0; i--)
{
// If the line has become orphaned, remove it
if ((lines[i].Front == null) && (lines[i].Back == null))
{
// Remove line
lines[i].Dispose();
}
else
{
// If the line only has a back side left, flip the line and sides
if ((lines[i].Front == null) && (lines[i].Back != null))
{
lines[i].FlipVertices();
lines[i].FlipSidedefs();
}
// Check textures.
if (lines[i].Front.MiddleRequired() && (lines[i].Front.MiddleTexture.Length == 0 || lines[i].Front.MiddleTexture == "-"))
{
if (lines[i].Front.HighTexture.Length > 0 && lines[i].Front.HighTexture != "-")
{
lines[i].Front.SetTextureMid(lines[i].Front.HighTexture);
}
else if (lines[i].Front.LowTexture.Length > 0 && lines[i].Front.LowTexture != "-")
{
lines[i].Front.SetTextureMid(lines[i].Front.LowTexture);
}
}
// Do we still need high/low textures?
lines[i].Front.RemoveUnneededTextures(false);
// Update sided flags
lines[i].ApplySidedFlags();
}
}
General.Map.Map.EndAddRemove();
// Update cache values
General.Map.IsChanged = true;
General.Map.Map.Update();
}
public void DeleteControlSector()
{
DeleteControlSector(sector);
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,259 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{88CFD996-027B-4CBE-9828-26B2728B6127}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ThreeDFloorMode</RootNamespace>
<AssemblyName>ThreeDFloorMode</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\..\..\Build\Plugins\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BuilderPlug.cs" />
<Compile Include="ControlSectorArea.cs" />
<Compile Include="Controls\ThreeDFloorTooltipControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\ThreeDFloorTooltipControl.Designer.cs">
<DependentUpon>ThreeDFloorTooltipControl.cs</DependentUpon>
</Compile>
<Compile Include="DrawSlopesMode.cs" />
<Compile Include="Interface\PreferencesForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Interface\PreferencesForm.Designer.cs">
<DependentUpon>PreferencesForm.cs</DependentUpon>
</Compile>
<Compile Include="Interface\ThreeDFloorPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Interface\ThreeDFloorPanel.Designer.cs">
<DependentUpon>ThreeDFloorPanel.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Controls\ThreeDFloorControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\ThreeDFloorControl.Designer.cs">
<DependentUpon>ThreeDFloorControl.cs</DependentUpon>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="SectorLabelInfo.cs" />
<Compile Include="SlopeMode.cs" />
<Compile Include="SlopeVertex.cs" />
<Compile Include="SlopeVertexGroup.cs" />
<Compile Include="ThreeDFloor.cs" />
<Compile Include="ThreeDFloorMode.cs" />
<Compile Include="Windows\ControlSectorAreaConfig.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Windows\ControlSectorAreaConfig.Designer.cs">
<DependentUpon>ControlSectorAreaConfig.cs</DependentUpon>
</Compile>
<Compile Include="Windows\MenusForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Windows\MenusForm.Designer.cs">
<DependentUpon>MenusForm.cs</DependentUpon>
</Compile>
<Compile Include="Windows\SlopeDataSectorDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Windows\SlopeDataSectorDialog.Designer.cs">
<DependentUpon>SlopeDataSectorDialog.cs</DependentUpon>
</Compile>
<Compile Include="Windows\SlopeVertexEditForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Windows\SlopeVertexEditForm.Designer.cs">
<DependentUpon>SlopeVertexEditForm.cs</DependentUpon>
</Compile>
<Compile Include="Windows\ThreeDFloorEditorWindow.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Windows\ThreeDFloorEditorWindow.Designer.cs">
<DependentUpon>ThreeDFloorEditorWindow.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Controls\ThreeDFloorControl.resx">
<DependentUpon>ThreeDFloorControl.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Interface\PreferencesForm.resx">
<DependentUpon>PreferencesForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Actions.cfg" />
<EmbeddedResource Include="Windows\ThreeDFloorEditorWindow.resx">
<DependentUpon>ThreeDFloorEditorWindow.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Controls\ThreeDFloorTooltipControl.resx">
<DependentUpon>ThreeDFloorTooltipControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Interface\ThreeDFloorPanel.resx">
<DependentUpon>ThreeDFloorPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Resources\ThreeDFloorIcon.png" />
<EmbeddedResource Include="Windows\ControlSectorAreaConfig.resx">
<DependentUpon>ControlSectorAreaConfig.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Windows\SlopeVertexEditForm.resx">
<DependentUpon>SlopeVertexEditForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\SlopeModeIcon.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\DrawSlopeModeIcon.png" />
<EmbeddedResource Include="Windows\MenusForm.resx">
<DependentUpon>MenusForm.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Ceiling.png" />
<EmbeddedResource Include="Resources\Floor.png" />
<EmbeddedResource Include="Resources\FloorAndCeiling.png" />
<EmbeddedResource Include="Windows\SlopeDataSectorDialog.resx">
<DependentUpon>SlopeDataSectorDialog.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\Builder.csproj">
<Project>{818b3d10-f791-4c3f-9af5-bb2d0079b63c}</Project>
<Name>Builder</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\BuilderEffects\BuilderEffects.csproj">
<Project>{b859be0f-a992-476d-a642-fa8efe94aaa5}</Project>
<Name>BuilderEffects</Name>
</ProjectReference>
<ProjectReference Include="..\BuilderModes\BuilderModes.csproj">
<Project>{b42d5aa0-f9a6-4234-9c4b-a05b11a64851}</Project>
<Name>BuilderModes</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,161 @@
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
partial class ControlSectorAreaConfig
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.lastTag = new CodeImp.DoomBuilder.Controls.NumericTextbox();
this.firstTag = new CodeImp.DoomBuilder.Controls.NumericTextbox();
this.useTagRange = new System.Windows.Forms.CheckBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.lastTag);
this.groupBox1.Controls.Add(this.firstTag);
this.groupBox1.Controls.Add(this.useTagRange);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(225, 57);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(120, 27);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(27, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Last";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 27);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(26, 13);
this.label1.TabIndex = 3;
this.label1.Text = "First";
//
// lastTag
//
this.lastTag.AllowDecimal = false;
this.lastTag.AllowNegative = false;
this.lastTag.AllowRelative = false;
this.lastTag.Enabled = false;
this.lastTag.ImeMode = System.Windows.Forms.ImeMode.Off;
this.lastTag.Location = new System.Drawing.Point(153, 24);
this.lastTag.Name = "lastTag";
this.lastTag.Size = new System.Drawing.Size(62, 20);
this.lastTag.TabIndex = 2;
//
// firstTag
//
this.firstTag.AllowDecimal = false;
this.firstTag.AllowNegative = false;
this.firstTag.AllowRelative = false;
this.firstTag.Enabled = false;
this.firstTag.ImeMode = System.Windows.Forms.ImeMode.Off;
this.firstTag.Location = new System.Drawing.Point(38, 24);
this.firstTag.Name = "firstTag";
this.firstTag.Size = new System.Drawing.Size(62, 20);
this.firstTag.TabIndex = 1;
//
// useTagRange
//
this.useTagRange.AutoSize = true;
this.useTagRange.Location = new System.Drawing.Point(7, 1);
this.useTagRange.Name = "useTagRange";
this.useTagRange.Size = new System.Drawing.Size(93, 17);
this.useTagRange.TabIndex = 0;
this.useTagRange.Text = "Use tag range";
this.useTagRange.UseVisualStyleBackColor = true;
this.useTagRange.CheckedChanged += new System.EventHandler(this.useTagRange_CheckedChanged);
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(47, 75);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 1;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(128, 75);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// ControlSectorAreaConfig
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(250, 109);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "ControlSectorAreaConfig";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Control Sector Area Configuration";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private CodeImp.DoomBuilder.Controls.NumericTextbox firstTag;
private System.Windows.Forms.CheckBox useTagRange;
private CodeImp.DoomBuilder.Controls.NumericTextbox lastTag;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
}
}

View file

@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public partial class ControlSectorAreaConfig : Form
{
private ControlSectorArea csa;
public ControlSectorAreaConfig(ControlSectorArea csa)
{
this.csa = csa;
InitializeComponent();
useTagRange.Checked = csa.UseCustomTagRnage;
firstTag.Text = csa.FirstTag.ToString();
lastTag.Text = csa.LastTag.ToString();
}
private void useTagRange_CheckedChanged(object sender, EventArgs e)
{
if (useTagRange.Checked)
{
firstTag.Enabled = true;
lastTag.Enabled = true;
}
else
{
firstTag.Enabled = false;
lastTag.Enabled = false;
}
}
private void cancelButton_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void okButton_Click(object sender, EventArgs e)
{
if (useTagRange.Checked && int.Parse(lastTag.Text) < int.Parse(firstTag.Text))
{
MessageBox.Show("Last tag of range must be bigger than first tag of range", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
csa.UseCustomTagRnage = useTagRange.Checked;
if (useTagRange.Checked)
{
csa.FirstTag = int.Parse(firstTag.Text);
csa.LastTag = int.Parse(lastTag.Text);
}
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,194 @@
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
partial class MenusForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MenusForm));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.floorslope = new System.Windows.Forms.ToolStripButton();
this.ceilingslope = new System.Windows.Forms.ToolStripButton();
this.floorandceilingslope = new System.Windows.Forms.ToolStripButton();
this.updateslopes = new System.Windows.Forms.ToolStripButton();
this.addsectorscontextmenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.addslopeceiling = new System.Windows.Forms.ToolStripMenuItem();
this.addslopefloor = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.removeslopeceiling = new System.Windows.Forms.ToolStripMenuItem();
this.removeslopefloor = new System.Windows.Forms.ToolStripMenuItem();
this.relocatecontrolsectors = new System.Windows.Forms.ToolStripButton();
this.toolStrip1.SuspendLayout();
this.addsectorscontextmenu.SuspendLayout();
this.SuspendLayout();
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.floorslope,
this.ceilingslope,
this.floorandceilingslope,
this.updateslopes,
this.relocatecontrolsectors});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(442, 25);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// floorslope
//
this.floorslope.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.floorslope.Image = global::ThreeDFloorMode.Properties.Resources.Floor;
this.floorslope.ImageTransparentColor = System.Drawing.Color.Magenta;
this.floorslope.Name = "floorslope";
this.floorslope.Size = new System.Drawing.Size(23, 22);
this.floorslope.Tag = "drawfloorslope";
this.floorslope.Text = "Apply drawn slope to floor";
this.floorslope.Click += new System.EventHandler(this.floorslope_Click);
//
// ceilingslope
//
this.ceilingslope.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.ceilingslope.Image = global::ThreeDFloorMode.Properties.Resources.Ceiling;
this.ceilingslope.ImageTransparentColor = System.Drawing.Color.Magenta;
this.ceilingslope.Name = "ceilingslope";
this.ceilingslope.Size = new System.Drawing.Size(23, 22);
this.ceilingslope.Tag = "drawceilingslope";
this.ceilingslope.Text = "Apply drawn slope to ceiling";
this.ceilingslope.Click += new System.EventHandler(this.ceilingslope_Click);
//
// floorandceilingslope
//
this.floorandceilingslope.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.floorandceilingslope.Image = global::ThreeDFloorMode.Properties.Resources.FloorAndCeiling;
this.floorandceilingslope.ImageTransparentColor = System.Drawing.Color.Magenta;
this.floorandceilingslope.Name = "floorandceilingslope";
this.floorandceilingslope.Size = new System.Drawing.Size(23, 22);
this.floorandceilingslope.Tag = "drawfloorandceilingslope";
this.floorandceilingslope.Text = "Apply drawn slope to floor and ceiling";
this.floorandceilingslope.Click += new System.EventHandler(this.floorandceilingslope_Click);
//
// updateslopes
//
this.updateslopes.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.updateslopes.Image = ((System.Drawing.Image)(resources.GetObject("updateslopes.Image")));
this.updateslopes.ImageTransparentColor = System.Drawing.Color.Magenta;
this.updateslopes.Name = "updateslopes";
this.updateslopes.Size = new System.Drawing.Size(85, 22);
this.updateslopes.Text = "Update slopes";
this.updateslopes.Click += new System.EventHandler(this.toolStripButton1_Click);
//
// addsectorscontextmenu
//
this.addsectorscontextmenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.addslopeceiling,
this.addslopefloor,
this.toolStripSeparator1,
this.removeslopeceiling,
this.removeslopefloor});
this.addsectorscontextmenu.Name = "addsectorscontextmenu";
this.addsectorscontextmenu.Size = new System.Drawing.Size(216, 98);
this.addsectorscontextmenu.Opening += new System.ComponentModel.CancelEventHandler(this.addsectorscontextmenu_Opening);
this.addsectorscontextmenu.Closing += new System.Windows.Forms.ToolStripDropDownClosingEventHandler(this.addsectorscontextmenu_Closing);
//
// addslopeceiling
//
this.addslopeceiling.Name = "addslopeceiling";
this.addslopeceiling.Size = new System.Drawing.Size(215, 22);
this.addslopeceiling.Text = "Add slope to ceiling";
this.addslopeceiling.Click += new System.EventHandler(this.ceilingToolStripMenuItem_Click);
//
// addslopefloor
//
this.addslopefloor.Name = "addslopefloor";
this.addslopefloor.Size = new System.Drawing.Size(215, 22);
this.addslopefloor.Text = "Add slope to floor";
this.addslopefloor.Click += new System.EventHandler(this.floorToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(212, 6);
//
// removeslopeceiling
//
this.removeslopeceiling.Name = "removeslopeceiling";
this.removeslopeceiling.Size = new System.Drawing.Size(215, 22);
this.removeslopeceiling.Text = "Remove slope from ceiling";
this.removeslopeceiling.Click += new System.EventHandler(this.removeSlopeFromCeilingToolStripMenuItem_Click);
//
// removeslopefloor
//
this.removeslopefloor.Name = "removeslopefloor";
this.removeslopefloor.Size = new System.Drawing.Size(215, 22);
this.removeslopefloor.Text = "Remove slope from floor";
this.removeslopefloor.Click += new System.EventHandler(this.removeSlopeFromFloorToolStripMenuItem_Click);
//
// relocatecontrolsectors
//
this.relocatecontrolsectors.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.relocatecontrolsectors.Image = ((System.Drawing.Image)(resources.GetObject("relocatecontrolsectors.Image")));
this.relocatecontrolsectors.ImageTransparentColor = System.Drawing.Color.Magenta;
this.relocatecontrolsectors.Name = "relocatecontrolsectors";
this.relocatecontrolsectors.Size = new System.Drawing.Size(137, 22);
this.relocatecontrolsectors.Tag = "relocate3dfloorcontrolsectors";
this.relocatecontrolsectors.Text = "Relocate control sectors";
this.relocatecontrolsectors.Click += new System.EventHandler(this.relocatecontrolsectors_Click);
//
// MenusForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(442, 262);
this.Controls.Add(this.toolStrip1);
this.Name = "MenusForm";
this.Text = "MenusForm";
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.addsectorscontextmenu.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton floorslope;
private System.Windows.Forms.ToolStripButton ceilingslope;
private System.Windows.Forms.ToolStripButton floorandceilingslope;
private System.Windows.Forms.ToolStripButton updateslopes;
private System.Windows.Forms.ContextMenuStrip addsectorscontextmenu;
private System.Windows.Forms.ToolStripMenuItem addslopefloor;
private System.Windows.Forms.ToolStripMenuItem addslopeceiling;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem removeslopeceiling;
private System.Windows.Forms.ToolStripMenuItem removeslopefloor;
private System.Windows.Forms.ToolStripButton relocatecontrolsectors;
}
}

View file

@ -0,0 +1,155 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public partial class MenusForm : Form
{
public ToolStripButton FloorSlope { get { return floorslope; } }
public ToolStripButton CeilingSlope { get { return ceilingslope; } }
public ToolStripButton FloorAndCeilingSlope { get { return floorandceilingslope; } }
public ToolStripButton UpdateSlopes { get { return updateslopes; } }
public ToolStripButton RelocateControlSectors { get { return relocatecontrolsectors; } }
public ContextMenuStrip AddSectorsContextMenu { get { return addsectorscontextmenu; } }
public MenusForm()
{
InitializeComponent();
}
private void InvokeTaggedAction(object sender, EventArgs e)
{
General.Interface.InvokeTaggedAction(sender, e);
}
private void floorslope_Click(object sender, EventArgs e)
{
if (floorslope.Checked)
return;
General.Interface.InvokeTaggedAction(sender, e);
}
private void ceilingslope_Click(object sender, EventArgs e)
{
if (ceilingslope.Checked)
return;
General.Interface.InvokeTaggedAction(sender, e);
}
private void floorandceilingslope_Click(object sender, EventArgs e)
{
if (floorandceilingslope.Checked)
return;
General.Interface.InvokeTaggedAction(sender, e);
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
BuilderPlug.Me.UpdateSlopes();
}
private void floorToolStripMenuItem_Click(object sender, EventArgs e)
{
List<SlopeVertexGroup> svgs = ((SlopeMode)General.Editing.Mode).GetSelectedSlopeVertexGroups();
// Can only add sectors to one slope vertex group
if (svgs.Count != 1)
return;
foreach (Sector s in (List<Sector>)addsectorscontextmenu.Tag)
{
SlopeVertexGroup rsvg = BuilderPlug.Me.GetSlopeVertexGroup(s);
if (rsvg != null)
rsvg.RemoveSector(s, PlaneType.Floor);
svgs[0].AddSector(s, PlaneType.Floor);
BuilderPlug.Me.UpdateSlopes(s);
}
General.Interface.RedrawDisplay();
}
private void removeSlopeFromFloorToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Sector s in (List<Sector>)addsectorscontextmenu.Tag)
{
SlopeVertexGroup svg = BuilderPlug.Me.GetSlopeVertexGroup(s);
if (svg != null)
svg.RemoveSector(s, PlaneType.Floor);
}
General.Interface.RedrawDisplay();
}
private void ceilingToolStripMenuItem_Click(object sender, EventArgs e)
{
List<SlopeVertexGroup> svgs = ((SlopeMode)General.Editing.Mode).GetSelectedSlopeVertexGroups();
// Can only add sectors to one slope vertex group
if (svgs.Count != 1)
return;
foreach (Sector s in (List<Sector>)addsectorscontextmenu.Tag)
{
SlopeVertexGroup rsvg = BuilderPlug.Me.GetSlopeVertexGroup(s);
if (rsvg != null)
rsvg.RemoveSector(s, PlaneType.Ceiling);
svgs[0].AddSector(s, PlaneType.Ceiling);
BuilderPlug.Me.UpdateSlopes(s);
}
General.Interface.RedrawDisplay();
}
private void removeSlopeFromCeilingToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Sector s in (List<Sector>)addsectorscontextmenu.Tag)
{
SlopeVertexGroup svg = BuilderPlug.Me.GetSlopeVertexGroup(s);
if(svg != null)
svg.RemoveSector(s, PlaneType.Ceiling);
}
General.Interface.RedrawDisplay();
}
private void addsectorscontextmenu_Opening(object sender, CancelEventArgs e)
{
// Disable adding if more than one slope vertex group is selected,
// otherwise enable adding
List<SlopeVertexGroup> svgs = ((SlopeMode)General.Editing.Mode).GetSelectedSlopeVertexGroups();
addslopefloor.Enabled = svgs.Count == 1;
addslopeceiling.Enabled = svgs.Count == 1;
}
private void addsectorscontextmenu_Closing(object sender, ToolStripDropDownClosingEventArgs e)
{
if( e.CloseReason != ToolStripDropDownCloseReason.ItemClicked &&
e.CloseReason != ToolStripDropDownCloseReason.Keyboard &&
e.CloseReason != ToolStripDropDownCloseReason.AppFocusChange)
((SlopeMode)General.Editing.Mode).ContextMenuClosing = true;
}
private void relocatecontrolsectors_Click(object sender, EventArgs e)
{
General.Interface.InvokeTaggedAction(sender, e);
}
}
}

View file

@ -0,0 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="updateslopes.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<data name="relocatecontrolsectors.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="addsectorscontextmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>122, 17</value>
</metadata>
</root>

View file

@ -0,0 +1,104 @@
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
partial class SlopeDataSectorDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.useselectedsector = new System.Windows.Forms.Button();
this.createnewsector = new System.Windows.Forms.Button();
this.cancel = new System.Windows.Forms.Button();
this.webBrowser1 = new System.Windows.Forms.WebBrowser();
this.SuspendLayout();
//
// useselectedsector
//
this.useselectedsector.Location = new System.Drawing.Point(147, 238);
this.useselectedsector.Name = "useselectedsector";
this.useselectedsector.Size = new System.Drawing.Size(129, 23);
this.useselectedsector.TabIndex = 2;
this.useselectedsector.Text = "Use selected sector";
this.useselectedsector.UseVisualStyleBackColor = true;
this.useselectedsector.Click += new System.EventHandler(this.button1_Click);
//
// createnewsector
//
this.createnewsector.Location = new System.Drawing.Point(12, 238);
this.createnewsector.Name = "createnewsector";
this.createnewsector.Size = new System.Drawing.Size(129, 23);
this.createnewsector.TabIndex = 1;
this.createnewsector.Text = "Create sector in CSA";
this.createnewsector.UseVisualStyleBackColor = true;
this.createnewsector.Click += new System.EventHandler(this.createnewsector_Click);
//
// cancel
//
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancel.Location = new System.Drawing.Point(282, 238);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(129, 23);
this.cancel.TabIndex = 3;
this.cancel.Text = "Cancel";
this.cancel.UseVisualStyleBackColor = true;
//
// webBrowser1
//
this.webBrowser1.Location = new System.Drawing.Point(12, 12);
this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser1.Name = "webBrowser1";
this.webBrowser1.ScrollBarsEnabled = false;
this.webBrowser1.Size = new System.Drawing.Size(399, 220);
this.webBrowser1.TabIndex = 4;
//
// SlopeDataSectorDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancel;
this.ClientSize = new System.Drawing.Size(423, 273);
this.Controls.Add(this.webBrowser1);
this.Controls.Add(this.cancel);
this.Controls.Add(this.createnewsector);
this.Controls.Add(this.useselectedsector);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SlopeDataSectorDialog";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Slope data sector";
this.Load += new System.EventHandler(this.SlopeDataSectorDialog_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button useselectedsector;
private System.Windows.Forms.Button createnewsector;
private System.Windows.Forms.Button cancel;
private System.Windows.Forms.WebBrowser webBrowser1;
}
}

View file

@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Windows;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public partial class SlopeDataSectorDialog : Form
{
public SlopeDataSectorDialog()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (General.Map.Map.SelectedSectorsCount == 0)
MessageBox.Show("No sectors selected. Please select exactly one sector", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
else if (General.Map.Map.SelectedSectorsCount > 1)
MessageBox.Show(General.Map.Map.SelectedSectorsCount.ToString() + " sectors selected. Please select exactly one sector", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
else
{
General.Map.Map.ClearAllMarks(false);
General.Map.Map.GetSelectedSectors(true).First().Marked = true;
this.DialogResult = DialogResult.OK;
this.Close();
}
}
private void SlopeDataSectorDialog_Load(object sender, EventArgs e)
{
webBrowser1.DocumentText = string.Format(System.Globalization.CultureInfo.GetCultureInfo("en-US"), @"
<style>
body {{ background-color:rgb({0},{1},{2}); font-family:{3}; font-size:12 }}
</style>
The map does not contain a slope data sector. This sector is required by the slope mode to store data for the slope vertex groups.
You have two options:
<ul>
<li>Use selected sector: uses the currently selected sector to store the slope data. <span style='color:red'>Make sure that this sector is only
used for this purpose! Do not edit or delete it!</span></li>
<li>Create sector in CSA: automatically creates a new sector in the control sector area. <span style='color:red'>Do not edit or delete it!</span></li>
</ul>
<b>Creating the sector in the CSA is the recommended method to use.</b>", this.BackColor.R, this.BackColor.G, this.BackColor.B, this.Font.Name);
}
private void createnewsector_Click(object sender, EventArgs e)
{
List<DrawnVertex> drawnvertices = new List<DrawnVertex>();
try
{
drawnvertices = BuilderPlug.Me.ControlSectorArea.GetNewControlSectorVertices();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
General.Map.Map.ClearAllMarks(false);
// DrawLines automatically marks the new sector, so we don't have to do it manually
if (Tools.DrawLines(drawnvertices) == false)
{
MessageBox.Show("Could not draw new sector", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
// Update textures
General.Map.Data.UpdateUsedTextures();
// Update caches
General.Map.Map.Update();
General.Interface.RedrawDisplay();
General.Map.IsChanged = true;
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,343 @@
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
partial class SlopeVertexEditForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.apply = new System.Windows.Forms.Button();
this.cancel = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.positionz = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.positiony = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.positionx = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.checkedListBoxSectors = new System.Windows.Forms.CheckedListBox();
this.reposition = new System.Windows.Forms.CheckBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.removeselectedsectorsceiling = new System.Windows.Forms.CheckBox();
this.addselectedsectorsceiling = new System.Windows.Forms.CheckBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.removeselectedsectorsfloor = new System.Windows.Forms.CheckBox();
this.addselectedsectorsfloor = new System.Windows.Forms.CheckBox();
this.spline = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.SuspendLayout();
//
// apply
//
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.apply.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.apply.Location = new System.Drawing.Point(260, 174);
this.apply.Name = "apply";
this.apply.Size = new System.Drawing.Size(112, 25);
this.apply.TabIndex = 0;
this.apply.Text = "OK";
this.apply.UseVisualStyleBackColor = true;
this.apply.Click += new System.EventHandler(this.apply_Click);
//
// cancel
//
this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancel.Location = new System.Drawing.Point(380, 174);
this.cancel.Name = "cancel";
this.cancel.Size = new System.Drawing.Size(112, 25);
this.cancel.TabIndex = 1;
this.cancel.Text = "Cancel";
this.cancel.UseVisualStyleBackColor = true;
this.cancel.Click += new System.EventHandler(this.cancel_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.positionz);
this.groupBox1.Controls.Add(this.positiony);
this.groupBox1.Controls.Add(this.positionx);
this.groupBox1.Location = new System.Drawing.Point(18, 13);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(149, 114);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Position";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label3.Location = new System.Drawing.Point(6, 87);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(17, 14);
this.label3.TabIndex = 15;
this.label3.Text = "Z:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(6, 57);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(17, 14);
this.label2.TabIndex = 14;
this.label2.Text = "Y:";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(6, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(17, 14);
this.label1.TabIndex = 13;
this.label1.Text = "X:";
//
// positionz
//
this.positionz.AllowDecimal = true;
this.positionz.AllowExpressions = false;
this.positionz.AllowNegative = true;
this.positionz.AllowRelative = true;
this.positionz.BackColor = System.Drawing.Color.Transparent;
this.positionz.ButtonStep = 8;
this.positionz.ButtonStepBig = 16F;
this.positionz.ButtonStepFloat = 8F;
this.positionz.ButtonStepSmall = 1F;
this.positionz.ButtonStepsUseModifierKeys = true;
this.positionz.ButtonStepsWrapAround = false;
this.positionz.Location = new System.Drawing.Point(29, 82);
this.positionz.Name = "positionz";
this.positionz.Size = new System.Drawing.Size(115, 24);
this.positionz.StepValues = null;
this.positionz.TabIndex = 0;
//
// positiony
//
this.positiony.AllowDecimal = true;
this.positiony.AllowExpressions = false;
this.positiony.AllowNegative = true;
this.positiony.AllowRelative = true;
this.positiony.BackColor = System.Drawing.Color.Transparent;
this.positiony.ButtonStep = 8;
this.positiony.ButtonStepBig = 16F;
this.positiony.ButtonStepFloat = 8F;
this.positiony.ButtonStepSmall = 1F;
this.positiony.ButtonStepsUseModifierKeys = true;
this.positiony.ButtonStepsWrapAround = false;
this.positiony.Location = new System.Drawing.Point(29, 52);
this.positiony.Name = "positiony";
this.positiony.Size = new System.Drawing.Size(115, 24);
this.positiony.StepValues = null;
this.positiony.TabIndex = 3;
//
// positionx
//
this.positionx.AllowDecimal = true;
this.positionx.AllowExpressions = false;
this.positionx.AllowNegative = true;
this.positionx.AllowRelative = true;
this.positionx.BackColor = System.Drawing.Color.Transparent;
this.positionx.ButtonStep = 8;
this.positionx.ButtonStepBig = 16F;
this.positionx.ButtonStepFloat = 8F;
this.positionx.ButtonStepSmall = 1F;
this.positionx.ButtonStepsUseModifierKeys = true;
this.positionx.ButtonStepsWrapAround = false;
this.positionx.Location = new System.Drawing.Point(29, 20);
this.positionx.Name = "positionx";
this.positionx.Size = new System.Drawing.Size(115, 24);
this.positionx.StepValues = null;
this.positionx.TabIndex = 2;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.checkedListBoxSectors);
this.groupBox2.Location = new System.Drawing.Point(174, 13);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(113, 149);
this.groupBox2.TabIndex = 2;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Sectors to remove";
//
// checkedListBoxSectors
//
this.checkedListBoxSectors.CheckOnClick = true;
this.checkedListBoxSectors.FormattingEnabled = true;
this.checkedListBoxSectors.Location = new System.Drawing.Point(6, 19);
this.checkedListBoxSectors.Name = "checkedListBoxSectors";
this.checkedListBoxSectors.Size = new System.Drawing.Size(100, 124);
this.checkedListBoxSectors.TabIndex = 1;
//
// reposition
//
this.reposition.AutoSize = true;
this.reposition.Location = new System.Drawing.Point(18, 178);
this.reposition.Name = "reposition";
this.reposition.Size = new System.Drawing.Size(187, 18);
this.reposition.TabIndex = 5;
this.reposition.Text = "Reposition after dragging sectors";
this.reposition.UseVisualStyleBackColor = true;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.removeselectedsectorsceiling);
this.groupBox3.Controls.Add(this.addselectedsectorsceiling);
this.groupBox3.Location = new System.Drawing.Point(297, 13);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(195, 71);
this.groupBox3.TabIndex = 8;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Ceiling";
//
// removeselectedsectorsceiling
//
this.removeselectedsectorsceiling.AutoSize = true;
this.removeselectedsectorsceiling.Location = new System.Drawing.Point(6, 43);
this.removeselectedsectorsceiling.Name = "removeselectedsectorsceiling";
this.removeselectedsectorsceiling.Size = new System.Drawing.Size(174, 18);
this.removeselectedsectorsceiling.TabIndex = 6;
this.removeselectedsectorsceiling.Text = "Remove from selected sectors";
this.removeselectedsectorsceiling.UseVisualStyleBackColor = true;
this.removeselectedsectorsceiling.CheckedChanged += new System.EventHandler(this.removeselectedsectorsceiling_CheckedChanged);
//
// addselectedsectorsceiling
//
this.addselectedsectorsceiling.AutoSize = true;
this.addselectedsectorsceiling.Location = new System.Drawing.Point(6, 19);
this.addselectedsectorsceiling.Name = "addselectedsectorsceiling";
this.addselectedsectorsceiling.Size = new System.Drawing.Size(150, 18);
this.addselectedsectorsceiling.TabIndex = 5;
this.addselectedsectorsceiling.Text = "Apply to selected sectors";
this.addselectedsectorsceiling.UseVisualStyleBackColor = true;
this.addselectedsectorsceiling.CheckedChanged += new System.EventHandler(this.addselectedsectorsceiling_CheckedChanged);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.removeselectedsectorsfloor);
this.groupBox4.Controls.Add(this.addselectedsectorsfloor);
this.groupBox4.Location = new System.Drawing.Point(297, 90);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(195, 72);
this.groupBox4.TabIndex = 9;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Floor";
//
// removeselectedsectorsfloor
//
this.removeselectedsectorsfloor.AutoSize = true;
this.removeselectedsectorsfloor.Location = new System.Drawing.Point(6, 43);
this.removeselectedsectorsfloor.Name = "removeselectedsectorsfloor";
this.removeselectedsectorsfloor.Size = new System.Drawing.Size(174, 18);
this.removeselectedsectorsfloor.TabIndex = 9;
this.removeselectedsectorsfloor.Text = "Remove from selected sectors";
this.removeselectedsectorsfloor.UseVisualStyleBackColor = true;
this.removeselectedsectorsfloor.CheckedChanged += new System.EventHandler(this.removeselectedsectorsfloor_CheckedChanged);
//
// addselectedsectorsfloor
//
this.addselectedsectorsfloor.AutoSize = true;
this.addselectedsectorsfloor.Location = new System.Drawing.Point(6, 19);
this.addselectedsectorsfloor.Name = "addselectedsectorsfloor";
this.addselectedsectorsfloor.Size = new System.Drawing.Size(150, 18);
this.addselectedsectorsfloor.TabIndex = 8;
this.addselectedsectorsfloor.Text = "Apply to selected sectors";
this.addselectedsectorsfloor.UseVisualStyleBackColor = true;
this.addselectedsectorsfloor.CheckedChanged += new System.EventHandler(this.addselectedsectorsfloor_CheckedChanged);
//
// spline
//
this.spline.AutoSize = true;
this.spline.Location = new System.Drawing.Point(18, 154);
this.spline.Name = "spline";
this.spline.Size = new System.Drawing.Size(55, 18);
this.spline.TabIndex = 10;
this.spline.Text = "Spline";
this.spline.UseVisualStyleBackColor = true;
this.spline.Visible = false;
//
// SlopeVertexEditForm
//
this.AcceptButton = this.apply;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancel;
this.ClientSize = new System.Drawing.Size(504, 211);
this.Controls.Add(this.spline);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.reposition);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.cancel);
this.Controls.Add(this.apply);
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "SlopeVertexEditForm";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Slope Vertex";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button apply;
private System.Windows.Forms.Button cancel;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
public CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox positionz;
public CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox positiony;
public CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox positionx;
private System.Windows.Forms.GroupBox groupBox2;
public System.Windows.Forms.CheckedListBox checkedListBoxSectors;
private System.Windows.Forms.CheckBox reposition;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox removeselectedsectorsceiling;
private System.Windows.Forms.CheckBox addselectedsectorsceiling;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.CheckBox removeselectedsectorsfloor;
private System.Windows.Forms.CheckBox addselectedsectorsfloor;
private System.Windows.Forms.CheckBox spline;
}
}

View file

@ -0,0 +1,222 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Map;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public partial class SlopeVertexEditForm : Form
{
private List<SlopeVertex> vertices;
private List<Sector> sectors;
private string undodescription;
private bool canaddsectors;
private bool canremovesectors;
public SlopeVertexEditForm()
{
InitializeComponent();
}
public void Setup(List<SlopeVertex> vertices)
{
this.vertices = vertices;
SlopeVertex fv = vertices[0];
SlopeVertexGroup fsvg = BuilderPlug.Me.GetSlopeVertexGroup(fv);
sectors = new List<Sector>();
undodescription = "Edit slope vertex";
if (vertices.Count > 1)
undodescription = "Edit " + vertices.Count + " slope vertices";
positionx.Text = fv.Pos.x.ToString();
positiony.Text = fv.Pos.y.ToString();
positionz.Text = fv.Z.ToString();
foreach (Sector s in fsvg.Sectors)
if (!sectors.Contains(s))
sectors.Add(s);
reposition.Checked = fsvg.Reposition;
spline.Checked = fsvg.Spline;
canaddsectors = true;
canremovesectors = true;
if (vertices.Count > 1)
{
List<SlopeVertexGroup> listsvgs = new List<SlopeVertexGroup>();
this.Text = "Edit slope vertices (" + vertices.Count.ToString() + ")";
foreach (SlopeVertex sv in vertices)
{
SlopeVertexGroup svg = BuilderPlug.Me.GetSlopeVertexGroup(sv);
if (!listsvgs.Contains(svg))
listsvgs.Add(svg);
if (sv.Pos.x.ToString() != positionx.Text)
positionx.Text = "";
if (sv.Pos.y.ToString() != positiony.Text)
positiony.Text = "";
if (sv.Z.ToString() != positionz.Text)
positionz.Text = "";
if (svg.Reposition != reposition.Checked)
reposition.CheckState = CheckState.Indeterminate;
if (svg.Spline)
spline.Enabled = true;
if (svg.Spline != spline.Checked)
spline.CheckState = CheckState.Indeterminate;
foreach (Sector s in svg.Sectors)
if (!sectors.Contains(s))
sectors.Add(s);
}
if (listsvgs.Count > 2)
{
canaddsectors = false;
canremovesectors = false;
}
}
foreach (Sector s in sectors.OrderBy(x => x.Index))
{
checkedListBoxSectors.Items.Add(s);
}
if (General.Map.Map.SelectedSectorsCount == 0)
{
addselectedsectorsceiling.Enabled = false;
removeselectedsectorsceiling.Enabled = false;
addselectedsectorsfloor.Enabled = false;
removeselectedsectorsfloor.Enabled = false;
}
else
{
addselectedsectorsceiling.Enabled = canaddsectors;
removeselectedsectorsceiling.Enabled = canremovesectors;
addselectedsectorsfloor.Enabled = canaddsectors;
removeselectedsectorsfloor.Enabled = canremovesectors;
}
}
private void apply_Click(object sender, EventArgs e)
{
List<SlopeVertexGroup> groups = new List<SlopeVertexGroup>();
// undodescription was set in the Setup method
General.Map.UndoRedo.CreateUndo(undodescription);
foreach (SlopeVertex sv in vertices)
{
SlopeVertexGroup svg = BuilderPlug.Me.GetSlopeVertexGroup(sv);
float x = positionx.GetResultFloat(sv.Pos.x);
float y = positiony.GetResultFloat(sv.Pos.y);
sv.Pos = new Vector2D(x, y);
sv.Z = positionz.GetResultFloat(sv.Z);
if (!groups.Contains(svg))
groups.Add(svg);
}
foreach (SlopeVertexGroup svg in groups)
{
if (reposition.CheckState != CheckState.Indeterminate)
svg.Reposition = reposition.Checked;
if (spline.CheckState != CheckState.Indeterminate && svg.Vertices.Count == 3)
svg.Spline = spline.Checked;
// Ceiling
if (addselectedsectorsceiling.Checked)
foreach (Sector s in General.Map.Map.GetSelectedSectors(true).ToList())
svg.AddSector(s, PlaneType.Ceiling);
if (removeselectedsectorsceiling.Checked)
foreach (Sector s in General.Map.Map.GetSelectedSectors(true).ToList())
if (svg.Sectors.Contains(s))
svg.RemoveSector(s, PlaneType.Ceiling);
// Floor
if (addselectedsectorsfloor.Checked)
foreach (Sector s in General.Map.Map.GetSelectedSectors(true).ToList())
svg.AddSector(s, PlaneType.Floor);
if (removeselectedsectorsfloor.Checked)
foreach (Sector s in General.Map.Map.GetSelectedSectors(true).ToList())
if (svg.Sectors.Contains(s))
svg.RemoveSector(s, PlaneType.Floor);
foreach (Sector s in checkedListBoxSectors.CheckedItems)
{
if (svg.Sectors.Contains(s))
{
svg.RemoveSector(s, PlaneType.Floor);
svg.RemoveSector(s, PlaneType.Ceiling);
}
}
svg.ApplyToSectors();
}
BuilderPlug.Me.StoreSlopeVertexGroupsInSector();
this.DialogResult = DialogResult.OK;
}
private void cancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
private void addselectedsectorsceiling_CheckedChanged(object sender, EventArgs e)
{
// Adding and removing selected sectors at the same time doesn't make sense,
// so make sure only one of the checkboxes is checked at most
if (addselectedsectorsceiling.Checked)
removeselectedsectorsceiling.Checked = false;
}
private void removeselectedsectorsceiling_CheckedChanged(object sender, EventArgs e)
{
// Adding and removing selected sectors at the same time doesn't make sense,
// so make sure only one of the checkboxes is checked at most
if (removeselectedsectorsceiling.Checked)
addselectedsectorsceiling.Checked = false;
}
private void addselectedsectorsfloor_CheckedChanged(object sender, EventArgs e)
{
// Adding and removing selected sectors at the same time doesn't make sense,
// so make sure only one of the checkboxes is checked at most
if (addselectedsectorsfloor.Checked)
removeselectedsectorsfloor.Checked = false;
}
private void removeselectedsectorsfloor_CheckedChanged(object sender, EventArgs e)
{
// Adding and removing selected sectors at the same time doesn't make sense,
// so make sure only one of the checkboxes is checked at most
if (removeselectedsectorsfloor.Checked)
addselectedsectorsfloor.Checked = false;
}
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,181 @@
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
partial class ThreeDFloorEditorWindow
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.threeDFloorPanel = new System.Windows.Forms.FlowLayoutPanel();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.addThreeDFloorButton = new System.Windows.Forms.Button();
this.sharedThreeDFloorsCheckBox = new System.Windows.Forms.CheckBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.no3dfloorspanel = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.add3dfloorbutton2 = new System.Windows.Forms.Button();
this.no3dfloorspanel.SuspendLayout();
this.SuspendLayout();
//
// threeDFloorPanel
//
this.threeDFloorPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.threeDFloorPanel.AutoScroll = true;
this.threeDFloorPanel.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.threeDFloorPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.threeDFloorPanel.Location = new System.Drawing.Point(12, 6);
this.threeDFloorPanel.Name = "threeDFloorPanel";
this.threeDFloorPanel.Size = new System.Drawing.Size(760, 500);
this.threeDFloorPanel.TabIndex = 0;
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(616, 513);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 3;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(697, 513);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 4;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// addThreeDFloorButton
//
this.addThreeDFloorButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.addThreeDFloorButton.Location = new System.Drawing.Point(12, 513);
this.addThreeDFloorButton.Name = "addThreeDFloorButton";
this.addThreeDFloorButton.Size = new System.Drawing.Size(75, 23);
this.addThreeDFloorButton.TabIndex = 1;
this.addThreeDFloorButton.Text = "Add 3D floor";
this.addThreeDFloorButton.UseVisualStyleBackColor = true;
this.addThreeDFloorButton.Click += new System.EventHandler(this.addThreeDFloorButton_Click);
//
// sharedThreeDFloorsCheckBox
//
this.sharedThreeDFloorsCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.sharedThreeDFloorsCheckBox.AutoSize = true;
this.sharedThreeDFloorsCheckBox.Location = new System.Drawing.Point(93, 517);
this.sharedThreeDFloorsCheckBox.Name = "sharedThreeDFloorsCheckBox";
this.sharedThreeDFloorsCheckBox.Size = new System.Drawing.Size(155, 17);
this.sharedThreeDFloorsCheckBox.TabIndex = 2;
this.sharedThreeDFloorsCheckBox.Text = "Show shared 3D floors only";
this.toolTip1.SetToolTip(this.sharedThreeDFloorsCheckBox, "If checked only shows the 3D floors that\r\nare shared among all selected sectors");
this.sharedThreeDFloorsCheckBox.UseVisualStyleBackColor = true;
this.sharedThreeDFloorsCheckBox.CheckedChanged += new System.EventHandler(this.sharedThreeDFloorsCheckBox_CheckedChanged);
//
// no3dfloorspanel
//
this.no3dfloorspanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.no3dfloorspanel.Controls.Add(this.add3dfloorbutton2);
this.no3dfloorspanel.Controls.Add(this.label1);
this.no3dfloorspanel.Location = new System.Drawing.Point(12, 6);
this.no3dfloorspanel.Name = "no3dfloorspanel";
this.no3dfloorspanel.Size = new System.Drawing.Size(760, 500);
this.no3dfloorspanel.TabIndex = 0;
//
// label1
//
this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(279, 212);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(227, 25);
this.label1.TabIndex = 0;
this.label1.Text = "There are no 3D floors";
//
// add3dfloorbutton2
//
this.add3dfloorbutton2.Anchor = System.Windows.Forms.AnchorStyles.None;
this.add3dfloorbutton2.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.add3dfloorbutton2.Location = new System.Drawing.Point(320, 254);
this.add3dfloorbutton2.Name = "add3dfloorbutton2";
this.add3dfloorbutton2.Size = new System.Drawing.Size(145, 33);
this.add3dfloorbutton2.TabIndex = 1;
this.add3dfloorbutton2.Text = "Add 3D floor";
this.add3dfloorbutton2.UseVisualStyleBackColor = true;
this.add3dfloorbutton2.Click += new System.EventHandler(this.addThreeDFloorButton_Click);
//
// ThreeDFloorEditorWindow
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(784, 548);
this.Controls.Add(this.no3dfloorspanel);
this.Controls.Add(this.sharedThreeDFloorsCheckBox);
this.Controls.Add(this.addThreeDFloorButton);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.threeDFloorPanel);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(800, 2000);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(800, 200);
this.Name = "ThreeDFloorEditorWindow";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "3D floors";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ThreeDFloorEditorWindow_FormClosed);
this.Load += new System.EventHandler(this.ThreeDFloorEditorWindow_Load);
this.no3dfloorspanel.ResumeLayout(false);
this.no3dfloorspanel.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.FlowLayoutPanel threeDFloorPanel;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button addThreeDFloorButton;
private System.Windows.Forms.CheckBox sharedThreeDFloorsCheckBox;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.Panel no3dfloorspanel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button add3dfloorbutton2;
}
}

View file

@ -0,0 +1,267 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using CodeImp.DoomBuilder.Windows;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Editing;
using CodeImp.DoomBuilder.Plugins;
using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.Data;
namespace CodeImp.DoomBuilder.ThreeDFloorMode
{
public partial class ThreeDFloorEditorWindow : Form
{
List<ThreeDFloor> threedfloors;
List<Sector> selectedsectors;
List<ThreeDFloorHelperControl> controlpool;
public List<Sector> SelectedSectors { get { return selectedsectors; } }
public List<ThreeDFloor> ThreeDFloors { get { return threedfloors; } set { threedfloors = value; } }
public ThreeDFloorEditorWindow()
{
this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width/2, Screen.PrimaryScreen.WorkingArea.Height/2);
controlpool = new List<ThreeDFloorHelperControl>();
InitializeComponent();
}
private void ThreeDFloorEditorWindow_Load(object sender, EventArgs e)
{
selectedsectors = new List<Sector>(General.Map.Map.GetSelectedSectors(true));
sharedThreeDFloorsCheckBox.Checked = false;
FillThreeDFloorPanel(threedfloors);
}
// Gets a control from the pool or creates a new one
private ThreeDFloorHelperControl GetThreeDFloorControl()
{
ThreeDFloorHelperControl ctrl = controlpool.FirstOrDefault(o => o.Used == false);
if (ctrl == null)
{
ctrl = new ThreeDFloorHelperControl();
ctrl.Used = true;
controlpool.Add(ctrl);
threeDFloorPanel.Controls.Add(ctrl);
}
else
{
ctrl.SetDefaults();
ctrl.Used = true;
}
return ctrl;
}
private void okButton_Click(object sender, EventArgs e)
{
threedfloors = new List<ThreeDFloor>();
foreach (ThreeDFloorHelperControl ctrl in threeDFloorPanel.Controls.OfType<ThreeDFloorHelperControl>())
{
if (ctrl.Used)
{
ctrl.ApplyToThreeDFloor();
threedfloors.Add(ctrl.ThreeDFloor);
}
}
this.DialogResult = DialogResult.OK;
this.Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
public void addThreeDFloorButton_Click(object sender, EventArgs e)
{
ThreeDFloorHelperControl ctrl = GetThreeDFloorControl();
ctrl.Show();
threeDFloorPanel.ScrollControlIntoView(ctrl);
no3dfloorspanel.Hide();
}
public void DuplicateThreeDFloor(ThreeDFloorHelperControl ctrl)
{
ThreeDFloorHelperControl dup = GetThreeDFloorControl();
dup.Update(ctrl);
dup.Show();
threeDFloorPanel.ScrollControlIntoView(dup);
}
public void SplitThreeDFloor(ThreeDFloorHelperControl ctrl)
{
var items = new List<int>();
var controls = new List<ThreeDFloorHelperControl>();
int numsplits = 0;
for (int i = 0; i < ctrl.checkedListBoxSectors.Items.Count; i++)
{
if(ctrl.checkedListBoxSectors.GetItemCheckState(i) == CheckState.Checked)
items.Add(i);
}
int useitem = items.Count - 1;
/*
Case 1: all tagged sectors are also selected sectors. In this case we can reuse
the original control, so one less additional control is needed
Case 2: multiple tagged sectors are also selected sectors. In this case we can
reuse the original control, so one less additional control is needed
Case 3: only one tagged sector is also the selected sector. In this case we
have to add exactly one additional control
*/
controls.Add(ctrl);
if (items.Count == 1)
{
numsplits = 1;
}
else
{
numsplits = items.Count - 1;
}
for (int i = 0; i < numsplits; i++)
{
var newctrl = GetThreeDFloorControl();
newctrl.Update(ctrl);
newctrl.Show();
controls.Add(newctrl);
}
for (int i = controls.Count - 1; i >= 0 ; i--)
{
for (int j = 0; j < items.Count; j++)
{
controls[i].checkedListBoxSectors.SetItemChecked(j, false);
}
if (useitem >= 0)
controls[i].checkedListBoxSectors.SetItemChecked(items[useitem], true);
useitem--;
}
}
public void DetachThreeDFloor(ThreeDFloorHelperControl ctrl)
{
ThreeDFloorHelperControl dup = GetThreeDFloorControl();
dup.Update(ctrl);
for (int i = 0; i < ctrl.checkedListBoxSectors.Items.Count; i++)
{
if (ctrl.checkedListBoxSectors.GetItemCheckState(i) == CheckState.Checked)
ctrl.checkedListBoxSectors.SetItemChecked(i, false);
}
dup.Show();
threeDFloorPanel.ScrollControlIntoView(dup);
}
private void FillThreeDFloorPanel(List<ThreeDFloor> threedfloors)
{
if (threedfloors.Count > 0)
{
// Create a new controller instance for each linedef and set its properties
foreach (ThreeDFloor tdf in threedfloors.OrderByDescending(o => o.TopHeight).ToList())
{
ThreeDFloorHelperControl ctrl = GetThreeDFloorControl();
ctrl.Update(tdf);
ctrl.Show();
}
no3dfloorspanel.Hide();
}
else
{
no3dfloorspanel.Show();
}
// Hide all unused pool controls
if (controlpool.Count - threedfloors.Count > 0)
{
foreach (ThreeDFloorHelperControl ctrl in controlpool.Skip(threedfloors.Count))
{
ctrl.Used = false;
ctrl.Hide();
}
}
}
private void sharedThreeDFloorsCheckBox_CheckedChanged(object sender, EventArgs e)
{
ICollection<Sector> selectedSectors = General.Map.Map.GetSelectedSectors(true);
if (selectedSectors.Count > 1 && sharedThreeDFloorsCheckBox.Checked)
{
var hideControls = new List<ThreeDFloorHelperControl>();
foreach (Sector s in selectedSectors)
{
foreach (ThreeDFloorHelperControl ctrl in threeDFloorPanel.Controls.OfType<ThreeDFloorHelperControl>())
{
// If the selected sector is not in the control's tagged sectors the control
// should be hidden
if (!ctrl.ThreeDFloor.TaggedSectors.Contains(s))
hideControls.Add(ctrl);
}
}
foreach (ThreeDFloorHelperControl ctrl in hideControls)
{
// Hide controls, unless they are new
if (ctrl.IsNew == false)
ctrl.Hide();
}
}
else
{
foreach (ThreeDFloorHelperControl ctrl in threeDFloorPanel.Controls.OfType<ThreeDFloorHelperControl>())
if (ctrl.Used)
ctrl.Show();
}
}
private void ThreeDFloorEditorWindow_FormClosed(object sender, FormClosedEventArgs e)
{
// Get rid of dummy sectors and makes all controls available
foreach (ThreeDFloorHelperControl ctrl in threeDFloorPanel.Controls.OfType<ThreeDFloorHelperControl>().ToList())
{
if (ctrl.Sector != null)
ctrl.Sector.Dispose();
ctrl.Used = false;
}
General.Map.Map.Update();
}
}
}

View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -123,6 +123,7 @@
<Compile Include="ClassicModes\DrawGeometryMode.cs" />
<Compile Include="ClassicModes\FindReplaceMode.cs" />
<Compile Include="ClassicModes\MakeSectorMode.cs" />
<Compile Include="ErrorChecks\BaseCheckTextures.cs" />
<Compile Include="ErrorChecks\CheckClosedSectors.cs" />
<Compile Include="ErrorChecks\CheckMissingActivations.cs" />
<Compile Include="ErrorChecks\CheckOffGridVertices.cs" />

View file

@ -895,11 +895,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Update texture offsets
if (transformoffsets)
{
Vector2D toffset = (selectionbasecenter - selectioncenter).GetRotated((texrotation + si.Rotation));
Vector2D soffset = si.Offset.GetRotated(texrotation + si.Rotation);
float trotation = rotateoffsets ? (si.Rotation + texrotation) : (si.Rotation);
Vector2D offset = selectioncenter.GetRotated(trotation);
fields["xpanning" + si.Part] = new UniValue(UniversalType.Float, (float)Math.Round(-offset.x, General.Map.FormatInterface.VertexDecimals));
fields["ypanning" + si.Part] = new UniValue(UniversalType.Float, (float)Math.Round(offset.y, General.Map.FormatInterface.VertexDecimals));
fields["xpanning" + si.Part] = new UniValue(UniversalType.Float, (float)Math.Round(soffset.x + toffset.x, General.Map.FormatInterface.VertexDecimals) % si.TextureSize.Width);
fields["ypanning" + si.Part] = new UniValue(UniversalType.Float, (float)Math.Round(-(soffset.y + toffset.y), General.Map.FormatInterface.VertexDecimals) % si.TextureSize.Height);
}
// Restore texture offsets
else

Some files were not shown because too many files have changed in this diff Show more