f1ced24f05
* multi swapchain draft * uwp fix * swapchain resize handling * swapchain buffercount * vsync toggle * tests fix * update * everything removed from graphicsdevice regarding global screen params, engine refactor * added GetSwapChainTexture() function to graphics device; screenshot() now requires swapChain * linux fix: vulkan device needs window handle for instance creation * refactor * removed unused includes * shader refactor and lensflare fix * swapchain clearcolor and other refactors * vulkan: no vector allocation in submit * tests fix * refactors * lens flare canvas size fix * gui refactor for canvas support * refactors * removed global canvas state * msaa fix * fixes * refactor to minimize interface changes * gui changes * checkbox fix * gui fixes * fixes * input system will accept window handle * editor fixes * refactor and removed resolution related system events * small editor update * refactor: renderpath inherits from canvas * fixed tests duh * image refactor * image fix * removed every using namespace std * pushconstant fix * editor: object picking only when necessary * removed include * dx12: copy fence waiting performed on CPU * dx12 copyallocator update * vulkan: copy allocator with timeline semaphores * missing include * dx12 copy allocator update * refactor * editor update * vulkan copy allocator fix * dx12 update * vulkan, dx12 fixes * version bump * vsync event helper * documentation update * updated vulkan, dx12, dxc
62 lines
1.2 KiB
C++
62 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;
|
|
|
|
editor->RefreshSceneGraphView();
|
|
});
|
|
AddWidget(&nameInput);
|
|
|
|
Translate(XMFLOAT3((float)editor->GetLogicalWidth() - 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...");
|
|
}
|
|
}
|