From 5889dd1b33e26708f0454032af124a9821e55eb7 Mon Sep 17 00:00:00 2001 From: qordlsgur <127704460+qordlsgur@users.noreply.github.com> Date: Tue, 2 Dec 2025 08:36:47 +0900 Subject: [PATCH] =?UTF-8?q?[Add]=20=EC=98=81=EC=83=81=20=EB=A7=88=EC=9A=B0?= =?UTF-8?q?=EC=8A=A4=20=EC=98=AC=EB=A6=B0=EA=B1=B0=EB=A1=9C=20=EB=B0=94?= =?UTF-8?q?=EB=80=8C=EA=B2=8C=20=EC=95=A0=EB=A7=A4=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jusin154_Team3D/Client/Public/Client_Struct.h | 4 +- .../Bin/Resources/Data/UI/Spell/SpellInfo.xml | 36 +++ .../ShaderFiles/Shader_UI_Instance.hlsl | 4 +- Jusin154_Team3D/Editor/Default/Editor.vcxproj | 4 + .../Editor/Default/Editor.vcxproj.filters | 24 +- .../Editor/Private/Current_Slot_Number.cpp | 278 ++++++++++++++++++ .../Editor/Private/Eessential_Spell_Slot.cpp | 34 +-- Jusin154_Team3D/Editor/Private/Level_UI.cpp | 5 +- Jusin154_Team3D/Editor/Private/Loader.cpp | 12 + Jusin154_Team3D/Editor/Private/Spell_Anim.cpp | 81 +++-- Jusin154_Team3D/Editor/Private/Spell_Data.cpp | 52 ++++ Jusin154_Team3D/Editor/Private/Spell_Drag.cpp | 1 + .../Editor/Private/Spell_Header.cpp | 38 ++- .../Editor/Private/Spell_Header_Line.cpp | 33 ++- .../Editor/Private/Spell_Hover.cpp | 21 +- .../Editor/Private/Spell_Hover_Effect.cpp | 23 +- Jusin154_Team3D/Editor/Private/Spell_List.cpp | 29 +- .../Editor/Private/Spell_Panel.cpp | 80 ++++- .../Editor/Private/Spell_Preview.cpp | 25 +- .../Editor/Private/Spell_Vidio_Border.cpp | 50 ++-- .../Editor/Public/Current_Slot_Number.h | 52 ++++ Jusin154_Team3D/Editor/Public/Editor_Define.h | 4 +- .../Editor/Public/Eessential_Spell_Slot.h | 8 +- Jusin154_Team3D/Editor/Public/Spell_Anim.h | 9 +- Jusin154_Team3D/Editor/Public/Spell_Data.h | 21 ++ Jusin154_Team3D/Editor/Public/Spell_Drag.h | 5 + Jusin154_Team3D/Editor/Public/Spell_Header.h | 4 +- .../Editor/Public/Spell_Header_Line.h | 3 - Jusin154_Team3D/Editor/Public/Spell_Hover.h | 1 - .../Editor/Public/Spell_Hover_Effect.h | 3 - Jusin154_Team3D/Editor/Public/Spell_List.h | 7 +- Jusin154_Team3D/Editor/Public/Spell_Panel.h | 23 +- Jusin154_Team3D/Editor/Public/Spell_Preview.h | 3 +- .../Editor/Public/Spell_Vidio_Border.h | 10 +- Jusin154_Team3D/Engine/Private/UIObject.cpp | 24 +- .../Engine/Private/VIBuffer_UI_Instance.cpp | 48 ++- Jusin154_Team3D/Engine/Public/UIObject.h | 23 ++ .../Engine/Public/VIBuffer_UI_Instance.h | 1 + 38 files changed, 875 insertions(+), 208 deletions(-) create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml create mode 100644 Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp create mode 100644 Jusin154_Team3D/Editor/Private/Spell_Drag.cpp create mode 100644 Jusin154_Team3D/Editor/Public/Current_Slot_Number.h create mode 100644 Jusin154_Team3D/Editor/Public/Spell_Drag.h diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index c3c76619d..498525f3d 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -21,7 +21,9 @@ namespace Client _uint iSpell_ID{}; _wstring pSpell_Name; _uint iSpell_Type{}; - _uint iSpell_CoolTime{}; + _uint iSkill_Type{}; + _float fSpell_CoolTime{}; + _float fDuration{}; _uint iAnimNum{}; _wstring pSpellInfo; _bool bSpell_Lock = false; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml new file mode 100644 index 000000000..e95b0bb5d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl index 5b35a6cf9..593c4b16a 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl @@ -43,7 +43,7 @@ VS_OUT VS_MAIN(VS_IN In) matrix matVP = mul(g_ViewMatrix, g_ProjMatrix); float3 vLocalPos = In.vPosition; - if (In.bHover != 0) + if (In.bHover == 1) vLocalPos.xy *= In.vSize * 1.1f; else vLocalPos.xy *= In.vSize; @@ -274,7 +274,7 @@ PS_OUT PS_Spell_Effect(PS_IN In) //float angle = -g_fTime; //float s = sin(angle); //float c = cos(angle); - //float2 rotUV = float2( + //float2 maskUV = float2( //uv.x * c - uv.y * s, //uv.x * s + uv.y * c //) + center; diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 90acba622..2f838d71f 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -166,6 +166,7 @@ + @@ -260,6 +261,7 @@ + @@ -322,6 +324,7 @@ + @@ -418,6 +421,7 @@ + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 0fa1be799..e9e3ed1fb 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -436,12 +436,18 @@ {99652c97-4011-4d1f-84fb-7e6aa9f6ec1a} - - {4aa98871-8d80-4757-b616-e96f4e840857} - {3949bd3b-1686-43e3-822c-d3eabe41653e} + + {2f8a3c68-c3d3-43cc-9649-16e0cfd168fa} + + + {dcc220a9-4649-4f95-9205-9eee9af128ec} + + + {4aa98871-8d80-4757-b616-e96f4e840857} + @@ -864,6 +870,12 @@ 50.UI\Spell_Data + + 50.UI\Spell_Canvas\Spell_Panel\Current_Slot_Number + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Drag + @@ -1285,6 +1297,12 @@ 50.UI\Spell_Data + + 50.UI\Spell_Canvas\Spell_Panel\Current_Slot_Number + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Drag + diff --git a/Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp b/Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp new file mode 100644 index 000000000..f7bb015e0 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp @@ -0,0 +1,278 @@ +#include "pch.h" +#include "Current_Slot_Number.h" +#include "GameInstance.h" + +CCurrent_Slot_Number::CCurrent_Slot_Number(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CCurrent_Slot_Number::CCurrent_Slot_Number(const CCurrent_Slot_Number& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CCurrent_Slot_Number::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCurrent_Slot_Number::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 35.f; + Desc.fSizeY = 35.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_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 105.f; + m_fOffSetY = 101.f; + m_iCols = 4; + UV(); + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-805.f, 380.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(pUVDesc); + return S_OK; +} + +void CCurrent_Slot_Number::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CCurrent_Slot_Number::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 CCurrent_Slot_Number::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CCurrent_Slot_Number::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 CCurrent_Slot_Number::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CCurrent_Slot_Number::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CCurrent_Slot_Number::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CCurrent_Slot_Number::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CCurrent_Slot_Number::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_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 CCurrent_Slot_Number::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Slot_Number_UI_Instance"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Number"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +void CCurrent_Slot_Number::UV() +{ + pUVDesc[0].fUV = Meter_Index(1); + pUVDesc[1].fUV = Meter_Index(2); + pUVDesc[2].fUV = Meter_Index(3); + pUVDesc[3].fUV = Meter_Index(4); +} + +_float4 CCurrent_Slot_Number::Meter_Index(_uint Number) +{ + m_fIamge_Size = { 320.f, 128.f }; + + _uint iXCount = 5; + _uint iYCount = 2; + + _float frameWidth = 64.f; + _float frameHeight = 64.f; + + _uint frameX = Number % iXCount; + _uint frameY = Number / iXCount; + + _float4 UV; + UV.x = frameX * frameWidth / m_fIamge_Size.x; + UV.y = frameY * frameHeight / m_fIamge_Size.y; + UV.z = UV.x + (frameWidth / m_fIamge_Size.x); + UV.w = UV.y + (frameHeight / m_fIamge_Size.y); + + return UV; +} + +CCurrent_Slot_Number* CCurrent_Slot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCurrent_Slot_Number* pInstance = new CCurrent_Slot_Number(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCurrent_Slot_Number"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CCurrent_Slot_Number::Clone(void* pArg, CGameObject* pOwner) +{ + CCurrent_Slot_Number* pInstance = new CCurrent_Slot_Number(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSlot_Number"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCurrent_Slot_Number::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CCurrent_Slot_Number::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp index 7f376933b..b8fc818c2 100644 --- a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp @@ -46,6 +46,8 @@ HRESULT CEessential_Spell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(-731.f, -300.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_fDelayTime = 0.5f; + m_iPerSpell_Slot = -1; return S_OK; } @@ -89,7 +91,7 @@ void CEessential_Spell_Slot::Update(_float fTimeDelta) } } - Hover(); + Hover(fTimeDelta); m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); @@ -154,7 +156,7 @@ void CEessential_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } -void CEessential_Spell_Slot::Hover() +void CEessential_Spell_Slot::Hover(_float fTimeDelta) { POINT ptMouse{}; GetCursorPos(&ptMouse); @@ -167,25 +169,23 @@ void CEessential_Spell_Slot::Hover() fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; - m_bPrevHover = m_bHover; - m_bHover = (m_iSpellType = m_pVIBufferCom->Set_Mouse_Hover(fMouse)); - if (m_iSpellType != -1) + + m_iSpellType = m_pVIBufferCom->Set_Mouse_Hover(fMouse); + CUIObject::HOVER_INFO Info; + Info.iSlotID = 1; + if (m_iSpellType == -1) { - m_bHover = true; - if (m_bHover == true && m_bPrevHover == false) - { - m_iSpellType += ENUM_CLASS(SKILL_TYPE::JAP); - static_cast(m_pOwner)->Set_SkillType(m_iSpellType); - } + Info.iHover_Index = -1; + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); + } + else { - m_bHover = false; - if (m_bHover == false && m_bPrevHover == true) - { - static_cast(m_pOwner)->Set_SkillType(m_iSpellType); - } - } + Info.iHover_Index = m_iSpellType + ENUM_CLASS(SKILL_TYPE::JAP); + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); + + } } diff --git a/Jusin154_Team3D/Editor/Private/Level_UI.cpp b/Jusin154_Team3D/Editor/Private/Level_UI.cpp index 89438401e..6eda2432e 100644 --- a/Jusin154_Team3D/Editor/Private/Level_UI.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_UI.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_UI.h" #include "GameInstance.h" #include "Level_Loading.h" @@ -6,6 +6,7 @@ #include "IMGUIUI.h" #include "GamePlay_Canvas.h" #include "Mouse_Cursor.h" +#include "Spell_Data.h" CLevel_UI::CLevel_UI(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -33,7 +34,7 @@ void CLevel_UI::Update(_float fTimeDelta) HRESULT CLevel_UI::Render() { - SetWindowText(g_hWnd, TEXT("UI·¹º§ÀԴϴÙ.")); + SetWindowText(g_hWnd, TEXT("UI레벨입니다.")); GUI::ShowDemoWindow(); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index f9d179fa8..ca36baa9f 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -36,6 +36,8 @@ #pragma region UI +#include "Spell_Data.h" + #include "GamePlay_Canvas.h" #include "Mission_Panel.h" @@ -78,6 +80,7 @@ #include "Spell_Header_Line.h" #include "Spell_Vidio_Border.h" #include "Spell_Anim.h" +#include "Current_Slot_Number.h" #include "IMGUIUI.h" @@ -813,6 +816,11 @@ HRESULT CLoader::Loading_For_UI() m_strMessage = TEXT("Prototype Loading.."); + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Data::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGamePlay_Canvas::Create(m_pDevice, m_pContext)))) { return E_FAIL; @@ -968,6 +976,10 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCurrent_Slot_Number::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_Anim.cpp b/Jusin154_Team3D/Editor/Private/Spell_Anim.cpp index 8ffec41f8..333921bdf 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Anim.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Anim.cpp @@ -21,8 +21,8 @@ HRESULT CSpell_Anim::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 0.f; - Desc.fY = 0.f; + Desc.fX = 590.f; + Desc.fY = -100.f; Desc.fSizeX = 470.f; Desc.fSizeY = 250.f; @@ -38,23 +38,34 @@ HRESULT CSpell_Anim::Initialize(void* pArg) } m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; + m_fAlpha = 0.f; + m_fAlphaTime = 9.f; m_fSortZ = 0.01f; - m_iTotalFrames = 216; + m_iTotalFrames = 120; m_fFrameTime = 0.1f; m_iCurrentFrame = 0; m_bAnim_Start = false; + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); return S_OK; } void CSpell_Anim::Priority_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } __super::Priority_Update(fTimeDelta); } void CSpell_Anim::Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bFadeIn == true) { if (m_fAlpha <= 1.f) @@ -69,26 +80,20 @@ void CSpell_Anim::Update(_float fTimeDelta) 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_bFadeOut = false; + m_fAlpha = 0.f; + m_bAnim_Start = false; } - if (m_pGameInstance->Key_Down(DIK_9)) - { - m_bAnim_Start = !m_bAnim_Start; - } - if (m_bAnim_Start) + + if (m_bAnim_Start == true) { m_fTime += fTimeDelta * m_fTimeMult; } else + { m_iCurrentFrame = 0; + } if (m_fTime >= m_fFrameTime) { @@ -104,14 +109,20 @@ void CSpell_Anim::Update(_float fTimeDelta) void CSpell_Anim::Late_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bVisible) { - m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + if (m_pDiffuse_TextureCom != nullptr) + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); } __super::Late_Update(fTimeDelta); } HRESULT CSpell_Anim::Render() { + if (FAILED(Bind_ShaderResources())) { return E_FAIL; @@ -137,12 +148,37 @@ _vector CSpell_Anim::Get_WorldPostion() return m_pTransformCom->Get_State(STATE::POSITION); } -void CSpell_Anim::Anim_Start(_uint iSpell_Id) +void CSpell_Anim::Set_FadeIn() { + if (!m_bFadeIn && m_fAlpha < 1.f) + { + m_bFadeIn = true; + m_bFadeOut = false; + } + m_bAnim_Start = true; } -void CSpell_Anim::Anim_End() +void CSpell_Anim::Change_Image(_int SpellID) { + _wstring pImageName = static_cast(m_pOwner)->Get_Info(SpellID).pImage_Name; + m_iTotalFrames = static_cast(m_pOwner)->Get_Info(SpellID).iAnimNum; + if (m_pDiffuse_TextureCom) + { + Remove_Component(); + SAFE_RELEASE(m_pDiffuse_TextureCom); + } + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(LEVEL::UI), pImageName, reinterpret_cast(&m_pDiffuse_TextureCom)))) + return; +} + +void CSpell_Anim::Set_SkillType(_int eType) +{ + if (eType != -1 && eType != m_iPerSpell) + { + m_iPerSpell = eType; + m_iCurrentFrame = 0; + Change_Image(eType); + } } HRESULT CSpell_Anim::Bind_ShaderResources() @@ -188,7 +224,7 @@ HRESULT CSpell_Anim::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Crucio"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Arresto_Momentum"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } @@ -196,7 +232,6 @@ HRESULT CSpell_Anim::Ready_Components(void* pArg) { return E_FAIL; } - return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Data.cpp b/Jusin154_Team3D/Editor/Private/Spell_Data.cpp index decc62317..2d61fc8c4 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Data.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Data.cpp @@ -1,6 +1,10 @@ #include "pch.h" #include "Spell_Data.h" #include "GameObject.h" +#include "UIObject.h" +#include "tinyxml2.h" + +; CSpell_Data::CSpell_Data(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CGameObject(pDevice, pContext) @@ -14,14 +18,62 @@ CSpell_Data::CSpell_Data(const CSpell_Data& rhs) HRESULT CSpell_Data::Initialize_Prototype() { + return S_OK; } HRESULT CSpell_Data::Initialize(void* pArg) { + auto* pInfo = static_cast(pArg); + + tinyxml2::XMLDocument doc; + tinyxml2::XMLError Error = doc.LoadFile("../Bin/Resources/Data/UI/Spell/SpellInfo.xml"); + if (Error != tinyxml2::XML_SUCCESS) + return E_FAIL; + + tinyxml2::XMLElement* pSpellInfo = doc.FirstChildElement("SpellInfo"); + if (!pSpellInfo) + return E_FAIL; + + tinyxml2::XMLElement* pSpell = pSpellInfo->FirstChildElement("Spell"); + while (pSpell) + { + int id = 0; + pSpell->QueryIntAttribute("Spell_ID", &id); + + if (id < 0 || id > 34) + { + pSpell = pSpell->NextSiblingElement("Spell"); + continue; + } + + pInfo[id].iSpell_ID = id; + pInfo[id].pSpell_Name = CMyTools::ToWstring(pSpell->Attribute("Spell_Name")); + pInfo[id].pImage_Name = CMyTools::ToWstring(pSpell->Attribute("Image_Name")); + pSpell->QueryIntAttribute("Spell_Type", &pInfo[id].iSpell_Type); + pSpell->QueryIntAttribute("Skill_Type", &pInfo[id].iSkill_Type); + pSpell->QueryFloatAttribute("Spell_Cooltime", &pInfo[id].fSpell_CoolTime); + pSpell->QueryFloatAttribute("Duration", &pInfo[id].fDuration); + pSpell->QueryIntAttribute("AnimNum", &pInfo[id].iAnimNum); + pInfo[id].pSpellInfo = CMyTools::ToWstring(pSpell->Attribute("SpellInfo")); + int lock = 0, equip = 0; + pSpell->QueryIntAttribute("Spell_Lock", &lock); + pSpell->QueryIntAttribute("Equip_Spell", &equip); + pInfo[id].bSpell_Lock = lock != 0; + pInfo[id].bEquip_Spell = equip != 0; + + pSpell = pSpell->NextSiblingElement("Spell"); + } + + //pInfo = SpellInfo; return S_OK; } +//const CUIObject::SPELLINFO& CSpell_Data::Get_Info(_uint SpellID) const +//{ +// return SpellInfo[SpellID]; +//} + void CSpell_Data::Priority_Update(_float fTimeDelta) { } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Drag.cpp b/Jusin154_Team3D/Editor/Private/Spell_Drag.cpp new file mode 100644 index 000000000..bcb5590be --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Drag.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/Jusin154_Team3D/Editor/Private/Spell_Header.cpp b/Jusin154_Team3D/Editor/Private/Spell_Header.cpp index 284be9ad9..190672a47 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Header.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Header.cpp @@ -21,8 +21,8 @@ HRESULT CSpell_Header::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 0.f; - Desc.fY = -20.f; + Desc.fX = 600.f; + Desc.fY = -385.f; Desc.fSizeX = 512.f; Desc.fSizeY = 64.f; @@ -38,21 +38,32 @@ HRESULT CSpell_Header::Initialize(void* pArg) } m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; + m_fAlpha = 0.f; + m_fAlphaTime = 5.f; m_fMoveSpeed = 5.f; m_fLerpX = m_fX; m_fLerpY = 45; + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); return S_OK; } void CSpell_Header::Priority_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } __super::Priority_Update(fTimeDelta); } void CSpell_Header::Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bFadeIn == true) { if (m_fAlpha <= 1.f) @@ -70,7 +81,7 @@ void CSpell_Header::Update(_float fTimeDelta) if (m_bFadeOut == true) { if (m_fAlpha >= 0.f) - m_fAlpha -= fTimeDelta; + m_fAlpha -= fTimeDelta * m_fAlphaTime;; if (m_fAlpha <= 0.f) { @@ -79,13 +90,23 @@ void CSpell_Header::Update(_float fTimeDelta) } } + if (m_iSpellType != -1) + { + m_iSkillType = static_cast(m_pOwner)->Get_Info(m_iSpellType).iSpell_Type; + } + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } void CSpell_Header::Late_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); __super::Late_Update(fTimeDelta); } } @@ -113,11 +134,6 @@ _vector CSpell_Header::Get_WorldPostion() return m_pTransformCom->Get_State(STATE::POSITION); } -void CSpell_Header::MoveY(_float fY) -{ - m_fY += fY; -} - HRESULT CSpell_Header::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) @@ -156,7 +172,7 @@ HRESULT CSpell_Header::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSkillType, sizeof(_int)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp b/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp index dbd3bdaf5..6810ed202 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp @@ -21,8 +21,8 @@ HRESULT CSpell_Header_Line::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 0.f; - Desc.fY = 20.f; + Desc.fX = 600.f; + Desc.fY = -345.f; Desc.fSizeX = 487.f; Desc.fSizeY = 18.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) }; @@ -37,19 +37,28 @@ HRESULT CSpell_Header_Line::Initialize(void* pArg) } m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; - m_fMoveSpeed = 5.f; + m_fAlpha = 0.f; + m_fAlphaTime = 5.f; + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); return S_OK; } void CSpell_Header_Line::Priority_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } __super::Priority_Update(fTimeDelta); } void CSpell_Header_Line::Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bFadeIn == true) { if (m_fAlpha <= 1.f) @@ -67,7 +76,7 @@ void CSpell_Header_Line::Update(_float fTimeDelta) if (m_bFadeOut == true) { if (m_fAlpha >= 0.f) - m_fAlpha -= fTimeDelta; + m_fAlpha -= fTimeDelta * m_fAlphaTime;; if (m_fAlpha <= 0.f) { @@ -75,14 +84,19 @@ void CSpell_Header_Line::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } void CSpell_Header_Line::Late_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); __super::Late_Update(fTimeDelta); } } @@ -110,11 +124,6 @@ _vector CSpell_Header_Line::Get_WorldPostion() return m_pTransformCom->Get_State(STATE::POSITION); } -void CSpell_Header_Line::MoveY(_float fY) -{ - m_fY += fY; -} - HRESULT CSpell_Header_Line::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp index 86a4e1685..9604d77e7 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp @@ -46,6 +46,7 @@ HRESULT CSpell_Hover::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); return S_OK; } @@ -88,7 +89,9 @@ void CSpell_Hover::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - Hover(); + + m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } @@ -152,22 +155,6 @@ void CSpell_Hover::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } -void CSpell_Hover::Hover() -{ - POINT ptMouse{}; - GetCursorPos(&ptMouse); - ScreenToClient(g_hWnd, &ptMouse); - _float2 fMouse; - fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); - fMouse.y = -(ptMouse.y - (g_iWinSizeY* 0.5f)); - - fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; - fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; - - m_pVIBufferCom->Set_Mouse_Hover(fMouse); - -} - HRESULT CSpell_Hover::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp index f336f09d1..d323d9f12 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp @@ -23,8 +23,8 @@ HRESULT CSpell_Hover_Effect::Initialize(void* pArg) Desc.fX = 0.f; Desc.fY = 0.f; - Desc.fSizeX = 105.f; - Desc.fSizeY = 105.f; + Desc.fSizeX = 115.f; + Desc.fSizeY = 115.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) }; @@ -47,6 +47,7 @@ HRESULT CSpell_Hover_Effect::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); return S_OK; } @@ -89,7 +90,7 @@ void CSpell_Hover_Effect::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - Hover(); + m_pVIBufferCom->Set_Hover_Index(m_iSpellType); m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } @@ -153,22 +154,6 @@ void CSpell_Hover_Effect::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } -void CSpell_Hover_Effect::Hover() -{ - POINT ptMouse{}; - GetCursorPos(&ptMouse); - ScreenToClient(g_hWnd, &ptMouse); - _float2 fMouse; - fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); - fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); - - fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; - fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; - - m_pVIBufferCom->Set_Mouse_Hover(fMouse); - -} - HRESULT CSpell_Hover_Effect::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Editor/Private/Spell_List.cpp b/Jusin154_Team3D/Editor/Private/Spell_List.cpp index 57eaeca74..2285e0425 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_List.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_List.cpp @@ -46,6 +46,8 @@ HRESULT CSpell_List::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_fDelayTime = 0.5f; + m_iPerSpell_Slot = -1; Color(); return S_OK; } @@ -90,7 +92,7 @@ void CSpell_List::Update(_float fTimeDelta) } } m_fTime += fTimeDelta * m_fTimeMult; - Hover(); + Hover(fTimeDelta); __super::Update(fTimeDelta); } @@ -165,7 +167,7 @@ void CSpell_List::Color() m_pVIBufferCom->Set_Index_Renge_Color(23, 25, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); } -void CSpell_List::Hover() +void CSpell_List::Hover(_float fTimeDelta) { POINT ptMouse{}; GetCursorPos(&ptMouse); @@ -178,23 +180,20 @@ void CSpell_List::Hover() fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; - m_bPrevHover = m_bHover; - m_bHover = (m_iSpellType = m_pVIBufferCom->Set_Mouse_Hover(fMouse)); - if (m_iSpellType != -1) + m_iSpellType = m_pVIBufferCom->Set_Mouse_Hover(fMouse); + + CUIObject::HOVER_INFO Info; + Info.iSlotID = 0; + if (m_iSpellType == -1) { - m_bHover = true; - if (m_bHover == true && m_bPrevHover == false) - { - static_cast(m_pOwner)->Set_SkillType(m_iSpellType); - } + Info.iHover_Index = -1; + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); } + else { - m_bHover = false; - if (m_bHover == false && m_bPrevHover == true) - { - static_cast(m_pOwner)->Set_SkillType(m_iSpellType); - } + Info.iHover_Index = m_iSpellType; + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); } } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp index 5825737f7..7f60a1c46 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp @@ -11,6 +11,11 @@ #include "Spell_Hover_Effect.h" #include "Spell_Preview.h" #include "Spell_Vidio_Border.h" +#include "Current_Slot_Number.h" +#include "Spell_Header.h" +#include "Spell_Header_Line.h" +#include "Spell_Data.h" +#include "Spell_Anim.h" CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -50,7 +55,10 @@ HRESULT CSpell_Panel::Initialize(void* pArg) } m_fCanvasAlpha = 1.f; m_fSortZ = 0.04f; - + m_iSpellType = -1; + m_iPendingSpell = -1; + m_fDelayTime = 1.f; + Add_Function(TEXT("Hover"), [this](void* p) {this->Slot_Chack(p); }); return S_OK; } @@ -70,6 +78,22 @@ void CSpell_Panel::Update(_float fTimeDelta) return; } + if (m_iSpellType != -1) + { + m_fHoverTimer += fTimeDelta; + } + else + { + m_fHoverTimer = 0.f; + Function_Callback(TEXT("FadeOut")); + } + + if (m_fHoverTimer >= m_fDelayTime && m_iPendingSpell != m_iSpellType) + { + m_iPendingSpell = m_iSpellType; + Function_Callback(TEXT("FadeIn")); + } + __super::Update(fTimeDelta); } @@ -108,6 +132,32 @@ _vector CSpell_Panel::Get_WorldPostion() return m_pTransformCom->Get_State(STATE::POSITION); } +const CUIObject::SPELLINFO CSpell_Panel::Get_Info(_int Index) +{ + return m_Info[Index]; +} + +void CSpell_Panel::Slot_Chack(void* pArg) +{ + CUIObject::HOVER_INFO* Info = static_cast(pArg); + + _int iSlot = Info->iSlotID; + m_iHoverSlot[iSlot] = Info->iHover_Index; + + int finalHover = -1; + for (int i = 0; i < 2; ++i) + { + if (m_iHoverSlot[i] != -1) + { + finalHover = m_iHoverSlot[i]; + break; + } + } + + m_iSpellType = finalHover; + Function_Callback(TEXT("Slot_Hover"), &m_iSpellType); +} + HRESULT CSpell_Panel::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) @@ -225,6 +275,34 @@ HRESULT CSpell_Panel::Ready_Element(void* pArg) } Add_Element(TEXT("Spell_Vidio_Border"), m_pSpell_Vidio_Border); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pCurrent_Slot_Number)))) + { + return E_FAIL; + } + Add_Element(TEXT("Current_Slot_Number"), m_pCurrent_Slot_Number); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Header"), m_pSpell_Header); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header_Line)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Header_Line"), m_pSpell_Header_Line); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Anim)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Anim"), m_pSpell_Anim); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, m_Info, nullptr, reinterpret_cast(&m_pSpell_Data)))) + { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp b/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp index 782652f26..f42d4fc15 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp @@ -1,8 +1,7 @@ #include "pch.h" #include "Spell_Preview.h" #include "GameInstance.h" -#include "Spell_Header.h" -#include "Spell_Header_Line.h" + CSpell_Preview::CSpell_Preview(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) @@ -40,14 +39,16 @@ HRESULT CSpell_Preview::Initialize(void* pArg) } // y값 최소 270 최대 410 m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; + m_fAlpha = 0.f; + m_fAlphaTime = 5.f; m_vNine_Slice = _float4(50.f, 75.f, 30.f, 96.f); m_fTopY = m_fY - m_vScale.y * 0.5f; SizeUpX(512.f); SizeUpY(270.f); m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); m_fSortZ = 0.02f; + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); return S_OK; } @@ -82,7 +83,7 @@ void CSpell_Preview::Update(_float fTimeDelta) if (m_bFadeOut == true) { if (m_fAlpha >= 0.f) - m_fAlpha -= fTimeDelta; + m_fAlpha -= fTimeDelta * m_fAlphaTime;; if (m_fAlpha <= 0.f) { @@ -90,7 +91,6 @@ void CSpell_Preview::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - static_cast(m_pSpell_Header)->Set_SkillType(ENUM_CLASS(m_iSpellType)); m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } @@ -121,8 +121,6 @@ HRESULT CSpell_Preview::Render() if (FAILED(m_pVIBufferCom->Render())) { return E_FAIL; } - m_pSpell_Header->Render(); - m_pSpell_Header_Line->Render(); return S_OK; } @@ -148,8 +146,6 @@ void CSpell_Preview::SizeUpY(_float fSizeY) _float deltaY = m_fY - prevY; - static_cast(m_pSpell_Header_Line)->MoveY(-deltaY); - static_cast(m_pSpell_Header)->MoveY(-deltaY); } HRESULT CSpell_Preview::Bind_ShaderResources() @@ -243,14 +239,7 @@ HRESULT CSpell_Preview::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header)))) - { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header_Line)))) - { - return E_FAIL; - } + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp index b5f0d702b..1324ee4b8 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp @@ -39,11 +39,15 @@ HRESULT CSpell_Vidio_Border::Initialize(void* pArg) } m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; + m_fAlpha = 0.f; + m_fAlphaTime = 9.f; m_fMoveSpeed = 5.f; m_fLerpX = m_fX; m_fLerpY = 45; + m_bStart = false; + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); return S_OK; } @@ -78,17 +82,21 @@ void CSpell_Vidio_Border::Update(_float fTimeDelta) if (m_bFadeOut == true) { if (m_fAlpha >= 0.f) - m_fAlpha -= fTimeDelta; + m_fAlpha -= fTimeDelta * m_fAlphaTime; if (m_fAlpha <= 0.f) { m_bFadeOut = false; + m_bStart = false; m_fAlpha = 0.f; } } m_fTime += fTimeDelta * m_fTimeMult; + if (m_fAlpha >= 0.3f) + m_bStart = true; + __super::Update(fTimeDelta); } @@ -107,21 +115,25 @@ void CSpell_Vidio_Border::Late_Update(_float fTimeDelta) HRESULT CSpell_Vidio_Border::Render() { - if (FAILED(Bind_ShaderResources())) + if (m_bStart == true) { - 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; + 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; @@ -187,10 +199,6 @@ HRESULT CSpell_Vidio_Border::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Anim)))) - { - return E_FAIL; - } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Public/Current_Slot_Number.h b/Jusin154_Team3D/Editor/Public/Current_Slot_Number.h new file mode 100644 index 000000000..ebfed02b7 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Current_Slot_Number.h @@ -0,0 +1,52 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CCurrent_Slot_Number final : public CElementObject +{ +private: + CCurrent_Slot_Number(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCurrent_Slot_Number(const CCurrent_Slot_Number& rhs); + virtual ~CCurrent_Slot_Number() = 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; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + void UV(); + _float4 Meter_Index(_uint Number); + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + CVIBuffer_UI_Instance::UI_ATLAS_DESC pUVDesc[4]; + + _float2 m_fIamge_Size{}; + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CCurrent_Slot_Number* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 809fed838..97ecad2b7 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -34,8 +34,8 @@ namespace Editor enum class EFFECT_TYPE { EFFECT, TRAIL, END }; - enum class SKILL_TYPE{ ARESTO_MOMENTUM, GLACIUS, LEVIOSO, TRANSFORM, // 노란색 - ASSIO, DEPULSO, DESCENDO, FLIPENDO, // 보라색 + enum class SKILL_TYPE{ ARRESTO_MOMENTUM, GLACIUS, LEVIOSO, TRANSFORM, // 노란색 + ACCIO, DEPULSO, DESCENDO, FLIPENDO, // 보라색 CONFRINGO, DIFFINDO, EXPELLIARMUS, BOMBARDA, INCENDIO, // 빨간색 DISILLUSIONMENT, LUMOS, REPARO, WINGARDIUM_LEVIOSA, // 하늘색 CONJURING_SPELL, ALTERING_SPELL, EVANESCO, // 연녹색 diff --git a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h index 6c0619e09..5ce4f508f 100644 --- a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h +++ b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h @@ -25,7 +25,7 @@ class CEessential_Spell_Slot final : public CElementObject private: - void Hover(); + void Hover(_float fTimeDelta); private: virtual HRESULT Bind_ShaderResources() override; @@ -43,8 +43,10 @@ class CEessential_Spell_Slot final : public CElementObject _float m_fOffSetY{}; _uint m_iCols{}; - _bool m_bHover = { false }; - _bool m_bPrevHover = { false }; + _float m_fHoverTime{}; + _int m_iPerSpell_Slot{}; + + public: static CEessential_Spell_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Anim.h b/Jusin154_Team3D/Editor/Public/Spell_Anim.h index 678f2b36a..4845e6212 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Anim.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Anim.h @@ -20,8 +20,11 @@ class CSpell_Anim final : public CElementObject virtual _vector Get_WorldPostion() override; public: - void Anim_Start(_uint iSpell_Id); - void Anim_End(); + virtual void Set_FadeIn() override; + +private: + void Change_Image(_int SpellID); + virtual void Set_SkillType(_int eType) override; private: virtual HRESULT Bind_ShaderResources() override; @@ -39,7 +42,7 @@ class CSpell_Anim final : public CElementObject _float m_fFrameTime{}; // 한 프레임당 시간(초) _int m_iCurrentFrame{}; // 현재 보여줄 프레임 - _uint m_iSpell_Index{}; + _int m_iPerSpell{}; _bool m_bAnim_Start = { false }; public: static CSpell_Anim* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Public/Spell_Data.h b/Jusin154_Team3D/Editor/Public/Spell_Data.h index 86c6f33f6..e1101bbae 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Data.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Data.h @@ -11,6 +11,22 @@ NS_BEGIN(Editor) class CSpell_Data final : public CGameObject { +public: + typedef struct tagSpellInfo + { + _int iSpell_ID{}; + _string pSpell_Name; + _string pImage_Name; + _int iSpell_Type{}; + _int iSkill_Type{}; + _float fSpell_CoolTime{}; + _float fDuration{}; + _int iAnimNum{}; + _string pSpellInfo; + _bool bSpell_Lock = false; + _bool bEquip_Spell = false; + }SPELLINFO; +private: CSpell_Data(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CSpell_Data(const CSpell_Data& rhs); virtual ~CSpell_Data() = default; @@ -28,9 +44,14 @@ class CSpell_Data final : public CGameObject virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; +public: + //const SPELLINFO& Get_Info(_uint SpellID) const; + private: CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pSpell_Panel = { nullptr }; + + SPELLINFO SpellInfo = {}; public: static CSpell_Data* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Drag.h b/Jusin154_Team3D/Editor/Public/Spell_Drag.h new file mode 100644 index 000000000..19a4d82f5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Drag.h @@ -0,0 +1,5 @@ +#pragma once +class CSpell_Drag +{ +}; + diff --git a/Jusin154_Team3D/Editor/Public/Spell_Header.h b/Jusin154_Team3D/Editor/Public/Spell_Header.h index 41fb41913..c9690aaab 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Header.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Header.h @@ -19,9 +19,6 @@ class CSpell_Header final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; -private: - virtual void MoveY(_float fY) override; - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -33,6 +30,7 @@ class CSpell_Header final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + _int m_iSkillType{}; public: static CSpell_Header* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h b/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h index d8062f7ec..822caa59e 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h @@ -19,9 +19,6 @@ class CSpell_Header_Line final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; -private: - virtual void MoveY(_float fY) override; - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover.h b/Jusin154_Team3D/Editor/Public/Spell_Hover.h index 496588411..7aeeca08a 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Hover.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover.h @@ -49,7 +49,6 @@ class CSpell_Hover final : public CElementObject _float m_fOffSetX{}; _float m_fOffSetY{}; _uint m_iCols{}; - public: static CSpell_Hover* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h index 433d74719..2216e07f9 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h @@ -27,9 +27,6 @@ class CSpell_Hover_Effect final : public CElementObject virtual void SizeUpY(_float fSizeY) override; virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; -private: - void Hover(); - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_List.h b/Jusin154_Team3D/Editor/Public/Spell_List.h index 7e81f303a..a74245592 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_List.h +++ b/Jusin154_Team3D/Editor/Public/Spell_List.h @@ -29,7 +29,7 @@ class CSpell_List final : public CElementObject private: void Color(); - void Hover(); + void Hover(_float fTimeDelta); private: virtual HRESULT Bind_ShaderResources() override; @@ -47,9 +47,8 @@ class CSpell_List final : public CElementObject _float m_fOffSetY{}; _uint m_iCols{}; - _bool m_bHover = { false }; - _bool m_bPrevHover = { false }; - + _int m_iPerSpell_Slot{}; + _float m_fHoverTime{}; public: static CSpell_List* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Panel.h b/Jusin154_Team3D/Editor/Public/Spell_Panel.h index 8fa70c623..af602b37e 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Panel.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Panel.h @@ -11,6 +11,7 @@ NS_BEGIN(Editor) class CSpell_Panel final : public CPanelObject { + private: CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CSpell_Panel(const CSpell_Panel& rhs); @@ -24,9 +25,11 @@ class CSpell_Panel final : public CPanelObject virtual _vector Get_WorldPostion() override; public: - void SlotHoverOn(); - void SlotHoverOff(); - void SlotHover(); + virtual const SPELLINFO Get_Info(_int Index) override; + +private: + void Slot_Chack(void* pArg); + private: virtual HRESULT Bind_ShaderResources() override; @@ -38,7 +41,7 @@ class CSpell_Panel final : public CPanelObject private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; - CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pCurrent_Spell_Slot = { nullptr }; CGameObject* m_pSpell_List = { nullptr }; @@ -50,9 +53,19 @@ class CSpell_Panel final : public CPanelObject CGameObject* m_pSpell_Hover_Effect = { nullptr }; CGameObject* m_pSpell_Preview = { nullptr }; CGameObject* m_pSpell_Vidio_Border = { nullptr }; + CGameObject* m_pCurrent_Slot_Number = { nullptr }; + CGameObject* m_pSpell_Data= { nullptr }; + CGameObject* m_pSpell_Header = { nullptr }; + CGameObject* m_pSpell_Header_Line = { nullptr }; + CGameObject* m_pSpell_Anim = { nullptr }; - _uint m_iSlotHover_Index{}; + _int m_iHoverSlot[2] = { -1,-1 }; + SPELLINFO m_Info[34] = {}; + CUIObject::HOVER_INFO m_Hover; + + _int m_iPendingSpell = -1; + _float m_fHoverTimer = 0.f; public: static CSpell_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Preview.h b/Jusin154_Team3D/Editor/Public/Spell_Preview.h index 6f3dcd134..e8d47274c 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Preview.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Preview.h @@ -36,8 +36,7 @@ class CSpell_Preview final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; - CGameObject* m_pSpell_Header = { nullptr }; - CGameObject* m_pSpell_Header_Line = { nullptr }; + _float4 m_vHeaderBack{}; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h index 3263a8c70..bb306b7bb 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h @@ -19,6 +19,12 @@ class CSpell_Vidio_Border final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; +//public: +// virtual const SPELLINFO Get_Info(_int Index) override; +// +//public: +// virtual void Set_SkillType(_int eType); + private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -31,7 +37,9 @@ class CSpell_Vidio_Border final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; - CGameObject* m_pSpell_Anim = { nullptr }; + _float m_fStertTimer{}; + _int m_iPerIndex{}; + _bool m_bStart = { false }; public: static CSpell_Vidio_Border* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index c3824772e..f50dce277 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -207,14 +207,20 @@ _bool CUIObject::Chack_Visible() void CUIObject::Set_FadeIn() { - m_bFadeIn = true; - m_bFadeOut = false; + if (!m_bFadeIn && m_fAlpha < 1.f) + { + m_bFadeIn = true; + m_bFadeOut = false; + } } void CUIObject::Set_FadeOut() { - m_bFadeIn = false; - m_bFadeOut = true; + if (!m_bFadeOut && m_fAlpha > 0.f) + { + m_bFadeOut = true; + m_bFadeIn = false; + } } _bool CUIObject::Get_FadeIn() @@ -467,6 +473,16 @@ void CUIObject::Function_Callback(wstring Name, void* pArg) { } +_bool CUIObject::Get_Hover() +{ + return m_bHover; +} + +const CUIObject::SPELLINFO CUIObject::Get_Info(_int Index) +{ + return SPELLINFO(); +} + void CUIObject::Free() { __super::Free(); diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp index 46981233b..57426e437 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp @@ -274,6 +274,9 @@ _int CVIBuffer_UI_Instance::Set_Mouse_Hover(_float2 fMousePos) VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); _int hoveredIndex = -1; + for (_uint i = 0; i < m_iNumInstance; i++) + pVertices[i].bHover = 0.f; + for (_uint i = 0; i < m_iNumInstance; i++) { _float2 pos = pVertices[i].fPos; @@ -289,21 +292,42 @@ _int CVIBuffer_UI_Instance::Set_Mouse_Hover(_float2 fMousePos) pt.x = LONG(fMousePos.x); pt.y = LONG(fMousePos.y); - if (PtInRect(&rcInstance, pt)) - { - pVertices[i].bHover = 1.f; - hoveredIndex = i; + if (PtInRect(&rcInstance, pt)) + { + pVertices[i].bHover = 1.f; + hoveredIndex = i; break; - } - else - { - pVertices[i].bHover = 0.f; + } + else + { + pVertices[i].bHover = 0.f; hoveredIndex = -1; - } - } + } + } - m_pContext->Unmap(m_pVBInstance, 0); - return hoveredIndex; + m_pContext->Unmap(m_pVBInstance, 0); + return hoveredIndex; +} + +void CVIBuffer_UI_Instance::Set_Hover_Index(_uint iIndex) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + for (_uint i = 0; i < m_iNumInstance; ++i) + { + if (i == iIndex) + { + pVertices[i].bHover = 1.f; + } + else + pVertices[i].bHover = 0.f; + } + + m_pContext->Unmap(m_pVBInstance, 0); } CVIBuffer_UI_Instance* CVIBuffer_UI_Instance::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const INSTANCE_DESC* pInstanceDesc) diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index 1564d510c..23ebe64e7 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -17,6 +17,25 @@ typedef struct tagUIObjectDesc _float fSizeX, fSizeY = {}; }UIOBJECT_DESC; +typedef struct tagSpellInfo +{ + _int iSpell_ID{}; + _wstring pSpell_Name; + _wstring pImage_Name; + _int iSpell_Type{}; + _int iSkill_Type{}; + _float fSpell_CoolTime{}; + _float fDuration{}; + _int iAnimNum{}; + _wstring pSpellInfo; + _bool bSpell_Lock = false; + _bool bEquip_Spell = false; +}SPELLINFO; +typedef struct SlotHover +{ + _int iSlotID{}; + _int iHover_Index{}; +}HOVER_INFO; protected: CUIObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CUIObject(const CUIObject& rhs); @@ -108,6 +127,10 @@ typedef struct tagUIObjectDesc virtual void Add_Function(wstring Name, function Evnet); virtual void Function_Callback(wstring Name, void* pArg = nullptr); + + virtual _bool Get_Hover(); + + virtual const SPELLINFO Get_Info(_int Index); protected: _vector m_fOrigin_Position_vector{}; _float2 m_fOrigin_Position{}; diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h index 75278c14b..c20a19ae6 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h @@ -34,6 +34,7 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance void Set_ImageUV(UI_ATLAS_DESC* AtlasUV); void Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float4 vColor); _int Set_Mouse_Hover(_float2 fMousePos); + void Set_Hover_Index(_uint iIndex); private: VTX_INSTANCE_UI* m_pInstanceVertices = { nullptr };