BearishSun 10 gadi atpakaļ
vecāks
revīzija
cd6d63da7d

+ 21 - 2
MBansheeEditor/CodeEditor.cs

@@ -4,8 +4,10 @@ using BansheeEngine;
 
 
 namespace BansheeEditor
 namespace BansheeEditor
 {
 {
-    // Note: Must match C++ CodeEditorType enum
-    public enum CodeEditorType
+    /// <summary>
+    /// Contains all supported external code editors
+    /// </summary>
+    public enum CodeEditorType // Note: Must match C++ CodeEditorType enum
     {
     {
         VS2008,
         VS2008,
         VS2010,
         VS2010,
@@ -14,23 +16,40 @@ namespace BansheeEditor
         VS2015
         VS2015
     }
     }
 
 
+    /// <summary>
+    /// Handles interaction with the external application used for editing scripts.
+    /// </summary>
     public static class CodeEditor
     public static class CodeEditor
     {
     {
+        /// <summary>
+        /// Currently active code editor.
+        /// </summary>
         public static CodeEditorType ActiveEditor
         public static CodeEditorType ActiveEditor
         {
         {
             set { Internal_SetActiveEditor(value); }
             set { Internal_SetActiveEditor(value); }
         }
         }
 
 
+        /// <summary>
+        /// Returns a list of all code editors available on this machine.
+        /// </summary>
         public static CodeEditorType[] AvailableEditors
         public static CodeEditorType[] AvailableEditors
         {
         {
             get { return Internal_GetAvailableEditors(); }
             get { return Internal_GetAvailableEditors(); }
         }
         }
 
 
+        /// <summary>
+        /// Opens a script file in the currently active code editor.
+        /// </summary>
+        /// <param name="path">Path to the script file to open, either absolute or relative to the project folder.</param>
+        /// <param name="line">Line in the file to focus the editor on.</param>
         public static void OpenFile(string path, UInt32 line)
         public static void OpenFile(string path, UInt32 line)
         {
         {
             Internal_OpenFile(path, line);
             Internal_OpenFile(path, line);
         }
         }
 
 
+        /// <summary>
+        /// Generates a solution file for the active editor, which includes all scripts in the project.
+        /// </summary>
         public static void SyncSolution()
         public static void SyncSolution()
         {
         {
             Internal_SyncSolution();
             Internal_SyncSolution();

+ 182 - 0
MBansheeEditor/ColorPicker.cs

@@ -3,6 +3,9 @@ using BansheeEngine;
 
 
 namespace BansheeEditor
 namespace BansheeEditor
 {
 {
+    /// <summary>
+    /// A color picker window that allows the user to select from a gamut of colors.
+    /// </summary>
     public class ColorPicker : ModalWindow
     public class ColorPicker : ModalWindow
     {
     {
         private const int SliderIndividualWidth = 150;
         private const int SliderIndividualWidth = 150;
@@ -58,6 +61,9 @@ namespace BansheeEditor
 
 
         private Action<bool, Color> closedCallback;
         private Action<bool, Color> closedCallback;
 
 
+        /// <summary>
+        /// Determines color gamut shown in the color box.
+        /// </summary>
         public enum ColorBoxMode
         public enum ColorBoxMode
         {
         {
             BG_R,
             BG_R,
@@ -68,12 +74,18 @@ namespace BansheeEditor
             HS_V
             HS_V
         }
         }
 
 
+        /// <summary>
+        /// Determines color gamut shown in the horizontal sliders.
+        /// </summary>
         public enum SliderMode
         public enum SliderMode
         {
         {
             RGB,
             RGB,
             HSV
             HSV
         }
         }
 
 
+        /// <summary>
+        /// Returns currently selected color as RGBA values.
+        /// </summary>
         public Color SelectedColor
         public Color SelectedColor
         {
         {
             get
             get
@@ -82,6 +94,12 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Shows the color picker window.
+        /// </summary>
+        /// <param name="closedCallback">Optional callback to trigger when the user selects a color or cancels out
+        ///                              of the dialog.</param>
+        /// <returns>A. instance of the color picker window.</returns>
         public static ColorPicker Show(Action<bool, Color> closedCallback = null)
         public static ColorPicker Show(Action<bool, Color> closedCallback = null)
         {
         {
             ColorPicker picker = new ColorPicker();
             ColorPicker picker = new ColorPicker();
@@ -90,6 +108,13 @@ namespace BansheeEditor
             return picker;
             return picker;
         }
         }
 
 
+        /// <summary>
+        /// Shows the color picker window and sets the initial color to show.
+        /// </summary>
+        /// <param name="color">Initial color to display.</param>
+        /// <param name="closedCallback">Optional callback to trigger when the user selects a color or cancels out
+        ///                              of the dialog.</param>
+        /// <returns>A. instance of the color picker window.</returns>
         public static ColorPicker Show(Color color, Action<bool, Color> closedCallback = null)
         public static ColorPicker Show(Color color, Action<bool, Color> closedCallback = null)
         {
         {
             ColorPicker picker = new ColorPicker();
             ColorPicker picker = new ColorPicker();
@@ -102,6 +127,9 @@ namespace BansheeEditor
             return picker;
             return picker;
         }
         }
 
 
+        /// <summary>
+        /// Constructs a new color picker window.
+        /// </summary>
         protected ColorPicker()
         protected ColorPicker()
             : base(false)
             : base(false)
         { }
         { }
@@ -281,6 +309,16 @@ namespace BansheeEditor
             colorBox.UpdateInput(windowPos);
             colorBox.UpdateInput(windowPos);
         }
         }
 
 
+        /// <summary>
+        /// Fills a 2D area with colors using the provided starting point and gradients.
+        /// </summary>
+        /// <param name="width">Width of the area to fill.</param>
+        /// <param name="height">Height of the area to fill.</param>
+        /// <param name="colors">Array to contain the output. Must be of 
+        ///                      <paramref name="width"/>*<paramref name="height"/> size.</param>
+        /// <param name="start">Initial color in the top-left corner of the area.</param>
+        /// <param name="rightGradient">Gradient towards which the colors increase to the right of the area.</param>
+        /// <param name="downGradient">Gradient towards which the colors increase to the bottom of the area.</param>
         private static void FillArea(int width, int height, Color[] colors, Color start, Color rightGradient, Color downGradient)
         private static void FillArea(int width, int height, Color[] colors, Color start, Color rightGradient, Color downGradient)
         {
         {
             Color rightDelta = new Color(0, 0, 0, 0);
             Color rightDelta = new Color(0, 0, 0, 0);
@@ -306,6 +344,9 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Converts the currently selected color from HSV to RGB color space.
+        /// </summary>
         void HSVToRGB()
         void HSVToRGB()
         {
         {
             Color hsv = new Color(colHue, colSaturation, colValue);
             Color hsv = new Color(colHue, colSaturation, colValue);
@@ -316,6 +357,9 @@ namespace BansheeEditor
             colBlue = rgb.b;
             colBlue = rgb.b;
         }
         }
 
 
+        /// <summary>
+        /// Converts the currently selected color from RGB to HSV color space.
+        /// </summary>
         void RGBToHSV()
         void RGBToHSV()
         {
         {
             Color rgb = new Color(colRed, colGreen, colBlue);
             Color rgb = new Color(colRed, colGreen, colBlue);
@@ -326,6 +370,9 @@ namespace BansheeEditor
             colValue = hsv.b;
             colValue = hsv.b;
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user selects a new mode for the color box, changing the gamut of colors displayed in the box.
+        /// </summary>
         void OnColorBoxModeChanged()
         void OnColorBoxModeChanged()
         {
         {
             int maxModes = Enum.GetNames(colorBoxMode.GetType()).Length;
             int maxModes = Enum.GetNames(colorBoxMode.GetType()).Length;
@@ -336,6 +383,10 @@ namespace BansheeEditor
             Update2DSliderValues();
             Update2DSliderValues();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user selects a new mode for the side slider, changing the gamut of colors displayed in the 
+        /// slider.
+        /// </summary>
         void OnSliderModeChanged()
         void OnSliderModeChanged()
         {
         {
             int maxModes = Enum.GetNames(sliderMode.GetType()).Length;
             int maxModes = Enum.GetNames(sliderMode.GetType()).Length;
@@ -349,6 +400,10 @@ namespace BansheeEditor
             Update1DSliderValues();
             Update1DSliderValues();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user selects a color in the color box.
+        /// </summary>
+        /// <param name="value">Location on the color box that was selected.</param>
         void OnColorBoxValueChanged(Vector2 value)
         void OnColorBoxValueChanged(Vector2 value)
         {
         {
             switch (colorBoxMode)
             switch (colorBoxMode)
@@ -398,6 +453,10 @@ namespace BansheeEditor
             guiSliderVert.Percent = 1.0f - z;
             guiSliderVert.Percent = 1.0f - z;
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user moves the side slider.
+        /// </summary>
+        /// <param name="percent">New value of the slider.</param>
         void OnSliderVertChanged(float percent)
         void OnSliderVertChanged(float percent)
         {
         {
             percent = 1.0f - percent;
             percent = 1.0f - percent;
@@ -436,6 +495,10 @@ namespace BansheeEditor
             Update1DSliderValues();
             Update1DSliderValues();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user moves the horizontal Red/Hue slider.
+        /// </summary>
+        /// <param name="percent">New value of the slider.</param>
         void OnSliderRHorzChanged(float percent)
         void OnSliderRHorzChanged(float percent)
         {
         {
             bool isHSV = sliderMode == SliderMode.HSV;
             bool isHSV = sliderMode == SliderMode.HSV;
@@ -456,6 +519,10 @@ namespace BansheeEditor
             Update2DSliderValues();
             Update2DSliderValues();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user moves the horizontal Green/Saturation slider.
+        /// </summary>
+        /// <param name="percent">New value of the slider.</param>
         void OnSliderGHorzChanged(float percent)
         void OnSliderGHorzChanged(float percent)
         {
         {
             bool isHSV = sliderMode == SliderMode.HSV;
             bool isHSV = sliderMode == SliderMode.HSV;
@@ -476,6 +543,10 @@ namespace BansheeEditor
             Update2DSliderValues();
             Update2DSliderValues();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user moves the horizontal Blue/Value slider.
+        /// </summary>
+        /// <param name="percent">New value of the slider.</param>
         void OnSliderBHorzChanged(float percent)
         void OnSliderBHorzChanged(float percent)
         {
         {
             bool isHSV = sliderMode == SliderMode.HSV;
             bool isHSV = sliderMode == SliderMode.HSV;
@@ -496,6 +567,10 @@ namespace BansheeEditor
             Update2DSliderValues();
             Update2DSliderValues();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user moves the horizontal alpha slider.
+        /// </summary>
+        /// <param name="percent">New value of the slider.</param>
         void OnSliderAHorzChanged(float percent)
         void OnSliderAHorzChanged(float percent)
         {
         {
             colAlpha = percent;
             colAlpha = percent;
@@ -504,6 +579,10 @@ namespace BansheeEditor
             guiInputA.Value = MathEx.RoundToInt(colAlpha * 255.0f);
             guiInputA.Value = MathEx.RoundToInt(colAlpha * 255.0f);
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user inputs new value in the Red/Hue input box.
+        /// </summary>
+        /// <param name="value">New value in the input box.</param>
         void OnInputRChanged(int value)
         void OnInputRChanged(int value)
         {
         {
             bool isHSV = sliderMode == SliderMode.HSV;
             bool isHSV = sliderMode == SliderMode.HSV;
@@ -524,6 +603,10 @@ namespace BansheeEditor
             Update2DSliderValues();
             Update2DSliderValues();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user inputs new value in the Green/Saturation input box.
+        /// </summary>
+        /// <param name="value">New value in the input box.</param>
         void OnInputGChanged(int value)
         void OnInputGChanged(int value)
         {
         {
             bool isHSV = sliderMode == SliderMode.HSV;
             bool isHSV = sliderMode == SliderMode.HSV;
@@ -544,6 +627,10 @@ namespace BansheeEditor
             Update2DSliderValues();
             Update2DSliderValues();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user inputs new value in the Blue/Value input box.
+        /// </summary>
+        /// <param name="value">New value in the input box.</param>
         void OnInputBChanged(int value)
         void OnInputBChanged(int value)
         {
         {
             bool isHSV = sliderMode == SliderMode.HSV;
             bool isHSV = sliderMode == SliderMode.HSV;
@@ -564,6 +651,10 @@ namespace BansheeEditor
             Update2DSliderValues();
             Update2DSliderValues();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user inputs new value in the alpha input box.
+        /// </summary>
+        /// <param name="value">New value in the input box.</param>
         void OnInputAChanged(int value)
         void OnInputAChanged(int value)
         {
         {
             colAlpha = value/255.0f;
             colAlpha = value/255.0f;
@@ -572,6 +663,9 @@ namespace BansheeEditor
             guiSliderAHorz.Percent = colAlpha;
             guiSliderAHorz.Percent = colAlpha;
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user selects a color and closes the dialog.
+        /// </summary>
         void OnOK()
         void OnOK()
         {
         {
             if (closedCallback != null)
             if (closedCallback != null)
@@ -580,6 +674,9 @@ namespace BansheeEditor
             Close();
             Close();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when the user cancels color selection and closes the dialog.
+        /// </summary>
         void OnCancel()
         void OnCancel()
         {
         {
             if (closedCallback != null)
             if (closedCallback != null)
@@ -588,6 +685,9 @@ namespace BansheeEditor
             Close();
             Close();
         }
         }
 
 
+        /// <summary>
+        /// Updates Red/Green/Blue or Hue/Saturation/Value labels and input box ranges depending on currently active mode.
+        /// </summary>
         void UpdateSliderMode()
         void UpdateSliderMode()
         {
         {
             if (sliderMode == SliderMode.RGB)
             if (sliderMode == SliderMode.RGB)
@@ -612,6 +712,9 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Updates Red/Green/Blue or Hue/Saturation/Value input boxes with currently selected color.
+        /// </summary>
         void UpdateInputBoxValues()
         void UpdateInputBoxValues()
         {
         {
             bool isHSV = sliderMode == SliderMode.HSV;
             bool isHSV = sliderMode == SliderMode.HSV;
@@ -629,6 +732,9 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Updates Red/Green/Blue or Hue/Saturation/Value sliders with currently selected color.
+        /// </summary>
         void Update1DSliderValues()
         void Update1DSliderValues()
         {
         {
             bool isHSV = sliderMode == SliderMode.HSV;
             bool isHSV = sliderMode == SliderMode.HSV;
@@ -646,6 +752,11 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Returns the current color in the form of color box and side slider coordinates.
+        /// </summary>
+        /// <param name="xy">Coordinates on the color box the current color is located on.</param>
+        /// <param name="z">Coordinates on the side slider the current color is located on.</param>
         void GetColorBoxValues(out Vector2 xy, out float z)
         void GetColorBoxValues(out Vector2 xy, out float z)
         {
         {
             xy = Vector2.Zero;
             xy = Vector2.Zero;
@@ -686,6 +797,9 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Updates values of the color box and side slider according to the current color.
+        /// </summary>
         void Update2DSliderValues()
         void Update2DSliderValues()
         {
         {
             Vector2 xy = Vector2.Zero;
             Vector2 xy = Vector2.Zero;
@@ -697,6 +811,9 @@ namespace BansheeEditor
             guiSliderVert.Percent = z;
             guiSliderVert.Percent = z;
         }
         }
 
 
+        /// <summary>
+        /// Generates textures to display for all horizontal (RGB/HSV) sliders depending on active slider mode.
+        /// </summary>
         void Update1DSliderTextures()
         void Update1DSliderTextures()
         {
         {
             bool isHSV = sliderMode == SliderMode.HSV;
             bool isHSV = sliderMode == SliderMode.HSV;
@@ -737,6 +854,9 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Generates a texture for the side slider depending on active color box mode.
+        /// </summary>
         void UpdateSideSliderTexture()
         void UpdateSideSliderTexture()
         {
         {
             switch (colorBoxMode)
             switch (colorBoxMode)
@@ -762,6 +882,9 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Generates textures for the color box and the side slider depending on active color box mode.
+        /// </summary>
         void Update2DSliderTextures()
         void Update2DSliderTextures()
         {
         {
             UpdateSideSliderTexture();
             UpdateSideSliderTexture();
@@ -770,6 +893,9 @@ namespace BansheeEditor
             colorBox.UpdateTexture(colorBoxMode, valueLookup[(int)colorBoxMode]);
             colorBox.UpdateTexture(colorBoxMode, valueLookup[(int)colorBoxMode]);
         }
         }
 
 
+        /// <summary>
+        /// Manages GUI for a 1D horizontal slider (used RGB/HSV display).
+        /// </summary>
         public class ColorSlider1DHorz
         public class ColorSlider1DHorz
         {
         {
             private const int SLIDER_X_OFFSET = 3;
             private const int SLIDER_X_OFFSET = 3;
@@ -782,6 +908,14 @@ namespace BansheeEditor
             private GUITexture guiTexture;
             private GUITexture guiTexture;
             private GUISliderH guiSlider;
             private GUISliderH guiSlider;
 
 
+            /// <summary>
+            /// Creates a new horizontal slider.
+            /// </summary>
+            /// <param name="guiTexture">GUI element to display the slider color range on.</param>
+            /// <param name="guiSlider">Slider rendered on top of the texture that may be moved by the user to select a 
+            ///                         color.</param>
+            /// <param name="width">Width of the slider in pixels.</param>
+            /// <param name="height">Height of the slider in pixels.</param>
             public ColorSlider1DHorz(GUITexture guiTexture, GUISliderH guiSlider, int width, int height)
             public ColorSlider1DHorz(GUITexture guiTexture, GUISliderH guiSlider, int width, int height)
             {
             {
                 this.width = width;
                 this.width = width;
@@ -793,6 +927,12 @@ namespace BansheeEditor
                 spriteTexture = new SpriteTexture(texture);
                 spriteTexture = new SpriteTexture(texture);
             }
             }
 
 
+            /// <summary>
+            /// Updates the displayed texture with specified color information.
+            /// </summary>
+            /// <param name="start">Initial color on the left of the slider.</param>
+            /// <param name="step">Final color to the right of the slider.</param>
+            /// <param name="isHSV">Determines are the provided colors in RGB or HSV space.</param>
             public void UpdateTexture(Color start, Color step, bool isHSV)
             public void UpdateTexture(Color start, Color step, bool isHSV)
             {
             {
                 Color[] colors = new Color[width * height];
                 Color[] colors = new Color[width * height];
@@ -817,6 +957,9 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Manages GUI for a 1D vertical slider (side slider along with the color box).
+        /// </summary>
         public class ColorSlider1DVert
         public class ColorSlider1DVert
         {
         {
             private const int SLIDER_X_OFFSET = 5;
             private const int SLIDER_X_OFFSET = 5;
@@ -829,6 +972,14 @@ namespace BansheeEditor
             private GUITexture guiTexture;
             private GUITexture guiTexture;
             private GUISliderV guiSlider;
             private GUISliderV guiSlider;
 
 
+            /// <summary>
+            /// Creates a new vertical slider.
+            /// </summary>
+            /// <param name="guiTexture">GUI element to display the slider color range on.</param>
+            /// <param name="guiSlider">Slider rendered on top of the texture that may be moved by the user to select a 
+            ///                         color.</param>
+            /// <param name="width">Width of the slider in pixels.</param>
+            /// <param name="height">Height of the slider in pixels.</param>
             public ColorSlider1DVert(GUITexture guiTexture, GUISliderV guiSlider, int width, int height)
             public ColorSlider1DVert(GUITexture guiTexture, GUISliderV guiSlider, int width, int height)
             {
             {
                 this.width = width;
                 this.width = width;
@@ -840,6 +991,12 @@ namespace BansheeEditor
                 spriteTexture = new SpriteTexture(texture);
                 spriteTexture = new SpriteTexture(texture);
             }
             }
 
 
+            /// <summary>
+            /// Updates the displayed texture with specified color information.
+            /// </summary>
+            /// <param name="start">Initial color on the top of the slider.</param>
+            /// <param name="step">Final color to the bottom of the slider.</param>
+            /// <param name="isHSV">Determines are the provided colors in RGB or HSV space.</param>
             public void UpdateTexture(Color start, Color step, bool isHSV)
             public void UpdateTexture(Color start, Color step, bool isHSV)
             {
             {
                 Color[] colors = new Color[width * height];
                 Color[] colors = new Color[width * height];
@@ -864,6 +1021,10 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Manages GUI for a 2D color box, as well as manually handling color box input. Color box serves as a 2D sliders 
+        /// as you can portion of it to select a color.
+        /// </summary>
         public class ColorSlider2D
         public class ColorSlider2D
         {
         {
             private int width, height;
             private int width, height;
@@ -878,6 +1039,14 @@ namespace BansheeEditor
             public delegate void OnValueChangedDelegate(Vector2 value);
             public delegate void OnValueChangedDelegate(Vector2 value);
             public event OnValueChangedDelegate OnValueChanged;
             public event OnValueChangedDelegate OnValueChanged;
 
 
+            /// <summary>
+            /// Creates a new color box.
+            /// </summary>
+            /// <param name="guiTexture">GUI element to display the 2D color range on.</param>
+            /// <param name="guiSliderHandle">Texture to be used for displaying the position of the currently selected 
+            ///                               color.</param>
+            /// <param name="width">Width of the slider in pixels.</param>
+            /// <param name="height">Height of the slider in pixels.</param>
             public ColorSlider2D(GUITexture guiTexture, GUITexture guiSliderHandle, int width, int height)
             public ColorSlider2D(GUITexture guiTexture, GUITexture guiSliderHandle, int width, int height)
             {
             {
                 this.width = width;
                 this.width = width;
@@ -890,6 +1059,11 @@ namespace BansheeEditor
                 spriteTexture = new SpriteTexture(texture);
                 spriteTexture = new SpriteTexture(texture);
             }
             }
 
 
+            /// <summary>
+            /// Updates the texture displayed on the color box.
+            /// </summary>
+            /// <param name="mode">Mode determining the color gamut shown in the color box.</param>
+            /// <param name="value">Value of the third component (normally retrieved from the separate side slider).</param>
             public void UpdateTexture(ColorBoxMode mode, float value)
             public void UpdateTexture(ColorBoxMode mode, float value)
             {
             {
                 Color[] colors = new Color[width * height];
                 Color[] colors = new Color[width * height];
@@ -926,6 +1100,10 @@ namespace BansheeEditor
                 guiTexture.SetTexture(spriteTexture);
                 guiTexture.SetTexture(spriteTexture);
             }
             }
 
 
+            /// <summary>
+            /// Handles input over the color box, moving the handle as needed.
+            /// </summary>
+            /// <param name="windowPos">Position of the pointer relative to the color picker window.</param>
             public void UpdateInput(Vector2I windowPos)
             public void UpdateInput(Vector2I windowPos)
             {
             {
                 if (Input.IsPointerButtonHeld(PointerButton.Left))
                 if (Input.IsPointerButtonHeld(PointerButton.Left))
@@ -943,6 +1121,10 @@ namespace BansheeEditor
                 }
                 }
             }
             }
 
 
+            /// <summary>
+            /// Moves the handle to a specific location on the color box and selects that color.
+            /// </summary>
+            /// <param name="value">Coordinates relative to the color box.</param>
             public void SetValue(Vector2 value)
             public void SetValue(Vector2 value)
             {
             {
                 Vector2 pos = value;
                 Vector2 pos = value;

+ 35 - 0
MBansheeEditor/DialogBox.cs

@@ -3,8 +3,15 @@ using BansheeEngine;
 
 
 namespace BansheeEditor
 namespace BansheeEditor
 {
 {
+    /// <summary>
+    /// Displays a modal window containing a title, a message and a set of buttons. Allows an easy way to query and inform
+    /// the user.
+    /// </summary>
     public class DialogBox : ModalWindow
     public class DialogBox : ModalWindow
     {
     {
+        /// <summary>
+        /// Type of the dialog box, determines what buttons to show.
+        /// </summary>
         public enum Type
         public enum Type
         {
         {
             OK,
             OK,
@@ -16,6 +23,9 @@ namespace BansheeEditor
             TryCancelContinue
             TryCancelContinue
         }
         }
 
 
+        /// <summary>
+        /// Type of button that was pressed when a dialog box was closed.
+        /// </summary>
         public enum ResultType
         public enum ResultType
         {
         {
             Yes,
             Yes,
@@ -37,16 +47,34 @@ namespace BansheeEditor
         private ResultType result = ResultType.None;
         private ResultType result = ResultType.None;
         private bool constructed;
         private bool constructed;
 
 
+        /// <summary>
+        /// Button that was pressed when the dialog box was closed. Only valid after the user closes the dialog box.
+        /// </summary>
         public ResultType Result
         public ResultType Result
         {
         {
             get { return result; }
             get { return result; }
         }
         }
 
 
+        /// <summary>
+        /// Opens a new dialog box.
+        /// </summary>
+        /// <param name="title">Text to display in the title bar.</param>
+        /// <param name="message">Message to display in the dialog box.</param>
+        /// <param name="type">Type of dialog box that determines what buttons to display.</param>
+        /// <param name="resultCallback">Callback to trigger when the user clicks on a dialog box button.</param>
+        /// <returns>Instance of the dialog box window.</returns>
         public static DialogBox Open(LocString title, LocString message, Type type, Action<ResultType> resultCallback = null)
         public static DialogBox Open(LocString title, LocString message, Type type, Action<ResultType> resultCallback = null)
         {
         {
             return new DialogBox(title, message, type, resultCallback);
             return new DialogBox(title, message, type, resultCallback);
         }
         }
 
 
+        /// <summary>
+        /// Constructs the dialog box.
+        /// </summary>
+        /// <param name="title">Text to display in the title bar.</param>
+        /// <param name="message">Message to display in the dialog box.</param>
+        /// <param name="type">Type of dialog box that determines what buttons to display.</param>
+        /// <param name="resultCallback">Callback to trigger when the user clicks on a dialog box button.</param>
         protected DialogBox(LocString title, LocString message, Type type, Action<ResultType> resultCallback)
         protected DialogBox(LocString title, LocString message, Type type, Action<ResultType> resultCallback)
             : base(false)
             : base(false)
         {
         {
@@ -116,6 +144,9 @@ namespace BansheeEditor
             }
             }
         }
         }
 
 
+        /// <summary>
+        /// Creates all of the GUI elements required for the specified type of dialog box.
+        /// </summary>
         private void SetupGUI()
         private void SetupGUI()
         {
         {
             messageLabel = new GUILabel("", EditorStyles.MultiLineLabel,
             messageLabel = new GUILabel("", EditorStyles.MultiLineLabel,
@@ -243,6 +274,10 @@ namespace BansheeEditor
             layoutY.AddFlexibleSpace();
             layoutY.AddFlexibleSpace();
         }
         }
 
 
+        /// <summary>
+        /// Triggered when one of the dialog box buttons was clicked.
+        /// </summary>
+        /// <param name="result">Type of the button that was clicked.</param>
         private void ButtonClicked(ResultType result)
         private void ButtonClicked(ResultType result)
         {
         {
             this.result = result;
             this.result = result;

+ 54 - 3
MBansheeEditor/DragDrop.cs

@@ -4,13 +4,37 @@ using BansheeEngine;
 
 
 namespace BansheeEditor
 namespace BansheeEditor
 {
 {
+    /// <summary>
+    /// Manages all drag and drop events within the engine. This doesn't include external OS drag and drop events.
+    /// </summary>
     public static class DragDrop
     public static class DragDrop
     {
     {
+        /// <summary>
+        /// Checks is a drag and drop operation in progress this frame.
+        /// </summary>
         public static bool DragInProgress { get { return Internal_IsDragInProgress(); } }
         public static bool DragInProgress { get { return Internal_IsDragInProgress(); } }
+
+        /// <summary>
+        /// Checks has a drag and drop operation finished this frame.
+        /// </summary>
         public static bool DropInProgress { get { return Internal_IsDropInProgress(); } }
         public static bool DropInProgress { get { return Internal_IsDropInProgress(); } }
+
+        /// <summary>
+        /// Data being currently dragged or dropped. Drag and drop must be currently in progress or have finished this 
+        /// frame for this data to be valid.
+        /// </summary>
         public static DragDropData Data { get { return Internal_GetData(); } }
         public static DragDropData Data { get { return Internal_GetData(); } }
+
+        /// <summary>
+        /// Type of data being currently dragged or dropped. 
+        /// </summary>
         public static DragDropType Type { get { return Internal_GetDragType();} }
         public static DragDropType Type { get { return Internal_GetDragType();} }
 
 
+        /// <summary>
+        /// Starts a new drag and drop operations. Drag and drop operation ends automatically when the mouse button is
+        /// released.
+        /// </summary>
+        /// <param name="data">Data to drag around. This will be passed to the element that accepts the drop operation.</param>
         public static void StartDrag(DragDropData data)
         public static void StartDrag(DragDropData data)
         {
         {
             if (data is SceneObjectDragDropData)
             if (data is SceneObjectDragDropData)
@@ -38,20 +62,36 @@ namespace BansheeEditor
         private static extern void Internal_StartResourceDrag(IntPtr instance);
         private static extern void Internal_StartResourceDrag(IntPtr instance);
     }
     }
 
 
+    /// <summary>
+    /// Contains data about a drag and drop operation.
+    /// </summary>
     public class DragDropData : ScriptObject
     public class DragDropData : ScriptObject
     {
     {
         internal DragDropType type;
         internal DragDropType type;
 
 
+        /// <summary>
+        /// Determines what kind of drag and drop operation this data belongs to.
+        /// </summary>
         public DragDropType Type { get { return type; } }
         public DragDropType Type { get { return type; } }
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_CreateInstance(DragDropData instance);
         private static extern void Internal_CreateInstance(DragDropData instance);
     }
     }
 
 
+    /// <summary>
+    /// Drag and drop data containing one or multiple scene objects.
+    /// </summary>
     public class SceneObjectDragDropData : DragDropData
     public class SceneObjectDragDropData : DragDropData
     {
     {
+        /// <summary>
+        /// Scene objects that are being dragged.
+        /// </summary>
         public SceneObject[] Objects { get { return Internal_GetObjects(mCachedPtr); } }
         public SceneObject[] Objects { get { return Internal_GetObjects(mCachedPtr); } }
 
 
+        /// <summary>
+        /// Creates a new scene drag and drop data.
+        /// </summary>
+        /// <param name="objects">A set of scene objects to drag.</param>
         public SceneObjectDragDropData(SceneObject[] objects)
         public SceneObjectDragDropData(SceneObject[] objects)
         {
         {
             this.type = DragDropType.SceneObject;
             this.type = DragDropType.SceneObject;
@@ -66,11 +106,20 @@ namespace BansheeEditor
         private static extern SceneObject[] Internal_GetObjects(IntPtr thisPtr);
         private static extern SceneObject[] Internal_GetObjects(IntPtr thisPtr);
     }
     }
 
 
+    /// <summary>
+    /// Drag and drop data containing one or multiple resource paths.
+    /// </summary>
     public class ResourceDragDropData : DragDropData
     public class ResourceDragDropData : DragDropData
     {
     {
+        /// <summary>
+        /// Absolute resource paths that are being dragged.
+        /// </summary>
         public string[] Paths { get { return Internal_GetPaths(mCachedPtr); } }
         public string[] Paths { get { return Internal_GetPaths(mCachedPtr); } }
 
 
-        // Paths must be absolute
+        /// <summary>
+        /// Creates a new resource drag and drop data.
+        /// </summary>
+        /// <param name="paths">A set of absolute resource paths to drag.</param>
         public ResourceDragDropData(string[] paths)
         public ResourceDragDropData(string[] paths)
         {
         {
             this.type = DragDropType.Resource;
             this.type = DragDropType.Resource;
@@ -85,8 +134,10 @@ namespace BansheeEditor
         private static extern string[] Internal_GetPaths(IntPtr thisPtr);
         private static extern string[] Internal_GetPaths(IntPtr thisPtr);
     }
     }
 
 
-    // Note: Must match C++ enum ScriptDragDropType
-    public enum DragDropType
+    /// <summary>
+    /// Types of available drag and drop operations.
+    /// </summary>
+    public enum DragDropType // Note: Must match C++ enum ScriptDragDropType
     {
     {
         Resource,
         Resource,
         SceneObject,
         SceneObject,

+ 42 - 0
MBansheeEditor/DropDownWindow.cs

@@ -5,17 +5,27 @@ using BansheeEngine;
 
 
 namespace BansheeEditor
 namespace BansheeEditor
 {
 {
+    /// <summary>
+    /// Base class for all drop down window implementations. Drop down windows are temporary windows that open above all
+    /// other GUI, and close as soon user clicks outside of them.
+    /// </summary>
     public class DropDownWindow : ScriptObject
     public class DropDownWindow : ScriptObject
     {
     {
         private int width;
         private int width;
         private int height;
         private int height;
 
 
+        /// <summary>
+        /// Width of the window in pixels.
+        /// </summary>
         public int Width
         public int Width
         {
         {
             get { return width; }
             get { return width; }
             set { Internal_SetWidth(mCachedPtr, value); width = value; }
             set { Internal_SetWidth(mCachedPtr, value); width = value; }
         }
         }
 
 
+        /// <summary>
+        /// Height of the window in pixels.
+        /// </summary>
         public int Height
         public int Height
         {
         {
             get { return height; }
             get { return height; }
@@ -24,6 +34,14 @@ namespace BansheeEditor
 
 
         protected GUIPanel GUI;
         protected GUIPanel GUI;
 
 
+        /// <summary>
+        /// Opens a new drop down window at the specified location.
+        /// </summary>
+        /// <typeparam name="T">Type of the drop down window to open.</typeparam>
+        /// <param name="parent">Parent editor window to open the drop down window in.</param>
+        /// <param name="position">Position relative to the parent editor window at which to open the drop down window.
+        ///                        </param>
+        /// <returns>Instance of the opened drop down window.</returns>
         public static T Open<T>(EditorWindow parent, Vector2I position) where T : DropDownWindow, new()
         public static T Open<T>(EditorWindow parent, Vector2I position) where T : DropDownWindow, new()
         {
         {
             T window = new T();
             T window = new T();
@@ -32,12 +50,23 @@ namespace BansheeEditor
             return window;
             return window;
         }
         }
 
 
+        /// <summary>
+        /// Constructs a new drop down window.
+        /// </summary>
+        /// <param name="width">Width of the window in pixels.</param>
+        /// <param name="height">Height of the window in pixels.</param>
         protected DropDownWindow(int width = 200, int height = 200)
         protected DropDownWindow(int width = 200, int height = 200)
         {
         {
             this.width = width;
             this.width = width;
             this.height = height;
             this.height = height;
         }
         }
 
 
+        /// <summary>
+        /// Initializes the drop down window after construction. Must be called before use.
+        /// </summary>
+        /// <param name="parent">Parent editor window to open the drop down window in.</param>
+        /// <param name="position">Position relative to the parent editor window at which to open the drop down window.
+        ///                        </param>
         private void Initialize(EditorWindow parent, Vector2I position)
         private void Initialize(EditorWindow parent, Vector2I position)
         {
         {
             IntPtr parentPtr = IntPtr.Zero;
             IntPtr parentPtr = IntPtr.Zero;
@@ -47,6 +76,11 @@ namespace BansheeEditor
             Internal_CreateInstance(this, parentPtr, position, width, height);
             Internal_CreateInstance(this, parentPtr, position, width, height);
         }
         }
 
 
+        /// <summary>
+        /// Converts coordinates in screen space to coordinates relative to the drop down window.
+        /// </summary>
+        /// <param name="screenPos">Coordinates in screen space.</param>
+        /// <returns>Coordinates relative to the drop down window.</returns>
         protected Vector2I ScreenToWindowPos(Vector2I screenPos)
         protected Vector2I ScreenToWindowPos(Vector2I screenPos)
         {
         {
             Vector2I windowPos;
             Vector2I windowPos;
@@ -54,6 +88,11 @@ namespace BansheeEditor
             return windowPos;
             return windowPos;
         }
         }
 
 
+        /// <summary>
+        /// Converts coordinates relative to the drop down window to screen space to coordinates.
+        /// </summary>
+        /// <param name="windowPos">Coordinates relative to the drop down window.</param>
+        /// <returns>Coordinates in screen space.</returns>
         protected Vector2I WindowToScreenPos(Vector2I windowPos)
         protected Vector2I WindowToScreenPos(Vector2I windowPos)
         {
         {
             Vector2I screenPos;
             Vector2I screenPos;
@@ -61,6 +100,9 @@ namespace BansheeEditor
             return screenPos;
             return screenPos;
         }
         }
 
 
+        /// <summary>
+        /// Closes the drop down window.
+        /// </summary>
         protected void Close()
         protected void Close()
         {
         {
             Internal_Close(mCachedPtr);
             Internal_Close(mCachedPtr);