draganddrop - Mud-H/TorqueLab GitHub Wiki

TorqueLab Drag And Drop UI System

Usage

The drag and drop system use a basic dropType variable to check compatibility between different DnD components. When a dragged control is dropped on another control, the dragged ctrl dropType will be compare with the allowTypes list of the "dropped on" control. If no dropType match found, the dropping will fail and dragged control original state will be restored. If match, the dropping process will start to determine how and where to drop depending of the needs.

Dropping process

When the dropType validation succeed, different options are available depending of the behavior wanted:

Special DnD Classes

  • Draggable: Default superclass required for any control that you want to drag

  • DropZone: Generated DropZone in which to drop control. It would then be added anywhere the script tell


  • DragCtrl.dropType = "InfoBox"; --> Need to be dropped on a InfoBox drop ctrl
  • DroppedOnCtrl.allowTypes = "InfoBox ThisBox ThatButton" --> All allowed types to be dropped on this control. Any ctrl with a matching dropType can be drop. ============================================================================== Classes: Plugins extend TorqueLab with their own interface which you have to select to use plugin features

Specific implementations

Extensions provide new features globally which can be used from all plugins/editors. In general, they use a Window dialog to manage their features but they could be mostly anything (Toolbars,menus,functionalities,etc)

Themes

Themes allow to change the appearance of TorqueLab and provide extra customization. There's 2 type of themes: Master and Child. Master are full featured themes while Child are Master clones with limited modifications.

⚠️ **GitHub.com Fallback** ⚠️