diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index c17ec5824..7ebee8d09 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -264,6 +264,7 @@ + @@ -414,6 +415,7 @@ + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 5de5f126a..07c30a054 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -418,6 +418,9 @@ {754c2260-5073-4489-9fa8-0df8da6d0255} + + {9d80f32a-aaca-490e-babf-3a7fe4cc0600} + @@ -816,6 +819,9 @@ 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header_Line + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Vidio_Border + @@ -1213,6 +1219,9 @@ 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header_Line + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Vidio_Border + diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 616889a06..eecad3678 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -76,6 +76,7 @@ #include "Spell_Preview.h" #include "Spell_Header.h" #include "Spell_Header_Line.h" +#include "Spell_Vidio_Border.h" #include "IMGUIUI.h" @@ -750,6 +751,10 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Vidio_Border::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CIMGUIUI::Create(m_pDevice, m_pContext)))) { diff --git a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp index fdd895bbb..7a9613978 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp @@ -10,6 +10,7 @@ #include "Spell_Hover.h" #include "Spell_Hover_Effect.h" #include "Spell_Preview.h" +#include "Spell_Vidio_Border.h" CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -217,6 +218,12 @@ HRESULT CSpell_Panel::Ready_Element(void* pArg) } Add_Element(TEXT("Spell_Preview"), m_pSpell_Preview); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Vidio_Border)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Vidio_Border"), m_pSpell_Vidio_Border); + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp new file mode 100644 index 000000000..094e65afd --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp @@ -0,0 +1,229 @@ +#include "pch.h" +#include "Spell_Vidio_Border.h" +#include "GameInstance.h" + +CSpell_Vidio_Border::CSpell_Vidio_Border(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Vidio_Border::CSpell_Vidio_Border(const CSpell_Vidio_Border& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Vidio_Border::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Vidio_Border::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 590.f; + Desc.fY = -100.f; + Desc.fSizeX = 520.f; + Desc.fSizeY = 275.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_fMoveSpeed = 5.f; + m_fLerpX = m_fX; + m_fLerpY = 45; + return S_OK; +} + +void CSpell_Vidio_Border::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Vidio_Border::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); + +} + +void CSpell_Vidio_Border::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_Vidio_Border::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_Vidio_Border::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Vidio_Border::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Vidio_Border::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_TalentVideoBorder"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Vidio_Border* CSpell_Vidio_Border::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Vidio_Border* pInstance = new CSpell_Vidio_Border(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Vidio_Border"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Vidio_Border::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Vidio_Border* pInstance = new CSpell_Vidio_Border(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Vidio_Border"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Vidio_Border::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Vidio_Border::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Public/Spell_Panel.h b/Jusin154_Team3D/Editor/Public/Spell_Panel.h index e10c33c99..fc3e3dcc6 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Panel.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Panel.h @@ -44,6 +44,7 @@ class CSpell_Panel final : public CPanelObject CGameObject* m_pSpell_Hover = { nullptr }; CGameObject* m_pSpell_Hover_Effect = { nullptr }; CGameObject* m_pSpell_Preview = { nullptr }; + CGameObject* m_pSpell_Vidio_Border = { nullptr }; public: static CSpell_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h new file mode 100644 index 000000000..d447cc059 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Vidio_Border final : public CElementObject +{ +private: + CSpell_Vidio_Border(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Vidio_Border(const CSpell_Vidio_Border& rhs); + virtual ~CSpell_Vidio_Border() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpell_Vidio_Border* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END