editor_style_guide.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. .. _doc_editor_style_guide:
  2. Editor style guide
  3. ==================
  4. Introduction
  5. ------------
  6. Thanks for your interest in contributing to the Godot editor!
  7. This page describes the grammar and writing style used throughout the Godot
  8. editor. Following this style guide will help your contribution get merged faster
  9. since there will be fewer review steps required.
  10. Writing style
  11. -------------
  12. - **Write messages (errors, warnings, ...) as full sentences.** They should start
  13. with an uppercase letter and end with a period.
  14. - **Try to keep sentences short.** This makes it more likely that their translations
  15. will be short as well, which is a good thing to avoid UI bugs.
  16. - **Use contractions.** For example, use "isn't" instead of "is not". An exception
  17. to this rule can be made when you specifically want to emphasize one of the
  18. contraction's words.
  19. - **Use double quotes in messages** (``""``) instead of single quotes (``''``).
  20. Double quotes should be used to quote user input, file paths and possibly
  21. other things depending on the context.
  22. .. seealso::
  23. Try to follow the :ref:`doc_docs_writing_guidelines` in addition to the
  24. guidelines outlined above.
  25. Button and menu texts
  26. ---------------------
  27. Capitalize text in buttons and menu actions:
  28. - **Good:** *Open Editor Data Folder*
  29. - **Bad:** *Open editor data folder*
  30. If a menu action opens a modal dialog, suffix it with an ellipsis (``...``).
  31. - **Good:** *Editor Settings...*
  32. - **Bad:** *Editor Settings*
  33. Inspector sections
  34. ------------------
  35. In general, don't create sections that contain less than 3 items. Sections that
  36. contain few items make it difficult to navigate the inspector, while missing the
  37. benefits of using sections such as folding.
  38. There are some valid exceptions for this, such as material features in
  39. :ref:`class_StandardMaterial3D`.
  40. This advice also applies to the Project Settings and Editor Settings.
  41. Inspector performance hints
  42. ---------------------------
  43. Enum properties that noticeably impact performance should have a performance
  44. hint associated. The hint should refer to the *absolute* performance impact,
  45. rather than being relative to the other options provided in the enum. Here are
  46. some examples taken from the Godot editor:
  47. - **Screen-space antialiasing:** *Disabled (Fastest), FXAA (Fast)*
  48. - **MSAA quality:** *Disabled (Fastest), 2x (Fast), 4x (Average), 8x (Slow), 16x
  49. (Slower)*
  50. - **DirectionalLight mode:** *Orthogonal (Fast), PSSM 2 Splits
  51. (Average), PSSM 4 Splits (Slow)*
  52. For consistency, try to stick to the terms below (from fastest to slowest):
  53. - *Fastest, Faster, Fast, Average, Slow, Slower, Slowest*
  54. Their usage doesn't have to be contiguous. For example, you can use only "Fast"
  55. and "Slow" from the list above.
  56. If you're adding a new enum, its values should be ordered from the fastest
  57. option to the slowest option.
  58. Tooltips
  59. --------
  60. Consider adding tooltips whenever the action performed by a button or menu
  61. action isn't obvious. You can also provide additional context or highlight
  62. caveats in the tooltip.
  63. You can do this by calling ``set_tooltip(TTR("Text here."))`` on the
  64. Control-based node in question. If the tooltip is particularly long (more than
  65. ~80 characters), wrap it over several lines by adding line breaks using ``\n``.
  66. Tooltips should follow the writing style described above. In addition to this,
  67. use indicative mood instead of imperative mood:
  68. - **Good:** *Computes global illumination for the selected GIProbe.*
  69. - **Bad:** *Compute global illumination for the selected GIProbe.*