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

Update GridMap to use Vector3i instead of three ints #39958

Merged
merged 1 commit into from
Jul 3, 2020

Conversation

aaronfranke
Copy link
Member

@aaronfranke aaronfranke commented Jun 29, 2020

Seems to work well, but needs testing.

@@ -524,8 +527,8 @@ void GridMapEditor::_set_clipboard_data() {

ClipboardItem item;
item.cell_item = itm;
item.grid_offset = Vector3(i, j, k) - selection.begin;
item.orientation = node->get_cell_item_orientation(i, j, k);
item.grid_offset = Vector3(ijk) - selection.begin;
Copy link
Contributor

Choose a reason for hiding this comment

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

At first I thought that's some kind of C++ syntax which allows to group arguments. 👀

Copy link
Member Author

Choose a reason for hiding this comment

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

I can see how this can be confusing from the diff, but I think it's clear when reading the code as a whole.

Do you have an alternative name suggestion? I just called it "ijk" because it can easily be understood as "[the vector containing] i, j, and k".

Copy link
Contributor

Choose a reason for hiding this comment

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

In the context of this, perhaps selected or pos would be better IMO, unless it shadows other variables.

Copy link
Member

@akien-mga akien-mga Jul 2, 2020

Choose a reason for hiding this comment

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

Yeah I'd suggest selected or pos too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, coming back to it I think selected makes a lot more sense, since these are all in a selection.

We should avoid pos since many instances of pos were switched to position in Godot 3.0, I think we should finish this work by converting the remaining instances of pos to position in Godot 4.0.

@akien-mga akien-mga merged commit 8ff99d2 into godotengine:master Jul 3, 2020
@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