Adam's blog formerly game development, now just casual madness

Project View

Working with the Duality Editor is always project-related. Instead of opening a lot of independent files and editing them isolated, a game project is opened as whole; basically like opening a project file in Visual Studio, except that there’s no project file for Duality. Instead, you’ll open a projects folder which then will be scanned for relevant files.

The most important editor widget will be the “Project View”: A tree view that shows a projects Resource files and stages them for user interaction. In addition to Resource files located inside the projects working directory, Duality’s (embedded) default Resources are also displayed, although flagged as read-only.

Using a context menu or shortcut keys, the user may cut, copy, paste, delete, rename or create Resources and move or copy them via dragdrop. Because the Project View is just a filtered, interpreted representation of an actual directory in the file system, maintaining consistency requires a little more effort than usually.

I chose to fully integrate Project View interactions into actual Windows Explorer / file system interactions: Cut, copy, paste, drag and drop operations actually work using Clipboard and FileDropList data and do nothing more than perform that same operation on files corresponding to selected Resource- and DirectoryNodes in the view. This way, it is possible to “dragdrop” or “cutcopypaste” files in between DualityEditor and Windows Explorer without any trouble. It behaves exactly like regular Explorer file interaction. Also, deleting a Resource will actually move it to the Recycle Bin instead of destroying it at once.

Resource operations don’t update the view when being performed – a FileSystemWatcher takes care of it as soon as an operation has finished. Redirecting view updates like that has the advantage of higher consistency and an improved Explorer integration: Instead of doing Resource operations in the Project View, the user may as well do file operations in the Explorer. DualityEditor doesn’t care – whatever happens to the currently opened working directory, the Project View widget is always up to date.

Importing files (i.e. converting common file formats to the corresponding Duality Resource format) is as easy: Just dragdrop or copypaste a media file to the Project View or alternatively do the same in the Windows Explorer. DualityEditor will automatically move the incoming files to a separate directory and hand it over to a suitable converter object. The converter will then create and insert an appropriate Resource file version of it.

You may have noticed the “New –> “ submenu in image #2. The list of Resource types available for creation is dynamically created based on the core and all core plugins that are currently loaded. If reasonable or even necessary, a developer may create whole new types of Resources using Duality’s plugin architecture. They will not only be available in his plugins source code but also fully integrated in the editor application.

59 of 74