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

Fix property array tooltip shows wrong ID on later pages #81408

Conversation

jsjtxietian
Copy link
Contributor

Fixes #81283
Take page into account when set the inspector array's tool tip.

@timothyqiu
Copy link
Member

begin_array_index + i is also used in later blocks in this loop, and a variable is also defined for it.

if (movable) {
int element_position = begin_array_index + i;
VBoxContainer *move_vbox = memnew(VBoxContainer);
move_vbox->set_v_size_flags(SIZE_EXPAND_FILL);
move_vbox->set_alignment(BoxContainer::ALIGNMENT_CENTER);
ae.hbox->add_child(move_vbox);
if (element_position > 0) {
ae.move_up = memnew(Button);
ae.move_up->set_icon(get_editor_theme_icon(SNAME("MoveUp")));
ae.move_up->connect("pressed", callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position - 1));
move_vbox->add_child(ae.move_up);
}

I think you can put a variable at the start of the loop and replace that definition.

@jsjtxietian
Copy link
Contributor Author

jsjtxietian commented Sep 7, 2023

Thanks! I missed that and wiil update it soon.

Also do some cleanup, use`element_position` instead of
`begin_array_index + i`
@jsjtxietian jsjtxietian force-pushed the fix-property-array-tooltip-shows-wrong-ID-on-later-pages branch from f43edc0 to d4ac65b Compare September 7, 2023 11:04
@akien-mga akien-mga merged commit d6d8cb1 into godotengine:master Sep 7, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@jsjtxietian jsjtxietian deleted the fix-property-array-tooltip-shows-wrong-ID-on-later-pages branch September 7, 2023 15:11
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.

Property array tooltip shows wrong ID on later pages
4 participants