Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniformize layer names, script methods and documentation #51532

Merged
merged 1 commit into from
Aug 12, 2021

Conversation

pouleyKetchoupp
Copy link
Contributor

Change based on discussion started in #44809 (comment), in order to solve godotengine/godot-proposals#2050 and still keep the editor layer mask UI intuitive.

  • Back to 1-based layer names to make it clearer in editor UI (inspector and project settings)
  • set/get_layer_mask_bit(bit) functions are renamed to set/get_layer_mask_value(layer_number) and they use 1-based indices too
  • Proper errors when layers are not in range for all these functions in render and physics
  • Proper documentation for all these functions in render and physics
  • Fix a few remaining collision_layer used in place of collision_mask in physics

<description>
Enables or disables the given [code]layer[/code] in the [member cull_mask].
Sets the specified [code]value[/code] of the [member cull_mask] to [code]true[/code] or [code]false[/code], given a [code]layer_number[/code] between 1 and 20.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description doesn't make much sense because [code]value[/code] refers to the passed bool, not to the value in cull_mask associated with the given layer. So I'd change it to something like:

Suggested change
Sets the specified [code]value[/code] of the [member cull_mask] to [code]true[/code] or [code]false[/code], given a [code]layer_number[/code] between 1 and 20.
Sets the specified value in the [member cull_mask] to [code]value[/code], given a [code]layer_number[/code] between 1 and 20.

or:

Suggested change
Sets the specified [code]value[/code] of the [member cull_mask] to [code]true[/code] or [code]false[/code], given a [code]layer_number[/code] between 1 and 20.
Sets the value for the specified layer in [member cull_mask] to [code]value[/code], given a [code]layer_number[/code] between 1 and 20.

or:

Suggested change
Sets the specified [code]value[/code] of the [member cull_mask] to [code]true[/code] or [code]false[/code], given a [code]layer_number[/code] between 1 and 20.
Based on [code]value[/code], enables or disables the specified layer in the [member cull_mask], given a [code]layer_number[/code] between 1 and 20.

The same issue is present in other similar changes (I'm not commenting them one by one though).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! I've updated the documentation based on your third suggestion, and also updated the get_ functions to use similar wording.

- Back to 1-based layer names to make it clearer in editor UI
- Layer bit accessors are renamed to layer value and 1-based too
- Uniform errors and documentation in render and physics
- Fix a few remaining collision_layer used in place of collision_mask
@akien-mga akien-mga merged commit c89ad92 into godotengine:master Aug 12, 2021
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants