Skip to content

Commit

Permalink
Mark alternate editor display modes as disabled in the GLES2 renderer
Browse files Browse the repository at this point in the history
This partially addresses godotengine#27018.
  • Loading branch information
Calinou committed Jan 17, 2020
1 parent e7ee9e0 commit 8bce0b6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions editor/plugins/spatial_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3613,6 +3613,24 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed

view_menu->set_disable_shortcuts(true);

if (OS::get_singleton()->get_current_video_driver() == OS::VIDEO_DRIVER_GLES2) {
// Alternate display modes only work when using the GLES3 renderer; make this explicit.
const int normal_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL);
const int wireframe_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_WIREFRAME);
const int overdraw_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_OVERDRAW);
const int shadeless_idx = view_menu->get_popup()->get_item_index(VIEW_DISPLAY_SHADELESS);
const String unsupported_tooltip = TTR("Not available when using the GLES2 renderer.");

view_menu->get_popup()->set_item_disabled(normal_idx, true);
view_menu->get_popup()->set_item_tooltip(normal_idx, unsupported_tooltip);
view_menu->get_popup()->set_item_disabled(wireframe_idx, true);
view_menu->get_popup()->set_item_tooltip(wireframe_idx, unsupported_tooltip);
view_menu->get_popup()->set_item_disabled(overdraw_idx, true);
view_menu->get_popup()->set_item_tooltip(overdraw_idx, unsupported_tooltip);
view_menu->get_popup()->set_item_disabled(shadeless_idx, true);
view_menu->get_popup()->set_item_tooltip(shadeless_idx, unsupported_tooltip);
}

ED_SHORTCUT("spatial_editor/freelook_left", TTR("Freelook Left"), KEY_A);
ED_SHORTCUT("spatial_editor/freelook_right", TTR("Freelook Right"), KEY_D);
ED_SHORTCUT("spatial_editor/freelook_forward", TTR("Freelook Forward"), KEY_W);
Expand Down

0 comments on commit 8bce0b6

Please sign in to comment.