Extending Dark Age World Editor with C#

Published October 14, 2009
Advertisement
I am pretty tired of doing all the GUI work in pure win32 so I wanted to use c# for the world editor.Converting all of it to C# isn't really an option because there is just too much code in it.So I decided to implement new dialogs with C# and run them from the C++ code with shell execute.

For example for an item editor or dialog editor I create a new c# application with one form then I modify this forms properties so that it looks like a popup window.Then I run it from the world editor.The changes I made to the form are as follows :
1-MinimizeBox = false
2-ShowIcon = false
3-ShowInTaskBar = false
4-Topmost = true

These settings make it look like a normal popup inside the editor.The only problem is it can be run multiple times and when the main application closes these popups stay open.I think I can find an elegant way to restrict only one app per world editor and send a close message to the c# apps when the world editor closes.

This will enable me to make much more advanced GUI elements in the world editor and hopefully speed up the progress of it.

Here is a screenshot showing the new c# dialog.The dialog on the top right is the regular win32 one the new one has a listview and a datagrid.

I will use c# apps for things that don't need data from the main application so that I won't have to deal with passing data around.For example the item editor can be done this way.It will read the item data from the disk and modify everything.The world editor is using IDs to add items so it just needs to reload the item list which holds ids and it should be all good [smile]

0 likes 3 comments

Comments

Moe
Very nice. I have to hand it to you - working on tools like that isn't always the most exciting or glamorous thing to do, but you seem to do quite well at it. It's also a bit of a shame that you didn't start writing the editor in C#.

Roughly how much C++ code is there that would need converting if you were to convert it to C#?
October 15, 2009 09:09 AM
Black Knight
The whole project is around 30k lines of code.And converting to C# is not just converting the GUI because all the rendering is done in C++ Direct3D so I have to wrap them up too or write it from scratch in C#+XNA or SlimDX etc.

Oh and BTW when I started this project back in 2002 C# wasnt really very popular and there wasn't much resources about it.
October 15, 2009 10:09 AM
Moe
Quote:Original post by Black Knight
The whole project is around 30k lines of code.And converting to C# is not just converting the GUI because all the rendering is done in C++ Direct3D so I have to wrap them up too or write it from scratch in C#+XNA or SlimDX etc.

Oh and BTW when I started this project back in 2002 C# wasnt really very popular and there wasn't much resources about it.

Completely understandable. If it ain't broke, don't fix it [smile].
October 16, 2009 01:06 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Advertisement