diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 6d883bd57..14c08945d 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -10,7 +10,7 @@ int g_iImageCountY; uint g_iIndexU; uint g_iIndexV; uint g_iQuestType; -uint g_iSpellType; +int g_iSpellType; float g_fPI; float g_fFar; @@ -506,22 +506,22 @@ PS_OUT PS_SpellAnim(PS_IN In) switch (g_iSpellType) { case 0: - BGColor = float3(208.f, 179.f, 54.f) / 255.f; + BGColor = float3(255.f, 255.f, 0.f) / 255.f; break; case 1: - BGColor = float3(89.f, 32.f, 215.f) / 255.f; + BGColor = float3(150.f, 120.f, 240.f) / 255.f; break; case 2: BGColor = float3(190.f, 46., 34.f) / 255.f; break; case 3: - BGColor = float3(37.f, 129.f, 162.f) / 255.f; + BGColor = float3(24.f, 190.f, 255.f) / 255.f; break; case 4: - BGColor = float3(134.f, 171.f, 78.f) / 255.f; + BGColor = float3(200.f, 220.f, 150.f) / 255.f; break; case 5: - BGColor = float3(0.f, 80.f, 55.f) / 255.f; + BGColor = float3(50.f, 150.f, 110.f) / 255.f; break; case 6: BGColor = float3(0.f, 0.f, 0.f); @@ -542,11 +542,11 @@ PS_OUT PS_SpellAnim(PS_IN In) color1 = tex3; - float wave1 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; - float wave2 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; + float wave1 = sin(OverrayUV.x * 10.f + g_fTime) * 0.01f; + float wave2 = sin(OverrayUV.x * 10.f + g_fTime) * 0.01f; float waveThreshold1 = CoolTime + wave1; float waveThreshold2 = CoolTime2 + wave2; - float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f , waveUV.y = (OverrayUV.y - waveThreshold1) /(waveThreshold2 - waveThreshold1)); + float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f, waveUV.y = (OverrayUV.y - waveThreshold1) / (waveThreshold2 - waveThreshold1)); waveUV = saturate(waveUV); float tex5 = g_Texture3.Sample(DefaultSampler, waveUV).r; @@ -896,7 +896,7 @@ PS_OUT PS_Magic_Item(PS_IN In) float2 OverrayUV = In.vTexcoord; float CoolTime = 0.f + g_fDeltaV; - float CoolTime2 = 0.f + g_fDeltaV + 0.05; + float CoolTime2 = 0.f + g_fDeltaV + 0.1f; atlasUV = startUV + In.vTexcoord * (endUV - startUV); float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); tex3.rgb *= BGColor; @@ -914,16 +914,20 @@ PS_OUT PS_Magic_Item(PS_IN In) float waveThreshold1 = CoolTime + wave1; float waveThreshold2 = CoolTime2 + wave2; - + float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f, waveUV.y = (OverrayUV.y - waveThreshold1) / (waveThreshold2 - waveThreshold1)); + waveUV = saturate(waveUV); + float Mask = g_MaskingTexture.Sample(DefaultSampler, waveUV).r; if (g_fDeltaV <= 1.f) { if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) { - color1.rgb = float3(1.f, 1.f, 1.f); + color1.rgb += float3(1.f, 1.f, 1.f) * Mask * 1.f; } } - if (OverrayUV.y <= CoolTime) + float waveThreshold = CoolTime + wave1; + + if (OverrayUV.y <= waveThreshold) { color1.a = 0.f; } @@ -962,6 +966,187 @@ PS_OUT PS_Magic_Item(PS_IN In) return Out; } +PS_OUT PS_Spell_Preview(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); + float2 uv = In.vTexcoord; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; + + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); + + float2 Finaluv = In.vTexcoord; + + if (CurrentPixelPosition.x < CurrentLeft) + { + Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; + } + else if (CurrentPixelPosition.x > CurrentRight) + { + float dist = CurrentPixelPosition.x - CurrentRight; + Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; + } + else + { + float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); + Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); + } + + if (CurrentPixelPosition.y < CurrentTop) + { + Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; + } + else if (CurrentPixelPosition.y > CurrentBottom) + { + float dist = CurrentPixelPosition.y - CurrentBottom; + Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; + } + else + { + float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); + Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + float4 tex3 = g_Texture2.Sample(DefaultSampler, Finaluv); + Color = tex1; + + tex3.rgb = tex2.rgb; + + Color = lerp(Color, tex3, tex3.a); + + float2 Imagetexpos1 = g_fImageSipos1.xy / g_fCurrent_Size; + float2 Imagetexsize1 = g_fImageSipos1.zw / g_fCurrent_Size; + float2 Imagelocal = (In.vTexcoord - Imagetexpos1) / Imagetexsize1; + bool inside1 = all(Imagelocal >= 0.0f && Imagelocal <= 1.0f); + float4 tex4 = g_Texture3.Sample(DefaultSampler, Finaluv); + if (inside1) + { + Color = lerp(Color, tex4, tex4.a); + } + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Spell_Header(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); + + float3 BGColor= float3(1.f, 1.f, 1.f); + + switch (g_iSpellType) + { + case 0: + BGColor = float3(255.f, 255.f, 0.f) / 255.f; + break; + case 1: + BGColor = float3(150.f, 120.f, 240.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(24.f, 190.f, 255.f) / 255.f; + break; + case 4: + BGColor = float3(200.f, 220.f, 150.f) / 255.f; + break; + case 5: + BGColor = float3(50.f, 150.f, 110.f) / 255.f; + break; + case 6: + BGColor = float3(0.f, 0.f, 0.f); + break; + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + Color.rgb *= BGColor; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} +PS_OUT PS_Spell_Header_Line(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); + float2 uv = In.vTexcoord; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; + + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); + + float2 Finaluv = In.vTexcoord; + + if (CurrentPixelPosition.x < CurrentLeft) + { + Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; + } + else if (CurrentPixelPosition.x > CurrentRight) + { + float dist = CurrentPixelPosition.x - CurrentRight; + Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; + } + else + { + float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); + Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); + } + + if (CurrentPixelPosition.y < CurrentTop) + { + Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; + } + else if (CurrentPixelPosition.y > CurrentBottom) + { + float dist = CurrentPixelPosition.y - CurrentBottom; + Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; + } + else + { + float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); + Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + //Color.rgb = tex2.rgb; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -1162,4 +1347,34 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Magic_Item(); } + pass Spell_Preview + { + SetRasterizerState(RS_Default); + 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_Spell_Preview(); + } + + pass Spell_Header + { + SetRasterizerState(RS_Default); + 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_Spell_Header(); + } + + pass Spell_Header_Line + { + SetRasterizerState(RS_Default); + 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_Spell_Header_Line(); + } + } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 54a0fbd2a..ea92cf48b 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -262,21 +262,6 @@ HRESULT CLoader::Loading_For_GamePlay() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, 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/HUD", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) - { - - _string strFilePath = pFilePath; - _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp index 88571df96..d86062901 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp @@ -44,10 +44,11 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) m_fAngle = XMConvertToRadians(-135.f); m_fAlpha = 1.f; m_fAlphaTime = 1.f; + m_vUVScale.x = 1.f; m_vUVScale.y = 1.f; m_fCoolTime = 5.f; m_fSortZ = 0.01f; - m_iSkillType = ENUM_CLASS(SKILLTYPE::CONTROL); + m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); Compute_UI(5); m_bActive = true; return S_OK; @@ -55,10 +56,10 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) void CSpell_Overlay::Compute_UI(_uint SpellID) { - _float2 fImage_Size = { 1024.f, 1792.f }; + _float2 fImage_Size = { 1024.f, 1536.f}; _uint iCountX = 4; - _uint iCountY = 7; + _uint iCountY = 6; _float iImageX = 256.f; _float iImageY = 256.f; @@ -154,7 +155,7 @@ HRESULT CSpell_Overlay::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELLTYPE)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::TYPE)))) { return E_FAIL; } @@ -225,7 +226,7 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSkillType, sizeof(_float)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) { return E_FAIL; } @@ -245,6 +246,10 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDeltaU", &m_vUVScale.x, sizeof(_float)))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fDeltaV", &m_vUVScale.y, sizeof(_float)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp index 64dde823a..6fed41de8 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp @@ -47,7 +47,6 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(380.f, -30.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 7a17c55df..e48f60f44 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -14,7 +14,7 @@ namespace Client enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, END }; - enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, SPELLTYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, END }; + enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, END }; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index fff89ab5c..5c631300c 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -15,4 +15,15 @@ namespace Client vector<_wstring> pRigidBodyTags; vector LoadedRigidBody; }FOLDER_LOAD; + + typedef struct tagSpellInfo + { + _uint iSpell_ID{}; + _wstring pSpell_Name{}; + _uint iSpell_Type{}; + _uint iSpell_CoolTime{}; + _bool bSpell_Lock = false; + _bool bEquip_Spell = false; + + }SPELLINFO; }; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 6d883bd57..14c08945d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -10,7 +10,7 @@ int g_iImageCountY; uint g_iIndexU; uint g_iIndexV; uint g_iQuestType; -uint g_iSpellType; +int g_iSpellType; float g_fPI; float g_fFar; @@ -506,22 +506,22 @@ PS_OUT PS_SpellAnim(PS_IN In) switch (g_iSpellType) { case 0: - BGColor = float3(208.f, 179.f, 54.f) / 255.f; + BGColor = float3(255.f, 255.f, 0.f) / 255.f; break; case 1: - BGColor = float3(89.f, 32.f, 215.f) / 255.f; + BGColor = float3(150.f, 120.f, 240.f) / 255.f; break; case 2: BGColor = float3(190.f, 46., 34.f) / 255.f; break; case 3: - BGColor = float3(37.f, 129.f, 162.f) / 255.f; + BGColor = float3(24.f, 190.f, 255.f) / 255.f; break; case 4: - BGColor = float3(134.f, 171.f, 78.f) / 255.f; + BGColor = float3(200.f, 220.f, 150.f) / 255.f; break; case 5: - BGColor = float3(0.f, 80.f, 55.f) / 255.f; + BGColor = float3(50.f, 150.f, 110.f) / 255.f; break; case 6: BGColor = float3(0.f, 0.f, 0.f); @@ -542,11 +542,11 @@ PS_OUT PS_SpellAnim(PS_IN In) color1 = tex3; - float wave1 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; - float wave2 = sin(OverrayUV.x * 10.f + g_fTime ) * 0.01f; + float wave1 = sin(OverrayUV.x * 10.f + g_fTime) * 0.01f; + float wave2 = sin(OverrayUV.x * 10.f + g_fTime) * 0.01f; float waveThreshold1 = CoolTime + wave1; float waveThreshold2 = CoolTime2 + wave2; - float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f , waveUV.y = (OverrayUV.y - waveThreshold1) /(waveThreshold2 - waveThreshold1)); + float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f, waveUV.y = (OverrayUV.y - waveThreshold1) / (waveThreshold2 - waveThreshold1)); waveUV = saturate(waveUV); float tex5 = g_Texture3.Sample(DefaultSampler, waveUV).r; @@ -896,7 +896,7 @@ PS_OUT PS_Magic_Item(PS_IN In) float2 OverrayUV = In.vTexcoord; float CoolTime = 0.f + g_fDeltaV; - float CoolTime2 = 0.f + g_fDeltaV + 0.05; + float CoolTime2 = 0.f + g_fDeltaV + 0.1f; atlasUV = startUV + In.vTexcoord * (endUV - startUV); float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); tex3.rgb *= BGColor; @@ -914,16 +914,20 @@ PS_OUT PS_Magic_Item(PS_IN In) float waveThreshold1 = CoolTime + wave1; float waveThreshold2 = CoolTime2 + wave2; - + float2 waveUV = float2(waveUV.x = OverrayUV.x * 2.f + g_fTime * 0.3f, waveUV.y = (OverrayUV.y - waveThreshold1) / (waveThreshold2 - waveThreshold1)); + waveUV = saturate(waveUV); + float Mask = g_MaskingTexture.Sample(DefaultSampler, waveUV).r; if (g_fDeltaV <= 1.f) { if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) { - color1.rgb = float3(1.f, 1.f, 1.f); + color1.rgb += float3(1.f, 1.f, 1.f) * Mask * 1.f; } } - if (OverrayUV.y <= CoolTime) + float waveThreshold = CoolTime + wave1; + + if (OverrayUV.y <= waveThreshold) { color1.a = 0.f; } @@ -962,6 +966,187 @@ PS_OUT PS_Magic_Item(PS_IN In) return Out; } +PS_OUT PS_Spell_Preview(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); + float2 uv = In.vTexcoord; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; + + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); + + float2 Finaluv = In.vTexcoord; + + if (CurrentPixelPosition.x < CurrentLeft) + { + Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; + } + else if (CurrentPixelPosition.x > CurrentRight) + { + float dist = CurrentPixelPosition.x - CurrentRight; + Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; + } + else + { + float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); + Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); + } + + if (CurrentPixelPosition.y < CurrentTop) + { + Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; + } + else if (CurrentPixelPosition.y > CurrentBottom) + { + float dist = CurrentPixelPosition.y - CurrentBottom; + Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; + } + else + { + float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); + Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + float4 tex3 = g_Texture2.Sample(DefaultSampler, Finaluv); + Color = tex1; + + tex3.rgb = tex2.rgb; + + Color = lerp(Color, tex3, tex3.a); + + float2 Imagetexpos1 = g_fImageSipos1.xy / g_fCurrent_Size; + float2 Imagetexsize1 = g_fImageSipos1.zw / g_fCurrent_Size; + float2 Imagelocal = (In.vTexcoord - Imagetexpos1) / Imagetexsize1; + bool inside1 = all(Imagelocal >= 0.0f && Imagelocal <= 1.0f); + float4 tex4 = g_Texture3.Sample(DefaultSampler, Finaluv); + if (inside1) + { + Color = lerp(Color, tex4, tex4.a); + } + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Spell_Header(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); + + float3 BGColor= float3(1.f, 1.f, 1.f); + + switch (g_iSpellType) + { + case 0: + BGColor = float3(255.f, 255.f, 0.f) / 255.f; + break; + case 1: + BGColor = float3(150.f, 120.f, 240.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(24.f, 190.f, 255.f) / 255.f; + break; + case 4: + BGColor = float3(200.f, 220.f, 150.f) / 255.f; + break; + case 5: + BGColor = float3(50.f, 150.f, 110.f) / 255.f; + break; + case 6: + BGColor = float3(0.f, 0.f, 0.f); + break; + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + Color.rgb *= BGColor; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} +PS_OUT PS_Spell_Header_Line(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); + float2 uv = In.vTexcoord; + float2 CurrentPixelPosition = uv * g_fCurrent_Size; + float OriginLeft = g_fNine_Slice.x; + float OriginRight = g_fNine_Slice.y; + float OriginTop = g_fNine_Slice.z; + float OriginBottom = g_fNine_Slice.w; + + float CurrentLeft = OriginLeft; + float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight); + float CurrentTop = OriginTop; + float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom); + + float2 Finaluv = In.vTexcoord; + + if (CurrentPixelPosition.x < CurrentLeft) + { + Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x; + } + else if (CurrentPixelPosition.x > CurrentRight) + { + float dist = CurrentPixelPosition.x - CurrentRight; + Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x; + } + else + { + float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft); + Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x); + } + + if (CurrentPixelPosition.y < CurrentTop) + { + Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y; + } + else if (CurrentPixelPosition.y > CurrentBottom) + { + float dist = CurrentPixelPosition.y - CurrentBottom; + Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y; + } + else + { + float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop); + Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y); + } + + float4 tex1 = g_Texture.Sample(DefaultSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + //Color.rgb = tex2.rgb; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -1162,4 +1347,34 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Magic_Item(); } + pass Spell_Preview + { + SetRasterizerState(RS_Default); + 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_Spell_Preview(); + } + + pass Spell_Header + { + SetRasterizerState(RS_Default); + 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_Spell_Header(); + } + + pass Spell_Header_Line + { + SetRasterizerState(RS_Default); + 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_Spell_Header_Line(); + } + } 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 48fe88d12..5b35a6cf9 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl @@ -4,12 +4,18 @@ matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; Texture2D g_Texture; Texture2D g_Texture1; +Texture2D g_Texture2; +Texture2D g_Texture3; +Texture2D g_Texture4; +Texture2D g_Texture5; +Texture2D g_MaskTexture; float g_fAlpha; float g_fOwnerAlpha; float g_fCanvasAlpha; float g_fAngle; float g_fFar; +float g_fTime; struct VS_IN { @@ -18,13 +24,17 @@ struct VS_IN float2 vSize : TEXCOORD1; float2 vPos : TEXCOORD2; - float4 vUV: TEXCOORD3; + float4 vUV : TEXCOORD3; + float4 vColor : TEXCOORD4; + float bHover : TEXCOORD5; }; struct VS_OUT { float4 vPosition : SV_POSITION; float2 vTexcoord : TEXCOORD0; + float4 vColor : TEXCOORD1; + float bHover : TEXCOORD2; }; VS_OUT VS_MAIN(VS_IN In) @@ -33,16 +43,21 @@ VS_OUT VS_MAIN(VS_IN In) matrix matVP = mul(g_ViewMatrix, g_ProjMatrix); float3 vLocalPos = In.vPosition; - vLocalPos.xy *= In.vSize; - vLocalPos.xy += In.vPos; + if (In.bHover != 0) + vLocalPos.xy *= In.vSize * 1.1f; + else + vLocalPos.xy *= In.vSize; + + vLocalPos.xy += In.vPos; float4 UV = In.vUV; float3 vParentPos = float3(g_WorldMatrix._41, g_WorldMatrix._42, g_WorldMatrix._43); float3 vFinalWorldPos = vLocalPos + vParentPos; - + Out.vPosition = mul(float4(vFinalWorldPos, 1.f), matVP); Out.vTexcoord = UV.xy + In.vTexcoord * (UV.zw - UV.xy); - + Out.vColor = In.vColor; + Out.bHover = In.bHover; return Out; } @@ -50,6 +65,8 @@ struct PS_IN { float4 vPosition : SV_POSITION; float2 vTexcoord : TEXCOORD0; + float4 vColor : TEXCOORD1; + float bHover : TEXCOORD2; }; struct PS_OUT @@ -86,7 +103,7 @@ PS_OUT PS_Alpha_Blend(PS_IN In) float4 color = g_Texture.Sample(ClampSampler, In.vTexcoord); - if(color.a <= 0.4f) + if (color.a <= 0.4f) discard; color.a *= Alpha; @@ -152,7 +169,6 @@ PS_OUT PS_Eessential_Spell_Slot(PS_IN In) { PS_OUT Out; float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float3 Blue = float3(41.f, 165.f, 255.f) / 255.f; float4 color = float4(1.f, 1.f, 1.f, 1.f); float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); @@ -173,7 +189,6 @@ PS_OUT PS_Eessential_Spell(PS_IN In) { PS_OUT Out; float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float3 Blue = float3(41.f, 165.f, 255.f) / 255.f; float4 color = float4(1.f, 1.f, 1.f, 1.f); float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); @@ -187,6 +202,109 @@ PS_OUT PS_Eessential_Spell(PS_IN In) return Out; } +PS_OUT PS_Color_Image(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 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); + color = tex1; + color *= In.vColor; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Spell_Hover(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float3 HoverOff = g_Texture2.Sample(DefaultSampler, In.vTexcoord).rgb; + float3 HoverOn = g_Texture3.Sample(DefaultSampler, In.vTexcoord).rgb; + + float4 color = float4(1.f, 1.f, 1.f, 1.f); + + if (In.bHover != 0) + { + float tex1 = g_Texture5.Sample(DefaultSampler, In.vTexcoord).r; + color.r *= tex1.r; + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + color = lerp(tex1, tex2, tex2.a); + color.rgb = HoverOn; + } + else + { + float tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord).r; + color.r *= tex1.r; + float4 tex2 = g_Texture4.Sample(DefaultSampler, In.vTexcoord); + color = lerp(tex1, tex2, tex2.a); + color.rgb = HoverOff; + color.a *= 0.5f; + } + + + color *= In.vColor; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Spell_Effect(PS_IN In) +{ + PS_OUT Out; + + if (In.bHover == 0) + discard; + + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 color = float4(1.f, 1.f, 1.f, 1.f); + float2 maskUV = In.vTexcoord + g_fTime * float2(0.2f, 0.0f); + + //float2 center = float2(0.5, 0.5); + //float2 uv = In.vTexcoord - center; + //float angle = -g_fTime; + //float s = sin(angle); + //float c = cos(angle); + //float2 rotUV = float2( + //uv.x * c - uv.y * s, + //uv.x * s + uv.y * c + //) + center; + + //float2 maskUV = In.vTexcoord; + + //maskUV.x += g_fTime * float2(0.05, 0.02); // 속도 조절 가능 + + //float2 center = float2(0.5, 0.0); + //float2 uv = In.vTexcoord - center; + + //float scale = 0.5 + sin(g_fTime * 20) * 0.5; + //uv.x *= scale; + + //uv += center; + + float tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord).r; + float mask = g_MaskTexture.Sample(DefaultSampler, maskUV).r; + + color.a *= tex1; + color.a *= mask; + color.a *= Alpha; + + color *= In.vColor; + + Out.vColor = color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -254,4 +372,37 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Eessential_Spell(); } + + pass Color_Image + { + SetRasterizerState(RS_Default); + 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_Color_Image(); + } + + pass Spell_Hover + { + SetRasterizerState(RS_Default); + 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_Spell_Hover(); + } + + pass Spell_Effect + { + SetRasterizerState(RS_Default); + 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_Spell_Effect(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Lock.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Lock.png new file mode 100644 index 000000000..5e3716df2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Lock.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/SpellWidgetPanelBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/SpellWidgetPanelBack.png new file mode 100644 index 000000000..7a7da21f3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/SpellWidgetPanelBack.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_GoldLeaf.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_GoldLeaf.png new file mode 100644 index 000000000..10b0bed15 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_GoldLeaf.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Goldleaf_Large.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Goldleaf_Large.png new file mode 100644 index 000000000..d6d761b05 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Goldleaf_Large.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Header_Line.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Header_Line.png new file mode 100644 index 000000000..3d6fffb31 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_Header_Line.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButton.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButton.png new file mode 100644 index 000000000..d350d3d8b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButton.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonOutline.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonOutline.png new file mode 100644 index 000000000..cc1dffe78 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonOutline.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_LighthouseHeaderBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_LighthouseHeaderBack.png new file mode 100644 index 000000000..ab94ead0f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_LighthouseHeaderBack.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png index 5e3716df2..18e940838 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderExtended_4K.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderExtended_4K.png deleted file mode 100644 index b5128f7bf..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderExtended_4K.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderMask.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderMask.png new file mode 100644 index 000000000..833a8ab61 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderMask.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedPresetBorder.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedPresetBorder.png new file mode 100644 index 000000000..a75f3ae17 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedPresetBorder.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_InnerShadow.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_InnerShadow.png deleted file mode 100644 index b505584cc..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_InnerShadow.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentTree_TreeBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentTree_TreeBack.png new file mode 100644 index 000000000..fa79e0ed1 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentTree_TreeBack.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentVideoBorder.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentVideoBorder.png new file mode 100644 index 000000000..b12972394 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TalentVideoBorder.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TooltipBorder_4K.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TooltipBorder_4K.png new file mode 100644 index 000000000..8310c6dd5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_TooltipBorder_4K.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Crucio_Decal_Emiss_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Crucio_Decal_Emiss_D.png new file mode 100644 index 000000000..3f857f63b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Crucio_Decal_Emiss_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Cursed_X_Outer_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Cursed_X_Outer_D.png new file mode 100644 index 000000000..f667ecabd Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Cursed_X_Outer_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_FlameTileGrey_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_FlameTileGrey_D.png new file mode 100644 index 000000000..b1a59d625 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_FlameTileGrey_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flare02_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flare02_D.png new file mode 100644 index 000000000..83ac7e0ee Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flare02_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flippendo_ScorchMark2_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flippendo_ScorchMark2_D.png new file mode 100644 index 000000000..41450a0b7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Flippendo_ScorchMark2_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Inky_Smoke_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Inky_Smoke_D.png new file mode 100644 index 000000000..eebd2001f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Inky_Smoke_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Noise08_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Noise08_D.png new file mode 100644 index 000000000..7c1ae0e40 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Noise08_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Repairo_Wisp_04_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Repairo_Wisp_04_D.png new file mode 100644 index 000000000..d8ef663c4 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_Repairo_Wisp_04_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_RingFlare_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_RingFlare_D.png new file mode 100644 index 000000000..5b2e570ee Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_RingFlare_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_SwirlNoise_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_SwirlNoise_01_D.png new file mode 100644 index 000000000..bf956b0cf Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_SwirlNoise_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WhispLine_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WhispLine_D.png new file mode 100644 index 000000000..47abb63ce Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WhispLine_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WindNoise_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WindNoise_D.png new file mode 100644 index 000000000..6f434b183 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WindNoise_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WispyNoise_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WispyNoise_D.png new file mode 100644 index 000000000..77c43e314 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/VFX_T_WispyNoise_D.png differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 9a8f3bfa1..c17ec5824 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -253,10 +253,16 @@ + + + + + + @@ -397,10 +403,16 @@ + + + + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index c5a8a4631..5de5f126a 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -205,9 +205,6 @@ {3131278b-18f5-4b84-ba85-73104998e9c9} - - {9c21aba5-00c1-4b4c-8a82-dac7a156fd9b} - {680910fd-aee2-4f69-b644-12b36b0f635b} @@ -298,30 +295,6 @@ {c81350c7-0edb-4e51-babf-09bf627414f1} - - {a56502cb-b0b8-4ea7-bc5e-5482b416fef9} - - - {8a70232d-f917-4ff6-b617-302e325996ae} - - - {dac78c4e-b898-45dc-8740-794899de0c69} - - - {d5681f71-af29-4418-bf3a-a1486c6ba171} - - - {029a22c4-ab06-4db0-9527-4e3cfa1a2e0d} - - - {b017e167-f48d-4417-a924-765ab802cff5} - - - {904a7ae5-33fe-49a1-9f31-27443acc9e1a} - - - {0b8cac41-419f-48ce-87bc-805b8962b4df} - {7e8b7123-11fb-4946-99fe-3265932d0536} @@ -400,6 +373,51 @@ {da710064-ef45-41e1-8fc5-1fc544cb4cb8} + + {78ffbbbe-930a-4770-93fc-ec46f7ff2c8d} + + + {d5815cd9-96d2-4364-b0d6-be0bb10b02db} + + + {62f1bdfb-9162-434a-a462-b63f5e763277} + + + {9c21aba5-00c1-4b4c-8a82-dac7a156fd9b} + + + {a56502cb-b0b8-4ea7-bc5e-5482b416fef9} + + + {8a70232d-f917-4ff6-b617-302e325996ae} + + + {dac78c4e-b898-45dc-8740-794899de0c69} + + + {d5681f71-af29-4418-bf3a-a1486c6ba171} + + + {029a22c4-ab06-4db0-9527-4e3cfa1a2e0d} + + + {b017e167-f48d-4417-a924-765ab802cff5} + + + {904a7ae5-33fe-49a1-9f31-27443acc9e1a} + + + {0b8cac41-419f-48ce-87bc-805b8962b4df} + + + {99125f58-acb9-4e9c-af15-87bf4e09c9b1} + + + {261e2297-e48d-4e42-b57e-12b0c0e633a3} + + + {754c2260-5073-4489-9fa8-0df8da6d0255} + @@ -780,6 +798,24 @@ 50.UI\Spell_Canvas\Spell_Panel\Spell_List_Image + + 50.UI\Spell_Canvas\Spell_Panel\Spell_State + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hober + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hover_Effect + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header_Line + @@ -1159,6 +1195,24 @@ 50.UI\Spell_Canvas\Spell_Panel\Spell_List_Image + + 50.UI\Spell_Canvas\Spell_Panel\Spell_State + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hober + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Hover_Effect + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Preview\Spell_Header_Line + diff --git a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp index 959fee00c..ceee66aaa 100644 --- a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp @@ -47,7 +47,6 @@ HRESULT CCurrent_Spell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(-780.f, 340.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp index 3d46acf32..923cc1afb 100644 --- a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp @@ -46,7 +46,6 @@ 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_pVIBufferCom->Set_ImageUV(); return S_OK; } @@ -90,6 +89,7 @@ void CEessential_Spell_Slot::Update(_float fTimeDelta) } } m_fTime += fTimeDelta * m_fTimeMult; + Hover(); __super::Update(fTimeDelta); } @@ -152,6 +152,23 @@ void CEessential_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } +void CEessential_Spell_Slot::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 CEessential_Spell_Slot::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp index 42977a5f6..e25650f18 100644 --- a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp +++ b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp @@ -153,7 +153,7 @@ void CIMGUIUI::Update(_float fTimeDelta) m_fLerpY = static_cast(m_pElementObject)->Get_Lerp_Pos().m128_f32[1]; m_fMoveSpeed = static_cast(m_pElementObject)->Get_Speed(); m_fAngle = static_cast(m_pElementObject)->Get_Angle(); - m_iSkillType = static_cast(m_pElementObject)->Get_SkillType(); + m_iSpellType = static_cast(m_pElementObject)->Get_SkillType(); m_fCoolTime = static_cast(m_pElementObject)->Get_CoolTime(); } GUI::Begin("Current_PanelObject_Info"); @@ -436,10 +436,10 @@ void CIMGUIUI::Update(_float fTimeDelta) static_cast(m_pElementObject)->Set_Angle(m_fAngle); } - GUI::Text("SkillType %d", m_iSkillType); - if (GUI::Combo("SkillType", &m_iSkillType, SpellTypeNames, itemCount)) + GUI::Text("SkillType %d", m_iSpellType); + if (GUI::Combo("SkillType", &m_iSpellType, SpellTypeNames, itemCount)) { - static_cast(m_pElementObject)->Set_SkillType(m_iSkillType); + static_cast(m_pElementObject)->Set_SkillType(m_iSpellType); } GUI::Text("CoolTime %.1f", m_fCoolTime); diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index b47e34c56..616889a06 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -70,6 +70,12 @@ #include "Eessential_Spell_Slot.h" #include "Eessential_Spell.h" #include "Spell_List_Image.h" +#include "Spell_State.h" +#include "Spell_Hover.h" +#include "Spell_Hover_Effect.h" +#include "Spell_Preview.h" +#include "Spell_Header.h" +#include "Spell_Header_Line.h" #include "IMGUIUI.h" @@ -720,6 +726,30 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_State::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Hover::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Hover_Effect::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Preview::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Header::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Header_Line::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/Magic_Item.cpp b/Jusin154_Team3D/Editor/Private/Magic_Item.cpp index b2a9664e9..beefb262a 100644 --- a/Jusin154_Team3D/Editor/Private/Magic_Item.cpp +++ b/Jusin154_Team3D/Editor/Private/Magic_Item.cpp @@ -219,6 +219,10 @@ HRESULT CMagic_Item::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom6->Bind_ShaderResource(m_pShaderCom, "g_MaskingTexture", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -316,6 +320,10 @@ HRESULT CMagic_Item::Ready_Components(void* pArg) { return E_FAIL; } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_tillingSmokes"), reinterpret_cast(&m_pDiffuse_TextureCom6), nullptr))) + { + return E_FAIL; + } if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) { return E_FAIL; @@ -360,6 +368,7 @@ void CMagic_Item::Free() SAFE_RELEASE(m_pDiffuse_TextureCom3); SAFE_RELEASE(m_pDiffuse_TextureCom4); SAFE_RELEASE(m_pDiffuse_TextureCom5); + SAFE_RELEASE(m_pDiffuse_TextureCom6); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Header.cpp b/Jusin154_Team3D/Editor/Private/Spell_Header.cpp new file mode 100644 index 000000000..284be9ad9 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Header.cpp @@ -0,0 +1,221 @@ +#include "pch.h" +#include "Spell_Header.h" +#include "GameInstance.h" + +CSpell_Header::CSpell_Header(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Header::CSpell_Header(const CSpell_Header& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Header::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Header::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = -20.f; + Desc.fSizeX = 512.f; + Desc.fSizeY = 64.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_fMoveSpeed = 5.f; + m_fLerpX = m_fX; + m_fLerpY = 45; + return S_OK; +} + +void CSpell_Header::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Header::Update(_float fTimeDelta) +{ + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + { + m_fAlpha += fTimeDelta * m_fAlphaTime; + } + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Header::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpell_Header::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_HEADER)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_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"))) + { + 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_iSpellType", &m_iSpellType, sizeof(_int)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Header::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_LighthouseHeaderBack"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Header* CSpell_Header::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Header* pInstance = new CSpell_Header(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Header::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Header* pInstance = new CSpell_Header(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Header::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Header::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp b/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp new file mode 100644 index 000000000..dbd3bdaf5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp @@ -0,0 +1,214 @@ +#include "pch.h" +#include "Spell_Header_Line.h" +#include "GameInstance.h" + +CSpell_Header_Line::CSpell_Header_Line(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Header_Line::CSpell_Header_Line(const CSpell_Header_Line& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Header_Line::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Header_Line::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 20.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) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.f; + m_fMoveSpeed = 5.f; + return S_OK; +} + +void CSpell_Header_Line::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Header_Line::Update(_float fTimeDelta) +{ + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + { + m_fAlpha += fTimeDelta * m_fAlphaTime; + } + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Header_Line::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpell_Header_Line::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_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"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Header_Line::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_Header_Line"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Header_Line* CSpell_Header_Line::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Header_Line* pInstance = new CSpell_Header_Line(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Header_Line"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Header_Line::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Header_Line* pInstance = new CSpell_Header_Line(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Header_Line::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Header_Line::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp new file mode 100644 index 000000000..86a4e1685 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp @@ -0,0 +1,313 @@ +#include "pch.h" +#include "Spell_Hover.h" +#include "GameInstance.h" + +CSpell_Hover::CSpell_Hover(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Hover::CSpell_Hover(const CSpell_Hover& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Hover::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Hover::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.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 = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + 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); + return S_OK; +} + +void CSpell_Hover::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Hover::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; + } + } + Hover(); + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Hover::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_Hover::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::SPELL_HOVER)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_Hover::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Hover::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_Hover::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_Hover::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = 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"))) + { + 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_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom3->Bind_ShaderResource(m_pShaderCom, "g_Texture3", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom4->Bind_ShaderResource(m_pShaderCom, "g_Texture4", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom5->Bind_ShaderResource(m_pShaderCom, "g_Texture5", 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_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpell_Hover::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_IconButtonOutline"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_IconButtonHighlight"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_GoldLeaf"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_Goldleaf_Large"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_IconButton"), reinterpret_cast(&m_pDiffuse_TextureCom4), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SelectedPresetBorder"), reinterpret_cast(&m_pDiffuse_TextureCom5), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Hover* CSpell_Hover::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Hover* pInstance = new CSpell_Hover(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Hover"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Hover::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Hover* pInstance = new CSpell_Hover(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Hover"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Hover::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); + SAFE_RELEASE(m_pDiffuse_TextureCom3); + SAFE_RELEASE(m_pDiffuse_TextureCom4); + SAFE_RELEASE(m_pDiffuse_TextureCom5); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Hover::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp new file mode 100644 index 000000000..f336f09d1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp @@ -0,0 +1,279 @@ +#include "pch.h" +#include "Spell_Hover_Effect.h" +#include "GameInstance.h" + +CSpell_Hover_Effect::CSpell_Hover_Effect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Hover_Effect::CSpell_Hover_Effect(const CSpell_Hover_Effect& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Hover_Effect::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Hover_Effect::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.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 = 1.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_fSortZ = 0.02f; + 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); + return S_OK; +} + +void CSpell_Hover_Effect::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Hover_Effect::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; + } + } + Hover(); + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Hover_Effect::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_Hover_Effect::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::SPELL_SLOT_EFFECT)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_Hover_Effect::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Hover_Effect::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_Hover_Effect::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_Hover_Effect::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = 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"))) + { + 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_MaskTexture", 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_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + + +HRESULT CSpell_Hover_Effect::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SelectedBorderMask"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_VFX_T_WhispLine_D"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Hover_Effect* CSpell_Hover_Effect::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Hover_Effect* pInstance = new CSpell_Hover_Effect(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Hover_Effect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Hover_Effect::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Hover_Effect* pInstance = new CSpell_Hover_Effect(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Hover_Effect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Hover_Effect::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Hover_Effect::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_List.cpp b/Jusin154_Team3D/Editor/Private/Spell_List.cpp index 263b9ffdd..2f93ffc37 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_List.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_List.cpp @@ -23,8 +23,8 @@ HRESULT CSpell_List::Initialize(void* pArg) Desc.fX = 0.f; Desc.fY = 0.f; - Desc.fSizeX = 150.f; - Desc.fSizeY = 150.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.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) }; @@ -46,7 +46,7 @@ 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_pVIBufferCom->Set_ImageUV(); + Color(); return S_OK; } @@ -90,6 +90,7 @@ void CSpell_List::Update(_float fTimeDelta) } } m_fTime += fTimeDelta * m_fTimeMult; + Hover(); __super::Update(fTimeDelta); } @@ -113,7 +114,7 @@ HRESULT CSpell_List::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::DEFAULT)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::COLOR)))) { return E_FAIL; } @@ -153,6 +154,34 @@ void CSpell_List::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } +void CSpell_List::Color() +{ + m_pVIBufferCom->Set_Index_Renge_Color(0, 3, _float4(255.f / 255.f, 255.f / 255.f, 0.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(4, 7, _float4(150.f / 255.f, 120.f / 255.f, 240.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(8, 12, _float4(190.f / 255.f, 46.f / 255.f, 34.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(13, 16, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(17, 19, _float4(200.f / 255.f, 220.f / 255.f, 150.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(20, 22, _float4(50.f / 255.f, 150.f / 255.f, 110.f / 255.f, 1.f)); + 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() +{ + 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_List::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) @@ -191,6 +220,10 @@ HRESULT CSpell_List::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp index cf51b84a4..566519b20 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp @@ -48,17 +48,17 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) m_vUVScale.y = 1.f; m_fCoolTime = 5.f; m_fSortZ = 1.f; - m_iSkillType = ENUM_CLASS(SKILLTYPE::CONTROL); + m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); Compute_UI(5); return S_OK; } void CSpell_Overlay::Compute_UI(_uint SpellID) { - _float2 fImage_Size = { 1024.f, 1792.f }; + _float2 fImage_Size = { 1024.f, 1536.f }; _uint iCountX = 4; - _uint iCountY = 7; + _uint iCountY = 6; _float iImageX = 256.f; _float iImageY = 256.f; @@ -154,7 +154,7 @@ HRESULT CSpell_Overlay::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELLTYPE)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::TYPE)))) { return E_FAIL; } @@ -225,7 +225,7 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSkillType, sizeof(_float)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp index feface3ee..fdd895bbb 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp @@ -6,6 +6,10 @@ #include "Eessential_Spell_Slot.h" #include "Eessential_Spell.h" #include "Spell_List_Image.h" +#include "Spell_State.h" +#include "Spell_Hover.h" +#include "Spell_Hover_Effect.h" +#include "Spell_Preview.h" CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -189,6 +193,30 @@ HRESULT CSpell_Panel::Ready_Element(void* pArg) } Add_Element(TEXT("Spell_List_Image"), m_pSpell_List_Image); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_State)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_State"), m_pSpell_State); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Hover)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Hover"), m_pSpell_Hover); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Hover_Effect)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Hover_Effect"), m_pSpell_Hover_Effect); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Preview)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Preview"), m_pSpell_Preview); + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp b/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp new file mode 100644 index 000000000..a33c455e2 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp @@ -0,0 +1,295 @@ +#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) +{ +} + +CSpell_Preview::CSpell_Preview(const CSpell_Preview& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Preview::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Preview::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 400.f; + Desc.fY = -365.f; + Desc.fSizeX = 128.f; + Desc.fSizeY = 128.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; + } + // y값 최소 270 최대 410 + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 3.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); + return S_OK; +} + +void CSpell_Preview::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Preview::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; + } + } + static_cast(m_pSpell_Header)->Set_SkillType(ENUM_CLASS(m_iSpellType)); + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Preview::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpell_Preview::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_PREVIEW)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + m_pSpell_Header->Render(); + m_pSpell_Header_Line->Render(); + return S_OK; +} + +_vector CSpell_Preview::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Preview::SizeUpX(_float fSizeX) +{ + _float fX = (fSizeX - m_vScale.x) * 0.5f; + m_fSizeX = fSizeX; + m_fX += fX; + m_fLerpX += fX; + +} + +void CSpell_Preview::SizeUpY(_float fSizeY) +{ + _float prevY = m_fY; + m_fSizeY = fSizeY; + m_fY = m_fTopY + fSizeY * 0.5f; + + _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() +{ + 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_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 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; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageSipos1", &m_vHeaderBack, sizeof(_float4)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Preview::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_SpellWidgetPanelBack"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_Goldleaf_Large"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_TooltipBorder_4K"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_LighthouseHeaderBack"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + 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; +} + +CSpell_Preview* CSpell_Preview::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Preview* pInstance = new CSpell_Preview(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Preview"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Preview::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Preview* pInstance = new CSpell_Preview(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Preview"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Preview::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Preview::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp index bebb79111..3e7fb4cfe 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp @@ -47,7 +47,6 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(380.f, -30.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp b/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp index 2a4986416..979927f06 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp @@ -44,7 +44,6 @@ HRESULT CSpell_Slot_Preview::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); //m_pVIBufferCom->Set_Pos(0.f, 0.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_pVIBufferCom->Set_ImageUV(); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_State.cpp b/Jusin154_Team3D/Editor/Private/Spell_State.cpp new file mode 100644 index 000000000..44fdf495c --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_State.cpp @@ -0,0 +1,269 @@ +#include "pch.h" +#include "Spell_State.h" +#include "GameInstance.h" + +CSpell_State::CSpell_State(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_State::CSpell_State(const CSpell_State& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_State::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_State::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.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 = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + 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); + return S_OK; +} + +void CSpell_State::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_State::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; + Hover(); + __super::Update(fTimeDelta); +} + +void CSpell_State::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_State::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::ALPHABLEND)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_State::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_State::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_State::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_State::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_State::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_State::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_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpell_State::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_NewLock"), 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; +} + +CSpell_State* CSpell_State::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_State* pInstance = new CSpell_State(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_State"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_State::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_State* pInstance = new CSpell_State(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_State"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_State::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_State::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 98dc5525c..8b6329daf 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -16,7 +16,7 @@ namespace Editor enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT, MAP, UI, EFFECT, PHYSX, BLOOM, END }; enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END }; enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT }; - enum class MAPOBJECT_RENDER_TYPE {NORMAL, DECAL, GLASS}; + enum class MAPOBJECT_RENDER_TYPE { NORMAL, DECAL, GLASS }; enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE_WRITE, OUTLINE_READ, END }; enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END }; @@ -24,13 +24,13 @@ namespace Editor enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; - enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR ,END }; + enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, END }; - enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, SPELLTYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, END }; - enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, END }; + enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, END }; + enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; - enum class SKILL_TYPE{ JAP , BOMBARD , DECENDO , PROTEGO , END }; + enum class SKILL_TYPE { JAP, BOMBARD, DECENDO, PROTEGO, END }; } using namespace Editor; diff --git a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h index 1e20db80e..7aadab096 100644 --- a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h +++ b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h @@ -24,6 +24,9 @@ class CEessential_Spell_Slot final : public CElementObject 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/IMGUIUI.h b/Jusin154_Team3D/Editor/Public/IMGUIUI.h index 3b8461faf..77f8ef5fe 100644 --- a/Jusin154_Team3D/Editor/Public/IMGUIUI.h +++ b/Jusin154_Team3D/Editor/Public/IMGUIUI.h @@ -48,7 +48,7 @@ class CIMGUIUI final : public CGameObject _float m_fAlpha{}; _float2 m_UV{}; - _int m_iSkillType{}; + _int m_iSpellType{}; _vector m_vLerpPosition{}; _float m_fLerpX{}; diff --git a/Jusin154_Team3D/Editor/Public/Magic_Item.h b/Jusin154_Team3D/Editor/Public/Magic_Item.h index 83cf77f0c..18df03ef7 100644 --- a/Jusin154_Team3D/Editor/Public/Magic_Item.h +++ b/Jusin154_Team3D/Editor/Public/Magic_Item.h @@ -35,6 +35,7 @@ class CMagic_Item final : public CElementObject CTexture* m_pDiffuse_TextureCom3 = { nullptr }; CTexture* m_pDiffuse_TextureCom4 = { nullptr }; CTexture* m_pDiffuse_TextureCom5 = { nullptr }; + CTexture* m_pDiffuse_TextureCom6 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Header.h b/Jusin154_Team3D/Editor/Public/Spell_Header.h new file mode 100644 index 000000000..41fb41913 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Header.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Header final : public CElementObject +{ +private: + CSpell_Header(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Header(const CSpell_Header& rhs); + virtual ~CSpell_Header() = 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 void MoveY(_float fY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpell_Header* 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/Spell_Header_Line.h b/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h new file mode 100644 index 000000000..d8062f7ec --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Header_Line final : public CElementObject +{ +private: + CSpell_Header_Line(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Header_Line(const CSpell_Header_Line& rhs); + virtual ~CSpell_Header_Line() = 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 void MoveY(_float fY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpell_Header_Line* 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/Spell_Hover.h b/Jusin154_Team3D/Editor/Public/Spell_Hover.h new file mode 100644 index 000000000..496588411 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover.h @@ -0,0 +1,60 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_Hover final : public CElementObject +{ +private: + CSpell_Hover(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Hover(const CSpell_Hover& rhs); + virtual ~CSpell_Hover() = 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: + void Hover(); + +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 }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CTexture* m_pDiffuse_TextureCom4 = { nullptr }; + CTexture* m_pDiffuse_TextureCom5 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _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; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h new file mode 100644 index 000000000..433d74719 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h @@ -0,0 +1,56 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_Hover_Effect final : public CElementObject +{ +private: + CSpell_Hover_Effect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Hover_Effect(const CSpell_Hover_Effect& rhs); + virtual ~CSpell_Hover_Effect() = 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: + void Hover(); + +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 }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_Hover_Effect* 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/Spell_List.h b/Jusin154_Team3D/Editor/Public/Spell_List.h index fca734abf..e4a085e4b 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_List.h +++ b/Jusin154_Team3D/Editor/Public/Spell_List.h @@ -27,6 +27,9 @@ class CSpell_List final : public CElementObject virtual void SizeUpY(_float fSizeY) override; virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; +private: + void Color(); + void Hover(); private: virtual HRESULT Bind_ShaderResources() override; @@ -36,6 +39,7 @@ class CSpell_List final : public CElementObject private: CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Panel.h b/Jusin154_Team3D/Editor/Public/Spell_Panel.h index cdc792457..e10c33c99 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Panel.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Panel.h @@ -40,6 +40,10 @@ class CSpell_Panel final : public CPanelObject CGameObject* m_pEessential_Spell_Slot = { nullptr }; CGameObject* m_pEessential_Spell = { nullptr }; CGameObject* m_pSpell_List_Image = { nullptr }; + CGameObject* m_pSpell_State = { nullptr }; + CGameObject* m_pSpell_Hover = { nullptr }; + CGameObject* m_pSpell_Hover_Effect = { nullptr }; + CGameObject* m_pSpell_Preview = { nullptr }; public: static CSpell_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Public/Spell_Preview.h b/Jusin154_Team3D/Editor/Public/Spell_Preview.h new file mode 100644 index 000000000..6f3dcd134 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Preview.h @@ -0,0 +1,51 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSpell_Preview final : public CElementObject +{ +private: + CSpell_Preview(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Preview(const CSpell_Preview& rhs); + virtual ~CSpell_Preview() = 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; + +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 }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CGameObject* m_pSpell_Header = { nullptr }; + CGameObject* m_pSpell_Header_Line = { nullptr }; + + _float4 m_vHeaderBack{}; + +public: + static CSpell_Preview* 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/Spell_State.h b/Jusin154_Team3D/Editor/Public/Spell_State.h new file mode 100644 index 000000000..ae6d7a509 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_State.h @@ -0,0 +1,55 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_State final : public CElementObject +{ +private: + CSpell_State(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_State(const CSpell_State& rhs); + virtual ~CSpell_State() = 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: + void Hover(); + +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_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_State* 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/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index 8549335bc..c3824772e 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -441,12 +441,12 @@ _float CUIObject::Get_Angle() void CUIObject::Set_SkillType(_int eType) { - m_iSkillType = eType; + m_iSpellType = eType; } _int CUIObject::Get_SkillType() { - return m_iSkillType; + return m_iSpellType; } void CUIObject::Set_CoolTime(_float CoolTime) diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp index 3b9875a2d..357a5a182 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp @@ -114,6 +114,14 @@ HRESULT CVIBuffer_UI_Instance::Initialize_Prototype(const INSTANCE_DESC* pInstan m_fPosition = new _float2[m_iNumInstance]; ZeroMemory(m_fPosition, sizeof(_float2) * m_iNumInstance); + for (_uint i = 0; i < m_iNumInstance; ++i) + { + m_pInstanceVertices[i].fSize = _float2(1.f, 1.f); // 기본 크기 + m_pInstanceVertices[i].fPos = _float2(0.f, 0.f); // 기본 위치 + m_pInstanceVertices[i].fUV = _float4(0.f, 0.f, 1.f, 1.f); // 전체 텍스처 영역 + m_pInstanceVertices[i].vColor = _float4(1.f, 1.f, 1.f, 1.f); // 기본 흰색 + m_pInstanceVertices[i].bHover = 0; + } m_InstanceInitialDesc.pSysMem = m_pInstanceVertices; @@ -140,7 +148,6 @@ void CVIBuffer_UI_Instance::Set_Index_Position(_uint iIndex, _float fX, _float f pVertices[iIndex].fPos.x = fX; pVertices[iIndex].fPos.y = fY; - m_pContext->Unmap(m_pVBInstance, 0); } @@ -236,19 +243,67 @@ void CVIBuffer_UI_Instance::Set_ImageUV(UI_ATLAS_DESC* AtlasUV) for (size_t i = 0; i < m_iNumInstance; i++) { - if (AtlasUV == nullptr) - { - pVertices[i].fUV = _float4(0.f, 0.f,1.f,1.f); - } - else - { - pVertices[i].fUV = AtlasUV[i].fUV; - } + pVertices[i].fUV = AtlasUV[i].fUV; } m_pContext->Unmap(m_pVBInstance, 0); } +void CVIBuffer_UI_Instance::Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float4 vColor) +{ + 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 (size_t i = StartIndex; i <= EndIndex; i++) + { + pVertices[i].vColor = vColor; + } + + m_pContext->Unmap(m_pVBInstance, 0); +} + +_uint CVIBuffer_UI_Instance::Set_Mouse_Hover(_float2 fMousePos) +{ + 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); + + _uint hoveredIndex = (_uint)-1; + for (_uint i = 0; i < m_iNumInstance; i++) + { + _float2 pos = pVertices[i].fPos; + _float2 size = pVertices[i].fSize; + + RECT rcInstance{}; + rcInstance.left = LONG(pos.x - size.x * 0.5f); + rcInstance.right = LONG(pos.x + size.x * 0.5f); + rcInstance.top = LONG(pos.y - size.y * 0.5f); + rcInstance.bottom = LONG(pos.y + size.y * 0.5f); + + POINT pt{}; + pt.x = LONG(fMousePos.x); + pt.y = LONG(fMousePos.y); + + if (PtInRect(&rcInstance, pt)) + { + pVertices[i].bHover = 1.f; + hoveredIndex = i; // ✅ 인덱스 저장 + } + else + { + pVertices[i].bHover = 0.f; + } + } + + m_pContext->Unmap(m_pVBInstance, 0); + return hoveredIndex; +} + CVIBuffer_UI_Instance* CVIBuffer_UI_Instance::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const INSTANCE_DESC* pInstanceDesc) { CVIBuffer_UI_Instance* pInstance = new CVIBuffer_UI_Instance(pDevice, pContext); diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index cd68b4dfa..202669b56 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -200,7 +200,9 @@ typedef struct tagVertexInstance_UI { _float2 fSize = {}; _float2 fPos = {}; - _float4 fUV = {}; + _float4 fUV = _float4(0.f, 0.f, 1.f, 1.f); + _float4 vColor = _float4(1.f, 1.f, 1.f, 1.f); + _float bHover = 0; }VTX_INSTANCE_UI; typedef struct tagVertexBlock @@ -348,21 +350,23 @@ typedef struct tagVertexModelInstanceModelDesc typedef struct tagVertexInstance_UIDesc { - static constexpr unsigned int iNumElements = {5}; + static constexpr unsigned int iNumElements = { 7 }; static constexpr D3D11_INPUT_ELEMENT_DESC Elements[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}, { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT, 1, 0, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, { "TEXCOORD", 2, DXGI_FORMAT_R32G32_FLOAT, 1, 8, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, - { "TEXCOORD", 3, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 16, D3D11_INPUT_PER_INSTANCE_DATA, 1 } + { "TEXCOORD", 3, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 16, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 4, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 32, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 5, DXGI_FORMAT_R32_FLOAT, 1, 48, D3D11_INPUT_PER_INSTANCE_DATA, 1 } }; }VTX_POSTEX_INSTANCE_UI; typedef struct tagPhsXUserData { - PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED; + PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED; class CGameObject* pOwner = { nullptr }; _float4x4 BeforeMatrix = { }; @@ -396,7 +400,7 @@ typedef struct tagKeyFrameDesc typedef struct tagChannelDesc { - _uint StartIndex; + _uint StartIndex; _uint KeyCount; _uint BoneIndex; //_uint Padding; diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index cc24b14a3..1564d510c 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -7,7 +7,7 @@ NS_BEGIN(Engine) class ENGINE_DLL CUIObject abstract : public CGameObject { public: - enum class SKILLTYPE { + enum class SPELLTYPE { CONTROL, POWER, DAMAGE, UTILITY ,TRANSFORM, CURSE, ESSENTIAL }; @@ -151,12 +151,14 @@ typedef struct tagUIObjectDesc RECT m_pRect{}; - _int m_iSkillType{}; + _int m_iSpellType{}; _float m_fSortZ{}; _float m_fMoveSpeed{}; _float4 m_vNine_Slice{}; + _float m_fTopY{}; + protected: virtual HRESULT Initialize_Prototype(); virtual HRESULT Initialize(void* pArg); diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h index 4dcbf1511..2ad90c4aa 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h @@ -31,7 +31,9 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance void Set_SizeX(_float fSizeX); void Set_SizeY(_float fSizeY); void Set_Cloned(_bool isCloned) { m_isCloned = isCloned; } - void Set_ImageUV(UI_ATLAS_DESC* AtlasUV = nullptr); + void Set_ImageUV(UI_ATLAS_DESC* AtlasUV); + void Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float4 vColor); + _uint Set_Mouse_Hover(_float2 fMousePos); private: VTX_INSTANCE_UI* m_pInstanceVertices = { nullptr };