diff --git a/Editor/Editor.cpp b/Editor/Editor.cpp index 4fccb54bb..aaa112362 100644 --- a/Editor/Editor.cpp +++ b/Editor/Editor.cpp @@ -545,7 +545,6 @@ void EditorComponent::Load() newEntityCombo.SetDropArrowEnabled(false); newEntityCombo.SetFixedDropWidth(200); newEntityCombo.SetMaxVisibleItemCount(16); - newEntityCombo.SetAngularHighlightWidth(3); newEntityCombo.AddItem("Transform " ICON_TRANSFORM, NEW_TRANSFORM); newEntityCombo.AddItem("Material " ICON_MATERIAL, NEW_MATERIAL); newEntityCombo.AddItem("Point Light " ICON_POINTLIGHT, NEW_POINTLIGHT); diff --git a/Editor/GeneralWindow.cpp b/Editor/GeneralWindow.cpp index 6d95aa7ed..3f3958f14 100644 --- a/Editor/GeneralWindow.cpp +++ b/Editor/GeneralWindow.cpp @@ -154,7 +154,20 @@ void GeneralWindow::Create(EditorComponent* _editor) forceDiffuseLightingCheckBox.SetCheck(wi::renderer::IsForceDiffuseLighting()); AddWidget(&forceDiffuseLightingCheckBox); - + focusModeCheckBox.Create(ICON_EYE " Focus mode GUI: "); + focusModeCheckBox.SetCheckText(ICON_EYE); + focusModeCheckBox.SetTooltip("Reduce the amount of effects in the editor GUI to improve accessibility"); + if (editor->main->config.GetSection("options").Has("focus_mode")) + { + focusModeCheckBox.SetCheck(editor->main->config.GetSection("options").GetBool("focus_mode")); + } + focusModeCheckBox.OnClick([&](wi::gui::EventArgs args) { + editor->main->config.GetSection("options").Set("focus_mode", args.bValue); + // trigger themeCombo's OnSelect handler, which will enable/disable shadow highlighting + // according to this checkbox's state + themeCombo.SetSelected(themeCombo.GetSelected()); + }); + AddWidget(&focusModeCheckBox); versionCheckBox.Create("Version: "); versionCheckBox.SetTooltip("Toggle the engine version display text in top left corner."); @@ -385,7 +398,7 @@ void GeneralWindow::Create(EditorComponent* _editor) break; } - theme.shadow_highlight = true; + theme.shadow_highlight = !focusModeCheckBox.GetCheck(); theme.shadow_highlight_spread = 0.6f; theme.shadow_highlight_color = theme_color_focus; theme.shadow_highlight_color.x *= 1.4f; @@ -777,6 +790,16 @@ void GeneralWindow::Create(EditorComponent* _editor) sprite.params.corners_rounding[3].radius = 10; } + if (focusModeCheckBox.GetCheck()) + { + editor->newEntityCombo.SetAngularHighlightWidth(0); + editor->newEntityCombo.SetShadowRadius(2); + } + else + { + editor->newEntityCombo.SetAngularHighlightWidth(3); + editor->newEntityCombo.SetShadowRadius(0); + } }); AddWidget(&themeCombo); @@ -993,6 +1016,9 @@ void GeneralWindow::ResizeLayout() add_right(freezeCullingCameraCheckBox); add_right(disableAlbedoMapsCheckBox); add_right(forceDiffuseLightingCheckBox); + y += jump; + + add_right(focusModeCheckBox); y += jump; diff --git a/Editor/GeneralWindow.h b/Editor/GeneralWindow.h index 25cf045c0..33da1b5f9 100644 --- a/Editor/GeneralWindow.h +++ b/Editor/GeneralWindow.h @@ -31,6 +31,7 @@ public: wi::gui::CheckBox freezeCullingCameraCheckBox; wi::gui::CheckBox disableAlbedoMapsCheckBox; wi::gui::CheckBox forceDiffuseLightingCheckBox; + wi::gui::CheckBox focusModeCheckBox; wi::gui::Slider transformToolOpacitySlider; wi::gui::Slider bonePickerOpacitySlider; diff --git a/Editor/IconDefinitions.h b/Editor/IconDefinitions.h index 23339198d..a79d95497 100644 --- a/Editor/IconDefinitions.h +++ b/Editor/IconDefinitions.h @@ -96,3 +96,5 @@ #define ICON_CAMERAOPTIONS ICON_CAMERA #define ICON_MATERIALBROWSER ICON_MATERIAL #define ICON_PAINTTOOL ICON_FA_PAINTBRUSH + +#define ICON_EYE ICON_FA_EYE diff --git a/WickedEngine/wiGUI.cpp b/WickedEngine/wiGUI.cpp index db08a5ad3..3a3d42ca7 100644 --- a/WickedEngine/wiGUI.cpp +++ b/WickedEngine/wiGUI.cpp @@ -339,7 +339,6 @@ namespace wi::gui sprites[state].Update(dt); font.Update(dt); - angular_highlight_timer += dt; } void Widget::Render(const wi::Canvas& canvas, wi::graphics::CommandList cmd) const @@ -993,6 +992,10 @@ namespace wi::gui fx.highlight_color = shadow_highlight_color; fx.highlight_spread = shadow_highlight_spread; } + else + { + fx.disableHighlight(); + } wi::image::Draw(nullptr, fx, cmd); } @@ -1399,6 +1402,10 @@ namespace wi::gui fx.highlight_color = shadow_highlight_color; fx.highlight_spread = shadow_highlight_spread; } + else + { + fx.disableHighlight(); + } wi::image::Draw(nullptr, fx, cmd); } @@ -1701,6 +1708,10 @@ namespace wi::gui fx.highlight_color = shadow_highlight_color; fx.highlight_spread = shadow_highlight_spread; } + else + { + fx.disableHighlight(); + } wi::image::Draw(nullptr, fx, cmd); } @@ -2065,6 +2076,10 @@ namespace wi::gui fx.highlight_color = shadow_highlight_color; fx.highlight_spread = shadow_highlight_spread; } + else + { + fx.disableHighlight(); + } wi::image::Draw(nullptr, fx, cmd); } @@ -2243,6 +2258,10 @@ namespace wi::gui fx.highlight_color = shadow_highlight_color; fx.highlight_spread = shadow_highlight_spread; } + else + { + fx.disableHighlight(); + } wi::image::Draw(nullptr, fx, cmd); } @@ -2604,6 +2623,10 @@ namespace wi::gui fx.highlight_color = shadow_highlight_color; fx.highlight_spread = shadow_highlight_spread; } + else + { + fx.disableHighlight(); + } wi::image::Draw(nullptr, fx, cmd); } @@ -3608,6 +3631,10 @@ namespace wi::gui fx.highlight_color = shadow_highlight_color; fx.highlight_spread = shadow_highlight_spread; } + else + { + fx.disableHighlight(); + } wi::image::Draw(nullptr, fx, cmd); } @@ -5245,6 +5272,10 @@ namespace wi::gui fx.highlight_color = shadow_highlight_color; fx.highlight_spread = shadow_highlight_spread; } + else + { + fx.disableHighlight(); + } wi::image::Draw(nullptr, fx, cmd); }