Undo

2007-07-04

Undo

Permalink 10:59:46 am, Categories: World Editor  

I implemented reparenting and renaming since last time.
Reparenting was rather annoying as I had to write my own function to recursively copy the node and its children to the new location. But it seems to work smoothly and it's the first "cool" feature of the editor.

I spent the beginning of this week working on the action system (aka undo system).
Here's how it works.

Actions derive from iAction but have their own Initialize function taking their needed parameters.

How to create an action and use it:

  • Create a new instance of your action (new SomeAction(), or through scfCreateInstance, more on that later)
  • Query for the action's interface (iSomeAction),
  • Call someAction->Initialize (params),
  • Call actionmgr->Do (someAction);

Plugins can implement their own actions. To allow something to instantiate an action implemented in another module, the class should be added to the plugin's metadata. Then it should call scfCreateInstance<Interface> ("crystalspace.editor.action.someaction").

As it stands, the action system should be fully functional, including the undo/redo menu items. Reparenting is not undoable yet though.

One current problem is that when you rename something and then undo it, the tree view doesn't update to reflect the old name. I think the best method to get it to update is to have the tree view listen for each iEditorObject's name change. That is to say, I should add a general iEditorObjectChangeListener, that will signal when an object has changed so that interested views can update themselves. This applies to things like properties too, which will come later.

Future thoughts:

I'm going to implement a drawer which will draw a bounding box around the current selection in the 3D view as well as little billboard icons for lights (and later, camera positions). Ideally this will have a settings page where you can toggle whether to draw this stuff, or tweak the bbox colors. Settings is another thing I haven't gotten to, although it is not essential yet.

I'm still thinking about the best way to implement tools in general, and in particular the transform tools, as these are core tools that will be used all the time.

Other random Q&A's with myself
Should object select tool be undoable? No, would get quite annoying.
Should selecting something in scene browser select it in the 3d view (e.g. actually select it)? This seems like a good idea.

A little reflection:
GUI work has been interesting. I'm glad I got the chance to do it. In the GUI world, the little things count. Like the status bar/progress bar, or the edit menu telling you what action you're going to undo or redo, or dragging the nodes around in the scene browser to reparent them, or being able to customize your panel layout due to the flexible wxAUI. I've been trying to implement things in a way that is as intuitive as possible. I hope I can continue to find ideas to make things nicer.

Trackback address for this post:

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

Comments, Trackbacks, Pingbacks:

Comment from: VigRX [Visitor] · http://vigrxsleuth.com
Amemiue quoluou oefefujar: VigRX axeaifu ulievees uudulae vodaudeo ooaoiz.
PermalinkPermalink 2013-02-18 @ 23:55
Comment from: Bali Mojo [Visitor] · http://balimojoguide.com
Baaiaqu ixiekaki aaiaak:- Bali Mojo emipekui.
PermalinkPermalink 2013-02-19 @ 00:02
Comment from: Stage De Salsa En Video [Visitor] · http://ap620.com/stage-de-salsa-en-video.html
Ufazoiuz maugekieq Stage De Salsa En Video ixeiwue oyosougda opuvukei
ueiibec oxnuiivu.
PermalinkPermalink 2013-04-18 @ 19:59
Comment from: Bali Mojo Dosage [Visitor] · http://balimojoco.com
Ugboaura uudoeiz, Bali Mojo Dosage pioraowo ulapiou oeguxixo eaiae itxeaami juemimuaf.
..
PermalinkPermalink 2013-06-20 @ 22:21

Comments are not allowed from anonymous visitors.

September 2014
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          

Search

Categories

Archives

Misc

XML Feeds

What is this?

powered by
b2evolution