- Added 3D Floor Mode plugin

- Flipped top/bottom in 3D Floor Mode plugin dialogs to be consistent with the edit sector dialog
@ fixed all compiler warnings in 3D Floor Mode plugin
This commit is contained in:
biwa 2019-10-23 20:55:41 +02:00
parent 05a64b4ab8
commit 8b98ce09c1
50 changed files with 11322 additions and 1 deletions

View file

@ -35,226 +35,312 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutomapMode", "Source\Plugi
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vpo_dll", "Source\Plugins\vpo_dll\vpo_dll.vcxproj", "{29C8D76F-DE3D-482D-AD7D-B86BBD0824DE}"
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
{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

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,541 @@
#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.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
if (s.Fields.GetValue("user_managed_3d_floor", false) == false)
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);
}
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);
}
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("e_drawgeometry.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,48 @@
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;
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
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,342 @@
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;
//
// 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

@ -182,6 +182,15 @@ msbuild "Source\Plugins\TagRange\TagRange.csproj" /t:Rebuild /p:Configuration=Re
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\TagRange.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling 3D Floor Mode plugin...
ECHO.
IF EXIST "Build\Plugins\ThreeDFloorMode.dll" DEL /F /Q "Build\Plugins\ThreeDFloorMode.dll" > NUL
IF EXIST "Source\Plugins\3DFloorMode\obj" RD /S /Q "Source\Plugins\3DFloorMode\obj"
msbuild "Source\Plugins\3DFloorMode\ThreeDFloorMode.csproj" /t:Rebuild /p:Configuration=Release /p:Platform=%PLATFORM% /v:minimal
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Build\Plugins\ThreeDFloorMode.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling vpo_dll...
ECHO.
@ -191,7 +200,6 @@ msbuild "Source\Plugins\vpo_dll\vpo_dll.vcxproj" /t:Rebuild /p:Configuration=Rel
IF %ERRORLEVEL% NEQ 0 GOTO ERRORFAIL
IF NOT EXIST "Source\Plugins\VisplaneExplorer\Resources\vpo.dll" GOTO FILEFAIL
ECHO.
ECHO Compiling Visplane Explorer plugin...
ECHO.