diff --git a/Editor/Editor.cpp b/Editor/Editor.cpp index aec5133c4..b6bfad545 100644 --- a/Editor/Editor.cpp +++ b/Editor/Editor.cpp @@ -928,24 +928,9 @@ void EditorComponent::Load() playButton.OnClick([&](wi::gui::EventArgs args) { if (last_script_path.empty() || !wi::helper::FileExists(last_script_path)) { - wi::helper::FileDialogParams params; - params.type = wi::helper::FileDialogParams::OPEN; - params.description = ".lua"; - params.extensions.push_back("lua"); - wi::helper::FileDialog(params, [&](std::string fileName) { - wi::eventhandler::Subscribe_Once(wi::eventhandler::EVENT_THREAD_SAFE_POINT, [=](uint64_t userdata) { - - std::string extension = wi::helper::toUpper(wi::helper::GetExtensionFromFileName(fileName)); - if (!extension.compare("LUA")) - { - last_script_path = fileName; - main->config.Set("last_script_path", last_script_path); - main->config.Commit(); - playButton.SetScriptTip("dofile(\"" + last_script_path + "\")"); - wi::lua::RunFile(fileName); - } - }); - }); + contentBrowserWnd.RefreshContent(); + contentBrowserWnd.SetVisible(true); + contentBrowserWnd.SetEnabled(true); } else { @@ -1759,7 +1744,8 @@ void EditorComponent::Update(float dt) XMStoreFloat3(&editorscene.cam_move, move); // Modify camera speed with mouse scroll in FPS mode: - if (std::abs(currentMouse.z) > 0.1f) + // Note: in Paint tool window the scroll is used to modify the brush size + if (!paintToolWnd.IsVisible() && std::abs(currentMouse.z) > 0.1f) { float current = cameraWnd.movespeedSlider.GetValue(); float increment = current > 10 ? 2.0f : 1.0f; diff --git a/Editor/PaintToolWindow.cpp b/Editor/PaintToolWindow.cpp index 1382909a8..f98decce5 100644 --- a/Editor/PaintToolWindow.cpp +++ b/Editor/PaintToolWindow.cpp @@ -90,15 +90,6 @@ void PaintToolWindow::Create(EditorComponent* _editor) radiusSlider.SetValue(vertex_paint_radius); } - if (args.userdata == MODE_TERRAIN_MATERIAL) - { - SetSize(XMFLOAT2(GetSize().x, 1200)); - } - else - { - SetSize(XMFLOAT2(GetSize().x, 800)); - } - }); AddWidget(&modeComboBox); @@ -1926,7 +1917,6 @@ void PaintToolWindow::ResizeLayout() Entity entity = terrain.materialEntities[i]; wi::gui::Button& button = terrain_material_buttons[i]; - button.SetVisible(IsVisible() && !IsCollapsed()); button.SetTheme(theme); button.SetColor(wi::Color::White()); @@ -1996,8 +1986,6 @@ void PaintToolWindow::RecreateTerrainMaterialButtons() wi::gui::Button& button = terrain_material_buttons[i]; button.Create(""); AddWidget(&button); - button.SetVisible(false); - button.SetEnabled(true); button.SetText(""); button.SetTooltip(""); diff --git a/Editor/config.ini b/Editor/config.ini index f3d99aef7..21ffee131 100644 --- a/Editor/config.ini +++ b/Editor/config.ini @@ -7,7 +7,7 @@ #height = 2160 borderless = false fullscreen = false -allow_hdr = true #This will enable HDR display output options (if display is HDR capable) +allow_hdr = false #This will enable HDR display output options (if display is HDR capable) #font = yumin.ttf #This will replace default font by loading a TTF font file [options] @@ -132,7 +132,7 @@ fps = true pressure = true backfaces = false wireframe = true -stabilizer = 8 +stabilizer = 1 [layout] options.width = 338.000000 diff --git a/WickedEngine/wiGUI.cpp b/WickedEngine/wiGUI.cpp index c700ae4af..df2ad6e32 100644 --- a/WickedEngine/wiGUI.cpp +++ b/WickedEngine/wiGUI.cpp @@ -548,6 +548,8 @@ namespace wi::gui { priority_change = val; enabled = val; + if (!enabled) + state = IDLE; } } bool Widget::IsEnabled() const @@ -560,6 +562,8 @@ namespace wi::gui { priority_change |= val; visible = val; + if (!visible) + state = IDLE; } } bool Widget::IsVisible() const