diff --git a/Editor/DecalWindow.cpp b/Editor/DecalWindow.cpp index 2f32e9af5..0b8bdb9b1 100644 --- a/Editor/DecalWindow.cpp +++ b/Editor/DecalWindow.cpp @@ -15,10 +15,29 @@ DecalWindow::DecalWindow(EditorComponent* editor) : GUI(&editor->GetGUI()) GUI->AddWidget(decalWindow); float x = 200; - float y = 0; + float y = 5; + float step = 22; + float itemheight = 20; - decalNameField = new wiTextInputField("MaterialName"); - decalNameField->SetPos(XMFLOAT2(10, 30)); + placementCheckBox = new wiCheckBox("Decal Placement Enabled: "); + placementCheckBox->SetPos(XMFLOAT2(x, y += step)); + placementCheckBox->SetSize(XMFLOAT2(itemheight, itemheight)); + placementCheckBox->SetCheck(false); + placementCheckBox->SetTooltip("Enable decal placement. Use the left mouse button to place decals to the scene."); + decalWindow->AddWidget(placementCheckBox); + + y += step; + + infoLabel = new wiLabel(""); + infoLabel->SetText("Selecting decals will select the according material. Set decal properties (texture, color, etc.) in the Material window."); + infoLabel->SetSize(XMFLOAT2(400 - 20, 100)); + infoLabel->SetPos(XMFLOAT2(10, y)); + infoLabel->SetColor(wiColor::Transparent()); + decalWindow->AddWidget(infoLabel); + y += infoLabel->GetScale().y - step + 5; + + decalNameField = new wiTextInputField("Decal Name"); + decalNameField->SetPos(XMFLOAT2(10, y+=step)); decalNameField->SetSize(XMFLOAT2(300, 20)); decalNameField->OnInputAccepted([&](wiEventArgs args) { NameComponent* name = wiScene::GetScene().names.GetComponent(entity); diff --git a/Editor/DecalWindow.h b/Editor/DecalWindow.h index e7abdf83c..5afe80171 100644 --- a/Editor/DecalWindow.h +++ b/Editor/DecalWindow.h @@ -19,6 +19,8 @@ public: wiECS::Entity entity; void SetEntity(wiECS::Entity entity); + wiCheckBox* placementCheckBox; + wiLabel* infoLabel; wiTextInputField* decalNameField; wiWindow* decalWindow; diff --git a/Editor/Editor.cpp b/Editor/Editor.cpp index 257c8cab8..6016cfbe0 100644 --- a/Editor/Editor.cpp +++ b/Editor/Editor.cpp @@ -1430,7 +1430,7 @@ void EditorComponent::Update(float dt) wiRenderer::PutWaterRipple(wiHelper::GetOriginalWorkingDirectory() + "images/ripple.png", hovered.position); } } - else if (translator.selected.empty() && wiInput::Press(wiInput::MOUSE_BUTTON_LEFT)) + else if (decalWnd->placementCheckBox->GetCheck() && wiInput::Press(wiInput::MOUSE_BUTTON_LEFT)) { // if not water or softbody, put a decal on it: static int decalselector = 0;