Added customisable grid color, issue 3781
This commit is contained in:
parent
e04e55f822
commit
a82ecf6d80
2 changed files with 9 additions and 4 deletions
|
@ -574,6 +574,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
|||
|
||||
set("grid_map/pick_distance", 5000.0);
|
||||
|
||||
set("3d_editor/grid_color",Color(0,1,0,0.2));
|
||||
hints["3d_editor/grid_color"]=PropertyInfo(Variant::COLOR,"3d_editor/grid_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
|
||||
set("3d_editor/default_fov",45.0);
|
||||
set("3d_editor/default_z_near",0.1);
|
||||
set("3d_editor/default_z_far",500.0);
|
||||
|
|
|
@ -3151,6 +3151,8 @@ void SpatialEditor::_init_indicators() {
|
|||
Vector<Color> origin_colors;
|
||||
Vector<Vector3> origin_points;
|
||||
|
||||
Color grid_color = EditorSettings::get_singleton()->get("3d_editor/grid_color");
|
||||
|
||||
for(int i=0;i<3;i++) {
|
||||
Vector3 axis;
|
||||
axis[i]=1;
|
||||
|
@ -3168,10 +3170,10 @@ void SpatialEditor::_init_indicators() {
|
|||
for(int j=-ORIGIN_GRID_SIZE;j<=ORIGIN_GRID_SIZE;j++) {
|
||||
|
||||
|
||||
grid_colors[i].push_back(Color(axis.x,axis.y,axis.z,0.2));
|
||||
grid_colors[i].push_back(Color(axis.x,axis.y,axis.z,0.2));
|
||||
grid_colors[i].push_back(Color(axis.x,axis.y,axis.z,0.2));
|
||||
grid_colors[i].push_back(Color(axis.x,axis.y,axis.z,0.2));
|
||||
grid_colors[i].push_back(grid_color);
|
||||
grid_colors[i].push_back(grid_color);
|
||||
grid_colors[i].push_back(grid_color);
|
||||
grid_colors[i].push_back(grid_color);
|
||||
grid_points[i].push_back(axis_n1*ORIGIN_GRID_SIZE+axis_n2*j);
|
||||
grid_points[i].push_back(-axis_n1*ORIGIN_GRID_SIZE+axis_n2*j);
|
||||
grid_points[i].push_back(axis_n2*ORIGIN_GRID_SIZE+axis_n1*j);
|
||||
|
|
Loading…
Reference in a new issue