Sunday, July 27, 2008

Tools coming together

The "add object" tool is coming together nicely. I toyed around with a lot of different setups for selecting objects: the El Ballo way of putting it all into a massive popup button was terrible. I tried hierarchical popups, headlined popups, data browser and an outline, but settled on a popup to select a group/category, and a table view to display the objects in that category. Once i have this done, I might have to start working on the XML output so that I can load it into the game.

Started working on the XML output, and immediately realized I'm going about this the wrong way. Instead of having the level editor dump a LevelWrapper, it should naturally ask the BaseLevel to dump itself. That way I ensure that I have the loading/dumping done from the same place (LevelFloor will for instance get both load and dump methods in straight C++). The only technicality is dumping editor-specific data, but that's probably a non-issue. I can put a special "editor private" block after the BaseLevel's XML dump, or just put that data into the BaseLevel representation. Though, one thing that I need to fix acutely is to bring the editor over to an NSDocument-based app; the way I'm doing it now won't cut it in the long run if I want normal "save/save as" behaviour and undo/redo stacks.

I think I've managed to hack the document behaviour into place, nice! Wasn't terribly hard, just a few quirks here and there.

No comments: