I had a few hours spare last night so I made a start on the SilverRogue map editor. The SilverRogue projects are Silverlight so the editor needs to be a Silverlight application to link to those assemblies. Editor/Designer applications are typically desktop based but Silverlight brings the power of the desktop to the browser, so implementing a fully featured Editor/Designer in Silverlight isn’t going to be a problem. Right?
Wrong.
Maybe I’m being a little unfair because I’m criticising the beta and I was expecting to find the WPF features I’m familiar with. Hopefully the features I need might be present in the final release.
Currently SIlverlight doesn’t support Menus and Toolbars. OK, no biggy, it’s just a simple editor, I’ll just add some buttons at the top for Load and Save. Ah, um, saving to the local file system is not supported! Some have the opinion that the desktop is truly dead once Photoshop runs in the browser. Well that’s not going to happen with Silverlight 2 beta if the user can’t save their files!
Also, mouse support isn’t quite as fully featured as in WPF. I’d like to know the mouse button states on the MouseEnter event. Maybe only a minor issue but I really wanted to be able to paint tiles onto the map. I couldn’t work around this by recording a mouse-down flag in conjunction with MouseMove. I had a few other minor issues but it was the no save issue that was the show stopper.
So I’ve decided to implement the Editor in WPF. Of course this presents me the issue that the editor can’t link to the SilverRogue assemblies because of binary incompatibility. I can get around this by auto-generating .net 3.5 projects from the SilverRogue Silverlight source as part of the build process.
The good news however, is that I’ve implemented the tile/map data structures, so once the WPF UI is complete I’ll have an editor to create and edit empty dungeons.