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

Add autocompletion for a few EditorInterface methods #86893

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions editor/editor_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,21 @@ bool EditorInterface::is_movie_maker_enabled() const {
}

// Base.
void EditorInterface::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
String pf = p_function;
if (p_idx == 0) {
if (pf == "set_main_screen_editor") {
for (String E : { "\"2D\"", "\"3D\"", "\"Script\"", "\"AssetLib\"" }) {
r_options->push_back(E);
}
} else if (pf == "get_editor_viewport_3d") {
for (uint32_t i = 0; i < Node3DEditor::VIEWPORTS_COUNT; i++) {
r_options->push_back(String::num_int64(i));
}
}
}
Object::get_argument_options(p_function, p_idx, r_options);
}

void EditorInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("restart_editor", "save"), &EditorInterface::restart_editor, DEFVAL(true));
Expand Down
2 changes: 2 additions & 0 deletions editor/editor_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ class EditorInterface : public Object {

// Base.

virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;

static void create();
static void free();

Expand Down
Loading