This commit is contained in:
turanszkij
2020-04-05 22:11:58 +01:00
parent 8cc52a171e
commit aa96b42bd7
26 changed files with 711 additions and 36 deletions
+17 -2
View File
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "MaterialWindow.h"
#include "Editor.h"
#include <sstream>
@@ -8,7 +9,7 @@ using namespace wiGraphics;
using namespace wiECS;
using namespace wiScene;
MaterialWindow::MaterialWindow(wiGUI* gui) : GUI(gui)
MaterialWindow::MaterialWindow(EditorComponent* editor) : GUI(&editor->GetGUI())
{
assert(GUI && "Invalid GUI!");
@@ -364,9 +365,21 @@ MaterialWindow::MaterialWindow(wiGUI* gui) : GUI(gui)
{
*name = args.sValue;
}
});
});
materialWindow->AddWidget(materialNameField);
newMaterialButton = new wiButton("New Material");
newMaterialButton->SetPos(XMFLOAT2(10 + 5 + 300, y));
newMaterialButton->SetSize(XMFLOAT2(100, 25));
newMaterialButton->OnClick([=](wiEventArgs args) {
Scene& scene = wiScene::GetScene();
Entity entity = scene.Entity_CreateMaterial("editorMaterial");
editor->ClearSelected();
editor->AddSelected(entity);
SetEntity(entity);
});
materialWindow->AddWidget(newMaterialButton);
texture_baseColor_Label = new wiLabel("BaseColorMap: ");
texture_baseColor_Label->SetPos(XMFLOAT2(x, y += step));
texture_baseColor_Label->SetSize(XMFLOAT2(120, 20));
@@ -846,4 +859,6 @@ void MaterialWindow::SetEntity(Entity entity)
texture_emissive_uvset_Field->SetText("");
texture_occlusion_uvset_Field->SetText("");
}
newMaterialButton->SetEnabled(true);
}