|
@@ -10,68 +10,108 @@ using BansheeEngine;
|
|
|
|
|
|
|
|
namespace BansheeEditor
|
|
namespace BansheeEditor
|
|
|
{
|
|
{
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Contains various settings that are applied globally to the editor. Settings will persist through editor sessions.
|
|
|
|
|
+ /// </summary>
|
|
|
internal static class EditorSettings
|
|
internal static class EditorSettings
|
|
|
{
|
|
{
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Determines if snapping for move handle is active. When active the move handle can only be moved in increments
|
|
|
|
|
+ /// specified by <see cref="MoveHandleSnapAmount"/>.
|
|
|
|
|
+ /// </summary>
|
|
|
public static bool MoveHandleSnapActive
|
|
public static bool MoveHandleSnapActive
|
|
|
{
|
|
{
|
|
|
get { return Internal_GetMoveHandleSnapActive(); }
|
|
get { return Internal_GetMoveHandleSnapActive(); }
|
|
|
set { Internal_SetMoveHandleSnapActive(value); }
|
|
set { Internal_SetMoveHandleSnapActive(value); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Determines if snapping for rotate handle is active. When active the rotate handle can only be rotated in
|
|
|
|
|
+ /// increments specified by <see cref="RotateHandleSnapAmount"/>.
|
|
|
|
|
+ /// </summary>
|
|
|
public static bool RotateHandleSnapActive
|
|
public static bool RotateHandleSnapActive
|
|
|
{
|
|
{
|
|
|
get { return Internal_GetRotateHandleSnapActive(); }
|
|
get { return Internal_GetRotateHandleSnapActive(); }
|
|
|
set { Internal_SetRotateHandleSnapActive(value); }
|
|
set { Internal_SetRotateHandleSnapActive(value); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Determines size of the increments the move handle can be moved when <see cref="MoveHandleSnapActive"/> is
|
|
|
|
|
+ /// active.
|
|
|
|
|
+ /// </summary>
|
|
|
public static float MoveHandleSnapAmount
|
|
public static float MoveHandleSnapAmount
|
|
|
{
|
|
{
|
|
|
get { return Internal_GetMoveHandleSnapAmount(); }
|
|
get { return Internal_GetMoveHandleSnapAmount(); }
|
|
|
set { Internal_SetMoveHandleSnapAmount(value); }
|
|
set { Internal_SetMoveHandleSnapAmount(value); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Determines size of the increments the rotate handle can be moved when <see cref="RotateHandleSnapActive"/> is
|
|
|
|
|
+ /// active.
|
|
|
|
|
+ /// </summary>
|
|
|
public static Degree RotateHandleSnapAmount
|
|
public static Degree RotateHandleSnapAmount
|
|
|
{
|
|
{
|
|
|
get { return Internal_GetRotateHandleSnapAmount(); }
|
|
get { return Internal_GetRotateHandleSnapAmount(); }
|
|
|
set { Internal_SetRotateHandleSnapAmount(value.Degrees); }
|
|
set { Internal_SetRotateHandleSnapAmount(value.Degrees); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Determines the default size for all handles.
|
|
|
|
|
+ /// </summary>
|
|
|
public static float DefaultHandleSize
|
|
public static float DefaultHandleSize
|
|
|
{
|
|
{
|
|
|
get { return Internal_GetDefaultHandleSize(); }
|
|
get { return Internal_GetDefaultHandleSize(); }
|
|
|
set { Internal_SetDefaultHandleSize(value); }
|
|
set { Internal_SetDefaultHandleSize(value); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Determines the active tool shown in the scene view.
|
|
|
|
|
+ /// </summary>
|
|
|
public static SceneViewTool ActiveSceneTool
|
|
public static SceneViewTool ActiveSceneTool
|
|
|
{
|
|
{
|
|
|
get { return (SceneViewTool)Internal_GetActiveSceneTool(); }
|
|
get { return (SceneViewTool)Internal_GetActiveSceneTool(); }
|
|
|
set { Internal_SetActiveSceneTool((int)value); }
|
|
set { Internal_SetActiveSceneTool((int)value); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Determines the coordinate mode used by the tools in the scene view.
|
|
|
|
|
+ /// </summary>
|
|
|
public static HandleCoordinateMode ActiveCoordinateMode
|
|
public static HandleCoordinateMode ActiveCoordinateMode
|
|
|
{
|
|
{
|
|
|
get { return (HandleCoordinateMode)Internal_GetActiveCoordinateMode(); }
|
|
get { return (HandleCoordinateMode)Internal_GetActiveCoordinateMode(); }
|
|
|
set { Internal_SetActiveCoordinateMode((int)value); }
|
|
set { Internal_SetActiveCoordinateMode((int)value); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Determines the pivot mode used by the tools in the scene view.
|
|
|
|
|
+ /// </summary>
|
|
|
public static HandlePivotMode ActivePivotMode
|
|
public static HandlePivotMode ActivePivotMode
|
|
|
{
|
|
{
|
|
|
get { return (HandlePivotMode)Internal_GetActivePivotMode(); }
|
|
get { return (HandlePivotMode)Internal_GetActivePivotMode(); }
|
|
|
set { Internal_SetActivePivotMode((int)value); }
|
|
set { Internal_SetActivePivotMode((int)value); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Contains the absolute path to the last open project, if any.
|
|
|
|
|
+ /// </summary>
|
|
|
public static string LastOpenProject
|
|
public static string LastOpenProject
|
|
|
{
|
|
{
|
|
|
get { return Internal_GetLastOpenProject(); }
|
|
get { return Internal_GetLastOpenProject(); }
|
|
|
set { Internal_SetLastOpenProject(value); }
|
|
set { Internal_SetLastOpenProject(value); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Determines should the last open project be automatically loaded on editor startup.
|
|
|
|
|
+ /// </summary>
|
|
|
public static bool AutoLoadLastProject
|
|
public static bool AutoLoadLastProject
|
|
|
{
|
|
{
|
|
|
get { return Internal_GetAutoLoadLastProject(); }
|
|
get { return Internal_GetAutoLoadLastProject(); }
|
|
|
set { Internal_SetAutoLoadLastProject(value); }
|
|
set { Internal_SetAutoLoadLastProject(value); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Contains a list of most recently loaded projects.
|
|
|
|
|
+ /// </summary>
|
|
|
public static RecentProject[] RecentProjects
|
|
public static RecentProject[] RecentProjects
|
|
|
{
|
|
{
|
|
|
get
|
|
get
|
|
@@ -107,66 +147,129 @@ namespace BansheeEditor
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Contains a hash value that is updated whenever one of the properties in this object is updated. This allows
|
|
|
|
|
+ /// external systems to track when they might need to reload the settings.
|
|
|
|
|
+ /// </summary>
|
|
|
public static int Hash
|
|
public static int Hash
|
|
|
{
|
|
{
|
|
|
get { return Internal_GetHash(); }
|
|
get { return Internal_GetHash(); }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Sets a generic floating point property.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="name">Name to record the property under.</param>
|
|
|
|
|
+ /// <param name="value">Value of the property.</param>
|
|
|
public static void SetFloat(string name, float value)
|
|
public static void SetFloat(string name, float value)
|
|
|
{
|
|
{
|
|
|
Internal_SetFloat(name, value);
|
|
Internal_SetFloat(name, value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Sets a generic integer property.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="name">Name to record the property under.</param>
|
|
|
|
|
+ /// <param name="value">Value of the property.</param>
|
|
|
public static void SetInt(string name, int value)
|
|
public static void SetInt(string name, int value)
|
|
|
{
|
|
{
|
|
|
Internal_SetInt(name, value);
|
|
Internal_SetInt(name, value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Sets a generic boolean property.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="name">Name to record the property under.</param>
|
|
|
|
|
+ /// <param name="value">Value of the property.</param>
|
|
|
public static void SetBool(string name, bool value)
|
|
public static void SetBool(string name, bool value)
|
|
|
{
|
|
{
|
|
|
Internal_SetBool(name, value);
|
|
Internal_SetBool(name, value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Sets a generic string property.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="name">Name to record the property under.</param>
|
|
|
|
|
+ /// <param name="value">Value of the property.</param>
|
|
|
public static void SetString(string name, String value)
|
|
public static void SetString(string name, String value)
|
|
|
{
|
|
{
|
|
|
Internal_SetString(name, value);
|
|
Internal_SetString(name, value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Retrieves a generic floating point property.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="name">Name of the property to retrieve.</param>
|
|
|
|
|
+ /// <param name="defaultValue">Default value to return if property cannot be found.</param>
|
|
|
|
|
+ /// <returns>Value of the property if it exists, otherwise the default value.</returns>
|
|
|
public static float GetFloat(string name, float defaultValue = 0.0f)
|
|
public static float GetFloat(string name, float defaultValue = 0.0f)
|
|
|
{
|
|
{
|
|
|
return Internal_GetFloat(name, defaultValue);
|
|
return Internal_GetFloat(name, defaultValue);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Retrieves a generic integer property.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="name">Name of the property to retrieve.</param>
|
|
|
|
|
+ /// <param name="defaultValue">Default value to return if property cannot be found.</param>
|
|
|
|
|
+ /// <returns>Value of the property if it exists, otherwise the default value.</returns>
|
|
|
public static int GetInt(string name, int defaultValue = 0)
|
|
public static int GetInt(string name, int defaultValue = 0)
|
|
|
{
|
|
{
|
|
|
return Internal_GetInt(name, defaultValue);
|
|
return Internal_GetInt(name, defaultValue);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Retrieves a generic boolean property.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="name">Name of the property to retrieve.</param>
|
|
|
|
|
+ /// <param name="defaultValue">Default value to return if property cannot be found.</param>
|
|
|
|
|
+ /// <returns>Value of the property if it exists, otherwise the default value.</returns>
|
|
|
public static bool GetBool(string name, bool defaultValue = false)
|
|
public static bool GetBool(string name, bool defaultValue = false)
|
|
|
{
|
|
{
|
|
|
return Internal_GetBool(name, defaultValue);
|
|
return Internal_GetBool(name, defaultValue);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Retrieves a generic string property.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="name">Name of the property to retrieve.</param>
|
|
|
|
|
+ /// <param name="defaultValue">Default value to return if property cannot be found.</param>
|
|
|
|
|
+ /// <returns>Value of the property if it exists, otherwise the default value.</returns>
|
|
|
public static String GetString(string name, string defaultValue = "")
|
|
public static String GetString(string name, string defaultValue = "")
|
|
|
{
|
|
{
|
|
|
return Internal_GetString(name, defaultValue);
|
|
return Internal_GetString(name, defaultValue);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Checks does a generic property with the specified name exists.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="name">Name of the property to check.</param>
|
|
|
|
|
+ /// <returns>True if the property exists, false otherwise.</returns>
|
|
|
public static bool HasKey(string name)
|
|
public static bool HasKey(string name)
|
|
|
{
|
|
{
|
|
|
return Internal_HasKey(name);
|
|
return Internal_HasKey(name);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Deletes a generic property with the specified name.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="name">Name of the property to delete.</param>
|
|
|
public static void DeleteKey(string name)
|
|
public static void DeleteKey(string name)
|
|
|
{
|
|
{
|
|
|
Internal_DeleteKey(name);
|
|
Internal_DeleteKey(name);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Deletes all generic properties.
|
|
|
|
|
+ /// </summary>
|
|
|
public static void DeleteAllKeys()
|
|
public static void DeleteAllKeys()
|
|
|
{
|
|
{
|
|
|
Internal_DeleteAllKeys();
|
|
Internal_DeleteAllKeys();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Saves editor settings to the disk.
|
|
|
|
|
+ /// </summary>
|
|
|
public static void Save()
|
|
public static void Save()
|
|
|
{
|
|
{
|
|
|
Internal_Save();
|
|
Internal_Save();
|
|
@@ -258,10 +361,17 @@ namespace BansheeEditor
|
|
|
private static extern void Internal_Save();
|
|
private static extern void Internal_Save();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Note: Must match C++ struct RecentProject
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Contains data about a recently opened project.
|
|
|
|
|
+ /// </summary>
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
- public struct RecentProject
|
|
|
|
|
|
|
+ public struct RecentProject // Note: Must match C++ struct RecentProject
|
|
|
{
|
|
{
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Constructs a new recently opened project object.
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="path">Absolute path to the project.</param>
|
|
|
|
|
+ /// <param name="timestamp">Timestamp when the project was last opened.</param>
|
|
|
public RecentProject(string path, UInt64 timestamp)
|
|
public RecentProject(string path, UInt64 timestamp)
|
|
|
{
|
|
{
|
|
|
this.path = path;
|
|
this.path = path;
|