diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 16287e040..da3d61395 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1745,6 +1745,27 @@ PS_OUT PS_Broomstick(PS_IN In) return Out; } +PS_OUT PS_SpellLearn(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = float4(1.f, 1.f, 1.f, 1.f); + + float4 tex = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float tex1 = g_Texture1.Sample(DefaultSampler, In.vTexcoord).r; + Color = tex; + + tex1 *= 0.95f; + + Color.a = tex1; + + Color.a *= Alpha; + + Out.vColor = Color; + return Out; +} + struct VS_IN3D { float3 vPosition : POSITION; @@ -2305,6 +2326,16 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Broomstick(); } + pass SpellLearn + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_SpellLearn(); + } + pass Enemy_Detection { SetRasterizerState(RS_Nocull); diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 1cf832623..22d87c920 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -270,42 +270,42 @@ HRESULT CLevel_GamePlay::Ready_Background() /* 테스트용 맵 */ CInfoInstance::GetInstance()->Load_MapObjects("Map1215"); } - else - { - - -#if 진우 - -#else - /* 전체 맵 */ - CInfoInstance::GetInstance()->Load_MapObjects("Hogsmeade_MapContainer_Data"); - - /* 물 오브젝트 */ - if (FAILED(CInfoInstance::GetInstance()->Load_WaterElemet("Element_Water_Info"))) { - return E_FAIL; - } - - /* 조명 오브젝트 */ - CInfoInstance::GetInstance()->Load_LightElements("LightElement"); -#endif - - /* 상호작용 오브젝트 */ - CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_Barrel"); - CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_B"); - CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_F"); - CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopTable"); - CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopChair"); - - /* Doors */ - CInfoInstance::GetInstance()->Load_DoorElemet("Element_Door_Info"); - - /* Chests */ - CInfoInstance::GetInstance()->Load_ChestElemet("Element_Chest_Info"); - - if (FAILED(Ready_IntstanceProp())) - return E_FAIL; - } - +// else +// { +// +// +//#if 진우 +// +//#else +// /* 전체 맵 */ +// CInfoInstance::GetInstance()->Load_MapObjects("Hogsmeade_MapContainer_Data"); +// +// /* 물 오브젝트 */ +// if (FAILED(CInfoInstance::GetInstance()->Load_WaterElemet("Element_Water_Info"))) { +// return E_FAIL; +// } +// +// /* 조명 오브젝트 */ +// CInfoInstance::GetInstance()->Load_LightElements("LightElement"); +//#endif +// +// /* 상호작용 오브젝트 */ +// CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_Barrel"); +// CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_B"); +// CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_F"); +// CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopTable"); +// CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopChair"); +// +// /* Doors */ +// CInfoInstance::GetInstance()->Load_DoorElemet("Element_Door_Info"); +// +// /* Chests */ +// CInfoInstance::GetInstance()->Load_ChestElemet("Element_Chest_Info"); +// +// if (FAILED(Ready_IntstanceProp())) +// return E_FAIL; +// } +// return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Quest_Slot.cpp b/Jusin154_Team3D/Client/Private/Quest_Slot.cpp index da9282e5b..f927a1486 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Slot.cpp @@ -49,10 +49,12 @@ HRESULT CQuest_Slot::Initialize(void* pArg) m_fOffSetX = 0.f; m_fOffSetY = 85; m_iCols = 1; + m_fPositionX = -475.f; + m_fPositionY = 330.f; SizeUpX(495.f); SizeUpY(80.f); m_pVIBufferCom->Set_Cloned(true); - m_pVIBufferCom->Set_Pos(-475.f, 330.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Pos(m_fPositionX, m_fPositionY, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_iQuestCount = m_pInfoInstance->Get_Quest_Count(ENUM_CLASS(QUESTSTATE::NONE)); Set_QuestType(ENUM_CLASS(QUESTSTATE::NONE)); @@ -100,7 +102,6 @@ void CQuest_Slot::Update(_float fTimeDelta) } } Hover(); - Font_Size(); static_cast(m_pOwner)->Function_Callback(TEXT("QuestListHover"), &m_Info); @@ -152,14 +153,14 @@ void CQuest_Slot::Font_Size() for (_int i = 0; i < m_iQuestCount; ++i) { m_fFontY = 190 + i * 85.f; - if (m_Info.iQuestIndex == -1) + if (m_Index == -1) { m_Fonts[i].pFontSizeName = TEXT("Font_size20"); m_Fonts[i].m_fFontSize = _float2(m_fFontX + m_fX, m_fFontY - m_fY); } else { - if (i == m_Info.iQuestIndex) + if (i == m_Index) { m_Fonts[i].pFontSizeName = TEXT("Font_size30"); m_Fonts[i].m_fFontSize = _float2(m_fFontX - 10.f + m_fX, m_fFontY - 10.f - m_fY); @@ -189,6 +190,26 @@ void CQuest_Slot::Font_Setting(_int Index) } } +_int CQuest_Slot::Mousechack(POINT Mouse) +{ + for (_int i = 0; i < m_iQuestCount; ++i) + { + RECT Box = { + long(m_fPositionX - m_fSizeX * 0.5f), + long((m_fPositionY - (i * m_fOffSetY)) - m_fSizeY * 0.5f), + long(m_fPositionX + m_fSizeX * 0.5f), + long((m_fPositionY + (i * m_fOffSetY)) + m_fSizeY * 0.5f) }; + + if (PtInRect(&Box, Mouse)) + { + return i; + } + } + + + return -1; +} + _vector CQuest_Slot::Get_WorldPostion() { return m_pTransformCom->Get_State(STATE::POSITION); @@ -293,9 +314,14 @@ void CQuest_Slot::Hover() fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); - m_Info.iQuestIndex = m_pVIBufferCom->Set_Mouse_Hover(fMouse); + POINT Mouse{}; + Mouse.x = _long(fMouse.x); + Mouse.y = _long(fMouse.y); + + m_Index = Mousechack(Mouse); - if (m_Info.iQuestIndex != -1) + m_pVIBufferCom->Set_Hover(m_Index); + if (m_Index != -1) { m_bHover = true; } @@ -303,6 +329,7 @@ void CQuest_Slot::Hover() { m_bHover = false; } + Font_Size(); } diff --git a/Jusin154_Team3D/Client/Public/Quest_Slot.h b/Jusin154_Team3D/Client/Public/Quest_Slot.h index c00981b61..5a51a0bcf 100644 --- a/Jusin154_Team3D/Client/Public/Quest_Slot.h +++ b/Jusin154_Team3D/Client/Public/Quest_Slot.h @@ -46,6 +46,8 @@ class CQuest_Slot final : public CElementObject void Font_Size(); void Font_Setting(_int Index); + _int Mousechack(POINT Mouse); + public: void Set_QuestType(_int Index); @@ -62,6 +64,11 @@ class CQuest_Slot final : public CElementObject _int m_iCurrentQeustClick{}; _int m_iQuestCount{}; + + _float m_fPositionX{}; + _float m_fPositionY{}; + + _int m_Index{}; vector m_Fonts; public: static CQuest_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml new file mode 100644 index 000000000..a2f8a1651 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 16287e040..da3d61395 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1745,6 +1745,27 @@ PS_OUT PS_Broomstick(PS_IN In) return Out; } +PS_OUT PS_SpellLearn(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = float4(1.f, 1.f, 1.f, 1.f); + + float4 tex = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float tex1 = g_Texture1.Sample(DefaultSampler, In.vTexcoord).r; + Color = tex; + + tex1 *= 0.95f; + + Color.a = tex1; + + Color.a *= Alpha; + + Out.vColor = Color; + return Out; +} + struct VS_IN3D { float3 vPosition : POSITION; @@ -2305,6 +2326,16 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Broomstick(); } + pass SpellLearn + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_SpellLearn(); + } + pass Enemy_Detection { SetRasterizerState(RS_Nocull); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/SpellLearn.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/SpellLearn.png new file mode 100644 index 000000000..97ff44aed Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/SpellLearn.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Accio_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Accio_Path.png new file mode 100644 index 000000000..eed73b87d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Accio_Path.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Descendo_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Descendo_Path.png new file mode 100644 index 000000000..b6a2f11f3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Descendo_Path.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Levioso_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Levioso_Path.png new file mode 100644 index 000000000..bbc9cc45e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Levioso_Path.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Lumos_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Lumos_Path.png new file mode 100644 index 000000000..431c70c4a Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Lumos_Path.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Revelio_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Revelio_Path.png new file mode 100644 index 000000000..75edd419f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Revelio_Path.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SpellLinkDivide.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SpellLinkDivide.png index 490886614..3c8d8edb6 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SpellLinkDivide.png and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SpellLinkDivide.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_Spell_Name.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_Spell_Name.png new file mode 100644 index 000000000..52d774819 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_Spell_Name.png differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index ed7bf8cef..39ddab3ef 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -197,6 +197,11 @@ call Update_Shaders.bat + + + + + @@ -415,6 +420,11 @@ call Update_Shaders.bat + + + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index da3bf4584..86f8427ad 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -610,6 +610,21 @@ {a2d06f57-c74f-4604-91b4-884bf6586584} + + {91999870-f29b-4c24-b888-09eb08b8e10c} + + + {37571a2a-97dd-447b-a25b-11194584a57a} + + + {f4d24f99-186c-4074-90ef-48a95d74fb47} + + + {7a016450-f745-4313-ba9d-781fa5909b76} + + + {d9382839-c0b8-4b3d-9227-6dcf65fba44f} + @@ -1218,6 +1233,21 @@ 50.UI\QuestInstance + + 50.UI\SpellLearn_Canvas + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Name + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_MovePointer + @@ -1828,6 +1858,21 @@ 50.UI\QuestInstance + + 50.UI\SpellLearn_Canvas + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Name + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_MovePointer + diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index bece6b8a7..5175bee7e 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -111,6 +111,12 @@ #include "QuestInstance.h" +#include "SpellLearn_Canvas.h" +#include "SpellLearn_Panel.h" +#include "SpellLearn_Name.h" +#include "SpellLearn.h" +#include "SpellLearn_MovePointer.h" + #include "IMGUIUI.h" #pragma endregion @@ -525,6 +531,22 @@ HRESULT CLoader::Loading_For_UI() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/SpellUnlock", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) + { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; @@ -1178,6 +1200,27 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Canvas::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Panel::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Name::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_MovePointer::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/SpellLearn.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn.cpp new file mode 100644 index 000000000..947fe07b2 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn.cpp @@ -0,0 +1,223 @@ +#include "pch.h" +#include "SpellLearn.h" +#include "GameInstance.h" + +CSpellLearn::CSpellLearn(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpellLearn::CSpellLearn(const CSpellLearn& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpellLearn::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 600.f; + Desc.fY = 0.f; + Desc.fSizeX = 550.f; + Desc.fSizeY = 550.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 = 5.f; + Visible(false); + return S_OK; +} + +void CSpellLearn::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn::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 * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpellLearn::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpellLearn::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn::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 CSpellLearn::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_SU_Levioso_Path"), 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; +} + +CSpellLearn* CSpellLearn::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn* pInstance = new CSpellLearn(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn* pInstance = new CSpellLearn(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Canvas.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Canvas.cpp new file mode 100644 index 000000000..c77af7192 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Canvas.cpp @@ -0,0 +1,138 @@ +#include "pch.h" +#include "UI_Manager.h" +#include "SpellLearn_Canvas.h" +#include "GameInstance.h" +#include "SpellLearn_Panel.h" + +CSpellLearn_Canvas::CSpellLearn_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CCanvasObject(pDevice, pContext) +{ +} + +CSpellLearn_Canvas::CSpellLearn_Canvas(const CSpellLearn_Canvas& rhs) + :CCanvasObject(rhs) +{ +} + +HRESULT CSpellLearn_Canvas::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_Canvas::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 1920.f; + Desc.fSizeY = 1080.f; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Panel(pArg))) + { + return E_FAIL; + } + Visible(false); + return S_OK; +} + +void CSpellLearn_Canvas::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_Canvas::Update(_float fTimeDelta) +{ + __super::Update(fTimeDelta); +} + +void CSpellLearn_Canvas::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpellLearn_Canvas::Render() +{ + return S_OK; +} + +_vector CSpellLearn_Canvas::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_Canvas::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CSpellLearn_Canvas::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpellLearn_Canvas::Ready_Panel(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast (&m_pSpellLearn_Panel)))) + { + return E_FAIL; + } + Add_Panel(TEXT("SpellLearn_Panel"), m_pSpellLearn_Panel); + + return S_OK; +} + +void CSpellLearn_Canvas::Clear_Penel() +{ +} + +CSpellLearn_Canvas* CSpellLearn_Canvas::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Canvas* pInstance = new CSpellLearn_Canvas(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_Canvas"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_Canvas::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_Canvas* pInstance = new CSpellLearn_Canvas(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Canvas"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Canvas::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn_Canvas::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_MovePointer.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_MovePointer.cpp new file mode 100644 index 000000000..86b1ccd78 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_MovePointer.cpp @@ -0,0 +1,272 @@ +#include "pch.h" +#include "SpellLearn_MovePointer.h" +#include "GameInstance.h" + +CSpellLearn_MovePointer::CSpellLearn_MovePointer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpellLearn_MovePointer::CSpellLearn_MovePointer(const CSpellLearn_MovePointer& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpellLearn_MovePointer::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_MovePointer::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 454.f; + Desc.fY = -240.f; + Desc.fSizeX = 32.f; + Desc.fSizeY = 32.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 = 5.f; + m_fMoveSpeed = 15.f; + m_MoveLine.push_back(XMVectorSet(454.f, -240.f, 0.f, 1.f)); + m_MoveLine.push_back(XMVectorSet(454.f, 90.f, 0.f, 1.f)); + + + + Index = 0; + + Visible(false); + return S_OK; +} + +void CSpellLearn_MovePointer::SpellLearn(_int Index) +{ + m_iSpell = Index; + m_bMoveStart = true; +} + +void CSpellLearn_MovePointer::Line(_float fTime) +{ + m_vLerp_Position = m_MoveLine[Index]; + + if (Start_Lerp(m_fMoveSpeed * fTime) == true) + { + if (Index < m_MoveLine.size() -1) + { + ++Index; + } + else + { + m_bMoveStart = false; + } + } + +} + +void CSpellLearn_MovePointer::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_MovePointer::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 * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + if (m_pGameInstance->Key_Down(DIK_L)) + { + m_bMoveStart = true; + } + + if (m_bMoveStart == true) + { + if (m_iSpell == ENUM_CLASS(SPELL_LINE::LINE)) + { + Line(fTimeDelta); + } + else if (m_iSpell == ENUM_CLASS(SPELL_LINE::CURVE)) + { + //Curve(); + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpellLearn_MovePointer::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn_MovePointer::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpellLearn_MovePointer::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_MovePointer::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 CSpellLearn_MovePointer::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_SU_Cursor"), 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; +} + +CSpellLearn_MovePointer* CSpellLearn_MovePointer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_MovePointer* pInstance = new CSpellLearn_MovePointer(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_MovePointer"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_MovePointer::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_MovePointer* pInstance = new CSpellLearn_MovePointer(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_MovePointer"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_MovePointer::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn_MovePointer::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Name.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Name.cpp new file mode 100644 index 000000000..ed9106018 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Name.cpp @@ -0,0 +1,243 @@ +#include "pch.h" +#include "SpellLearn_Name.h" + +CSpellLearn_Name::CSpellLearn_Name(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpellLearn_Name::CSpellLearn_Name(const CSpellLearn_Name& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpellLearn_Name::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_Name::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 600.f; + Desc.fY = 420.f; + Desc.fSizeX = 432.f; + Desc.fSizeY = 27.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 = 5.f; + m_vNine_Slice = _float4(216.f, 216.f, 0.f, 27.f); + m_fFontX = 944.f; + m_fFontY = 520.f; + SizeUpX(550.f); + SizeUpY(27.f); + Visible(false); + return S_OK; +} + + +void CSpellLearn_Name::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_Name::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 * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpellLearn_Name::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn_Name::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::QUEST_BORDER)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + _float OffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), TEXT("봄바르다")) - 30) * 0.5f; + m_pGameInstance->Render_Text(TEXT("Font_size20"), TEXT("봄바르다"), _float2((m_fFontX + m_fX) - OffSet, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + + return S_OK; +} + +_vector CSpellLearn_Name::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_Name::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; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNine_Slice", &m_vNine_Slice, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_fOrigin_Size, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpellLearn_Name::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_Spell_Name"), 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; +} + +CSpellLearn_Name* CSpellLearn_Name::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Name* pInstance = new CSpellLearn_Name(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_Name"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_Name::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_Name* pInstance = new CSpellLearn_Name(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Name"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Name::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn_Name::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp new file mode 100644 index 000000000..fc448de6a --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp @@ -0,0 +1,229 @@ +#include "pch.h" +#include "SpellLearn_Panel.h" +#include "GameInstance.h" +#include "SpellLearn_Name.h" +#include "SpellLearn.h" +#include "SpellLearn_MovePointer.h" + +CSpellLearn_Panel::CSpellLearn_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPanelObject(pDevice, pContext) +{ +} + +CSpellLearn_Panel::CSpellLearn_Panel(const CSpellLearn_Panel& rhs) + :CPanelObject(rhs) +{ +} + +HRESULT CSpellLearn_Panel::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_Panel::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 960.f; + Desc.fY = -540.f; + Desc.fSizeX = g_iWinSizeX; + Desc.fSizeY = g_iWinSizeY; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Element(pArg))) + { + return E_FAIL; + } + m_fCanvasAlpha = 1.f; + m_fSortZ = 0.05f; + m_fDelayTime = 1.f; + Visible(true); + ElementAllVisible(true); + return S_OK; +} + +void CSpellLearn_Panel::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_Panel::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Update(fTimeDelta); +} + +void CSpellLearn_Panel::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn_Panel::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_LEARN)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpellLearn_Panel::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_Panel::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_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 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 CSpellLearn_Panel::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_SpellLearn"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SpellLinkDivide"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpellLearn_Panel::Ready_Element(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn_Name)))) + { + return E_FAIL; + } + Add_Element(TEXT("SpellLearn_Name"), m_pSpellLearn_Name); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn)))) + { + return E_FAIL; + } + Add_Element(TEXT("SpellLearn"), m_pSpellLearn); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn_MovePointer)))) + { + return E_FAIL; + } + Add_Element(TEXT("SpellLearn_MovePointer"), m_pSpellLearn_MovePointer); + + return S_OK; +} + +CSpellLearn_Panel* CSpellLearn_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Panel* pInstance = new CSpellLearn_Panel(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_Panel::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_Panel* pInstance = new CSpellLearn_Panel(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Panel::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn_Panel::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp b/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp index 1b53268cb..347f2947e 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp @@ -92,6 +92,7 @@ HRESULT CSpell_Canvas::Ready_Panel(void* pArg) return E_FAIL; } Add_Panel(TEXT("Spell_Panel"), m_pSpell_Panel); + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/UI_Manager.cpp b/Jusin154_Team3D/Editor/Private/UI_Manager.cpp index 7d42624bf..b8d75a4dc 100644 --- a/Jusin154_Team3D/Editor/Private/UI_Manager.cpp +++ b/Jusin154_Team3D/Editor/Private/UI_Manager.cpp @@ -4,6 +4,7 @@ #include "GamePlay_Canvas.h" #include "Spell_Canvas.h" #include "Quest_Canvas.h" +#include "SpellLearn_Canvas.h" #include "Mouse_Cursor.h" #include "CameraLockOn.h" #include "Loding_Canvas.h" @@ -165,6 +166,11 @@ HRESULT CUI_Manager::Ready_Components(void* pArg) } Add_Canvas(TEXT("Quest_Canves"), m_pQuest_Canves); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn_Canvas)))) { + return E_FAIL; + } + Add_Canvas(TEXT("SpellLearn_Canvas"), m_pSpellLearn_Canvas); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMouse_Cursor)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index f1f6529c7..35c5b4156 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -34,6 +34,7 @@ namespace Editor REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, SPELL_DRAG, CAMERA_LOCKON, LODING_SCREEN, ENEMY_HPBAR, BOSS_HPBAR, QUEST_BORDER, QUEST_INFO, QUEST_STATUS, BROOMSTICK, + SPELL_LEARN, ENEMY_DETECTION, INTERACTION_OBJECT, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, BLUR_NO_EMMISVE, BLUR_NO_WORLD_NO_EMISSIVE, WEIGHTBLEND_FOR_BLEND, DEPTH_STOP, WB_CULLING, SCREEN_FX , DISTORTION ,END }; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, UVALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, SPELL_SLOT, SPELL_LOCK, QUEST_SLOT, END }; @@ -58,6 +59,8 @@ namespace Editor END }; + enum class SPELL_LINE { LINE, CURVE }; + enum class BLOOM_TYPE { NONE, BASIC, MULTIPLY, END }; enum class ELEMENT_INTERACTABLE_ID { BARREL, BOX, END }; diff --git a/Jusin154_Team3D/Editor/Public/IMGUIUI.h b/Jusin154_Team3D/Editor/Public/IMGUIUI.h index 69d0a7a48..d8a26a832 100644 --- a/Jusin154_Team3D/Editor/Public/IMGUIUI.h +++ b/Jusin154_Team3D/Editor/Public/IMGUIUI.h @@ -101,6 +101,7 @@ class CIMGUIUI final : public CGameObject _float2 m_fFontPos {}; _float m_fFontX {}; _float m_fFontY {}; + public: static CIMGUIUI* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn.h b/Jusin154_Team3D/Editor/Public/SpellLearn.h new file mode 100644 index 000000000..e5dcfcd5b --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpellLearn final : public CElementObject +{ +private: + CSpellLearn(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn(const CSpellLearn& rhs); + virtual ~CSpellLearn() = 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 CSpellLearn* 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/SpellLearn_Canvas.h b/Jusin154_Team3D/Editor/Public/SpellLearn_Canvas.h new file mode 100644 index 000000000..bd7299667 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_Canvas.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Editor_Define.h" +#include "CanvasObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpellLearn_Canvas final : public CCanvasObject +{ +private: + CSpellLearn_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_Canvas(const CSpellLearn_Canvas& rhs); + virtual ~CSpellLearn_Canvas() = 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 Ready_Panel(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + void Clear_Penel(); + +private: + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CGameObject* m_pSpellLearn_Panel = { nullptr }; + +public: + static CSpellLearn_Canvas* 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/SpellLearn_MovePointer.h b/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h new file mode 100644 index 000000000..1cbad5c47 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h @@ -0,0 +1,52 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpellLearn_MovePointer final : public CElementObject +{ +private: + CSpellLearn_MovePointer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_MovePointer(const CSpellLearn_MovePointer& rhs); + virtual ~CSpellLearn_MovePointer() = 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; + +public: + void SpellLearn(_int Index); +private: + void Line(_float fTime); + + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _bool m_bMoveStart = { false }; + _int m_iSpell{}; + + _int Index{}; + vector<_vector> m_MoveLine; + +public: + static CSpellLearn_MovePointer* 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/SpellLearn_Name.h b/Jusin154_Team3D/Editor/Public/SpellLearn_Name.h new file mode 100644 index 000000000..6449ec521 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_Name.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpellLearn_Name final : public CElementObject +{ +private: + CSpellLearn_Name(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_Name(const CSpellLearn_Name& rhs); + virtual ~CSpellLearn_Name() = 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 CSpellLearn_Name* 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/SpellLearn_Panel.h b/Jusin154_Team3D/Editor/Public/SpellLearn_Panel.h new file mode 100644 index 000000000..8cb5c3066 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_Panel.h @@ -0,0 +1,51 @@ +#pragma once + +#include "Editor_Define.h" +#include "PanelObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpellLearn_Panel final : public CPanelObject +{ + +private: + CSpellLearn_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_Panel(const CSpellLearn_Panel& rhs); + virtual ~CSpellLearn_Panel() = 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 Ready_Element(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CGameObject* m_pSpellLearn_Name = { nullptr }; + CGameObject* m_pSpellLearn = { nullptr }; + CGameObject* m_pSpellLearn_MovePointer = { nullptr }; + +public: + static CSpellLearn_Panel* 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/UI_Manager.h b/Jusin154_Team3D/Editor/Public/UI_Manager.h index 9461bd7df..7f3a92171 100644 --- a/Jusin154_Team3D/Editor/Public/UI_Manager.h +++ b/Jusin154_Team3D/Editor/Public/UI_Manager.h @@ -53,6 +53,7 @@ class CUI_Manager final : public CUIObject CGameObject* m_pSpell_Canvas = { nullptr }; CGameObject* m_pLoding_Canvas= { nullptr }; CGameObject* m_pQuest_Canves= { nullptr }; + CGameObject* m_pSpellLearn_Canvas = { nullptr }; CGameObject* m_pMouse_Cursor = { nullptr }; CGameObject* m_pCamera_LockOn = { nullptr }; _bool m_bCanvas_Change = { false }; diff --git a/Jusin154_Team3D/Engine/Private/ElementObject.cpp b/Jusin154_Team3D/Engine/Private/ElementObject.cpp index ae0cb26f6..92e573c9f 100644 --- a/Jusin154_Team3D/Engine/Private/ElementObject.cpp +++ b/Jusin154_Team3D/Engine/Private/ElementObject.cpp @@ -130,7 +130,7 @@ _float CElementObject::Get_Nine_Slice_Bottom() return m_vNine_Slice.w; } -void CElementObject::Start_Lerp(_float fTimeDelta) +_bool CElementObject::Start_Lerp(_float fTimeDelta) { _vector Pos = m_fCurrent_Position; @@ -146,7 +146,7 @@ void CElementObject::Start_Lerp(_float fTimeDelta) { m_fX = m_vLerp_Position.m128_f32[0]; m_fY = m_vLerp_Position.m128_f32[1]; - m_bLerpOn = false; + return true; } else @@ -154,6 +154,7 @@ void CElementObject::Start_Lerp(_float fTimeDelta) XMVECTOR DirNorm = XMVector3Normalize(Dir); m_fX = (Pos + DirNorm * move).m128_f32[0]; m_fY = (Pos + DirNorm * move).m128_f32[1]; + return false; } } diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index abfb41447..d88e3d418 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -304,7 +304,7 @@ void CUIObject::Nine_Slice_Left(_float X) void CUIObject::Nine_Slice_Right(_float Y) { - m_vNine_Slice.y =Y; + m_vNine_Slice.y = Y; } void CUIObject::Nine_Slice_Top(_float Z) @@ -367,8 +367,14 @@ void CUIObject::Lerp_PosY(_float PosY) m_fLerpY = PosY; } -void CUIObject::Start_Lerp(_float fTimeDelta) +_bool CUIObject::Start_Lerp(_float fTimeDelta) { + return false; +} + +_bool CUIObject::Start_Bezier(_float fTimeDelta) +{ + return _bool(); } void CUIObject::Reset_Pos(_float fTimeDelta) diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp index 9fcd697a4..5c6c197e2 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp @@ -336,6 +336,32 @@ _int CVIBuffer_UI_Instance::Set_Mouse_Hover(_float2 fMousePos) return hoveredIndex; } +void CVIBuffer_UI_Instance::Set_Hover(_int Index) +{ + 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); + + if(Index == -1) + for (_uint i = 0; i < m_iNumInstance; i++) + pVertices[i].bHover = 0.f; + + for (_uint i = 0; i < m_iNumInstance; i++) + { + if (i == Index) + { + pVertices[i].bHover = 1.f; + } + else + { + pVertices[i].bHover = 0.f; + } + } + m_pContext->Unmap(m_pVBInstance, 0); +} + void CVIBuffer_UI_Instance::Set_Hover_Index(_uint iIndex) { D3D11_MAPPED_SUBRESOURCE SubResource{}; diff --git a/Jusin154_Team3D/Engine/Public/ElementObject.h b/Jusin154_Team3D/Engine/Public/ElementObject.h index 8ace2e23b..90b5c68b5 100644 --- a/Jusin154_Team3D/Engine/Public/ElementObject.h +++ b/Jusin154_Team3D/Engine/Public/ElementObject.h @@ -30,7 +30,7 @@ class ENGINE_DLL CElementObject abstract : public CUIObject virtual _float Get_Nine_Slice_Top() override; virtual _float Get_Nine_Slice_Bottom() override; - virtual void Start_Lerp(_float fTimeDelta) override; + virtual _bool Start_Lerp(_float fTimeDelta) override; virtual void Reset_Pos(_float fTimeDelta)override; virtual void Start_Size_Lerp(_float fTimeDelta) override; virtual void Reset_Size_Lerp(_float fTimeDelta) override; @@ -41,6 +41,8 @@ class ENGINE_DLL CElementObject abstract : public CUIObject virtual HRESULT Initialize(void* pArg); virtual HRESULT Ready_Components(void* pArg) override; + _float m_fBezierTime = 0; + public: virtual void Free() override; }; diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index 4c23fc167..cbd2bff11 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -141,7 +141,8 @@ typedef struct tagCurrentQeustSerectInfo virtual void Lerp_PosX(_float PosX); virtual void Lerp_PosY(_float PosY); - virtual void Start_Lerp(_float fTimeDelta); + virtual _bool Start_Lerp(_float fTimeDelta); + virtual _bool Start_Bezier(_float fTimeDelta); virtual void Reset_Pos(_float fTimeDelta); virtual void Start_Size_Lerp(_float fTimeDelta); virtual void Reset_Size_Lerp(_float fTimeDelta); diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h index fe5e72dc6..7238bcae2 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h @@ -36,6 +36,7 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance void Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float vColor); void Set_Index_Color(_int Index, _float vColor); _int Set_Mouse_Hover(_float2 fMousePos); + void Set_Hover(_int Index); void Set_Hover_Index(_uint iIndex); void Set_Equip_Index(_uint iIndex); void Set_Draw(_int iCount = -1);