EditorSettings.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.CompilerServices;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using BansheeEngine;
  8. namespace BansheeEditor
  9. {
  10. internal static class EditorSettings
  11. {
  12. public static bool MoveHandleSnapActive
  13. {
  14. get { return Internal_GetMoveHandleSnapActive(); }
  15. set { Internal_SetMoveHandleSnapActive(value); }
  16. }
  17. public static bool RotateHandleSnapActive
  18. {
  19. get { return Internal_GetRotateHandleSnapActive(); }
  20. set { Internal_SetRotateHandleSnapActive(value); }
  21. }
  22. public static float MoveHandleSnapAmount
  23. {
  24. get { return Internal_GetMoveHandleSnapAmount(); }
  25. set { Internal_SetMoveHandleSnapAmount(value); }
  26. }
  27. public static Degree RotateHandleSnapAmount
  28. {
  29. get { return Internal_GetRotateHandleSnapAmount(); }
  30. set { Internal_SetRotateHandleSnapAmount(value.Degrees); }
  31. }
  32. public static float DefaultHandleSize
  33. {
  34. get { return Internal_GetDefaultHandleSize(); }
  35. set { Internal_SetDefaultHandleSize(value); }
  36. }
  37. public static SceneViewTool ActiveSceneTool
  38. {
  39. get { return (SceneViewTool)Internal_GetActiveSceneTool(); }
  40. set { Internal_SetActiveSceneTool((int)value); }
  41. }
  42. public static HandleCoordinateMode ActiveCoordinateMode
  43. {
  44. get { return (HandleCoordinateMode)Internal_GetActiveCoordinateMode(); }
  45. set { Internal_SetActiveCoordinateMode((int)value); }
  46. }
  47. public static HandlePivotMode ActivePivotMode
  48. {
  49. get { return (HandlePivotMode)Internal_GetActivePivotMode(); }
  50. set { Internal_SetActivePivotMode((int)value); }
  51. }
  52. public static void SetFloat(string name, float value)
  53. {
  54. Internal_SetFloat(name, value);
  55. }
  56. public static void SetInt(string name, int value)
  57. {
  58. Internal_SetInt(name, value);
  59. }
  60. public static void SetBool(string name, bool value)
  61. {
  62. Internal_SetBool(name, value);
  63. }
  64. public static void SetString(string name, String value)
  65. {
  66. Internal_SetString(name, value);
  67. }
  68. public static float GetFloat(string name, float defaultValue = 0.0f)
  69. {
  70. return Internal_GetFloat(name, defaultValue);
  71. }
  72. public static int GetInt(string name, int defaultValue = 0)
  73. {
  74. return Internal_GetInt(name, defaultValue);
  75. }
  76. public static bool GetBool(string name, bool defaultValue = false)
  77. {
  78. return Internal_GetBool(name, defaultValue);
  79. }
  80. public static String GetString(string name, string defaultValue = "")
  81. {
  82. return Internal_GetString(name, defaultValue);
  83. }
  84. public static bool HasKey(string name)
  85. {
  86. return Internal_HasKey(name);
  87. }
  88. public static void DeleteKey(string name)
  89. {
  90. Internal_DeleteKey(name);
  91. }
  92. public static void DeleteAllKeys()
  93. {
  94. Internal_DeleteAllKeys();
  95. }
  96. public static int Hash
  97. {
  98. get { return Internal_GetHash(); }
  99. }
  100. [MethodImpl(MethodImplOptions.InternalCall)]
  101. private static extern bool Internal_GetMoveHandleSnapActive();
  102. [MethodImpl(MethodImplOptions.InternalCall)]
  103. private static extern void Internal_SetMoveHandleSnapActive(bool value);
  104. [MethodImpl(MethodImplOptions.InternalCall)]
  105. private static extern bool Internal_GetRotateHandleSnapActive();
  106. [MethodImpl(MethodImplOptions.InternalCall)]
  107. private static extern void Internal_SetRotateHandleSnapActive(bool value);
  108. [MethodImpl(MethodImplOptions.InternalCall)]
  109. private static extern float Internal_GetMoveHandleSnapAmount();
  110. [MethodImpl(MethodImplOptions.InternalCall)]
  111. private static extern void Internal_SetMoveHandleSnapAmount(float value);
  112. [MethodImpl(MethodImplOptions.InternalCall)]
  113. private static extern float Internal_GetRotateHandleSnapAmount();
  114. [MethodImpl(MethodImplOptions.InternalCall)]
  115. private static extern void Internal_SetRotateHandleSnapAmount(float value);
  116. [MethodImpl(MethodImplOptions.InternalCall)]
  117. private static extern float Internal_GetDefaultHandleSize();
  118. [MethodImpl(MethodImplOptions.InternalCall)]
  119. private static extern void Internal_SetDefaultHandleSize(float value);
  120. [MethodImpl(MethodImplOptions.InternalCall)]
  121. private static extern int Internal_GetActiveSceneTool();
  122. [MethodImpl(MethodImplOptions.InternalCall)]
  123. private static extern void Internal_SetActiveSceneTool(int value);
  124. [MethodImpl(MethodImplOptions.InternalCall)]
  125. private static extern int Internal_GetActiveCoordinateMode();
  126. [MethodImpl(MethodImplOptions.InternalCall)]
  127. private static extern void Internal_SetActiveCoordinateMode(int value);
  128. [MethodImpl(MethodImplOptions.InternalCall)]
  129. private static extern int Internal_GetActivePivotMode();
  130. [MethodImpl(MethodImplOptions.InternalCall)]
  131. private static extern void Internal_SetActivePivotMode(int value);
  132. [MethodImpl(MethodImplOptions.InternalCall)]
  133. private static extern void Internal_SetFloat(string name, float value);
  134. [MethodImpl(MethodImplOptions.InternalCall)]
  135. private static extern void Internal_SetInt(string name, int value);
  136. [MethodImpl(MethodImplOptions.InternalCall)]
  137. private static extern void Internal_SetBool(string name, bool value);
  138. [MethodImpl(MethodImplOptions.InternalCall)]
  139. private static extern void Internal_SetString(string name, String value);
  140. [MethodImpl(MethodImplOptions.InternalCall)]
  141. private static extern float Internal_GetFloat(string name, float defaultValue);
  142. [MethodImpl(MethodImplOptions.InternalCall)]
  143. private static extern int Internal_GetInt(string name, int defaultValue);
  144. [MethodImpl(MethodImplOptions.InternalCall)]
  145. private static extern bool Internal_GetBool(string name, bool defaultValue);
  146. [MethodImpl(MethodImplOptions.InternalCall)]
  147. private static extern string Internal_GetString(string name, string defaultValue);
  148. [MethodImpl(MethodImplOptions.InternalCall)]
  149. private static extern bool Internal_HasKey(string name);
  150. [MethodImpl(MethodImplOptions.InternalCall)]
  151. private static extern void Internal_DeleteKey(string name);
  152. [MethodImpl(MethodImplOptions.InternalCall)]
  153. private static extern void Internal_DeleteAllKeys();
  154. [MethodImpl(MethodImplOptions.InternalCall)]
  155. private static extern int Internal_GetHash();
  156. }
  157. }