mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Allow negative indexes in ItemList and PopupMenu
This commit is contained in:
parent
d5076439e4
commit
42078dec9f
25 changed files with 163 additions and 59 deletions
|
|
@ -1881,7 +1881,7 @@ void ScriptEditor::_update_members_overview() {
|
|||
String name = functions[i].get_slice(":", 0);
|
||||
if (filter.is_empty() || filter.is_subsequence_ofn(name)) {
|
||||
members_overview->add_item(name);
|
||||
members_overview->set_item_metadata(members_overview->get_item_count() - 1, functions[i].get_slice(":", 1).to_int() - 1);
|
||||
members_overview->set_item_metadata(-1, functions[i].get_slice(":", 1).to_int() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2139,7 +2139,7 @@ void ScriptEditor::_update_script_names() {
|
|||
for (int i = 0; i < sedata_filtered.size(); i++) {
|
||||
script_list->add_item(sedata_filtered[i].name, sedata_filtered[i].icon);
|
||||
if (sedata_filtered[i].tool) {
|
||||
script_list->set_item_icon_modulate(script_list->get_item_count() - 1, tool_color);
|
||||
script_list->set_item_icon_modulate(-1, tool_color);
|
||||
}
|
||||
|
||||
int index = script_list->get_item_count() - 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue