Files
WickedEngine/Editor/NameWindow.cpp
T
Turánszki János 180ddc3586 0.49 (#160)
* renderer updates: material shadertype, customshaders

* custom shader updates

* hologram fix

* editor windows refactor

* major gui update:
- gui no longer lifetime manager
- window no longer needs gui to construct
- removed gui constructors/destructors
- rewritten every editor window

* renderer update

* gui hasfocus fix

* editor fix

* renderpath upgrades: hybrid forward-deferred

* fix

* water ripple refactor

* cmake fix

* cmake fix

* renderer fix

* volumetric light fix

* customshader stencilref

* cmake fix

* rtdeferred fix

* editor update

* raytraced shadows denoise

* anisotropic shader

* sss stencil greater

* added cartoon shader

* using precomputed tangents

* added unlit object shader

* importer update

* editor update

* editor fix

* vulkan envmap rendering fix

* terrain shader simplification (normal texture mapping instead of triplanar)

* added subsurface profiles, reduced gbuffer

* denoise disocclusion fallback

* editor fix

* more sorting priority for blend than instancing

* hairparticle culling

* particle updates; font update instancing instead of index buffer; vulkan/dx12 fixes;

* shader fixes

* hairparticle trianglestrip and no cross section

* editor fix

* cam wnd update

* terrain shader fix
2020-10-17 13:17:07 +02:00

60 lines
1.2 KiB
C++

#include "stdafx.h"
#include "NameWindow.h"
#include "Editor.h"
using namespace wiECS;
using namespace wiScene;
void NameWindow::Create(EditorComponent* editor)
{
wiWindow::Create("Name Window");
SetSize(XMFLOAT2(360, 80));
float x = 60;
float y = 0;
float step = 25;
float siz = 280;
float hei = 20;
nameInput.Create("");
nameInput.SetDescription("Name: ");
nameInput.SetPos(XMFLOAT2(x, y += step));
nameInput.SetSize(XMFLOAT2(siz, hei));
nameInput.OnInputAccepted([&](wiEventArgs args) {
NameComponent* name = wiScene::GetScene().names.GetComponent(entity);
if (name == nullptr)
{
name = &wiScene::GetScene().names.Create(entity);
}
name->name = args.sValue;
});
AddWidget(&nameInput);
Translate(XMFLOAT3((float)wiRenderer::GetDevice()->GetScreenWidth() - 450, 200, 0));
SetVisible(false);
SetEntity(INVALID_ENTITY);
}
void NameWindow::SetEntity(Entity entity)
{
this->entity = entity;
if (entity != INVALID_ENTITY)
{
SetEnabled(true);
NameComponent* name = wiScene::GetScene().names.GetComponent(entity);
if (name != nullptr)
{
nameInput.SetValue(name->name);
}
}
else
{
SetEnabled(false);
nameInput.SetValue("Select entity to modify name...");
}
}