Dragging, copying, pasting, etc.
Man, lots of stuff came together over the last little bit.
I have full dragging support in now for entities, brushes and brush faces. I need to figure out how to do edges and vertices next but the framework is in place. The drag code is nice too because it figures out which axis you want to drag on based on your mouse movement and the camera angle. So dragging to the right will pick the right most axis based on your camera view. It’s hard to explain but super intuitive when you’re using it!
Since selecting brush faces works now, I added clicking in the texture browser which naturally led to changing texture assignments on brushes and faces. That all works and is fully supported by the undo/redo system.
Everything, in fact, is fully supported by the undo/redo system. It’s fantastic! I love having it there and being able to add new features to it as they come online has been great. As soon as I get something new working, I immediately hook up the undo/redo support. You’ll thank me later!
Here’s something cool … you can cut, copy and paste pieces of your map between levels. So open up DM2, select some stuff that you want to borrow, hit CMD+C, flip back to your map in another window and hit CMD+V. Voila! Enjoy your borrowed goods.
This is especially cool because it’s writing and reading to the clipboard in Quake MAP text format so once you copy something, you can paste it into a text editor and save it for later use if you want.
Once the clipboard stuff was working, it was pretty trivial to get duplication set up. Hitting the space bar will duplicate whatever you have selected and offset it slightly.
The editor also now writes out to MAP file format so you can save your work - kind of important, I know. The thing is I must be doing something wrong because currently I can’t load a map that I KNOW compiles, save it out, and compile it again successfully. I have a rounding bug somewhere but I’ll get to the bottom of it. That’s currently my top priority because, well, it’s pretty bad. Heh.
What was great in this process however was the cut/copy/paste functionality. The fact that it works is great but I love the fact that I was able to refactor the code base a few times over and now everything MAP related flows through a single pipeline. Loading a map, saving a map, copying and pasting, and duplication all use the same functions. As a programmer, that satisfies me greatly. ![]()