Commit Graph

34 Commits

Author SHA1 Message Date
tetrapod00
3bc5ea85af Remove references to 3.x minor versions
Removes notes about features being introduced in 3.x minor versions. In 4.x, these
details are no longer relevant.
2024-10-20 15:35:32 -07:00
tetrapod00
a6484f9841 Fix docstring written as comment 2024-10-19 11:31:59 -07:00
Hugo Locurcio
960125f576 Fix Code order section saying it's the first section in GDScript style guide
It's not the first section of the page anymore.
2024-09-23 23:58:39 +02:00
Jace Bennest
d71c24c699 Update gdscript_styleguide.rst
fixes typo
2024-08-04 10:48:19 -07:00
Hana - Piralein
3e2a8f6f7c Update outdated annotation and setget syntax
Co-Authored-By: PoolloverNathan <24194027+PoolloverNathan@users.noreply.github.com>
Co-Authored-By: Solor Vox <1246172+solorvox@users.noreply.github.com>
2024-06-27 22:13:37 +02:00
Hugo Locurcio
71cdbdd055 Tweak guidelines on dictionary and enum formatting in GDScript style guide
- Recommend writing each enum item on its own line, similar to C++.
- Recommend using spaces around inline dictionary declarations
  to make them easier to distinguish from arrays (due to similar-looking
  `[]` and `{}` characters in most fonts). This is commonly found
  in Python or JavaScript style guides.
2024-05-29 17:52:29 +02:00
444B
3d441150b1 Update gdscript_styleguide.rst - clarified sentence and grammar (#9110)
* Update gdscript_styleguide.rst - clarified sentence and grammar

- Clarified the statement on "One statement per line"
- Removed unclear sentence with incorrect grammar

---------

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-03-21 11:49:25 +01:00
Peter Anderson
ab98451bc8 Re-word 'Comment spacing' note in gdscript_styleguide.rst 2024-01-22 05:14:52 +00:00
oujionghong
c925bcd76f Fixing guide example on 2 indent levels for continuation lines
The original example seems to be using 3 tabs for indentation, but the description said 2 should be used.
2023-11-17 10:16:32 +08:00
Hugo Locurcio
54331c3c8f Document support for code folding regions in GDScript reference 2023-11-06 22:49:28 +01:00
Elnar Dakeshov
4b6e15d3b3 Update style guide (#8038)
Used get instead of set.
2023-09-27 03:03:08 +02:00
Hannes
085d4035a3 Changed a code example that didn't follow the style guide 2023-06-26 11:42:11 +02:00
Danil Alexeev
d8e71f7453 Update info about BBCode in doc comments and Class Reference 2023-05-29 21:43:10 +03:00
Max Hilbrunner
ebf3a02dbc Merge pull request #6498 from vmedea/2022-12-style-guide
Update style guide for new export and setget syntax
2023-03-23 04:46:52 +01:00
Justin McGettigan
7f7042c515 Updated instances of onready to @onready. 2023-03-18 16:06:11 -04:00
Thiago Lages de Alencar
8a112dcef2 Add bang operator to operators table (#6558)
* Add bang operator to operators table

* Add symbolic aliases for `and` & `or`

* Remove comma from operators table

* Add bang to the aliases list

---------

Co-authored-by: Max Hilbrunner <mhilbrunner@users.noreply.github.com>
2023-02-27 07:37:17 +01:00
Thiago Lages de Alencar
6095b20174 Add bang operator to gdscript style guide (#6828) 2023-02-27 07:19:38 +01:00
Mara Huldra
59c4480051 Update style guide for new signal emit/connect syntax 2023-02-07 22:03:04 +01:00
Mara Huldra
6336d03a3a Update style guide for new export and setget syntax 2023-02-07 22:00:35 +01:00
Aaron Franke
370f936922 GDScript style guide: Improve type inference section (#6661) 2023-02-05 16:33:38 +03:00
Jonathan Deiss
bec737cb75 Update gdscript_styleguide.rst (#6379)
Adds two changes:
- makes it clear where subclasses should go (at the bottom of the script)
- put the `_enter_tree()` method before `_ready()` but after `_init()` since that's the order in which the methods are executed
2023-02-05 16:19:27 +03:00
notPelf
beb5f02422 Clarify ternary operator in the style guide
In the current style guide, the example for ternary operators includes a "not" in the conditional which is the same text color as the preceding "if" giving the impression that the format for a ternary operation is "[some_value] if not [condition] else [other_value]" which is incorrect, and may be confusing to figure out. I'm new to Godot and I've never used python (which I understand GDScript is based on). My only experience is with c# which I don't believe has a "not" keyword so I was quite confused by this.

This change would remove "not" from the condition to eliminate confusion, and rearrange the values to keep the meaning of the example code the same. Any alternative that removes the "not" would also work.
2023-02-01 18:41:48 -05:00
BlueStag
135ad68cab Use 4.0 method of connecting to and emitting signals (#6311)
Change docs to use the new method of connecting and emitting signals
2023-01-22 22:01:34 -05:00
Max Hilbrunner
024fedb0f3 Kinematic -> Character 2022-10-15 17:55:24 +02:00
Evanaellio
3cb674285e Fix references to the @tool annotation 2022-09-21 22:48:04 +02:00
Markus Sauermann
57a9ef3fea Add @ to onready annotated variables in examples 2022-02-04 19:33:10 +01:00
Max Hilbrunner
7b758e4739 Merge pull request #5326 from zacryol/inferred-typing-cast
Show example of casting get_node() for static typing in style guide
2021-11-03 14:43:45 +01:00
zacryol
35211f6002 Show example of casting get_node() for inferred static typing in style guide 2021-10-22 11:04:56 -06:00
zacryol
8b5fb7a39d Rename var "character_dir" to "character_dict" in GDScript style guide (#5325) 2021-10-16 01:12:08 +02:00
merumelu
41a3150726 GDScript style guide: tint borders of good/bad code examples (#5138)
Add `rst-class` directives before code blocks to allow custom styling.
2021-08-01 16:09:09 +02:00
Hugo Locurcio
669c163135 Add a GDScript style guide recommendation for multiline wrapping 2021-07-29 15:30:21 +02:00
Vladislav Vorobev
9ffebd0812 Fixed class_name keyword ordering in GDScript style guide
Fixes two examples to follow rules described in "Code order" section of this page.
2021-06-25 12:05:50 +03:00
Nathan Lovato
b928c651e7 Add note about line skips in the style guide 2020-11-18 08:10:24 -06:00
Nathan Lovato
4272395ab7 Move scripting section to tutorials/
Closes #4113
2020-10-07 14:05:48 -06:00