Inspector.txt 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. Needed controls:
  2. Array field/List field/Dictionary field
  3. Matrix3 field
  4. Matrix4 field
  5. GameObject field
  6. Resource field
  7. -------------
  8. Cursor
  9. - A way to save/load a set of cursors
  10. IMMEDIATE:
  11. - Deleting first entry in input field moves the cursor incorrectly
  12. - Test if parsing int/float value from int/float field actually works
  13. - ProfilerOverlay elements are constantly dirty? even though I'm not calling update
  14. Other:
  15. - Refactor BuiltinMaterialFactory to BuiltinEngineResources
  16. -------------
  17. Boost any replacement: http://www.codeproject.com/Articles/11250/High-Performance-Dynamic-Typing-in-C-using-a-Repla
  18. -------------
  19. Get rid of the CamelotFramework namespace
  20. - I shouldn't need to prefix each variable with CM::
  21. Undocking a window wont remove the tabbed title bar
  22. While dragging an undocked window, dropping it over the main window (not over dock overlays) will not restore it
  23. - GameObjectField
  24. - When dragging over GameObjectField cursor needs to change depending whether drop will be accepted or not
  25. - How will I limit it to just certain component types?
  26. Make a common class for ScriptGUIElement as they all share:
  27. - Destroy(), DestroyInstance(), SetParent(), SetVisible() methods, and potentially others
  28. Add InsertElement to GUILayout
  29. -------------
  30. Get rid of EditorGUI and GUI classes and instead make them a single class GUIPanel
  31. - IMPORANT. Consider replacing InspectorArea with GUIPanels (they internally in C++ are just clipped GUIAreas). This way I have a generic system
  32. IMPLEMENT:
  33. EditorWindow
  34. WindowResized
  35. Internal_GetWidth
  36. Internal_GetHeight
  37. Internal_CreateGUIPanel
  38. GUIPanel
  39. Internal_SetArea
  40. Internal_Destroy
  41. SceneObject
  42. GetComponents
  43. GUIArea
  44. SetArea
  45. Refactor existing ScriptGUI and ScriptEditorGUI and add support for GUIPanel instead
  46. Remove support for resizable areas
  47. Tab indexes
  48. - EditorFields should have SetNextField method that allow you to set tab order directly
  49. - InspectableField are automatically assigned ID
  50. - ID is part depth (also governs identation) and part sequential index
  51. - This allows me to add/remove elements from objects like lists and arrays and not mess up the tab order
  52. - Also collapse/expand doesn't require us to modify tab indexes
  53. - InspectableObjects should likely have a reference to the Inspector so that they can query next InspectableField based on tab ID
  54. - These IDs are then used for calling SetNextField on normal EditorFields
  55. Custom inspector
  56. - Custom inspector should have complete knowledge of the GUI objects within it (so that parent Inspector can expand/collapse it without worrying about the user forgetting to hide an element and messing up the other inspectors)
  57. - Since custom inspector should have all of its elements in a specific GUILayout, we should be able to just manipulate that GUILayout
  58. Positioning/Indentation
  59. - Inspector needs to be provided with a layout
  60. - Whenever an InspectableObject is created it will create a new X layout with a space (for indenting) and a Y layout (for child elements)
  61. - We will provide it with parent layout from which to create those on
  62. - And depth for determining indent amount
  63. - For top level objects there is no space or X layout (depth is 0)
  64. - InspectableFields will use the Layouts they are given by their parent InspectableObjects
  65. C++ bit for creating InspectableField
  66. - Need a way to list all fields in an object (should already have most of that functionality)
  67. - And hook up those fields with get/set callbacks for editing/updating
  68. UndoRedo
  69. - A global UndoRedo class for generic use
  70. - Specific UndoRedo for automatic use in InspectableField
  71. - Will likely need Undo/Redo context
  72. - e.g. when in a text field I want to undo/redo my changes in that text field one by one
  73. - but when I click outside maybe I just want to undo to the previous state before I even focused on that text field
  74. - plus it doesn't make sense for example to undo a text field if I'm currently focusing on something in scene
  75. ---------------------------
  76. SerializableObject(object obj)
  77. - GetFields()
  78. SerializableField
  79. - Type
  80. - GetInt/SetInt
  81. - GetString/SetString
  82. - GetObject/SetObject
  83. - GetArray/SetArray
  84. - etc.
  85. SerializableArray
  86. - GetInt(arrayIdx)/SetInt(arrayIdx)
  87. - GetKVP(arrayIdx)/SetKVP(arrayIdx)
  88. - etc.
  89. SerializableDictionary
  90. - GetInt(key)/SetInt(key)
  91. - GetKVP(key)/SetKVP(key)
  92. - etc.
  93. ----------------
  94. InspectableObject(SerializableObject)
  95. - Internally creates a list of InspectorFields (does not initialize any GUI elements)
  96. - CreateGUI(GUILayout) <- populates the GUI layout with every InspectorField
  97. - For nested objects it creates child layouts and indents them appropriately
  98. InspectorField(SerializableField)
  99. - CreateGUI(GUILayout) <- Inserts the corresponding GUI element into the layout
  100. -------------------
  101. When creating a custom inspector, where will I store InspectorFields? Require user to store them?
  102. - I guess. If user doesn't store them they get destructed and upon destruction they remove their GUI element from the layout.
  103. - But what happens when Destroy is called? GUI elements get destroyed as normal and InspectorField will need to check for that, in which case it will essentially do nothing.
  104. How do I refresh Inspector fields if source object changes?
  105. - Keep all InspectorFields in InspectorManager class, which will call Update on it regularily
  106. - If InspectorField GUI elements were destroyed then Update will show a warning
  107. - Otherwise you are required to call destroy on an InspectorField to properly remove it