summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2014-08-14 10:30:20 -0300
committerreduz <reduzio@gmail.com>2014-08-14 10:30:20 -0300
commit2693a883fa08f753e10c8d1321f57717457ba583 (patch)
treeffeae6329c9c42b2d0c5c2ed82e2c18b95cb6e07 /tools/editor
parent20159ea7e956e1d8cd4502acc5d9f6aeb642e9f1 (diff)
parentf5c56f4a3de502ecc8e5d1730f9657abd81a014b (diff)
Merge pull request #595 from marynate/PR-fix-view-grid
Fixed #470 View grid toggle in 3d not working
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index 1bf425f3f3..e9020c91f5 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -2345,8 +2345,7 @@ void SpatialEditor::set_state(const Dictionary& p_state) {
bool use = d["show_grid"];
if (use!=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_GRID))) {
- view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_GRID), use );
- grid_enabled=use;
+ _menu_item_pressed(MENU_VIEW_GRID);
}
}
@@ -2653,6 +2652,13 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
grid_enabled=!is_checked;
+ for(int i=0;i<3;++i) {
+ if (grid_enable[i]) {
+ VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,grid_enabled);
+ grid_visible[i]=grid_enabled;
+ }
+ }
+
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(p_option), grid_enabled );