diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl new file mode 100644 index 000000000..1aee12e67 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -0,0 +1,1164 @@ +#include "Engine_Shader_Defines.hlsli" + +matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; +Texture2D g_DepthTexture; + +int g_iImageCountX; +int g_iImageCountY; + +uint g_iIndexU; +uint g_iIndexV; +uint g_iQuestType; +uint g_iSpellType; + +float g_fPI; +float g_fFar; +float g_fBlinkTime; +float g_fTime; +float g_fFrame; +float g_fDeltaU; +float g_fDeltaV; +float g_fAlpha; +float g_fOwnerAlpha; +float g_fCanvasAlpha; +float g_fAngle; +float g_fCoolTime; +float g_fHp; + +float2 g_fOrigin_Size; +float2 g_fCurrent_Size; +float2 g_fHpBG; +float2 g_Pos; +float2 g_fImageSize; + +float4 g_fNine_Slice; +float4 g_fImageUV; +float4 g_fImageUV1; + +uint g_iArrayCount; +float2 g_fItemPosition1; +float2 g_fItemImageSizes1; +float2 g_fItemPosition2; +float2 g_fItemImageSizes2; +float2 g_fPosition[4]; +float2 g_fImageSizes[4]; +float4 g_fImagesUV[4]; + +float4 g_fImageSipos1; +float4 g_fImageSipos2; +float4 g_fImageSipos3; + +Texture2D g_Texture; +Texture2D g_Texture1; +Texture2D g_Texture2; +Texture2D g_Texture3; +Texture2D g_Texture4; +Texture2D g_Texture5; +Texture2D g_DiffuseTexture; +Texture2D g_MaskingTexture; + + +struct VS_IN +{ + float3 vPosition : POSITION; + float2 vTexcoord : TEXCOORD0; +}; + +struct VS_OUT +{ + float4 vPosition : SV_Position; + float2 vTexcoord : TEXCOORD0; +}; + +VS_OUT VS_MAIN(VS_IN In) +{ + VS_OUT Out; + + + matrix matWV, matWVP; + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vTexcoord = In.vTexcoord; + + return Out; +} + +struct PS_IN +{ + float4 vPosition : SV_Position; + float2 vTexcoord : TEXCOORD0; +}; + +struct PS_OUT +{ + float4 vColor : SV_Target0; +}; + +PS_OUT PS_MAIN(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord); + + if (Color.a <= 0.1f) + discard; + + Color.a *= Alpha; + Out.vColor = Color; + return Out; +} + +PS_OUT PS_AlphaBlend(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord); + + Color.rgb *= 1.5f; + + Color.a *= Alpha; + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Clamp(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord); + + Color.a *= Alpha; + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Cursor(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = float4(0.f, 0.f, 0.f, 0.f); + float4 White = float4(1.f, 1.f, 1.f, 1.f); + + float2 UV = In.vTexcoord; + float2 Center = float2(0.5f, 0.5f); + + float CW = -g_fTime; + float CCW = g_fTime; + + float2 RedCircle = UV; + float2 RedUV = UV - Center; + + RedCircle.x = RedUV.x * cos(CCW) - RedUV.y * sin(CCW); + RedCircle.y = RedUV.x * sin(CCW) + RedUV.y * cos(CCW); + RedCircle = RedCircle + Center; + + float2 BlueCircle = UV; + float2 BlueUV = UV - Center; + + BlueCircle.x = BlueUV.x * cos(CW) - BlueUV.y * sin(CW); + BlueCircle.y = BlueUV.x * sin(CW) + BlueUV.y * cos(CW); + BlueCircle = BlueCircle + Center; + + + float4 Texture1 = g_Texture.Sample(ClampSampler, RedCircle); + float4 Texture2 = g_Texture2.Sample(ClampSampler, BlueCircle); + + if (Texture1.r >= 0.7f) + Color = Texture1; + + if (Texture2.b >= 0.7f) + Color = Texture2; + + if (all(Color.rgb <= 0.5f)) + discard; + + Color = White; + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Key_Hold_Rotation(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(DefaultSampler, In.vTexcoord); + Color = tex1; + + 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 tex2 = g_Texture1.Sample(ClampSampler, Imagelocal); + if (inside1) + { + float2 center = float2(0.5f, 0.5f); + float2 dir = Imagelocal - center; + + float angle = atan2(dir.x, -dir.y); + if (angle < 0) + angle += g_fPI; + + float rotation = saturate(g_fTime) * g_fPI; + + tex2.rgb = (angle <= rotation) ? 1.0 : tex2.rgb; + + + Color = lerp(Color, tex2, tex2.a); + } + + + + float2 Imagetexpos2 = g_fImageSipos2.xy / g_fCurrent_Size; + float2 Imagetexsize2 = g_fImageSipos2.zw / g_fCurrent_Size; + float2 Imagelocal2 = (In.vTexcoord - Imagetexpos2) / Imagetexsize2; + bool inside2 = all(Imagelocal2 >= 0.0f && Imagelocal2 <= 1.0f); + if (inside2) + { + float2 atlasUV = g_fImageUV.xy + Imagelocal2 * (g_fImageUV.zw - g_fImageUV.xy); + float2 safeUV = saturate(atlasUV); + float4 tex3 = g_Texture2.Sample(ClampSampler, safeUV); + Color = lerp(Color, tex3, tex3.a); + } + + float2 Imagetexpos3 = g_fImageSipos3.xy / g_fCurrent_Size; + float2 Imagetexsize3 = g_fImageSipos3.zw / g_fCurrent_Size; + float2 Imagelocal3 = (In.vTexcoord - Imagetexpos3) / Imagetexsize3; + bool inside3 = all(Imagelocal3 >= 0.0f && Imagelocal3 <= 1.0f); + if (inside3) + { + float3 QuestColor = float3(253.f, 207.f, 11.f) / 255.f; + + float4 tex4 = g_Texture3.Sample(ClampSampler, Imagelocal3); + + if (g_iQuestType == 0) + { + + tex4.rgb *= QuestColor; + + } + + Color = lerp(Color, tex4, tex4.a); + } + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Mission(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 Color = float4(0.f, 0.f, 0.f, 0.f); + + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + + tex1.a *= 0.5f; + + if (tex1.a >= 0.f) + Color = tex1; + + Color = lerp(Color, tex2, tex2.a); + + Color.a *= Alpha; + Out.vColor = Color; + return Out; +} + +PS_OUT PS_Sptire_Sheet(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 Color = float4(0.f, 0.f, 0.f, 0.f); + float2 UV = In.vTexcoord; + + int iTotalFrame = g_iImageCountX * g_iImageCountY; + + uint iCurrentFrame = uint(floor(g_fTime / g_fFrame)) % iTotalFrame; + + int iFrameX = iCurrentFrame % g_iImageCountX; + int iFrameY = iCurrentFrame / g_iImageCountX; + + float fFreamWidth = 1.0 / g_iImageCountX; + float fFreamHeight = 1.0 / g_iImageCountY; + + UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; + UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; + + float4 Texture = g_Texture.Sample(DefaultSampler, UV); + + Color = Texture; + + if (Color.r <= 0.4f) + discard; + + + Color.a *= Alpha; + + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_QuestType(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float3 Color = float3(253.f, 207.f, 11.f) / 255.f; + float4 Texture1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + + if (g_iQuestType == 0) + { + if (Texture1.r >= 0.3f) + { + Texture1.rgb = Color; + } + } + + Texture1.a *= Alpha; + Out.vColor = Texture1; + + return Out; +} + +PS_OUT PS_UVMult(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 color = g_Texture.Sample(DefaultSampler, In.vTexcoord); + + + color.a *= Alpha; + Out.vColor = color; + + return Out; +} + +PS_OUT PS_NineSlice(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(ClampSampler, Finaluv); + float4 tex2 = g_Texture1.Sample(ClampSampler, Finaluv); + + tex1.a *= 0.5f; + + if (tex1.a >= 0.f) + Color = tex1; + + Color = lerp(Color, tex2, tex2.a); + + Color.a *= Alpha; + Out.vColor = Color; + return Out; +} + +PS_OUT PS_Rotation(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 color = float4(0.f, 0.f, 0.f, 0.f); + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + + tex1.rgb *= 0.4f; + color = tex1; + tex2.rgb *= 0.3f; + + if (tex2.a >= 0.9f) + color = tex2; + + color.a *= Alpha; + + Out.vColor = color; + return Out; + +} + +PS_OUT PS_Slot(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float4 color = g_Texture.Sample(ClampSampler, Rotation); + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_SpellAnim(PS_IN In) +{ + PS_OUT Out; + + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 color = float4(0.f, 0.f, 0.f, 0.f); + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float2 startUV = g_fImageUV.xy; + float2 endUV = g_fImageUV.zw; + + float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture2.Sample(DefaultSampler, atlasUV); + + tex1.rgb *= 0.4f; + color = tex1; + tex2.rgb *= 0.3f; + + if (tex2.a >= 0.9f) + color = tex2; + float3 BGColor = float3(1.f, 1.f, 1.f); + + switch (g_iSpellType) + { + case 0: + BGColor = float3(208.f, 179.f, 54.f) / 255.f; + break; + case 1: + BGColor = float3(89.f, 32.f, 215.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; + break; + case 4: + BGColor = float3(134.f, 171.f, 78.f) / 255.f; + break; + case 5: + BGColor = float3(0.f, 80.f, 55.f) / 255.f; + break; + case 6: + BGColor = float3(0.f, 0.f, 0.f); + break; + } + float4 color1 = float4(1.f, 1.f, 1.f, 1.f); + + float2 OverrayUV = In.vTexcoord; + float CoolTime = 1.f - g_fDeltaV; + float CoolTime2 = 1.f - g_fDeltaV + 0.1f; + atlasUV = startUV + In.vTexcoord * (endUV - startUV); + float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); + tex3.rgb *= BGColor; + float4 tex4 = g_Texture2.Sample(DefaultSampler, atlasUV); + + if (tex4.a >= 0.9f) + tex3 = tex4; + + 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 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 tex5 = g_Texture3.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) * tex5 * g_fDeltaU; + } + } + + float waveThreshold = CoolTime + wave1; + + if (OverrayUV.y <= waveThreshold) + { + color1.a = 0.f; + } + + color = lerp(color, color1, color1.a); + + color.a *= Alpha; + + Out.vColor = color; + return Out; +} + +PS_OUT PS_HpBar(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 Color1 = 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(ClampSampler, Finaluv); + tex1.rgb = float3(255.f, 0.f, 0.f) / 255.f; + if (g_fHp <= 0.3f) + { + tex1.a *= (sin(g_fBlinkTime) * 0.25f + 0.75f) * 1.5f; + } + else + { + tex1.a = 0.f; + } + Color = tex1; + + float2 BGPos = g_Pos; + float2 BGSize = g_fImageSize; + float2 BGPixel = Finaluv * g_fOrigin_Size; + float2 localUV = (BGPixel - BGPos) / BGSize; + bool inside = all(localUV >= 0.0f && localUV <= 1.0f); + + float4 tex2 = g_Texture1.Sample(ClampSampler, localUV); + + if (inside) + Color = lerp(Color, tex2, tex2.a); + + float2 reversuv = In.vTexcoord; + + reversuv.x = 1.0f - localUV.x; + + float4 tex3 = g_Texture2.Sample(ClampSampler, localUV); + + if (reversuv.x >= g_fHp) + { + tex3.rgb = float3(0.f, 0.f, 0.f); + } + + float3 Green = (float3(112.f, 241.f, 31.f) / 255.f) * 1.2f; + float3 Red = (float3(255.f, 0.f, 0.f) / 255.f) * 1.2f; + + tex3.rgb *= lerp(Green, Red, g_fTime); + + if (all(Color.rgb >= float3(55.f / 255.f, 0.f / 255.f, 55.f / 255.f))) + Color = lerp(Color, tex3, tex3.a); + + Color.a *= Alpha; + Out.vColor = Color; + return Out; +} + +PS_OUT PS_Magic_Meter(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); + float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord); + + float2 reverseuv = 1.f - In.vTexcoord; + + color = tex1; + tex2.rgb *= Blue * 1.5f; + + if (reverseuv.x >= g_fHp) + { + tex2.rgb = float3(0.f, 0.f, 0.f); + } + + if (all(color.rgb >= float3(65.f / 255.f, 65.f / 255.f, 65.f / 255.f))) + color = tex2; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + + +PS_OUT PS_Magic_Icon(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 center = float2(0.5f, 0.5f); + float2 BGuv = In.vTexcoord - center; + BGuv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = BGuv.x * cos(g_fAngle) - BGuv.y * sin(g_fAngle); + Rotation.y = BGuv.x * sin(g_fAngle) + BGuv.y * cos(g_fAngle); + Rotation += center; + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture1.Sample(ClampSampler, Rotation); + + Color = tex1; + Color = lerp(tex1, tex2, tex2.a); + + float2 uv = In.vTexcoord; + float scale = 1.2; + + uv = (uv - center) * scale + center; + float4 tex3 = g_Texture2.Sample(ClampSampler, uv); + + + Color = Color * (1 - tex3.a) + tex3; + + Color.a *= Alpha; + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_RemapUV(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 startUV = g_fImageUV.xy; + float2 endUV = g_fImageUV.zw; + + float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); + + float4 tex1 = g_Texture.Sample(DefaultSampler, atlasUV); + + Color = tex1; + + Color.a *= Alpha; + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Revelio(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 Position[4]; + //float2 startUV[4]; + //float2 endUV[4]; + + //float2 Atlases[4]; + + //for (int i = 0; i < 4; ++i) + //{ + // Position[i] = g_fPosition[i]; + // startUV[i] = g_fImagesUV[i].xy; + // endUV[i] = g_fImagesUV[i].zw; + + // Atlases[i] = startUV[i] + UV * (endUV[i] - startUV[i]); + //} + + //float4 tex1 = g_Texture.Sample(DefaultSampler, UV); + //float4 tex2 = g_Texture1.Sample(DefaultSampler, Atlases[0]); + //float4 tex3 = g_Texture1.Sample(DefaultSampler, Atlases[1]); + //float4 tex4 = g_Texture2.Sample(DefaultSampler, Atlases[2]); + //float4 tex5 = g_Texture2.Sample(DefaultSampler, Atlases[3]); + + + + ////float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); + + Color.a *= Alpha; + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Potion(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 Color = float4(214.f / 255.f, 225 / 255.f, 36 / 255.f, 1.f); + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + Color = tex1; + + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + //Color += tex2; + float4 tex3 = g_Texture2.Sample(ClampSampler, Rotation); + Color = lerp(Color, tex3, tex3.a); + + float2 Potionuv = In.vTexcoord; + float scale = 1.2; + + Potionuv = (Potionuv - center) * scale + center; + float4 tex4 = g_Texture3.Sample(ClampSampler, Potionuv); + Color = lerp(Color, tex4, tex4.a); + + float2 tex5pos = g_Pos / g_fCurrent_Size; + float2 tex5size = g_fOrigin_Size / g_fCurrent_Size; + float2 tex5local = (In.vTexcoord - tex5pos) / tex5size; + bool inside = all(tex5local >= 0.0f && tex5local <= 1.0f); + float4 tex5 = g_Texture4.Sample(ClampSampler, tex5local); + if (inside) + Color = lerp(Color, tex5, tex5.a); + + Color.a *= Alpha; + Out.vColor = Color; + + return Out; +} + +PS_OUT PS_Magic_Item(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 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + float2 Rotation = In.vTexcoord; + Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle); + Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle); + Rotation += center; + + float2 startUV = g_fImageUV.xy; + float2 endUV = g_fImageUV.zw; + + float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV); + + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex2 = g_Texture3.Sample(ClampSampler, atlasUV); + + tex1.rgb *= 0.4f; + color = tex1; + tex2.rgb *= 0.3f; + + if (tex2.a >= 0.9f) + color = tex2; + float3 BGColor = float3(1.f, 1.f, 1.f); + + switch (g_iSpellType) + { + case 0: + BGColor = float3(50.f, 50.f, 50.f) / 255.f; + break; + case 1: + BGColor = float3(89.f, 32.f, 215.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; + break; + case 4: + BGColor = float3(134.f, 171.f, 78.f) / 255.f; + break; + } + + float4 color1 = float4(1.f, 1.f, 1.f, 1.f); + + float2 OverrayUV = In.vTexcoord; + float CoolTime = 0.f + g_fDeltaV; + float CoolTime2 = 0.f + g_fDeltaV + 0.05; + atlasUV = startUV + In.vTexcoord * (endUV - startUV); + float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); + tex3.rgb *= BGColor; + float4 tex4 = g_Texture3.Sample(DefaultSampler, atlasUV); + + if (g_fDeltaV <= 1.f) + { + if (tex4.a >= 0.9f) + tex3 = tex4; + + color1 = tex3; + + float wave1 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; + float wave2 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; + + float waveThreshold1 = CoolTime + wave1; + float waveThreshold2 = CoolTime2 + wave2; + + if (g_fDeltaV <= 1.f) + { + if (OverrayUV.y >= waveThreshold1 && OverrayUV.y <= waveThreshold2) + { + color1.rgb = float3(1.f, 1.f, 1.f); + } + } + + if (OverrayUV.y <= CoolTime) + { + color1.a = 0.f; + } + + color = lerp(color, color1, color1.a); + } + else if (g_fDeltaV >= 1.f) + color = lerp(color, tex4, tex4.a); + + float4 tex5 = g_Texture2.Sample(ClampSampler, Rotation); + color = lerp(color, tex5, tex5.a); + + float2 texpos1 = g_fItemPosition1 / g_fCurrent_Size; + float2 texpos2 = g_fItemPosition2 / g_fCurrent_Size; + float2 texsize1 = g_fItemImageSizes1 / g_fCurrent_Size; + float2 texsize2 = g_fItemImageSizes2 / g_fCurrent_Size; + float2 texlocal1 = (In.vTexcoord - texpos1) / texsize1; + float2 texlocal2 = (In.vTexcoord - texpos2) / texsize2; + + + bool inside1 = all(texlocal1 >= 0.0f && texlocal1 <= 1.0f); + float4 tex6 = g_Texture4.Sample(DefaultSampler, texlocal1); + + if (inside1) + color = lerp(color, tex6, tex6.a); + + bool inside2 = all(texlocal2 >= 0.0f && texlocal2 <= 1.0f); + + float4 tex7 = g_Texture5.Sample(DefaultSampler, texlocal2); + if (inside2) + color = lerp(color, tex7, tex7.a); + + color.a *= Alpha; + + Out.vColor = color; + return Out; +} + +technique11 PosTexTechnique11 +{ + pass Default + { + 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_MAIN(); + } + + pass AlphaBlend + { + 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_AlphaBlend(); + } + + pass TextureClamp + { + 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_Clamp(); + } + + pass Mouse_Cursor + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, 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_Cursor(); + } + + pass Sptire_Sheet + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_UIBlend, 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_Sptire_Sheet(); + } + + pass Key_Hold_Rotation + { + 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_Key_Hold_Rotation(); + } + + pass Mission + { + 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_Mission(); + } + + pass QuestType + { + 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_QuestType(); + } + + pass UVMult + { + 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_UVMult(); + } + + pass NineSlice + { + 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_NineSlice(); + } + + pass Rotation + { + 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_Rotation(); + } + + pass Slot + { + 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_Slot(); + } + + pass SpellAnim + { + 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_SpellAnim(); + } + pass HpBar + { + 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_HpBar(); + } + pass Magic_Meter + { + 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_Magic_Meter(); + } + + pass Magic_Icon + { + 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_Magic_Icon(); + } + + pass RemapUV + { + 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_RemapUV(); + } + + pass Revelio + { + 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_Revelio(); + } + + pass Potion + { + 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_Potion(); + } + + pass Magic_Item + { + 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_Magic_Item(); + } + +} diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 51b07cd9b..e1de4a5ba 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -159,6 +159,12 @@ call Update_Shaders.bat + + + + + + @@ -182,13 +188,21 @@ call Update_Shaders.bat + + + + + + + + @@ -210,6 +224,10 @@ call Update_Shaders.bat + + + + @@ -226,6 +244,12 @@ call Update_Shaders.bat + + + + + + @@ -242,14 +266,22 @@ call Update_Shaders.bat + + + + + + + + @@ -279,6 +311,10 @@ call Update_Shaders.bat + + + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index 7f4b487b4..ce93017e5 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -184,6 +184,33 @@ 02.GameObjects\Environment\Terrain + + 02.GameObjects\UI + + + 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget + + + 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel + + + 02.GameObjects\UI\GamePlay_Canvas\MiniMap_Panel + + + 02.GameObjects\UI\GamePlay_Canvas\Mission_Panel + + + 02.GameObjects\UI\GamePlay_Canvas\MiniMap_Panel\MiniMap_TrimBorder + + + 02.GameObjects\UI\GamePlay_Canvas\MiniMap_Panel\NoMountIcon + + + 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget_Flame + 02.GameObjects\Effect\EffectPool @@ -196,6 +223,33 @@ 02.GameObjects\Effect\Effects\Protego + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\HPBarBG + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Magic_Icon + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Magic_Item + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Magic_Meter + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Spell_Slot + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Spell_Overlay + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Spell_UI + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Slot_Number + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Potion + @@ -461,6 +515,39 @@ {37b6e4b9-42fb-4fda-9112-e62ab434bee0} + + {59283aaa-2cb7-40da-97a7-2705ed78c830} + + + {e5e2a92a-d549-4573-b8e7-d48e7a409888} + + + {5a49d7f9-f675-43f0-be32-f32c3e6523b9} + + + {ba2aee38-d721-4b54-bb39-5b9bb5ec3e9f} + + + {b284d03c-90f5-4e1f-860c-f7b07b13309f} + + + {dbb67727-3b9d-40d3-92d8-8faf19dee261} + + + {d92bccc9-1515-4701-9e57-d9162d8d5ed4} + + + {f3862ab8-1127-4efd-8739-0728b5aca058} + + + {cca29e49-aaa7-4575-b29a-04aecf66e91c} + + + {2ddf4d5c-bb90-4e5f-8c3a-98d07da215df} + + + {9914341c-f246-4fdb-b28c-de7a6d2d149b} + @@ -634,6 +721,33 @@ 02.GameObjects\Environment\Terrain + + 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel + + + 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget + + + 02.GameObjects\UI + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel + + + 02.GameObjects\UI\GamePlay_Canvas\MiniMap_Panel + + + 02.GameObjects\UI\GamePlay_Canvas\Mission_Panel + + + 02.GameObjects\UI\GamePlay_Canvas\MiniMap_Panel\MiniMap_TrimBorder + + + 02.GameObjects\UI\GamePlay_Canvas\MiniMap_Panel\NoMountIcon + + + 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget_Flame + 02.GameObjects\Effect\EffectPool @@ -646,6 +760,33 @@ 02.GameObjects\Effect\Effects\Protego + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\HPBarBG + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Magic_Icon + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Magic_Item + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Magic_Meter + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Spell_Slot + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Spell_Overlay + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Spell_UI + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Slot_Number + + + 02.GameObjects\UI\GamePlay_Canvas\Action_Panel\Potion + diff --git a/Jusin154_Team3D/Client/Private/Action_Panel.cpp b/Jusin154_Team3D/Client/Private/Action_Panel.cpp new file mode 100644 index 000000000..397ed394d --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Action_Panel.cpp @@ -0,0 +1,295 @@ +#include "pch.h" +#include "Action_Panel.h" +#include "GameInstance.h" +#include "Spell_Slot.h" +#include "Spell_Overlay.h" +#include "Slot_Number.h" +#include "HpBarBG.h" +#include "Magic_Meter.h" +#include "Magic_Icon.h" +#include "Spell_UI.h" +#include "Potion.h" +#include "Magic_Item.h" + +CAction_Panel::CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPanelObject(pDevice, pContext) +{ +} + +CAction_Panel::CAction_Panel(const CAction_Panel& rhs) + :CPanelObject(rhs) +{ +} + +HRESULT CAction_Panel::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CAction_Panel::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 1150.f; + Desc.fY = 850.f; + Desc.fSizeX = 1650.f; + Desc.fSizeY = 450.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; + } + if (FAILED(Ready_Element(pArg))) + { + return E_FAIL; + } + + + Magic_Meter_UV(); + Magic_Meter_Visible(1, true); + Magic_Meter_Visible(5, true); + m_bActive = true; + return S_OK; +} + +void CAction_Panel::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CAction_Panel::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + Matic_Meter_Move(); + + __super::Update(fTimeDelta); +} + +void CAction_Panel::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bVisible) { + + } + __super::Late_Update(fTimeDelta); + +} + +HRESULT CAction_Panel::Render() +{ + return S_OK; +} + +_vector CAction_Panel::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CAction_Panel::Magic_Meter_Visible(_uint iIndex, _bool bVisible) +{ + switch (iIndex) + { + case 1: + static_cast(m_pMagic_Meter1)->Visible(bVisible); + break; + case 2: + static_cast(m_pMagic_Meter2)->Visible(bVisible); + break; + case 3: + static_cast(m_pMagic_Meter3)->Visible(bVisible); + break; + case 4: + static_cast(m_pMagic_Meter4)->Visible(bVisible); + break; + case 5: + static_cast(m_pMagic_Meter5)->Visible(bVisible); + break; + + default: + return; + } + if (bVisible) + m_iMagic_Meter_Count++; + else + m_iMagic_Meter_Count--; +} + +void CAction_Panel::Magic_Meter_UV() +{ + static_cast(m_pMagic_Meter1)->Meter_Index(2); + static_cast(m_pMagic_Meter2)->Meter_Index(1); + static_cast(m_pMagic_Meter3)->Meter_Index(1); + static_cast(m_pMagic_Meter4)->Meter_Index(1); + static_cast(m_pMagic_Meter5)->Meter_Index(0); + + for (_uint i = 0; i < 5; ++i) + { + m_vMagic_MeterUV[i].x = 570.f - (55.f * i); + m_vMagic_MeterUV[i].y = 145.f; + } +} + +void CAction_Panel::Matic_Meter_Move() +{ + static_cast(m_pMagic_Meter1)->Move(m_vMagic_MeterUV[0].x, m_vMagic_MeterUV[0].y); + static_cast(m_pMagic_Meter5)->Move(m_vMagic_MeterUV[1].x, m_vMagic_MeterUV[1].y); + + if (static_cast(m_pMagic_Meter2)->Get_Active() == true) + { + static_cast(m_pMagic_Meter2)->Move(m_vMagic_MeterUV[1].x, m_vMagic_MeterUV[1].y); + static_cast(m_pMagic_Meter5)->Move(m_vMagic_MeterUV[2].x, m_vMagic_MeterUV[2].y); + } + if (static_cast(m_pMagic_Meter3)->Get_Active() == true) + { + static_cast(m_pMagic_Meter2)->Move(m_vMagic_MeterUV[1].x, m_vMagic_MeterUV[1].y); + static_cast(m_pMagic_Meter3)->Move(m_vMagic_MeterUV[2].x, m_vMagic_MeterUV[2].y); + static_cast(m_pMagic_Meter5)->Move(m_vMagic_MeterUV[3].x, m_vMagic_MeterUV[3].y); + } + if (static_cast(m_pMagic_Meter4)->Get_Active() == true) + { + static_cast(m_pMagic_Meter2)->Move(m_vMagic_MeterUV[1].x, m_vMagic_MeterUV[1].y); + static_cast(m_pMagic_Meter3)->Move(m_vMagic_MeterUV[2].x, m_vMagic_MeterUV[2].y); + static_cast(m_pMagic_Meter4)->Move(m_vMagic_MeterUV[3].x, m_vMagic_MeterUV[3].y); + static_cast(m_pMagic_Meter5)->Move(m_vMagic_MeterUV[4].x, m_vMagic_MeterUV[4].y); + } + +} + +HRESULT CAction_Panel::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CAction_Panel::Ready_Components(void* pArg) +{ + return S_OK; +} + +HRESULT CAction_Panel::Ready_Element(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast (&m_pSpell_Slot)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Slot"), m_pSpell_Slot); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Overlay"), m_pSpell_Overlay); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSlot_Number)))) + { + return E_FAIL; + } + Add_Element(TEXT("Slot_Number"), m_pSlot_Number); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pHpBarBG)))) + { + return E_FAIL; + } + Add_Element(TEXT("HpBarBG"), m_pHpBarBG); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMagic_Meter1)))) + { + return E_FAIL; + } + Add_Element(TEXT("Magic_Meter1"), m_pMagic_Meter1); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMagic_Meter2)))) + { + return E_FAIL; + } + Add_Element(TEXT("Magic_Meter2"), m_pMagic_Meter2); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMagic_Meter3)))) + { + return E_FAIL; + } + Add_Element(TEXT("Magic_Meter3"), m_pMagic_Meter3); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMagic_Meter4)))) + { + return E_FAIL; + } + Add_Element(TEXT("Magic_Meter4"), m_pMagic_Meter4); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMagic_Meter5)))) + { + return E_FAIL; + } + Add_Element(TEXT("Magic_Meter5"), m_pMagic_Meter5); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMagic_Icon)))) + { + return E_FAIL; + } + Add_Element(TEXT("Magic_Icon"), m_pMagic_Icon); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_UI)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_UI"), m_pSpell_UI); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pPotion)))) + { + return E_FAIL; + } + Add_Element(TEXT("Potion"), m_pPotion); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMagic_Item)))) + { + return E_FAIL; + } + Add_Element(TEXT("Magic_Item"), m_pMagic_Item); + return S_OK; +} + +CAction_Panel* CAction_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CAction_Panel* pInstance = new CAction_Panel(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CAction_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CAction_Panel::Clone(void* pArg, CGameObject* pOwner) +{ + CAction_Panel* pInstance = new CAction_Panel(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CAction_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CAction_Panel::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CAction_Panel::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/GamePlay_Canvas.cpp b/Jusin154_Team3D/Client/Private/GamePlay_Canvas.cpp index 32fafc0cd..2ba2436c6 100644 --- a/Jusin154_Team3D/Client/Private/GamePlay_Canvas.cpp +++ b/Jusin154_Team3D/Client/Private/GamePlay_Canvas.cpp @@ -1,10 +1,10 @@ #include "pch.h" #include "GamePlay_Canvas.h" #include "GameInstance.h" -//#include "Mission_Panel.h" -//#include "MiniMap_Panel.h" +#include "Mission_Panel.h" +#include "MiniMap_Panel.h" #include "Loading_Panel.h" -//#include "Action_Panel.h" +#include "Action_Panel.h" //#include "Mouse_Cursor.h" CGamePlay_Canvas::CGamePlay_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -95,23 +95,23 @@ HRESULT CGamePlay_Canvas::Ready_Panel(void* pArg) } Add_Panel(TEXT("LoadingPanel"), m_pLoading_Panel); - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMinimap_Panel)))) - //{ - // return E_FAIL; - //} - //Add_Panel(TEXT("MinimapPanel"), m_pMinimap_Panel); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMinimap_Panel)))) + { + return E_FAIL; + } + Add_Panel(TEXT("MinimapPanel"), m_pMinimap_Panel); - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMission_Panel)))) - //{ - // return E_FAIL; - //} - //Add_Panel(TEXT("MissionPanel"), m_pMission_Panel); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMission_Panel)))) + { + return E_FAIL; + } + Add_Panel(TEXT("MissionPanel"), m_pMission_Panel); - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pAction_Panel)))) - //{ - // return E_FAIL; - //} - //Add_Panel(TEXT("ActionPanel"), m_pAction_Panel); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pAction_Panel)))) + { + return E_FAIL; + } + Add_Panel(TEXT("ActionPanel"), m_pAction_Panel); return S_OK; @@ -151,10 +151,11 @@ void CGamePlay_Canvas::Free() { __super::Free(); - SAFE_RELEASE(m_pLoading_Panel); SAFE_RELEASE(m_pVIBufferCom); } +#ifdef _DEBUG void CGamePlay_Canvas::Describe_Entity() { } +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 767cfcb84..4ea2c9add 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -51,7 +51,9 @@ HRESULT CGoblin::Initialize(void* pArg) m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); - m_pCharacter_Controller->Set_Position(XMVectorSet(-10.f, 0.f, -10.f, 1.f)); + + + m_pCharacter_Controller->Set_Position(XMVectorSet(m_pGameInstance->Random_Float(-20.f, 20.f), 0.f, m_pGameInstance->Random_Float(-20.f, 20.f), 1.f)); return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/HpBarBG.cpp b/Jusin154_Team3D/Client/Private/HpBarBG.cpp new file mode 100644 index 000000000..b0ba7def3 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/HpBarBG.cpp @@ -0,0 +1,335 @@ +#include "pch.h" +#include "HpBarBG.h" +#include "GameInstance.h" + +CHpBarBG::CHpBarBG(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CHpBarBG::CHpBarBG(const CHpBarBG& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CHpBarBG::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CHpBarBG::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 600.f; + Desc.fY = 180.f; + Desc.fSizeX = 144.f; + Desc.fSizeY = 50.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 = 5.f; + m_fAlpha = 1.f; + m_fAlphaTime = 1.f; + m_vNine_Slice = _float4(27.f, 125.f, m_fSizeY * 0.5f, m_fSizeY * 0.5f); + m_fMaxHp = 1000.f; + m_fCurrentHp = m_fMaxHp; + m_fMoveSpeed = 5.f; + m_fHpBGSize = _float2(144.f, 24.f); + m_fHpBGPos = _float2(0.f, 13.f); + m_fHpBG = _float2(0, m_fSizeX); + SizeUpX(240.f); + m_bActive = true; + return S_OK; +} + +void CHpBarBG::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CHpBarBG::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; + } + } + + if (m_fCurrentHp < 0.f) + m_fCurrentHp = 0.f; + if (m_fDamage <= 0.f) + m_fDamage = 0.f; + m_fTargetHp = m_fMaxHp - m_fDamage; + + if (m_fTargetHp > m_fCurrentHp) + Heal(fTimeDelta); + else if (m_fTargetHp < m_fCurrentHp) + Hit(fTimeDelta); + m_fHpBar = m_fCurrentHp / m_fMaxHp; + + if (m_pGameInstance->Key_Down(DIK_3)) + { + Lerp_PosX(100.f); + } + + if (m_pGameInstance->Key_Down(DIK_4)) + { + Lerp_PosX(-101.f); + } + if (m_fHpBar <= 0.3f) + { + m_fBlinkTime += fTimeDelta * m_fTimeMult; + if (m_fTime <= 1.f) + { + m_fTime += fTimeDelta * m_fTimeMult; + } + } + else + { + m_fBlinkTime = 0.f; + m_fTime = 0.f; + } + __super::Update(fTimeDelta); +} + +void CHpBarBG::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CHpBarBG::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::HPBAR)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CHpBarBG::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CHpBarBG::Lerp_PosX(_float X) +{ + m_fDamage += X; +} + +void CHpBarBG::Heal(_float fTimeDelta) +{ + m_fCurrentHp = CMyTools::Lerp_f1D(m_fTargetHp, m_fCurrentHp, fTimeDelta * m_fMoveSpeed); +} + +void CHpBarBG::Hit(_float fTimeDelta) +{ + m_fCurrentHp = CMyTools::Lerp_f1D(m_fCurrentHp, m_fTargetHp, fTimeDelta * m_fMoveSpeed); +} + +void CHpBarBG::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_fX -= (fSizeX - m_vScale.x) * 0.5f; +} + +HRESULT CHpBarBG::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_fBlinkTime", &m_fBlinkTime, 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_fHp", &m_fHpBar, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fHpBG", &m_fHpBG, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageSize", &m_fHpBGSize, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_Pos", &m_fHpBGPos, sizeof(_float2)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CHpBarBG::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_GlowBar"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_HpBarBG"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_HUD_HealthMeterFill"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + return S_OK; +} + +CHpBarBG* CHpBarBG::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CHpBarBG* pInstance = new CHpBarBG(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CHpBarBG"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CHpBarBG::Clone(void* pArg, CGameObject* pOwner) +{ + CHpBarBG* pInstance = new CHpBarBG(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Image"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CHpBarBG::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); +} + +#ifdef _DEBUG +void CHpBarBG::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index e43230fad..a7c439793 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -132,9 +132,9 @@ HRESULT CLevel_GamePlay::Ready_Background() HRESULT CLevel_GamePlay::Ready_Layer_UI(const _wstring& strLayerTag) { - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_UI))) { - // return E_FAIL; - //} + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_UI))) { + return E_FAIL; + } return S_OK; } @@ -213,10 +213,13 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) HRESULT CLevel_GamePlay::Ready_Layer_Monster() { - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))){ - return E_FAIL; - } + /*for (_uint i = 0; i < 2; ++i) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER,&i))) { + return E_FAIL; + } + }*/ + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 765f2afc7..c2568ca7a 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -6,10 +6,6 @@ #include "Camera_Debug.h" #include "Client_Struct.h" #include "Model.h" -//#include "GamePlay_Canvas.h" -//#include "Loading_Panel.h" -//#include "LoadingWidget.h" - #include "Player.h" #include "Camera_Gaze.h" #include "CamPosition_Socket.h" @@ -21,6 +17,32 @@ #include "Broom.h" #include "Goblin.h" +#pragma region UI + +#include "GamePlay_Canvas.h" +#include "Loading_Panel.h" +#include "LoadingWidget.h" +#include "LoadingWidget_Flame.h" + +#include "Action_Panel.h" +#include "Spell_Slot.h" +#include "Spell_Overlay.h" +#include "Slot_Number.h" +#include "HpBarBG.h" +#include "Potion.h" +#include "Magic_Meter.h" +#include "Magic_Icon.h" +#include "Spell_UI.h" +#include "Magic_Item.h" + +#include "MiniMap_Panel.h" +#include "MiniMap_TrimBorder.h" +#include "NoMountIcon.h" + +#include "Mission_Panel.h" + +#pragma endregion + #pragma region PHYSX #include "Dummy_PhysXWall.h" @@ -161,11 +183,196 @@ HRESULT CLoader::Loading_For_GamePlay() { m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("LoadingWidget"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Loading/LoadingWidget.png"), 0)))) { +#pragma region UI + + Asset_FileLoad("../Bin/Resources/Textures/Keyboard", 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; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Action", 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; + } + + return S_OK; + + }); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Cursor"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) { return E_FAIL; } + Asset_FileLoad("../Bin/Resources/Textures/Mission", 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; + } + + return S_OK; + + }); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Mission_Icon"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Mission/Mission_Icon_%d.png"), 2)))) { + return E_FAIL; + } + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("ActiveMission_Icon"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Mission/ActiveMission_Icon_%d.png"), 2)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Megic_Metar"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Action/Megic_Meter%d.png"), 3)))) { + return E_FAIL; + } + + + Asset_FileLoad("../Bin/Resources/Textures/MiniMap", 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; + } + + 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; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Loading", 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; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Spells", 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; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Spells/SpellMeters", 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; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Potions", 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; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/GadgetWheel", 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; + } + + return S_OK; + + }); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Item"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/GadgetWheel/Item%d.png"), 8)))) { + return E_FAIL; + } + +#pragma endregion + #pragma region TERRAIN_TEXTURE /* Terrain_Diffuse */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Diffuse"), @@ -277,6 +484,24 @@ HRESULT CLoader::Loading_For_GamePlay() m_strMessage = TEXT("모델를(을) 로딩 중 입니다."); + CVIBuffer_UI_Instance::UI_INSTANCE_DESC SpellSlotUIDesc{}; + + SpellSlotUIDesc.iNum = 4; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Instance"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &SpellSlotUIDesc)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC SlotNumberUIDesc{}; + + SlotNumberUIDesc.iNum = 4; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Slot_Number_UI_Instance"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &SlotNumberUIDesc)))) { + return E_FAIL; + } + m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIEDITOR, @@ -285,6 +510,12 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIINSTANCE, + CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl"), + VTX_POSTEX_INSTANCE_UI::Elements, VTX_POSTEX_INSTANCE_UI::iNumElements)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_MODEL, CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl"), VTX_MODEL_INSTANCE_PARTICLE::Elements, VTX_MODEL_INSTANCE_PARTICLE::iNumElements)))) { @@ -747,16 +978,92 @@ HRESULT CLoader::Loading_For_GamePlay() m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다."); - //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGamePlay_Canvas::Create(m_pDevice, m_pContext)))) { - // return E_FAIL; - //} - //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLoading_Panel::Create(m_pDevice, m_pContext)))) { - // return E_FAIL; - //} - //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLoadingWidget::Create(m_pDevice, m_pContext)))) { - // return E_FAIL; - //} - + /* For.Prototype_GameObject_GamePlay_Canvas*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGamePlay_Canvas::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + /* For.Prototype_GameObject_Action_Panel*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CAction_Panel::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + /* For.Prototype_GameObject_Spell_Slot*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Slot::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_Spell_Overlay*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Overlay::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_Slot_Number*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSlot_Number::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_HpBarBG*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CHpBarBG::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_Potion*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CPotion::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_Magic_Meter*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMagic_Meter::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_Magic_Icon*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMagic_Icon::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_Spell_UI*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_UI::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_Magic_Item*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMagic_Item::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + + /* For.Prototype_GameObject_Loading_Panel*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLoading_Panel::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + /* For.Prototype_GameObject_LoadingWidget*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLoadingWidget::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + /* For.Prototype_GameObject_LoadingWidget_Flame*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLoadingWidget_Flame::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + /* For.Prototype_GameObject_Mission_Panel*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMission_Panel::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + /* For.Prototype_GameObject_Minimap_Panel*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMiniMap_Panel::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + /* For.Prototype_GameObject_MiniMap_TrimBorder*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMiniMap_TrimBorder::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + /* For.Prototype_GameObject_NoMountIcon*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CNoMountIcon::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + /* For.Prototype_GameObject_SkyBox */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSkyBox::Create(m_pDevice, m_pContext)))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/LoadingWidget.cpp b/Jusin154_Team3D/Client/Private/LoadingWidget.cpp index f1edb4509..7f16a0561 100644 --- a/Jusin154_Team3D/Client/Private/LoadingWidget.cpp +++ b/Jusin154_Team3D/Client/Private/LoadingWidget.cpp @@ -36,18 +36,18 @@ HRESULT CLoadingWidget::Initialize(void* pArg) { return E_FAIL; } - - m_iImageFrameX = 6; - m_iImageFrameY = 6; - m_fFrame = 0.2f; - m_fTimeMult = 3.f; - m_fDelayTime = 1.f; - m_fEndTime = 1.8f; + // UI의 알파값을 조절 m_fAlpha = 1.f; m_fAlphaTime = 3.f; - m_fMoveSpeed = 10.f; - m_bVisible = true; - m_bActive = true; + + // 스프라이트 애니메이션의 정보 + m_fTimeMult = 3.f; // 속도 + m_fDelayTime = 1.f; // 딜레이 + m_fFrame = 0.2f; // 프레임 + m_iImageFrameX = 6; // 이미지의 x 갯수 + m_iImageFrameY = 6; // 이미지의 y 갯수 + + //m_bActive = true; return S_OK; } @@ -90,15 +90,7 @@ void CLoadingWidget::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - if (m_bLerpOn == true) - { - Start_Lerp(m_fMoveSpeed); - } - if (m_bLerpOff == true) - { - Reset_Pos(m_fMoveSpeed); - } m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } @@ -197,7 +189,7 @@ HRESULT CLoadingWidget::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::STATIC), TEXT("LoadingWidget"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_LoadingWidget"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } @@ -244,6 +236,8 @@ void CLoadingWidget::Free() SAFE_RELEASE(m_pVIBufferCom); } +#ifdef _DEBUG void CLoadingWidget::Describe_Entity() { } +#endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/Mission_KeyHold.cpp b/Jusin154_Team3D/Client/Private/LoadingWidget_Flame.cpp similarity index 56% rename from Jusin154_Team3D/Editor/Private/Mission_KeyHold.cpp rename to Jusin154_Team3D/Client/Private/LoadingWidget_Flame.cpp index fcc39e4a9..93623a688 100644 --- a/Jusin154_Team3D/Editor/Private/Mission_KeyHold.cpp +++ b/Jusin154_Team3D/Client/Private/LoadingWidget_Flame.cpp @@ -1,30 +1,30 @@ #include "pch.h" -#include "Mission_KeyHold.h" +#include "LoadingWidget_Flame.h" #include "GameInstance.h" -CMission_KeyHold::CMission_KeyHold(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +CLoadingWidget_Flame::CLoadingWidget_Flame(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) { } -CMission_KeyHold::CMission_KeyHold(const CMission_KeyHold& rhs) +CLoadingWidget_Flame::CLoadingWidget_Flame(const CLoadingWidget_Flame& rhs) :CElementObject(rhs) { } -HRESULT CMission_KeyHold::Initialize_Prototype() +HRESULT CLoadingWidget_Flame::Initialize_Prototype() { return S_OK; } -HRESULT CMission_KeyHold::Initialize(void* pArg) +HRESULT CLoadingWidget_Flame::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = -297.f; - Desc.fY = 158.f; - Desc.fSizeX = 94.f; - Desc.fSizeY = 94.f; + Desc.fX = -237.f; + Desc.fY = 90.f; + Desc.fSizeX = 100.f; + Desc.fSizeY = 100.f; m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; @@ -37,14 +37,26 @@ HRESULT CMission_KeyHold::Initialize(void* pArg) return E_FAIL; } - m_fTimeMult = 1.f; + // UI의 알파값을 조절 m_fAlpha = 1.f; m_fAlphaTime = 3.f; - m_fPI = AI_MATH_TWO_PI_F; + + // 스프라이트 애니메이션의 정보 + m_fTimeMult = 3.f; // 속도 + m_fDelayTime = 1.f; // 딜레이 + m_fFrame = 0.2f; // 프레임 + m_fEndTime = 1.8f; // 한번 실행되는 시간 + m_iImageFrameX = 3; // 이미지의 x 갯수 + m_iImageFrameY = 3; // 이미지의 y 갯수 + + m_bActive = true; + // 이 친구는 FadeIn을 해주면 알아서 한번 깜빡이고 들어감 + // 조절을 할꺼면 나중에 제대로 확인을 한 다음에 할 예정 + Set_FadeIn(); return S_OK; } -void CMission_KeyHold::Priority_Update(_float fTimeDelta) +void CLoadingWidget_Flame::Priority_Update(_float fTimeDelta) { if (!__super::Chack_Visible()) { @@ -53,13 +65,32 @@ void CMission_KeyHold::Priority_Update(_float fTimeDelta) __super::Priority_Update(fTimeDelta); } -void CMission_KeyHold::Update(_float fTimeDelta) +void CLoadingWidget_Flame::Update(_float fTimeDelta) { if (!__super::Chack_Visible()) { return; } + if (m_fAlpha >= 1.f) + { + if (m_fDelayTime >= 0.f) + { + m_fDelayTime -= fTimeDelta * m_fTimeMult; + } + else + { + m_fTime += fTimeDelta * m_fTimeMult; + } + + if (m_fTime >= m_fEndTime) + { + m_fTime = 0.f; + m_fDelayTime = 1.f; + m_bFadeOut = true; + } + } + if (m_bFadeIn == true) { if (m_fAlpha <= 1.f) @@ -84,45 +115,10 @@ void CMission_KeyHold::Update(_float fTimeDelta) } } - - if (m_bKeyHold == false) - { - if (m_pGameInstance->Key_Pressing(DIK_V)) - { - m_fTime += fTimeDelta * m_fTimeMult; - } - else - { - m_fTime = 0.f; - m_bKeyHold = false; - } - } - - if (m_pGameInstance->Key_Up(DIK_V)) - { - m_bKeyHold = false; - } - - if (m_fTimeMult <= m_fTime) - { - m_fTime = 0.f; - m_bisHoldOn = !m_bisHoldOn; - m_bKeyHold = true; - } - - if (m_bisHoldOn) - { - static_cast(m_pOwner)->Function_Callback(TEXT("Mission_On")); - } - else - { - static_cast(m_pOwner)->Function_Callback(TEXT("Mission_Off")); - } - __super::Update(fTimeDelta); } -void CMission_KeyHold::Late_Update(_float fTimeDelta) +void CLoadingWidget_Flame::Late_Update(_float fTimeDelta) { if (!__super::Chack_Visible()) { @@ -134,12 +130,12 @@ void CMission_KeyHold::Late_Update(_float fTimeDelta) } } -HRESULT CMission_KeyHold::Render() +HRESULT CLoadingWidget_Flame::Render() { if (FAILED(Bind_ShaderResources())) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::HOLD_ROTATION)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::LODING)))) { return E_FAIL; } if (FAILED(m_pVIBufferCom->Bind_Resources())) { @@ -152,12 +148,12 @@ HRESULT CMission_KeyHold::Render() return S_OK; } -_vector CMission_KeyHold::Get_WorldPostion() +_vector CLoadingWidget_Flame::Get_WorldPostion() { return m_pTransformCom->Get_State(STATE::POSITION); } -HRESULT CMission_KeyHold::Bind_ShaderResources() +HRESULT CLoadingWidget_Flame::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { @@ -183,11 +179,11 @@ HRESULT CMission_KeyHold::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fTimeMult", &m_fTimeMult, sizeof(_float)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFrame", &m_fFrame, sizeof(_float)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fPI", &m_fPI, sizeof(_float)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) { return E_FAIL; } @@ -195,21 +191,28 @@ HRESULT CMission_KeyHold::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_iImageCountX", &m_iImageFrameX, sizeof(_int)))) + { + 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_iImageCountY", &m_iImageFrameY, sizeof(_int)))) + { + return E_FAIL; + } return S_OK; } - -HRESULT CMission_KeyHold::Ready_Components(void* pArg) +HRESULT CLoadingWidget_Flame::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_Finishi_Rect"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_LoadingWidget_Flame"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } @@ -221,33 +224,33 @@ HRESULT CMission_KeyHold::Ready_Components(void* pArg) return S_OK; } -CMission_KeyHold* CMission_KeyHold::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +CLoadingWidget_Flame* CLoadingWidget_Flame::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { - CMission_KeyHold* pInstance = new CMission_KeyHold(pDevice, pContext); + CLoadingWidget_Flame* pInstance = new CLoadingWidget_Flame(pDevice, pContext); if (FAILED(pInstance->Initialize_Prototype())) { - MSG_BOX("Failed to Created : CMission_KeyHold"); + MSG_BOX("Failed to Created : CLoadingWidget_Flame"); SAFE_RELEASE(pInstance); } return pInstance; } -CGameObject* CMission_KeyHold::Clone(void* pArg, CGameObject* pOwner) +CGameObject* CLoadingWidget_Flame::Clone(void* pArg, CGameObject* pOwner) { - CMission_KeyHold* pInstance = new CMission_KeyHold(*this); + CLoadingWidget_Flame* pInstance = new CLoadingWidget_Flame(*this); pInstance->m_pOwner = pOwner; if (FAILED(pInstance->Initialize(pArg))) { - MSG_BOX("Failed to Cloned : CMission_KeyHold"); + MSG_BOX("Failed to Cloned : CLoadingWidget_Flame"); SAFE_RELEASE(pInstance); } return pInstance; } -void CMission_KeyHold::Free() +void CLoadingWidget_Flame::Free() { __super::Free(); @@ -256,6 +259,8 @@ void CMission_KeyHold::Free() SAFE_RELEASE(m_pVIBufferCom); } -void CMission_KeyHold::Describe_Entity() +#ifdef _DEBUG +void CLoadingWidget_Flame::Describe_Entity() { } +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Loading_Panel.cpp b/Jusin154_Team3D/Client/Private/Loading_Panel.cpp index 935aa9b33..a39128f96 100644 --- a/Jusin154_Team3D/Client/Private/Loading_Panel.cpp +++ b/Jusin154_Team3D/Client/Private/Loading_Panel.cpp @@ -2,7 +2,7 @@ #include "Loading_Panel.h" #include "GameInstance.h" #include "LoadingWidget.h" -//#include "LoadingWidget_Flame.h" +#include "LoadingWidget_Flame.h" CLoading_Panel::CLoading_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -41,7 +41,6 @@ HRESULT CLoading_Panel::Initialize(void* pArg) { return E_FAIL; } - m_bVisible = true; m_bActive = true; return S_OK; } @@ -108,11 +107,11 @@ HRESULT CLoading_Panel::Ready_Element(void* pArg) return E_FAIL; } Add_Element(TEXT("LoadingWidget"), m_pLoadingWidget); - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pLoadingWidget_Flame)))) - //{ - // return E_FAIL; - //} - //Add_Element(TEXT("LoadingWidget_Flame"), m_pLoadingWidget_Flame); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pLoadingWidget_Flame)))) + { + return E_FAIL; + } + Add_Element(TEXT("LoadingWidget_Flame"), m_pLoadingWidget_Flame); return S_OK; } @@ -150,6 +149,8 @@ void CLoading_Panel::Free() SAFE_RELEASE(m_pVIBufferCom); } +#ifdef _DEBUG void CLoading_Panel::Describe_Entity() { } +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Magic_Icon.cpp b/Jusin154_Team3D/Client/Private/Magic_Icon.cpp new file mode 100644 index 000000000..5128a6f15 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Magic_Icon.cpp @@ -0,0 +1,235 @@ +#include "pch.h" +#include "Magic_Icon.h" +#include "GameInstance.h" + +CMagic_Icon::CMagic_Icon(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CMagic_Icon::CMagic_Icon(const CMagic_Icon& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CMagic_Icon::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMagic_Icon::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 630.f; + Desc.fY = 125.f; + Desc.fSizeX = 65.f; + Desc.fSizeY = 65.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_bActive = true; + return S_OK; +} + +void CMagic_Icon::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CMagic_Icon::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + m_fTime += fTimeDelta * m_fTimeMult; + + 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; + } + } + + __super::Update(fTimeDelta); +} + +void CMagic_Icon::Late_Update(_float fTimeDelta) +{ + if (__super::Chack_Visible()) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CMagic_Icon::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::MAGIC_ICON)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CMagic_Icon::Get_WorldPostion() +{ + return m_pOwner->Get_WorldPostion(); +} + +HRESULT CMagic_Icon::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_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 CMagic_Icon::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_AncientMagicFinisher"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CMagic_Icon* CMagic_Icon::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMagic_Icon* pInstance = new CMagic_Icon(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMagic_Icon"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMagic_Icon::Clone(void* pArg, CGameObject* pOwner) +{ + CMagic_Icon* pInstance = new CMagic_Icon(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMagic_Icon"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMagic_Icon::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); +} + +#ifdef _DEBUG +void CMagic_Icon::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Magic_Item.cpp b/Jusin154_Team3D/Client/Private/Magic_Item.cpp new file mode 100644 index 000000000..9ea657f63 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Magic_Item.cpp @@ -0,0 +1,372 @@ +#include "pch.h" +#include "Magic_Item.h" +#include "GameInstance.h" + +CMagic_Item::CMagic_Item(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CMagic_Item::CMagic_Item(const CMagic_Item& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CMagic_Item::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMagic_Item::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = -800.f; + Desc.fY = 70.f; + Desc.fSizeX = 100.f; + Desc.fSizeY = 100.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 = 0.5f; + m_fAngle = XMConvertToRadians(-135.f); + m_fAlphaTime = 1.f; + m_fSortZ = 0.2f; + m_fCoolTime = 5.f; + m_vUVScale.y = 1.f; + m_iArratCount = 2; + Compute_UV(0); + Compute_Image(); + m_bActive = true; + return S_OK; +} + +void CMagic_Item::Compute_UV(_uint iItemID) +{ + _float2 fImage_Size = { 1024.f, 512.f }; + + _uint iCountX = 4; + _uint iCountY = 2; + + _float iImageX = 256.f; + _float iImageY = 256.f; + + _uint iframeX = iItemID % iCountX; + _uint iframeY = iItemID / iCountX; + + _float2 UVStart{}; + UVStart.x = iframeX * iImageX / fImage_Size.x; + UVStart.y = iframeY * iImageY / fImage_Size.y; + + _float2 UVEnd{}; + UVEnd.x = UVStart.x + (iImageX / fImage_Size.x); + UVEnd.y = UVStart.y + (iImageY / fImage_Size.y); + + _float4 UV = _float4{ UVStart.x, UVStart.y, UVEnd.x, UVEnd.y }; + m_vUV = UV; +} + +void CMagic_Item::Compute_Image() +{ + m_vImagePos1 = _float2(72.f, 0.f); + m_vImageSize1 = _float2(30.f, 30.f); + m_vImagePos2 = _float2(65.f, 65.f); + m_vImageSize2 = _float2(30.f, 30.f); +} + +void CMagic_Item::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + + +void CMagic_Item::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; + } + } + + if (m_vUVScale.y >= 1.f) + { + if (m_pGameInstance->Key_Down(DIK_TAB)) + { + m_vUVScale.y = 0.f; + } + } + + if (m_vUVScale.y <= 1) + { + m_vUVScale.y += fTimeDelta * (1.f / m_fCoolTime); + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CMagic_Item::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CMagic_Item::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::MAGIC_ITEM)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CMagic_Item::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CMagic_Item::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_fTime", &m_fTime, 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; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCoolTime", &m_fCoolTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDeltaV", &m_vUVScale.y, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_iArrayCount", &m_iArratCount, sizeof(_uint)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fItemPosition1", &m_vImagePos1, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fItemImageSizes1", &m_vImageSize1, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fItemPosition2", &m_vImagePos2, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fItemImageSizes2", &m_vImageSize2, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CMagic_Item::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_spellmeter_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Atlas_Item"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Keyboard_Tab"), reinterpret_cast(&m_pDiffuse_TextureCom4), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_AmountFrame"), reinterpret_cast(&m_pDiffuse_TextureCom5), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CMagic_Item* CMagic_Item::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMagic_Item* pInstance = new CMagic_Item(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMagic_Item"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMagic_Item::Clone(void* pArg, CGameObject* pOwner) +{ + CMagic_Item* pInstance = new CMagic_Item(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMagic_Item"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMagic_Item::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); +} + +#ifdef _DEBUG +void CMagic_Item::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Magic_Meter.cpp b/Jusin154_Team3D/Client/Private/Magic_Meter.cpp new file mode 100644 index 000000000..5ee0715f5 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Magic_Meter.cpp @@ -0,0 +1,258 @@ +#include "pch.h" +#include "Magic_Meter.h" +#include "GameInstance.h" + +CMagic_Meter::CMagic_Meter(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CMagic_Meter::CMagic_Meter(const CMagic_Meter& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CMagic_Meter::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMagic_Meter::Initialize(void* pArg) +{ + + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 190.f; + Desc.fY = 145.f; + Desc.fSizeX = 70.f; + Desc.fSizeY = 20.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_fMaxGauge = 20.f; + m_fCurrentGauge = 10.f; + Visible(false); + m_bActive = true; + return S_OK; +} + +void CMagic_Meter::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CMagic_Meter::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; + } + } + if (m_fCurrentGauge< 0.f) + m_fCurrentGauge = 0.f; + //if (m_fDamage <= 0.f) + // m_fDamage = 0.f; + //m_fTargetHp = m_fMaxHp - m_fDamage; + + m_fGaugeBar = m_fCurrentGauge / m_fMaxGauge; + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + + +void CMagic_Meter::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CMagic_Meter::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::MAGIC_METER)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + + +_vector CMagic_Meter::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CMagic_Meter::Meter_Index(_uint Number) +{ + m_iImageCount = Number; +} + +HRESULT CMagic_Meter::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", m_iImageCount))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fHp", &m_fGaugeBar, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CMagic_Meter::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Megic_Metar"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_HUD_HealthMeterFill"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + + +CMagic_Meter* CMagic_Meter::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMagic_Meter* pInstance = new CMagic_Meter(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMagic_Meter"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMagic_Meter::Clone(void* pArg, CGameObject* pOwner) +{ + CMagic_Meter* pInstance = new CMagic_Meter(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMagic_Meter::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CMagic_Meter::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/MiniMap_Panel.cpp b/Jusin154_Team3D/Client/Private/MiniMap_Panel.cpp new file mode 100644 index 000000000..82ac9609d --- /dev/null +++ b/Jusin154_Team3D/Client/Private/MiniMap_Panel.cpp @@ -0,0 +1,151 @@ +#include "pch.h" +#include "MiniMap_Panel.h" +#include "GameInstance.h" +#include "MiniMap_TrimBorder.h" +#include "NoMountIcon.h" + +CMiniMap_Panel::CMiniMap_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPanelObject(pDevice, pContext) +{ +} + +CMiniMap_Panel::CMiniMap_Panel(const CMiniMap_Panel& rhs) + :CPanelObject(rhs) +{ +} + +HRESULT CMiniMap_Panel::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMiniMap_Panel::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 170.f; + Desc.fY = 920.f; + Desc.fSizeX = 280.f; + Desc.fSizeY = 280.f; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Element(pArg))) + { + return E_FAIL; + } + + m_bActive = true; + return S_OK; +} + +void CMiniMap_Panel::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CMiniMap_Panel::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + __super::Update(fTimeDelta); +} + +void CMiniMap_Panel::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CMiniMap_Panel::Render() +{ + return S_OK; +} + +_vector CMiniMap_Panel::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CMiniMap_Panel::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CMiniMap_Panel::Ready_Components(void* pArg) +{ + + return S_OK; +} + +HRESULT CMiniMap_Panel::Ready_Element(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast (&m_pMiniMap_TrimBorder)))) + { + return E_FAIL; + } + Add_Element(TEXT("MiniMap_TrimBorder"), m_pMiniMap_TrimBorder); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast (&m_pNoMountIcon)))) + { + return E_FAIL; + } + Add_Element(TEXT("NoMountIcon"), m_pNoMountIcon); + return S_OK; +} + +CMiniMap_Panel* CMiniMap_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMiniMap_Panel* pInstance = new CMiniMap_Panel(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMiniMap_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMiniMap_Panel::Clone(void* pArg, CGameObject* pOwner) +{ + CMiniMap_Panel* pInstance = new CMiniMap_Panel(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMiniMap_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMiniMap_Panel::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CMiniMap_Panel::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/Active_Icon.cpp b/Jusin154_Team3D/Client/Private/MiniMap_TrimBorder.cpp similarity index 66% rename from Jusin154_Team3D/Editor/Private/Active_Icon.cpp rename to Jusin154_Team3D/Client/Private/MiniMap_TrimBorder.cpp index 25432d584..a02ef979b 100644 --- a/Jusin154_Team3D/Editor/Private/Active_Icon.cpp +++ b/Jusin154_Team3D/Client/Private/MiniMap_TrimBorder.cpp @@ -1,30 +1,30 @@ #include "pch.h" -#include "Active_Icon.h" +#include "MiniMap_TrimBorder.h" #include "GameInstance.h" -CActive_Icon::CActive_Icon(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +CMiniMap_TrimBorder::CMiniMap_TrimBorder(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) { } -CActive_Icon::CActive_Icon(const CActive_Icon& rhs) +CMiniMap_TrimBorder::CMiniMap_TrimBorder(const CMiniMap_TrimBorder& rhs) :CElementObject(rhs) { } -HRESULT CActive_Icon::Initialize_Prototype() +HRESULT CMiniMap_TrimBorder::Initialize_Prototype() { return S_OK; } -HRESULT CActive_Icon::Initialize(void* pArg) +HRESULT CMiniMap_TrimBorder::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = -230.f; - Desc.fY = 160.f; - Desc.fSizeX = 35.f; - Desc.fSizeY = 35.f; + Desc.fX = -20.f; + Desc.fY = 0; + Desc.fSizeX = 290.f; + Desc.fSizeY = 290.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) }; @@ -40,16 +40,12 @@ HRESULT CActive_Icon::Initialize(void* pArg) m_fTimeMult = 3.f; m_fAlpha = 1.f; m_fAlphaTime = 3.f; - m_eType = QUESTYPE::MAIN; + + m_bActive = true; return S_OK; } -void CActive_Icon::QuestType(QUESTYPE eType) -{ - m_eType = eType; -} - -void CActive_Icon::Priority_Update(_float fTimeDelta) +void CMiniMap_TrimBorder::Priority_Update(_float fTimeDelta) { if (!__super::Chack_Visible()) { @@ -58,13 +54,12 @@ void CActive_Icon::Priority_Update(_float fTimeDelta) __super::Priority_Update(fTimeDelta); } -void CActive_Icon::Update(_float fTimeDelta) +void CMiniMap_TrimBorder::Update(_float fTimeDelta) { if (!__super::Chack_Visible()) { return; } - m_fTime += fTimeDelta * m_fTimeMult; if (m_bFadeIn == true) { @@ -90,20 +85,11 @@ void CActive_Icon::Update(_float fTimeDelta) } } - if (m_bLerpOn == true) - { - Start_Lerp(fTimeDelta); - } - - if (m_bLerpOff == true) - { - Reset_Pos(fTimeDelta); - } - + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } -void CActive_Icon::Late_Update(_float fTimeDelta) +void CMiniMap_TrimBorder::Late_Update(_float fTimeDelta) { if (!__super::Chack_Visible()) { @@ -115,12 +101,12 @@ void CActive_Icon::Late_Update(_float fTimeDelta) } } -HRESULT CActive_Icon::Render() +HRESULT CMiniMap_TrimBorder::Render() { if (FAILED(Bind_ShaderResources())) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::QUESTYPE)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) { return E_FAIL; } if (FAILED(m_pVIBufferCom->Bind_Resources())) { @@ -133,12 +119,12 @@ HRESULT CActive_Icon::Render() return S_OK; } -_vector CActive_Icon::Get_WorldPostion() +_vector CMiniMap_TrimBorder::Get_WorldPostion() { - return m_pOwner->Get_WorldPostion(); + return m_pTransformCom->Get_State(STATE::POSITION); } -HRESULT CActive_Icon::Bind_ShaderResources() +HRESULT CMiniMap_TrimBorder::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { @@ -176,20 +162,17 @@ HRESULT CActive_Icon::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iQuestType", &m_eType, sizeof(_uint)))) - { - return E_FAIL; - } + return S_OK; } -HRESULT CActive_Icon::Ready_Components(void* pArg) +HRESULT CMiniMap_TrimBorder::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("ActiveMission_Icon"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_HUD_MiniMap_TrimBorder"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } @@ -201,33 +184,33 @@ HRESULT CActive_Icon::Ready_Components(void* pArg) return S_OK; } -CActive_Icon* CActive_Icon::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +CMiniMap_TrimBorder* CMiniMap_TrimBorder::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { - CActive_Icon* pInstance = new CActive_Icon(pDevice, pContext); + CMiniMap_TrimBorder* pInstance = new CMiniMap_TrimBorder(pDevice, pContext); if (FAILED(pInstance->Initialize_Prototype())) { - MSG_BOX("Failed to Created : CActive_Icon"); + MSG_BOX("Failed to Created : CMiniMap_TrimBorder"); SAFE_RELEASE(pInstance); } return pInstance; } -CGameObject* CActive_Icon::Clone(void* pArg, CGameObject* pOwner) +CGameObject* CMiniMap_TrimBorder::Clone(void* pArg, CGameObject* pOwner) { - CActive_Icon* pInstance = new CActive_Icon(*this); + CMiniMap_TrimBorder* pInstance = new CMiniMap_TrimBorder(*this); pInstance->m_pOwner = pOwner; if (FAILED(pInstance->Initialize(pArg))) { - MSG_BOX("Failed to Cloned : CActive_Icon"); + MSG_BOX("Failed to Cloned : CMiniMap_TrimBorder"); SAFE_RELEASE(pInstance); } return pInstance; } -void CActive_Icon::Free() +void CMiniMap_TrimBorder::Free() { __super::Free(); @@ -236,6 +219,8 @@ void CActive_Icon::Free() SAFE_RELEASE(m_pVIBufferCom); } -void CActive_Icon::Describe_Entity() +#ifdef _DEBUG +void CMiniMap_TrimBorder::Describe_Entity() { } +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Mission_Panel.cpp b/Jusin154_Team3D/Client/Private/Mission_Panel.cpp new file mode 100644 index 000000000..b65db6cf2 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Mission_Panel.cpp @@ -0,0 +1,174 @@ +#include "pch.h" +#include "Mission_Panel.h" +#include "GameInstance.h" +//#include "Mission_KeyHold.h" +//#include "Mission_Key.h" +//#include "Active_Icon.h" +//#include "MissionBanner_Border.h" +//#include "MissionBanner_Key.h" + +CMission_Panel::CMission_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPanelObject(pDevice, pContext) +{ +} + +CMission_Panel::CMission_Panel(const CMission_Panel& rhs) + :CPanelObject(rhs) +{ +} + +HRESULT CMission_Panel::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMission_Panel::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 380.f; + Desc.fY = 580.f; + Desc.fSizeX = 750.f; + Desc.fSizeY = 410.f; + + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Element(pArg))) + { + return E_FAIL; + } + return S_OK; +} + +void CMission_Panel::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CMission_Panel::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + __super::Update(fTimeDelta); +} + +void CMission_Panel::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bVisible) { + + } + __super::Late_Update(fTimeDelta); + +} + +HRESULT CMission_Panel::Render() +{ + return S_OK; +} + +_vector CMission_Panel::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CMission_Panel::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CMission_Panel::Ready_Components(void* pArg) +{ + return S_OK; +} + +HRESULT CMission_Panel::Ready_Element(void* pArg) +{ + /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMissionBanner_Border)))) + { + return E_FAIL; + } + Add_Element(TEXT("MissionBanner_Border"), m_pMissionBanner_Border); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMissionBanner_Key)))) + { + return E_FAIL; + } + Add_Element(TEXT("MissionBanner_Key"), m_pMissionBanner_Key); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMission_KeyHold)))) + { + return E_FAIL; + } + Add_Element(TEXT("Mission_KeyHold"), m_pMission_KeyHold); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMission_Key)))) + { + return E_FAIL; + } + Add_Element(TEXT("Mission_Key"), m_pMission_Key); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pActive_Icon)))) + { + return E_FAIL; + } + Add_Element(TEXT("Active_Icon"), m_pActive_Icon); +*/ + return S_OK; +} + +CMission_Panel* CMission_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMission_Panel* pInstance = new CMission_Panel(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMission_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMission_Panel::Clone(void* pArg, CGameObject* pOwner) +{ + CMission_Panel* pInstance = new CMission_Panel(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMission_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMission_Panel::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CMission_Panel::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/Mission_Key.cpp b/Jusin154_Team3D/Client/Private/NoMountIcon.cpp similarity index 59% rename from Jusin154_Team3D/Editor/Private/Mission_Key.cpp rename to Jusin154_Team3D/Client/Private/NoMountIcon.cpp index a95b2c00a..ccb7ce9fd 100644 --- a/Jusin154_Team3D/Editor/Private/Mission_Key.cpp +++ b/Jusin154_Team3D/Client/Private/NoMountIcon.cpp @@ -1,30 +1,30 @@ #include "pch.h" -#include "Mission_Key.h" +#include "NoMountIcon.h" #include "GameInstance.h" -CMission_Key::CMission_Key(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +CNoMountIcon::CNoMountIcon(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) { } -CMission_Key::CMission_Key(const CMission_Key& rhs) +CNoMountIcon::CNoMountIcon(const CNoMountIcon& rhs) :CElementObject(rhs) { } -HRESULT CMission_Key::Initialize_Prototype() +HRESULT CNoMountIcon::Initialize_Prototype() { return S_OK; } -HRESULT CMission_Key::Initialize(void* pArg) +HRESULT CNoMountIcon::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = -297.f; - Desc.fY = 159.f; - Desc.fSizeX = 40.f; - Desc.fSizeY = 40.f; + Desc.fX = 120.f; + Desc.fY = -90; + Desc.fSizeX = 65.f; + Desc.fSizeY = 65.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) }; @@ -38,13 +38,14 @@ HRESULT CMission_Key::Initialize(void* pArg) } m_fTimeMult = 3.f; - m_fAlpha = 1.f; + m_fAlpha = 0.7f; m_fAlphaTime = 3.f; - AlphabetUV('V'); + + m_bActive = true; return S_OK; } -void CMission_Key::Priority_Update(_float fTimeDelta) +void CNoMountIcon::Priority_Update(_float fTimeDelta) { if (!__super::Chack_Visible()) { @@ -53,7 +54,7 @@ void CMission_Key::Priority_Update(_float fTimeDelta) __super::Priority_Update(fTimeDelta); } -void CMission_Key::Update(_float fTimeDelta) +void CNoMountIcon::Update(_float fTimeDelta) { if (!__super::Chack_Visible()) { @@ -62,13 +63,13 @@ void CMission_Key::Update(_float fTimeDelta) if (m_bFadeIn == true) { - if (m_fAlpha <= 1.f) + if (m_fAlpha <= 7.f) m_fAlpha += fTimeDelta * m_fAlphaTime; - if (m_fAlpha >= 1.f) + if (m_fAlpha >= 7.f) { m_bFadeIn = false; - m_fAlpha = 1.f; + m_fAlpha = 7.f; } } @@ -83,28 +84,29 @@ void CMission_Key::Update(_float fTimeDelta) m_fAlpha = 0.f; } } + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } -void CMission_Key::Late_Update(_float fTimeDelta) +void CNoMountIcon::Late_Update(_float fTimeDelta) { if (!__super::Chack_Visible()) { return; } if (m_bVisible) { - m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); __super::Late_Update(fTimeDelta); } } -HRESULT CMission_Key::Render() +HRESULT CNoMountIcon::Render() { if (FAILED(Bind_ShaderResources())) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::REMOVEUV)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) { return E_FAIL; } if (FAILED(m_pVIBufferCom->Bind_Resources())) { @@ -117,38 +119,12 @@ HRESULT CMission_Key::Render() return S_OK; } -_vector CMission_Key::Get_WorldPostion() +_vector CNoMountIcon::Get_WorldPostion() { return m_pTransformCom->Get_State(STATE::POSITION); } -_float4 CMission_Key::AlphabetUV(_tchar Alphabet) -{ - _uint Number = CMyTools::AlphabetToInt(Alphabet); - - _float2 fImage_Size = { 320.f, 384.f }; - - _uint iXCount = 5; - _uint iYCount = 6; - - _float frameWidth = 64.f; - _float frameHeight = 64.f; - - _uint iframeX = Number % iXCount; - _uint iframeY = Number / iXCount; - - _float2 UVStart; - UVStart.x = iframeX * frameWidth / fImage_Size.x; - UVStart.y = iframeY * frameHeight / fImage_Size.y; - - _float2 UVEnd; - UVEnd.x = UVStart.x + (frameWidth / fImage_Size.x); - UVEnd.y = UVStart.y + (frameHeight / fImage_Size.y); - - return m_vUV = _float4(UVStart.x, UVStart.y, UVEnd.x, UVEnd.y); -} - -HRESULT CMission_Key::Bind_ShaderResources() +HRESULT CNoMountIcon::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { @@ -186,20 +162,17 @@ HRESULT CMission_Key::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4)))) - { - return E_FAIL; - } + return S_OK; } -HRESULT CMission_Key::Ready_Components(void* pArg) +HRESULT CNoMountIcon::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_Atlas_Keyboard"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_NoMountIcon"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } @@ -211,33 +184,33 @@ HRESULT CMission_Key::Ready_Components(void* pArg) return S_OK; } -CMission_Key* CMission_Key::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +CNoMountIcon* CNoMountIcon::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { - CMission_Key* pInstance = new CMission_Key(pDevice, pContext); + CNoMountIcon* pInstance = new CNoMountIcon(pDevice, pContext); if (FAILED(pInstance->Initialize_Prototype())) { - MSG_BOX("Failed to Created : CMission_Key"); + MSG_BOX("Failed to Created : CNoMountIcon"); SAFE_RELEASE(pInstance); } return pInstance; } -CGameObject* CMission_Key::Clone(void* pArg, CGameObject* pOwner) +CGameObject* CNoMountIcon::Clone(void* pArg, CGameObject* pOwner) { - CMission_Key* pInstance = new CMission_Key(*this); + CNoMountIcon* pInstance = new CNoMountIcon(*this); pInstance->m_pOwner = pOwner; if (FAILED(pInstance->Initialize(pArg))) { - MSG_BOX("Failed to Cloned : CMission_Key"); + MSG_BOX("Failed to Cloned : CNoMountIcon"); SAFE_RELEASE(pInstance); } return pInstance; } -void CMission_Key::Free() +void CNoMountIcon::Free() { __super::Free(); @@ -246,6 +219,8 @@ void CMission_Key::Free() SAFE_RELEASE(m_pVIBufferCom); } -void CMission_Key::Describe_Entity() +#ifdef _DEBUG +void CNoMountIcon::Describe_Entity() { } +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 4e149b6f6..a631dba9d 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -55,7 +55,7 @@ HRESULT CPlayer::Initialize(void* pArg) return E_FAIL; } #ifdef _DEBUG - //Load_KeyFrame(); + Load_KeyFrame(); #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 463d084ce..73f250212 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -309,12 +309,10 @@ void CPlayer::Behavior_MoveEnter() m_bSprintToggle = false; m_bWalkToggle = false; pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; - m_bRatio = true; } } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount, m_bRatio); - m_fAmount = 1.f; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount); } HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) @@ -470,28 +468,29 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) _float absDir = fabsf(vDir); if (absDir <= XMConvertToRadians(80.f)) { pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + m_fAmount = 1.f; + m_bRatio = true; } else if (absDir < XMConvertToRadians(160.f)) { if (cross > 0) { pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT]; - m_fAmount = 0.2f; + m_fAmount = 0.8f; m_bRatio = true; } else { pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT]; - m_fAmount = 0.2f; + m_fAmount = 0.8f; m_bRatio = true; } } else { pairAnimInfo = m_Animation[STATEANIM::JOG_BWD]; - m_fAmount = 0.2f; + m_fAmount = 0.8f; m_bRatio = true; } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,m_fAmount, m_bRatio); - m_fAmount = 1.f; } } return S_OK; @@ -643,10 +642,8 @@ void CPlayer::Behavior_CombatEnter() else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; - m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::LIGHT_ATTACK].first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this); - return E_FAIL; }); } @@ -774,14 +771,14 @@ HRESULT CPlayer::Behavior_CombatExitCheck() - m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::ACCIO].first, [this]() { + m_pModelCom->Anim_Event(0.f, m_Animation[STATEANIM::ACCIO].first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARD, this); m_eSpell = STATEANIM::END; return E_FAIL; }); - m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::DESCENDO].first, [this]() { + m_pModelCom->Anim_Event(0.f, m_Animation[STATEANIM::DESCENDO].first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, this); m_eSpell = STATEANIM::END; diff --git a/Jusin154_Team3D/Client/Private/Potion.cpp b/Jusin154_Team3D/Client/Private/Potion.cpp new file mode 100644 index 000000000..d6885dcba --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Potion.cpp @@ -0,0 +1,281 @@ +#include "pch.h" +#include "Potion.h" +#include "GameInstance.h" + +CPotion::CPotion(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CPotion::CPotion(const CPotion& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CPotion::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CPotion::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 700.f; + Desc.fY = 150.f; + Desc.fSizeX = 80.f; + Desc.fSizeY = 80.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 = 1.f; + m_vImageSlotPos = _float2(45.f,45.f); + m_vImageSize = _float2(32.f,32.f); + m_bActive = true; + return S_OK; +} + +void CPotion::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + + +void CPotion::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; + } + } + + if (m_pGameInstance->Key_Down(DIK_G)) + { + m_fTime = -1.f; + } + + + m_fTime += fTimeDelta * m_fTimeMult; + + __super::Update(fTimeDelta); +} + +void CPotion::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CPotion::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::POTION)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CPotion::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CPotion::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_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_fCurrent_Size", &m_vScale, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_Pos", &m_vImageSlotPos, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_vImageSize, sizeof(_float2)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CPotion::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_FG_IndexIconBorder"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_WoundCleaning"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_AmountFrame"), reinterpret_cast(&m_pDiffuse_TextureCom4), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + return S_OK; +} + +CPotion* CPotion::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CPotion* pInstance = new CPotion(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CPotion"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CPotion::Clone(void* pArg, CGameObject* pOwner) +{ + CPotion* pInstance = new CPotion(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Image"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CPotion::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_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CPotion::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Slot_Number.cpp b/Jusin154_Team3D/Client/Private/Slot_Number.cpp new file mode 100644 index 000000000..675349f6b --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Slot_Number.cpp @@ -0,0 +1,300 @@ +#include "pch.h" +#include "Slot_Number.h" +#include "GameInstance.h" + +CSlot_Number::CSlot_Number(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSlot_Number::CSlot_Number(const CSlot_Number& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSlot_Number::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSlot_Number::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 35.f; + Desc.fSizeY = 35.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + m_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 101.f; + m_fOffSetY = 101.f; + m_iCols = 4; + UV(); + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(350.f, 10.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(pUVDesc); + m_bActive = true; + return S_OK; +} + +void CSlot_Number::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSlot_Number::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSlot_Number::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSlot_Number::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSlot_Number::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSlot_Number::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSlot_Number::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSlot_Number::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CSlot_Number::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSlot_Number::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Slot_Number_UI_Instance"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Atlas_Number"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +void CSlot_Number::UV() +{ + pUVDesc[0].fUVStart = Meter_Index(1); + pUVDesc[0].fUVEnd = Compute_UVY(1); + pUVDesc[1].fUVStart = Meter_Index(2); + pUVDesc[1].fUVEnd = Compute_UVY(2); + pUVDesc[2].fUVStart = Meter_Index(3); + pUVDesc[2].fUVEnd = Compute_UVY(3); + pUVDesc[3].fUVStart = Meter_Index(4); + pUVDesc[3].fUVEnd = Compute_UVY(4); +} + +_float2 CSlot_Number::Meter_Index(_uint Number) +{ + m_fIamge_Size = { 320.f, 128.f }; + + _uint iXCount = 5; + _uint iYCount = 2; + + _float frameWidth = 64.f; + _float frameHeight = 64.f; + + _uint frameX = Number % iXCount; + _uint frameY = Number / iXCount; + + _float2 UVStart; + UVStart.x = frameX * frameWidth / m_fIamge_Size.x; + UVStart.y = frameY * frameHeight / m_fIamge_Size.y; + + return UVStart; +} + +_float2 CSlot_Number::Compute_UVY(_uint Number) +{ + m_fIamge_Size = { 320.f, 128.f }; + + _float frameWidth = 64.f; + _float frameHeight = 64.f; + + // Start 구함 + _float2 UVStart = Meter_Index(Number); + + _float2 UVEnd; + UVEnd.x = UVStart.x + (frameWidth / m_fIamge_Size.x); + UVEnd.y = UVStart.y + (frameHeight / m_fIamge_Size.y); + + return UVEnd; +} + +CSlot_Number* CSlot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSlot_Number* pInstance = new CSlot_Number(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSlot_Number"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSlot_Number::Clone(void* pArg, CGameObject* pOwner) +{ + CSlot_Number* pInstance = new CSlot_Number(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSlot_Number"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSlot_Number::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSlot_Number::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp new file mode 100644 index 000000000..d7335caec --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp @@ -0,0 +1,326 @@ +#include "pch.h" +#include "Spell_Overlay.h" +#include "GameInstance.h" + +CSpell_Overlay::CSpell_Overlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Overlay::CSpell_Overlay(const CSpell_Overlay& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Overlay::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Overlay::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 380.f; + Desc.fY = 30.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_iImageFrameX = 8; + m_iImageFrameY = 8; + m_fFrame = 0.2f; + m_fTimeMult = 3.f; + m_fAngle = XMConvertToRadians(-135.f); + m_fAlpha = 1.f; + m_fAlphaTime = 1.f; + m_vUVScale.y = 1.f; + m_fCoolTime = 5.f; + m_fSortZ = 0.01f; + m_iSkillType = ENUM_CLASS(SKILLTYPE::CONTROL); + Compute_UI(5); + m_bActive = true; + return S_OK; +} + +void CSpell_Overlay::Compute_UI(_uint SpellID) +{ + _float2 fImage_Size = { 1024.f, 1536.f }; + + _uint iCountX = 4; + _uint iCountY = 6; + + _float iImageX = 256.f; + _float iImageY = 256.f; + + _uint iframeX = SpellID % iCountX; + _uint iframeY = SpellID / iCountX; + + _float2 UVStart; + UVStart.x = iframeX * iImageX / fImage_Size.x; + UVStart.y = iframeY * iImageY / fImage_Size.y; + + _float2 UVEnd; + UVEnd.x = UVStart.x + (iImageX / fImage_Size.x); + UVEnd.y = UVStart.y + (iImageY / fImage_Size.y); + + _float4 UV = _float4{UVStart.x, UVStart.y, UVEnd.x, UVEnd.y}; + m_vUV = UV; +} + +void CSpell_Overlay::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Overlay::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; + } + } + + if (m_vUVScale.y >= 1.f) + { + if (m_pGameInstance->Key_Down(DIK_1)) + { + m_vUVScale.y = 0.f; + } + } + + if (m_vUVScale.y <= 1) + { + m_vUVScale.y += fTimeDelta * (1.f / m_fCoolTime); + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); + +} + +void CSpell_Overlay::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_Overlay::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELLTYPE)))) + { + 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_Overlay::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Overlay::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_fFrame", &m_fFrame, 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_iSpellType", &m_iSkillType, 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_iImageCountX", &m_iImageFrameX, sizeof(_int)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_iImageCountY", &m_iImageFrameY, sizeof(_int)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDeltaV", &m_vUVScale.y, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCoolTime", &m_fCoolTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Overlay::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_spellmeter_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Atlas_Spell"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Overlay* CSpell_Overlay::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Overlay* pInstance = new CSpell_Overlay(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Overlay"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Overlay::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Overlay* pInstance = new CSpell_Overlay(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Overlay"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Overlay::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); +} + +#ifdef _DEBUG +void CSpell_Overlay::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp new file mode 100644 index 000000000..cb57aa16d --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp @@ -0,0 +1,256 @@ +#include "pch.h" +#include "Spell_Slot.h" +#include "GameInstance.h" + +CSpell_Slot::CSpell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Slot::CSpell_Slot(const CSpell_Slot& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Slot::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Slot::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_fAngle = XMConvertToRadians(45); + m_fAlphaTime = 1.f; + m_fOffSetX = 101.f; + m_fOffSetY = 101.f; + m_iCols = 4; + 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; +} + +void CSpell_Slot::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Slot::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Slot::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_Slot::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_Slot::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Slot::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_Slot::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CSpell_Slot::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_Slot::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Instance"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), 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_Slot* CSpell_Slot::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Slot* pInstance = new CSpell_Slot(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Slot::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Slot* pInstance = new CSpell_Slot(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Slot::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Slot::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_UI.cpp b/Jusin154_Team3D/Client/Private/Spell_UI.cpp new file mode 100644 index 000000000..e2cde53dc --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_UI.cpp @@ -0,0 +1,310 @@ +#include "pch.h" +#include "Spell_UI.h" +#include "GameInstance.h" + +CSpell_UI::CSpell_UI(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_UI::CSpell_UI(const CSpell_UI& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_UI::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_UI::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 650.f; + Desc.fY = -60.f; + Desc.fSizeX = 180.f; + Desc.fSizeY = 50.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_vImageUV[0] = Image_UV(0); + //m_vImageUV[1] = Alphabet_UV('R'); + //m_vImageUV[2] = Image_UV(1); + //m_vImageUV[3] = Alphabet_UV('T'); + Set_ImagePos(); + m_bActive = true; + return S_OK; +} + +_float4 CSpell_UI::Alphabet_UV(_tchar Alphabet) +{ + _uint Number = CMyTools::AlphabetToInt(Alphabet); + + _float2 fIamge_Size = { 320.f, 384.f }; + + _uint iXCount = 5; + _uint iYCount = 6; + + _float frameWidth = 64.f; + _float frameHeight = 64.f; + + _uint frameX = Number % iXCount; + _uint frameY = Number / iXCount; + + _float2 UVStart; + UVStart.x = frameX * frameWidth / fIamge_Size.x; + UVStart.y = frameY * frameHeight / fIamge_Size.y; + + _float2 UVEnd; + UVEnd.x = UVStart.x + (frameWidth / fIamge_Size.x); + UVEnd.y = UVStart.y + (frameHeight / fIamge_Size.y); + + _float4 UV{}; + + return UV = _float4(UVStart.x, UVStart.y, UVEnd.x, UVEnd.y); +} + +_float4 CSpell_UI::Image_UV(_uint Index) +{ + _float2 fIamge_Size = { 256.f, 128.f }; + + _uint iXCount = 2; + _uint iYCount = 1; + + _float frameWidth = 128.f; + _float frameHeight = 128.f; + + _uint frameX = Index % iXCount; + _uint frameY = Index / iXCount; + + _float2 UVStart; + UVStart.x = frameX * frameWidth / fIamge_Size.x; + UVStart.y = frameY * frameHeight / fIamge_Size.y; + + _float2 UVEnd; + UVEnd.x = UVStart.x + (frameWidth / fIamge_Size.x); + UVEnd.y = UVStart.y + (frameHeight / fIamge_Size.y); + + _float4 UV{}; + + return UV = _float4(UVStart.x, UVStart.y, UVEnd.x, UVEnd.y); +} + +void CSpell_UI::Set_ImagePos() +{ + m_vUV[0] = _float2(16,25); + m_vUV[1] = _float2(42,25); + m_vUV[2] = _float2(138,25); + m_vUV[3] = _float2(164,25); +} + +void CSpell_UI::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_UI::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + m_fTime += fTimeDelta * m_fTimeMult; + + 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; + } + } + + __super::Update(fTimeDelta); +} + +void CSpell_UI::Late_Update(_float fTimeDelta) +{ + if (__super::Chack_Visible()) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpell_UI::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_UI::Get_WorldPostion() +{ + return m_pOwner->Get_WorldPostion(); +} + +HRESULT CSpell_UI::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_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_fPosition", m_vUV, sizeof(m_vUV)))) + //{ + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Bind_RawValue("g_fImagesUV", m_vImageUV, sizeof(m_vImageUV)))) + //{ + // return E_FAIL; + //} + return S_OK; +} + +HRESULT CSpell_UI::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Revelio_SpellSelectionGridIcon"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Revelio_SpellSelectionGridIcon"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Atlas_Keyboard"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_UI* CSpell_UI::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_UI* pInstance = new CSpell_UI(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_UI"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_UI::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_UI* pInstance = new CSpell_UI(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_UI"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_UI::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); +} + +#ifdef _DEBUG +void CSpell_UI::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Public/Action_Panel.h b/Jusin154_Team3D/Client/Public/Action_Panel.h new file mode 100644 index 000000000..60fff67e2 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Action_Panel.h @@ -0,0 +1,68 @@ +#pragma once + +#include "Client_Define.h" +#include "PanelObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CAction_Panel final : public CPanelObject +{ +private: + CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CAction_Panel(const CAction_Panel& rhs); + virtual ~CAction_Panel() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + void Magic_Meter_Visible(_uint iIndex, _bool bVisible); + void Magic_Meter_UV(); + void Matic_Meter_Move(); +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Ready_Element(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _float2 m_vMagic_MeterUV[5] = {}; + _uint m_iMagic_Meter_Count{}; + + CGameObject* m_pSpell_Slot = { nullptr }; + CGameObject* m_pSpell_Overlay = { nullptr }; + CGameObject* m_pSlot_Number = { nullptr }; + CGameObject* m_pHpBarBG = { nullptr }; + CGameObject* m_pMagic_Meter1 = { nullptr }; + CGameObject* m_pMagic_Meter2 = { nullptr }; + CGameObject* m_pMagic_Meter3 = { nullptr }; + CGameObject* m_pMagic_Meter4 = { nullptr }; + CGameObject* m_pMagic_Meter5 = { nullptr }; + CGameObject* m_pMagic_Icon = { nullptr }; + CGameObject* m_pSpell_UI = { nullptr }; + CGameObject* m_pPotion = { nullptr }; + CGameObject* m_pMagic_Item = { nullptr }; + +public: + static CAction_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index b015a18db..7a17c55df 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -14,7 +14,8 @@ 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, 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, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; enum class SKILL_TYPE { JAP, BOMBARD, DESCENDO, PROTEGO, END }; diff --git a/Jusin154_Team3D/Client/Public/Goblin.h b/Jusin154_Team3D/Client/Public/Goblin.h index 4769da3e5..05a575185 100644 --- a/Jusin154_Team3D/Client/Public/Goblin.h +++ b/Jusin154_Team3D/Client/Public/Goblin.h @@ -26,6 +26,7 @@ class CGoblin final : public CMonster CCharacter_Controller* m_pCharacter_Controller = { nullptr }; CRigidBody_Dynamic* m_pRigidBody = { nullptr }; + _uint iIndex; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/HpBarBG.h b/Jusin154_Team3D/Client/Public/HpBarBG.h new file mode 100644 index 000000000..f38f8c751 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/HpBarBG.h @@ -0,0 +1,64 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CHpBarBG final : public CElementObject +{ +private: + CHpBarBG(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CHpBarBG(const CHpBarBG& rhs); + virtual ~CHpBarBG() = 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 Lerp_PosX(_float X) override; + +public: + void Heal(_float fTimeDelta); + void Hit(_float fTimeDelta); + virtual void SizeUpX(_float SizeX) 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 }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _float m_fBlinkTime{}; + _float m_fMaxHp{}; + _float m_fCurrentHp{}; + _float m_fHpBar{}; + _float m_fDamage{}; + _float m_fTargetHp{}; + _float2 m_fHpBG{}; + _float2 m_fHpBGPos{}; + _float2 m_fHpBGSize{}; +public: + static CHpBarBG* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/LoadingWidget.h b/Jusin154_Team3D/Client/Public/LoadingWidget.h index bf53b9206..a140629f1 100644 --- a/Jusin154_Team3D/Client/Public/LoadingWidget.h +++ b/Jusin154_Team3D/Client/Public/LoadingWidget.h @@ -3,6 +3,12 @@ #include "Client_Define.h" #include "ElementObject.h" +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + NS_BEGIN(Client) class CLoadingWidget final : public CElementObject @@ -38,7 +44,9 @@ class CLoadingWidget final : public CElementObject static CLoadingWidget* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; virtual void Free() override; +#ifdef _DEBUG void Describe_Entity() override; +#endif // _DEBUG }; NS_END diff --git a/Jusin154_Team3D/Client/Public/LoadingWidget_Flame.h b/Jusin154_Team3D/Client/Public/LoadingWidget_Flame.h new file mode 100644 index 000000000..c3e8d2333 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/LoadingWidget_Flame.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CLoadingWidget_Flame final : public CElementObject +{ +private: + CLoadingWidget_Flame(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CLoadingWidget_Flame(const CLoadingWidget_Flame& rhs); + virtual ~CLoadingWidget_Flame() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _int m_iImageFrameX{}; + _int m_iImageFrameY{}; + _float m_fFrame{}; + +public: + static CLoadingWidget_Flame* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Loading_Panel.h b/Jusin154_Team3D/Client/Public/Loading_Panel.h index f1b195fde..49e3d40de 100644 --- a/Jusin154_Team3D/Client/Public/Loading_Panel.h +++ b/Jusin154_Team3D/Client/Public/Loading_Panel.h @@ -40,7 +40,9 @@ class CLoading_Panel final : public CPanelObject static CLoading_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; virtual void Free() override; +#ifdef _DEBUG void Describe_Entity() override; +#endif // _DEBUG }; NS_END diff --git a/Jusin154_Team3D/Client/Public/Magic_Icon.h b/Jusin154_Team3D/Client/Public/Magic_Icon.h new file mode 100644 index 000000000..298697a48 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Magic_Icon.h @@ -0,0 +1,51 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CMagic_Icon final : public CElementObject +{ +private: + CMagic_Icon(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMagic_Icon(const CMagic_Icon& rhs); + virtual ~CMagic_Icon() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CMagic_Icon* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Magic_Item.h b/Jusin154_Team3D/Client/Public/Magic_Item.h new file mode 100644 index 000000000..88421e214 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Magic_Item.h @@ -0,0 +1,62 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CMagic_Item final : public CElementObject +{ +private: + CMagic_Item(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMagic_Item(const CMagic_Item& rhs); + virtual ~CMagic_Item() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + void Compute_UV(_uint iItemID); + void Compute_Image(); +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_Rect* m_pVIBufferCom = { nullptr }; + + _float4 m_vUV{}; + _uint m_iArratCount{}; + _float2 m_vImageSize1 = {}; + _float2 m_vImagePos1 = {}; + _float2 m_vImageSize2 = {}; + _float2 m_vImagePos2 = {}; +public: + static CMagic_Item* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Magic_Meter.h b/Jusin154_Team3D/Client/Public/Magic_Meter.h new file mode 100644 index 000000000..29818638a --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Magic_Meter.h @@ -0,0 +1,59 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CMagic_Meter final : public CElementObject +{ +private: + CMagic_Meter(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMagic_Meter(const CMagic_Meter& rhs); + virtual ~CMagic_Meter() = 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; + +public: + void Meter_Index(_uint Number); + //void Set_ + +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_Rect* m_pVIBufferCom = { nullptr }; + + _uint m_iImageCount{}; + _float4 m_vGaugeUV{}; + _float m_fMaxGauge{}; + _float m_fCurrentGauge{}; + _float m_fGaugeBar{}; + _float m_fTargetGauge{}; +public: + static CMagic_Meter* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/MiniMap_Panel.h b/Jusin154_Team3D/Client/Public/MiniMap_Panel.h new file mode 100644 index 000000000..79381c49c --- /dev/null +++ b/Jusin154_Team3D/Client/Public/MiniMap_Panel.h @@ -0,0 +1,50 @@ +#pragma once + +#include "Client_Define.h" +#include "PanelObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CMiniMap_Panel final : public CPanelObject +{ +private: + CMiniMap_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMiniMap_Panel(const CMiniMap_Panel& rhs); + virtual ~CMiniMap_Panel() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Ready_Element(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + CGameObject* m_pMiniMap_TrimBorder = { nullptr }; + CGameObject* m_pNoMountIcon = { nullptr }; + + +public: + static CMiniMap_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Mission_KeyHold.h b/Jusin154_Team3D/Client/Public/MiniMap_TrimBorder.h similarity index 62% rename from Jusin154_Team3D/Editor/Public/Mission_KeyHold.h rename to Jusin154_Team3D/Client/Public/MiniMap_TrimBorder.h index 360e4af86..de0a7da6e 100644 --- a/Jusin154_Team3D/Editor/Public/Mission_KeyHold.h +++ b/Jusin154_Team3D/Client/Public/MiniMap_TrimBorder.h @@ -1,16 +1,22 @@ #pragma once -#include "Editor_Define.h" +#include "Client_Define.h" #include "ElementObject.h" -NS_BEGIN(Editor) +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END -class CMission_KeyHold final : public CElementObject +NS_BEGIN(Client) + +class CMiniMap_TrimBorder final : public CElementObject { private: - CMission_KeyHold(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - CMission_KeyHold(const CMission_KeyHold& rhs); - virtual ~CMission_KeyHold() = default; + CMiniMap_TrimBorder(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMiniMap_TrimBorder(const CMiniMap_TrimBorder& rhs); + virtual ~CMiniMap_TrimBorder() = default; public: virtual void Priority_Update(_float fTimeDelta); @@ -31,14 +37,14 @@ class CMission_KeyHold final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; - _float m_fPI{}; - _bool m_bisHoldOn = { false }; - _bool m_bKeyHold = { false }; + public: - static CMission_KeyHold* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + static CMiniMap_TrimBorder* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; virtual void Free() override; +#ifdef _DEBUG void Describe_Entity() override; +#endif // _DEBUG }; NS_END diff --git a/Jusin154_Team3D/Client/Public/Mission_Panel.h b/Jusin154_Team3D/Client/Public/Mission_Panel.h new file mode 100644 index 000000000..2c44c31b6 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Mission_Panel.h @@ -0,0 +1,50 @@ +#pragma once + +#include "Client_Define.h" +#include "PanelObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CMission_Panel final : public CPanelObject +{ +private: + CMission_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMission_Panel(const CMission_Panel& rhs); + virtual ~CMission_Panel() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Ready_Element(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + CGameObject* m_pMissionBanner_Border = { nullptr }; + CGameObject* m_pMissionBanner_Key = { nullptr }; + CGameObject* m_pMission_KeyHold = { nullptr }; + CGameObject* m_pMission_Key = { nullptr }; + CGameObject* m_pActive_Icon = { nullptr }; + +public: + static CMission_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Mission_Key.h b/Jusin154_Team3D/Client/Public/NoMountIcon.h similarity index 67% rename from Jusin154_Team3D/Editor/Public/Mission_Key.h rename to Jusin154_Team3D/Client/Public/NoMountIcon.h index 662205cf4..c92fe7efa 100644 --- a/Jusin154_Team3D/Editor/Public/Mission_Key.h +++ b/Jusin154_Team3D/Client/Public/NoMountIcon.h @@ -1,16 +1,22 @@ #pragma once -#include "Editor_Define.h" +#include "Client_Define.h" #include "ElementObject.h" -NS_BEGIN(Editor) +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END -class CMission_Key final : public CElementObject +NS_BEGIN(Client) + +class CNoMountIcon final : public CElementObject { private: - CMission_Key(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - CMission_Key(const CMission_Key& rhs); - virtual ~CMission_Key() = default; + CNoMountIcon(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CNoMountIcon(const CNoMountIcon& rhs); + virtual ~CNoMountIcon() = default; public: virtual void Priority_Update(_float fTimeDelta); @@ -20,9 +26,6 @@ class CMission_Key final : public CElementObject virtual _vector Get_WorldPostion() override; -private: - _float4 AlphabetUV(_tchar Alphabet); - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -34,12 +37,14 @@ class CMission_Key final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; - _float4 m_vUV{}; + public: - static CMission_Key* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + static CNoMountIcon* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; virtual void Free() override; +#ifdef _DEBUG void Describe_Entity() override; +#endif // _DEBUG }; NS_END diff --git a/Jusin154_Team3D/Client/Public/Potion.h b/Jusin154_Team3D/Client/Public/Potion.h new file mode 100644 index 000000000..80231f230 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Potion.h @@ -0,0 +1,54 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CPotion final : public CElementObject +{ +private: + CPotion(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CPotion(const CPotion& rhs); + virtual ~CPotion() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CTexture* m_pDiffuse_TextureCom4 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _float2 m_vImageSlotPos{}; + _float2 m_vImageSize{}; +public: + static CPotion* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Slot_Number.h b/Jusin154_Team3D/Client/Public/Slot_Number.h new file mode 100644 index 000000000..0d30e7301 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Slot_Number.h @@ -0,0 +1,61 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSlot_Number final : public CElementObject +{ +private: + CSlot_Number(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSlot_Number(const CSlot_Number& rhs); + virtual ~CSlot_Number() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + void UV(); + _float2 Meter_Index(_uint Numver); + _float2 Compute_UVY(_uint Numver); + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + CVIBuffer_UI_Instance::UI_ATLAS_DESC pUVDesc[4]; + + _float2 m_fIamge_Size{}; + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSlot_Number* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Spell_Overlay.h b/Jusin154_Team3D/Client/Public/Spell_Overlay.h new file mode 100644 index 000000000..ae3ce440e --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Overlay.h @@ -0,0 +1,59 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Overlay final : public CElementObject +{ +private: + CSpell_Overlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Overlay(const CSpell_Overlay& rhs); + virtual ~CSpell_Overlay() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + void Compute_UI(_uint SpellID); + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _int m_iImageFrameX{}; + _int m_iImageFrameY{}; + _float m_fFrame{}; + _float4 m_vUV{}; + +public: + static CSpell_Overlay* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Spell_Slot.h b/Jusin154_Team3D/Client/Public/Spell_Slot.h new file mode 100644 index 000000000..8f3d25ebf --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Slot.h @@ -0,0 +1,57 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Slot final : public CElementObject +{ +private: + CSpell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Slot(const CSpell_Slot& rhs); + virtual ~CSpell_Slot() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + 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_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Spell_UI.h b/Jusin154_Team3D/Client/Public/Spell_UI.h new file mode 100644 index 000000000..310dbb123 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_UI.h @@ -0,0 +1,58 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_UI final : public CElementObject +{ +private: + CSpell_UI(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_UI(const CSpell_UI& rhs); + virtual ~CSpell_UI() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + _float4 Alphabet_UV(_tchar Alphabet); + _float4 Image_UV(_uint Index); + void Set_ImagePos(); +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _float2 m_vUV[4]; + _float4 m_vImageUV[4]; + +public: + static CSpell_UI* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index cd43fbd4d..1aee12e67 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -15,7 +15,6 @@ float g_fPI; float g_fFar; float g_fBlinkTime; float g_fTime; -float g_fTimeMult; float g_fFrame; float g_fDeltaU; float g_fDeltaV; @@ -45,6 +44,10 @@ float2 g_fPosition[4]; float2 g_fImageSizes[4]; float4 g_fImagesUV[4]; +float4 g_fImageSipos1; +float4 g_fImageSipos2; +float4 g_fImageSipos3; + Texture2D g_Texture; Texture2D g_Texture1; Texture2D g_Texture2; @@ -190,24 +193,70 @@ PS_OUT PS_Key_Hold_Rotation(PS_IN In) PS_OUT Out; float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; - float2 uv = In.vTexcoord; - - float4 tex = g_Texture.Sample(DefaultSampler, uv); - - float2 center = float2(0.5f, 0.5f); - float2 dir = uv - center; - - float angle = atan2(dir.x, -dir.y); - if (angle < 0) - angle += g_fPI; - - float rotation = saturate(g_fTime * g_fTimeMult) * g_fPI; - - tex.rgb = (angle <= rotation) ? 1.0 : tex.rgb; - - tex.a *= Alpha; + float4 Color = float4(1.f, 1.f, 1.f, 1.f); - Out.vColor = tex; + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + Color = tex1; + + 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 tex2 = g_Texture1.Sample(ClampSampler, Imagelocal); + if (inside1) + { + float2 center = float2(0.5f, 0.5f); + float2 dir = Imagelocal - center; + + float angle = atan2(dir.x, -dir.y); + if (angle < 0) + angle += g_fPI; + + float rotation = saturate(g_fTime) * g_fPI; + + tex2.rgb = (angle <= rotation) ? 1.0 : tex2.rgb; + + + Color = lerp(Color, tex2, tex2.a); + } + + + + float2 Imagetexpos2 = g_fImageSipos2.xy / g_fCurrent_Size; + float2 Imagetexsize2 = g_fImageSipos2.zw / g_fCurrent_Size; + float2 Imagelocal2 = (In.vTexcoord - Imagetexpos2) / Imagetexsize2; + bool inside2 = all(Imagelocal2 >= 0.0f && Imagelocal2 <= 1.0f); + if (inside2) + { + float2 atlasUV = g_fImageUV.xy + Imagelocal2 * (g_fImageUV.zw - g_fImageUV.xy); + float2 safeUV = saturate(atlasUV); + float4 tex3 = g_Texture2.Sample(ClampSampler, safeUV); + Color = lerp(Color, tex3, tex3.a); + } + + float2 Imagetexpos3 = g_fImageSipos3.xy / g_fCurrent_Size; + float2 Imagetexsize3 = g_fImageSipos3.zw / g_fCurrent_Size; + float2 Imagelocal3 = (In.vTexcoord - Imagetexpos3) / Imagetexsize3; + bool inside3 = all(Imagelocal3 >= 0.0f && Imagelocal3 <= 1.0f); + if (inside3) + { + float3 QuestColor = float3(253.f, 207.f, 11.f) / 255.f; + + float4 tex4 = g_Texture3.Sample(ClampSampler, Imagelocal3); + + if (g_iQuestType == 0) + { + + tex4.rgb *= QuestColor; + + } + + Color = lerp(Color, tex4, tex4.a); + } + + Color.a *= Alpha; + + Out.vColor = Color; return Out; } @@ -481,7 +530,7 @@ PS_OUT PS_SpellAnim(PS_IN In) float2 OverrayUV = In.vTexcoord; float CoolTime = 1.f - g_fDeltaV; - float CoolTime2 = 1.f - g_fDeltaV + 0.05; + float CoolTime2 = 1.f - g_fDeltaV + 0.1f; atlasUV = startUV + In.vTexcoord * (endUV - startUV); float4 tex3 = g_Texture1.Sample(ClampSampler, OverrayUV); tex3.rgb *= BGColor; @@ -492,21 +541,25 @@ PS_OUT PS_SpellAnim(PS_IN In) color1 = tex3; - float wave1 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 0.01f; - float wave2 = sin(OverrayUV.x * 10.f + g_fTime * 2.f) * 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)); + waveUV = saturate(waveUV); + float tex5 = g_Texture3.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) * tex5 * g_fDeltaU; } } - if (OverrayUV.y <= CoolTime) + float waveThreshold = CoolTime + wave1; + + if (OverrayUV.y <= waveThreshold) { color1.a = 0.f; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_PointFlame.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_PointFlame.png new file mode 100644 index 000000000..06170a5c3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_PointFlame.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Cursor/UI_T_AimLockReticle_02.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Cursor/UI_T_AimLockReticle_02.png new file mode 100644 index 000000000..a27e1fc56 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Cursor/UI_T_AimLockReticle_02.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Cursor/UI_T_AimReticleBase.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Cursor/UI_T_AimReticleBase.png new file mode 100644 index 000000000..88f05ef5e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Cursor/UI_T_AimReticleBase.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Cursor/UI_T_AimReticlePulse.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Cursor/UI_T_AimReticlePulse.png new file mode 100644 index 000000000..60d736aed Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Cursor/UI_T_AimReticlePulse.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_ItemBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_ItemBack.png new file mode 100644 index 000000000..05a72bd53 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_ItemBack.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_RaySpike.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_RaySpike.png new file mode 100644 index 000000000..4a176d26a Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_RaySpike.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_Selected.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_Selected.png new file mode 100644 index 000000000..f3fc01b43 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_Selected.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_background.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_background.png new file mode 100644 index 000000000..3444ee544 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/GadgetWheel/UI_T_GadgetWheel_background.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_ConjurationHUDPanelBack.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Mission/UI_T_ConjurationHUDPanelBack.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/UI_T_ConjurationHUDPanelBack.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/Mission/UI_T_ConjurationHUDPanelBack.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png new file mode 100644 index 000000000..bd3c9cea3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_ActionDiamondTriggerBack_4K.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_ActionDiamondTriggerBack_4K.png new file mode 100644 index 000000000..8d5b64250 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_ActionDiamondTriggerBack_4K.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_ActionItemBG.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_ActionItemBG.png new file mode 100644 index 000000000..5ac6148a8 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_ActionItemBG.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_tillingSmokes.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_tillingSmokes.png new file mode 100644 index 000000000..6b4026e84 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/UI_T_tillingSmokes.png differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index dc6ef7eb1..97c92149b 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -166,7 +166,7 @@ - + @@ -215,6 +215,7 @@ + @@ -249,6 +250,8 @@ + + @@ -286,11 +289,8 @@ - - - @@ -304,7 +304,7 @@ - + @@ -354,6 +354,7 @@ + @@ -389,6 +390,8 @@ + + @@ -423,11 +426,8 @@ - - - diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index ab7fb694c..741323ffe 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -100,24 +100,12 @@ {b652ee5a-69ca-4c85-8c6c-def398a4dd23} - - {887de1c6-ada2-4dc8-be5c-bcef4213e3b6} - - - {3804137e-7af7-40db-b729-8afa81035b35} - {f897068c-184a-4bb2-a4fb-e74ec1877b02} - - {d1c99bb3-369e-49b9-93f9-6b8536579cb5} - {5da34159-e4a2-4b4b-a7a0-a65966579e2f} - - {977fe4d3-c3b5-413c-80fe-777ece19453e} - {61a808c7-2765-42d9-8b4c-b4bed93b013e} @@ -388,6 +376,18 @@ {c0589f6e-ed9c-4e76-8df2-4f95ce3c7b9a} + + {a54567fa-e528-4c98-a605-289d7d300029} + + + {612b0d39-53e3-4c8c-a32e-387b0d3b128c} + + + {d9a965e7-77c6-450f-88e8-ef69c42d9053} + + + {c7b1ffc6-548f-464c-8f19-8b6ff5913b06} + @@ -477,15 +477,6 @@ 50.UI\GamePlay_Canvas\Loding_Panel\LoadingWidget - - 50.UI\GamePlay_Canvas\Mission_Panel\Mission_Key - - - 50.UI\GamePlay_Canvas\Mission_Panel\MissionBanner_Border - - - 50.UI\GamePlay_Canvas\Mission_Panel\Mission_KeyHold - 50.UI\GamePlay_Canvas\Mission_Panel\MissionBanner_Key @@ -495,9 +486,6 @@ 50.UI\GamePlay_Canvas\MiniMap_Panel\MiniMap_TrimBorder - - 50.UI\GamePlay_Canvas\Mission_Panel\Active_Icon - 50.UI\IMGUIUI @@ -756,6 +744,18 @@ 02.GameObjects\Layer_Effect\EffectPool + + 50.UI\GamePlay_Canvas\Mission_Panel\MissionBanner_Border + + + 50.UI\Spell_Canvas + + + 50.UI\Spell_Canvas\Spell_Panel + + + 50.UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + @@ -826,15 +826,6 @@ 50.UI\GamePlay_Canvas\Loding_Panel\LoadingWidget - - 50.UI\GamePlay_Canvas\Mission_Panel\Mission_Key - - - 50.UI\GamePlay_Canvas\Mission_Panel\MissionBanner_Border - - - 50.UI\GamePlay_Canvas\Mission_Panel\Mission_KeyHold - 50.UI\GamePlay_Canvas\Mission_Panel\MissionBanner_Key @@ -844,9 +835,6 @@ 50.UI\GamePlay_Canvas\MiniMap_Panel\MiniMap_TrimBorder - - 50.UI\GamePlay_Canvas\Mission_Panel\Active_Icon - 50.UI\IMGUIUI @@ -1123,6 +1111,18 @@ 02.GameObjects\Layer_Effect\EffectPool + + 50.UI\GamePlay_Canvas\Mission_Panel\MissionBanner_Border + + + 50.UI\Spell_Canvas + + + 50.UI\Spell_Canvas\Spell_Panel + + + 50.UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + diff --git a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp index 0954840ab..ea6164263 100644 --- a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp @@ -50,11 +50,7 @@ HRESULT CAction_Panel::Initialize(void* pArg) return E_FAIL; } - m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; - m_fOwnerAlpha = 1.f; - m_fCanvasAlpha = 1.f; + Magic_Meter_UV(); Magic_Meter_Visible(1, true); Magic_Meter_Visible(5, true); @@ -99,19 +95,6 @@ void CAction_Panel::Late_Update(_float fTimeDelta) HRESULT CAction_Panel::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; } @@ -193,38 +176,6 @@ void CAction_Panel::Matic_Meter_Move() HRESULT CAction_Panel::Bind_ShaderResources() { - if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) - { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) - { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) - { - return E_FAIL; - } - if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) - { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) - { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) - { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) - { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) - { - return E_FAIL; - } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp new file mode 100644 index 000000000..5e22856f8 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp @@ -0,0 +1,253 @@ +#include "pch.h" +#include "Current_Spell_Slot.h" +#include "GameInstance.h" + +CCurrent_Spell_Slot::CCurrent_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CCurrent_Spell_Slot::CCurrent_Spell_Slot(const CCurrent_Spell_Slot& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CCurrent_Spell_Slot::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCurrent_Spell_Slot::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_fAngle = XMConvertToRadians(45); + m_fAlphaTime = 1.f; + m_fOffSetX = 105.f; + m_fOffSetY = 150.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-780.f, -110.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(); + return S_OK; +} + +void CCurrent_Spell_Slot::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CCurrent_Spell_Slot::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CCurrent_Spell_Slot::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CCurrent_Spell_Slot::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CCurrent_Spell_Slot::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CCurrent_Spell_Slot::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CCurrent_Spell_Slot::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CCurrent_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CCurrent_Spell_Slot::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 CCurrent_Spell_Slot::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Current_Spell_Slot"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), 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; +} + +CCurrent_Spell_Slot* CCurrent_Spell_Slot::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCurrent_Spell_Slot* pInstance = new CCurrent_Spell_Slot(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCurrent_Spell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CCurrent_Spell_Slot::Clone(void* pArg, CGameObject* pOwner) +{ + CCurrent_Spell_Slot* pInstance = new CCurrent_Spell_Slot(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCurrent_Spell_Slot::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CCurrent_Spell_Slot::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp b/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp index 95b43e007..92bceea98 100644 --- a/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp +++ b/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp @@ -44,7 +44,6 @@ HRESULT CGamePlay_Canvas::Initialize(void* pArg) { return E_FAIL; } - return S_OK; } @@ -61,9 +60,6 @@ void CGamePlay_Canvas::Update(_float fTimeDelta) void CGamePlay_Canvas::Late_Update(_float fTimeDelta) { if (m_bVisible) { - if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { - m_pGameInstance->Add_RenderGroup(RENDER::UI, this); - } } __super::Late_Update(fTimeDelta); } @@ -156,7 +152,6 @@ void CGamePlay_Canvas::Free() { __super::Free(); - SAFE_RELEASE(m_pLoading_Panel); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/HpBarBG.cpp b/Jusin154_Team3D/Editor/Private/HpBarBG.cpp index d65652395..8af4488ab 100644 --- a/Jusin154_Team3D/Editor/Private/HpBarBG.cpp +++ b/Jusin154_Team3D/Editor/Private/HpBarBG.cpp @@ -41,7 +41,7 @@ HRESULT CHpBarBG::Initialize(void* pArg) m_fAlpha = 1.f; m_fAlphaTime = 1.f; m_vNine_Slice = _float4(27.f, 125.f, m_fSizeY * 0.5f, m_fSizeY * 0.5f); - m_fMaxHp = 1000.f; + m_fMaxHp = 200.f; m_fCurrentHp = m_fMaxHp; m_fMoveSpeed = 5.f; m_fHpBGSize = _float2(144.f, 24.f); diff --git a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp index 0b731a6f6..42977a5f6 100644 --- a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp +++ b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp @@ -2,6 +2,7 @@ #include "IMGUIUI.h" #include "UIObject.h" #include "GamePlay_Canvas.h" +#include "Spell_Canvas.h" #include "PanelObject.h" #include "ElementObject.h" #include "Mouse_Cursor.h" @@ -25,6 +26,9 @@ HRESULT CIMGUIUI::Initialize(void* pArg) { if (FAILED(Ready_Components(pArg))) return E_FAIL; + + m_pCurrent_Canvas = m_pGamePlay_Canvas; + return S_OK; } @@ -100,11 +104,11 @@ void CIMGUIUI::Update(_float fTimeDelta) { static const char* SpellTypeNames[] = { "CONTROL","POWER", "DAMAGE","UTILITY", "TRANSFORM", "CURSE", "ESSENTIAL" }; int itemCount = sizeof(SpellTypeNames) / sizeof(const char*); - if (m_pGamePlay_Canvas != nullptr) + static const char* CanvasNames[] = { "GamePlay Canvas", "Spell Canvas" }; + static int iCanvasIndex = 0; + if (m_pCurrent_Canvas != nullptr) { - m_fCanvasAlpha = static_cast(m_pGamePlay_Canvas)->Get_Alpha(); - - + m_fCanvasAlpha = static_cast(m_pCurrent_Canvas)->Get_Alpha(); } if (m_pPanelObject != nullptr) { @@ -153,31 +157,41 @@ void CIMGUIUI::Update(_float fTimeDelta) m_fCoolTime = static_cast(m_pElementObject)->Get_CoolTime(); } GUI::Begin("Current_PanelObject_Info"); - if (m_pGamePlay_Canvas != nullptr) + if (m_pCurrent_Canvas != nullptr) { - if (m_pGamePlay_Canvas != nullptr) + if (GUI::Combo("Canvas", &iCanvasIndex, CanvasNames, 2)) { - m_bCanvasVisible = static_cast(m_pGamePlay_Canvas)->Get_Visible(); - auto panelNames = static_cast(m_pGamePlay_Canvas)->Panel_Name(); + if (iCanvasIndex == 0) + m_pCurrent_Canvas = m_pGamePlay_Canvas; + else + m_pCurrent_Canvas = m_pSpell_Canvas; + } + } + if (m_pCurrent_Canvas != nullptr) + { + if (m_pCurrent_Canvas != nullptr) + { + m_bCanvasVisible = static_cast(m_pCurrent_Canvas)->Get_Visible(); + auto panelNames = static_cast(m_pCurrent_Canvas)->Panel_Name(); if (panelNames != m_iPanelNamewstring) { PanelwstringTostring(panelNames); } if (GUI::Combo("Panels", &m_iPanelCount, m_iPanelName.data(), static_cast<_int>(m_iPanelName.size()))) { - m_pPanelObject = static_cast(m_pGamePlay_Canvas)->Get_Panel(m_iPanelNamewstring[m_iPanelCount]); + m_pPanelObject = static_cast(m_pCurrent_Canvas)->Get_Panel(m_iPanelNamewstring[m_iPanelCount]); } if (GUI::Checkbox("Canvas Active", &m_bCanvasVisible)) { - static_cast(m_pGamePlay_Canvas)->Visible(m_bCanvasVisible); + static_cast(m_pCurrent_Canvas)->Visible(m_bCanvasVisible); } if (GUI::Button("CanvasFadeIn")) { - static_cast(m_pGamePlay_Canvas)->Set_FadeIn(); + static_cast(m_pCurrent_Canvas)->Set_FadeIn(); } if (GUI::Button("CanvasFadeOut")) { - static_cast(m_pGamePlay_Canvas)->Set_FadeOut(); + static_cast(m_pCurrent_Canvas)->Set_FadeOut(); } GUI::Text("PanelAlph : %.1f", m_fCanvasAlpha); @@ -458,6 +472,11 @@ HRESULT CIMGUIUI::Ready_Components(void* pArg) return E_FAIL; } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Canvas)))) + { + return E_FAIL; + } + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 48bb2791b..160b367c4 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -42,11 +42,8 @@ #include "MissionBanner_Border.h" #include "MissionBanner_Key.h" #include "Mission_Icon.h" -#include "Mission_Key.h" -#include "Mission_KeyHold.h" #include "Mouse_Cursor.h" #include "MiniMap_TrimBorder.h" -#include "Active_Icon.h" #include "MiniMap_Panel.h" #include "NoMountIcon.h" @@ -66,6 +63,10 @@ #include "Spell_UI.h" #include "Magic_Item.h" +#include "Spell_Canvas.h" +#include "Spell_Panel.h" +#include "Current_Spell_Slot.h" + #include "IMGUIUI.h" #pragma endregion @@ -333,6 +334,22 @@ HRESULT CLoader::Loading_For_UI() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/SpellWidget", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) + { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; @@ -482,11 +499,20 @@ HRESULT CLoader::Loading_For_UI() SpellSlotUIDesc.iNum = 4; - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Instance"), + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_Slot"), CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &SpellSlotUIDesc)))) { return E_FAIL; } + CVIBuffer_UI_Instance::UI_INSTANCE_DESC CurrentSpellSlotUIDesc{}; + + CurrentSpellSlotUIDesc.iNum = 16; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Current_Spell_Slot"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &CurrentSpellSlotUIDesc)))) { + return E_FAIL; + } + CVIBuffer_UI_Instance::UI_INSTANCE_DESC SlotNumberUIDesc{}; SlotNumberUIDesc.iNum = 4; @@ -507,7 +533,7 @@ HRESULT CLoader::Loading_For_UI() CVIBuffer_UI_Instance::UI_INSTANCE_DESC Spell_Slot_PreviewDesc{}; - Spell_Slot_PreviewDesc.iNum = 5; + Spell_Slot_PreviewDesc.iNum = 4; if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Spell_Slot_Previe_UI_Instance"), CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Spell_Slot_PreviewDesc)))) { @@ -570,18 +596,6 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMission_Key::Create(m_pDevice, m_pContext)))) - { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMission_KeyHold::Create(m_pDevice, m_pContext)))) - { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CActive_Icon::Create(m_pDevice, m_pContext)))) - { - return E_FAIL; - } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMiniMap_Panel::Create(m_pDevice, m_pContext)))) { @@ -638,6 +652,19 @@ HRESULT CLoader::Loading_For_UI() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Canvas::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Panel::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCurrent_Spell_Slot::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CIMGUIUI::Create(m_pDevice, m_pContext)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Magic_Item.cpp b/Jusin154_Team3D/Editor/Private/Magic_Item.cpp index e2da15982..b2a9664e9 100644 --- a/Jusin154_Team3D/Editor/Private/Magic_Item.cpp +++ b/Jusin154_Team3D/Editor/Private/Magic_Item.cpp @@ -22,7 +22,7 @@ HRESULT CMagic_Item::Initialize(void* pArg) CUIObject::UIOBJECT_DESC Desc{}; Desc.fX = -800.f; - Desc.fY = 100.f; + Desc.fY = 70.f; Desc.fSizeX = 100.f; Desc.fSizeY = 100.f; diff --git a/Jusin154_Team3D/Editor/Private/MiniMap_Panel.cpp b/Jusin154_Team3D/Editor/Private/MiniMap_Panel.cpp index 4d5481ed6..e2a9a1ef2 100644 --- a/Jusin154_Team3D/Editor/Private/MiniMap_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/MiniMap_Panel.cpp @@ -90,7 +90,6 @@ HRESULT CMiniMap_Panel::Bind_ShaderResources() HRESULT CMiniMap_Panel::Ready_Components(void* pArg) { - return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/MiniMap_TrimBorder.cpp b/Jusin154_Team3D/Editor/Private/MiniMap_TrimBorder.cpp index 3aafbe280..dc1a8a276 100644 --- a/Jusin154_Team3D/Editor/Private/MiniMap_TrimBorder.cpp +++ b/Jusin154_Team3D/Editor/Private/MiniMap_TrimBorder.cpp @@ -22,9 +22,9 @@ HRESULT CMiniMap_TrimBorder::Initialize(void* pArg) CUIObject::UIOBJECT_DESC Desc{}; Desc.fX = -20.f; - Desc.fY = 30; - Desc.fSizeX = 256.f; - Desc.fSizeY = 256.f; + Desc.fY = 0; + Desc.fSizeX = 290.f; + Desc.fSizeY = 290.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) }; diff --git a/Jusin154_Team3D/Editor/Private/MissionBanner_Border.cpp b/Jusin154_Team3D/Editor/Private/MissionBanner_Border.cpp index 0258e390e..1d67b69e9 100644 --- a/Jusin154_Team3D/Editor/Private/MissionBanner_Border.cpp +++ b/Jusin154_Team3D/Editor/Private/MissionBanner_Border.cpp @@ -26,7 +26,7 @@ HRESULT CMissionBanner_Border::Initialize(void* pArg) Desc.fX = -207.f; Desc.fY = 115.f; Desc.fSizeX = 256.f; - Desc.fSizeY = 175.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) }; diff --git a/Jusin154_Team3D/Editor/Private/MissionBanner_Key.cpp b/Jusin154_Team3D/Editor/Private/MissionBanner_Key.cpp index a0fa7faf5..8bb1b80f9 100644 --- a/Jusin154_Team3D/Editor/Private/MissionBanner_Key.cpp +++ b/Jusin154_Team3D/Editor/Private/MissionBanner_Key.cpp @@ -3,12 +3,12 @@ #include "GameInstance.h" CMissionBanner_Key::CMissionBanner_Key(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) - :CElementObject(pDevice, pContext) + :CElementObject(pDevice, pContext) { } CMissionBanner_Key::CMissionBanner_Key(const CMissionBanner_Key& rhs) - :CElementObject(rhs) + :CElementObject(rhs) { } @@ -37,12 +37,54 @@ HRESULT CMissionBanner_Key::Initialize(void* pArg) return E_FAIL; } - m_fTimeMult = 3.f; + m_fTimeMult = 1.f; m_fAlpha = 1.f; m_fAlphaTime = 3.f; + m_fPI = AI_MATH_TWO_PI_F; + Compute_UV(); + Compute_Alphabat('V'); + m_eType = QUESTYPE::MAIN; return S_OK; } +void CMissionBanner_Key::QuestType(QUESTYPE eType) +{ + m_eType = eType; +} + +void CMissionBanner_Key::Compute_Alphabat(_tchar Alphabet) +{ + _uint Number = CMyTools::AlphabetToInt(Alphabet); + + _float2 fImage_Size = { 320.f, 384.f }; + + _uint iXCount = 5; + _uint iYCount = 6; + + _float frameWidth = 64.f; + _float frameHeight = 64.f; + + _uint iframeX = Number % iXCount; + _uint iframeY = Number / iXCount; + + _float2 UVStart; + UVStart.x = iframeX * frameWidth / fImage_Size.x; + UVStart.y = iframeY * frameHeight / fImage_Size.y; + + _float2 UVEnd; + UVEnd.x = UVStart.x + (frameWidth / fImage_Size.x); + UVEnd.y = UVStart.y + (frameHeight / fImage_Size.y); + + m_vUV = _float4(UVStart.x, UVStart.y, UVEnd.x, UVEnd.y); +} + +void CMissionBanner_Key::Compute_UV() +{ + m_vKeyHold = _float4(-9.f, -9.f, 94.f, 94.f); + m_vKey = _float4(18.f, 18.5f, 40.f, 40.f); + m_vActive_Icon = _float4(80.f, 10.f, 36.f, 36.f); +} + void CMissionBanner_Key::Priority_Update(_float fTimeDelta) { if (!__super::Chack_Visible()) @@ -83,7 +125,39 @@ void CMissionBanner_Key::Update(_float fTimeDelta) } } - m_fTime += fTimeDelta * m_fTimeMult; + if (m_bKeyHold == false) + { + if (m_pGameInstance->Key_Pressing(DIK_V)) + { + m_fTime += fTimeDelta * (1.f / m_fTimeMult); + } + else + { + m_fTime = 0.f; + m_bKeyHold = false; + } + } + + if (m_pGameInstance->Key_Up(DIK_V)) + { + m_bKeyHold = false; + } + + if (m_fTime >= 1.f) + { + m_fTime = 0.f; + m_bisHoldOn = !m_bisHoldOn; + m_bKeyHold = true; + } + + if (m_bisHoldOn) + { + static_cast(m_pOwner)->Function_Callback(TEXT("Mission_On")); + } + else + { + static_cast(m_pOwner)->Function_Callback(TEXT("Mission_Off")); + } __super::Update(fTimeDelta); } @@ -94,7 +168,7 @@ void CMissionBanner_Key::Late_Update(_float fTimeDelta) return; } if (m_bVisible) { - m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); __super::Late_Update(fTimeDelta); } } @@ -104,7 +178,7 @@ HRESULT CMissionBanner_Key::Render() if (FAILED(Bind_ShaderResources())) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::HOLD_ROTATION)))) { return E_FAIL; } if (FAILED(m_pVIBufferCom->Bind_Resources())) { @@ -140,6 +214,18 @@ HRESULT CMissionBanner_Key::Bind_ShaderResources() { 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_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -148,6 +234,10 @@ HRESULT CMissionBanner_Key::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fPI", &m_fPI, sizeof(_float)))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) { return E_FAIL; @@ -160,6 +250,30 @@ HRESULT CMissionBanner_Key::Bind_ShaderResources() { 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_vKeyHold, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageSipos2", &m_vKey, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageSipos3", &m_vActive_Icon, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_iQuestType", &m_eType, sizeof(_uint)))) + { + return E_FAIL; + } return S_OK; } @@ -173,6 +287,18 @@ HRESULT CMissionBanner_Key::Ready_Components(void* pArg) { return E_FAIL; } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Finishi_Rect"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Keyboard"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("ActiveMission_Icon"), 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; @@ -211,6 +337,9 @@ void CMissionBanner_Key::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_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/Mission_Panel.cpp b/Jusin154_Team3D/Editor/Private/Mission_Panel.cpp index df5af310b..ec6e7a058 100644 --- a/Jusin154_Team3D/Editor/Private/Mission_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Mission_Panel.cpp @@ -1,9 +1,6 @@ #include "pch.h" #include "Mission_Panel.h" #include "GameInstance.h" -#include "Mission_KeyHold.h" -#include "Mission_Key.h" -#include "Active_Icon.h" #include "MissionBanner_Border.h" #include "MissionBanner_Key.h" @@ -27,7 +24,7 @@ HRESULT CMission_Panel::Initialize(void* pArg) CUIObject::UIOBJECT_DESC Desc{}; Desc.fX = 380.f; - Desc.fY = 612.f; + Desc.fY = 580.f; Desc.fSizeX = 750.f; Desc.fSizeY = 410.f; @@ -114,23 +111,6 @@ HRESULT CMission_Panel::Ready_Element(void* pArg) } Add_Element(TEXT("MissionBanner_Key"), m_pMissionBanner_Key); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMission_KeyHold)))) - { - return E_FAIL; - } - Add_Element(TEXT("Mission_KeyHold"), m_pMission_KeyHold); - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMission_Key)))) - { - return E_FAIL; - } - Add_Element(TEXT("Mission_Key"), m_pMission_Key); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pActive_Icon)))) - { - return E_FAIL; - } - Add_Element(TEXT("Active_Icon"), m_pActive_Icon); - return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/NoMountIcon.cpp b/Jusin154_Team3D/Editor/Private/NoMountIcon.cpp index ca641dad1..82d7eab8a 100644 --- a/Jusin154_Team3D/Editor/Private/NoMountIcon.cpp +++ b/Jusin154_Team3D/Editor/Private/NoMountIcon.cpp @@ -21,10 +21,10 @@ HRESULT CNoMountIcon::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 100.f; - Desc.fY = -55; - Desc.fSizeX = 50.f; - Desc.fSizeY = 50.f; + Desc.fX = 120.f; + Desc.fY = -90; + Desc.fSizeX = 65.f; + Desc.fSizeY = 65.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) }; diff --git a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp index c595674a8..3099589bb 100644 --- a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp +++ b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp @@ -44,7 +44,7 @@ HRESULT CSlot_Number::Initialize(void* pArg) m_iCols = 4; UV(); m_pVIBufferCom->Set_Cloned(true); - m_pVIBufferCom->Set_Pos(350.f, 30.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Pos(350.f, 10.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_pVIBufferCom->Set_ImageUV(pUVDesc); return S_OK; diff --git a/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp b/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp new file mode 100644 index 000000000..13d0525bd --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp @@ -0,0 +1,140 @@ +#include "pch.h" +#include "Spell_Canvas.h" +#include "GameInstance.h" +#include "Spell_Panel.h" + +CSpell_Canvas::CSpell_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CCanvasObject(pDevice, pContext) +{ +} + +CSpell_Canvas::CSpell_Canvas(const CSpell_Canvas& rhs) + :CCanvasObject(rhs) +{ +} + +HRESULT CSpell_Canvas::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Canvas::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 1920.f; + Desc.fSizeY = 1080.f; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Panel(pArg))) + { + return E_FAIL; + } + + return S_OK; +} + +void CSpell_Canvas::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Canvas::Update(_float fTimeDelta) +{ + __super::Update(fTimeDelta); +} + +void CSpell_Canvas::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_Canvas::Render() +{ + return S_OK; +} + +_vector CSpell_Canvas::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Canvas::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CSpell_Canvas::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpell_Canvas::Ready_Panel(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast (&m_pSpell_Panel)))) + { + return E_FAIL; + } + Add_Panel(TEXT("Spell_Panel"), m_pSpell_Panel); + return S_OK; +} + +void CSpell_Canvas::Clear_Penel() +{ + +} + +CSpell_Canvas* CSpell_Canvas::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Canvas* pInstance = new CSpell_Canvas(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Canvas"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Canvas::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Canvas* pInstance = new CSpell_Canvas(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Canvas"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Canvas::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Canvas::Describe_Entity() +{ +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp index 7b2fb303c..0b657c26f 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp @@ -22,9 +22,9 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) CUIObject::UIOBJECT_DESC Desc{}; Desc.fX = 380.f; - Desc.fY = 0.f; - Desc.fSizeX = 100.f; - Desc.fSizeY = 100.f; + Desc.fY = 30.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) }; @@ -44,6 +44,7 @@ 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 = 1.f; @@ -200,6 +201,10 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom3->Bind_ShaderResource(m_pShaderCom, "g_Texture3", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -240,6 +245,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; @@ -273,6 +282,10 @@ HRESULT CSpell_Overlay::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_TextureCom3), nullptr))) + { + return E_FAIL; + } if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) { return E_FAIL; @@ -314,6 +327,7 @@ void CSpell_Overlay::Free() SAFE_RELEASE(m_pDiffuse_TextureCom); SAFE_RELEASE(m_pDiffuse_TextureCom1); SAFE_RELEASE(m_pDiffuse_TextureCom2); + SAFE_RELEASE(m_pDiffuse_TextureCom3); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp new file mode 100644 index 000000000..40ad30251 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp @@ -0,0 +1,207 @@ +#include "pch.h" +#include "Spell_Panel.h" +#include "GameInstance.h" +#include "Current_Spell_Slot.h" + +CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPanelObject(pDevice, pContext) +{ +} + +CSpell_Panel::CSpell_Panel(const CSpell_Panel& rhs) + :CPanelObject(rhs) +{ +} + +HRESULT CSpell_Panel::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Panel::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 960.f; + Desc.fY = 540.f; + Desc.fSizeX = g_iWinSizeX; + Desc.fSizeY = g_iWinSizeY; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Element(pArg))) + { + return E_FAIL; + } + m_fCanvasAlpha = 1.f; + + return S_OK; +} + +void CSpell_Panel::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Panel::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + __super::Update(fTimeDelta); +} + +void CSpell_Panel::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpell_Panel::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_Panel::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Panel::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Panel::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Spell_Widget"), 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; +} + +HRESULT CSpell_Panel::Ready_Element(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pCurrent_Spell_Slot)))) + { + return E_FAIL; + } + Add_Element(TEXT("Current_Spell_Slot"), m_pCurrent_Spell_Slot); + + return S_OK; +} + +CSpell_Panel* CSpell_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Panel* pInstance = new CSpell_Panel(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Panel::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Panel* pInstance = new CSpell_Panel(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Panel::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Panel::Describe_Entity() +{ +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp index ab7432f97..ebe541b3d 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp @@ -23,8 +23,8 @@ HRESULT CSpell_Slot::Initialize(void* pArg) Desc.fX = 0.f; Desc.fY = 0.f; - Desc.fSizeX = 100.f; - Desc.fSizeY = 100.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) }; @@ -45,7 +45,7 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_fOffSetY = 101.f; m_iCols = 4; m_pVIBufferCom->Set_Cloned(true); - m_pVIBufferCom->Set_Pos(380.f, 0.f, m_fOffSetX, m_fOffSetY, m_iCols); + 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; @@ -197,7 +197,7 @@ HRESULT CSpell_Slot::Bind_ShaderResources() HRESULT CSpell_Slot::Ready_Components(void* pArg) { - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Instance"), (CComponent**)&m_pVIBufferCom, nullptr))) + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_Slot"), (CComponent**)&m_pVIBufferCom, nullptr))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp b/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp index 9820becb0..2a4986416 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Slot_Preview.cpp @@ -99,7 +99,7 @@ void CSpell_Slot_Preview::Late_Update(_float fTimeDelta) } if (m_bVisible) { - m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + //m_pGameInstance->Add_RenderGroup(RENDER::UI, this); } __super::Late_Update(fTimeDelta); } diff --git a/Jusin154_Team3D/Editor/Private/Spell_UI.cpp b/Jusin154_Team3D/Editor/Private/Spell_UI.cpp index f6f8fe911..7990e029e 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_UI.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_UI.cpp @@ -22,7 +22,7 @@ HRESULT CSpell_UI::Initialize(void* pArg) CUIObject::UIOBJECT_DESC Desc{}; Desc.fX = 650.f; - Desc.fY = -90.f; + Desc.fY = -60.f; Desc.fSizeX = 180.f; Desc.fSizeY = 50.f; diff --git a/Jusin154_Team3D/Editor/Public/Current_Spell_Slot.h b/Jusin154_Team3D/Editor/Public/Current_Spell_Slot.h new file mode 100644 index 000000000..4bba09fc0 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Current_Spell_Slot.h @@ -0,0 +1,49 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CCurrent_Spell_Slot final : public CElementObject +{ +private: + CCurrent_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCurrent_Spell_Slot(const CCurrent_Spell_Slot& rhs); + virtual ~CCurrent_Spell_Slot() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + 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 CCurrent_Spell_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index ad6cc1300..af57f3848 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -25,7 +25,7 @@ namespace Editor 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_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, END }; diff --git a/Jusin154_Team3D/Editor/Public/GamePlay_Canvas.h b/Jusin154_Team3D/Editor/Public/GamePlay_Canvas.h index 33353a99e..f879ea4e7 100644 --- a/Jusin154_Team3D/Editor/Public/GamePlay_Canvas.h +++ b/Jusin154_Team3D/Editor/Public/GamePlay_Canvas.h @@ -44,7 +44,9 @@ class CGamePlay_Canvas final : public CCanvasObject static CGamePlay_Canvas* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; virtual void Free() override; +#ifdef _DEBUG void Describe_Entity() override; +#endif // _DEBUG }; NS_END diff --git a/Jusin154_Team3D/Editor/Public/HpBarBG.h b/Jusin154_Team3D/Editor/Public/HpBarBG.h index 46c0162d8..63c7001c9 100644 --- a/Jusin154_Team3D/Editor/Public/HpBarBG.h +++ b/Jusin154_Team3D/Editor/Public/HpBarBG.h @@ -50,7 +50,9 @@ class CHpBarBG final : public CElementObject static CHpBarBG* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; virtual void Free() override; +#ifdef _DEBUG void Describe_Entity() override; +#endif // _DEBUG }; NS_END diff --git a/Jusin154_Team3D/Editor/Public/IMGUIUI.h b/Jusin154_Team3D/Editor/Public/IMGUIUI.h index 226a5b7c4..3b8461faf 100644 --- a/Jusin154_Team3D/Editor/Public/IMGUIUI.h +++ b/Jusin154_Team3D/Editor/Public/IMGUIUI.h @@ -35,6 +35,8 @@ class CIMGUIUI final : public CGameObject private: CGameObject* m_pGamePlay_Canvas = { nullptr }; + CGameObject* m_pSpell_Canvas = { nullptr }; + CGameObject* m_pCurrent_Canvas = { nullptr }; CGameObject* m_pPanelObject = { nullptr }; CGameObject* m_pElementObject = { nullptr }; _float2 m_fPos{}; @@ -92,7 +94,9 @@ class CIMGUIUI final : public CGameObject static CIMGUIUI* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; virtual void Free() override; +#ifdef _DEBUG void Describe_Entity() override; +#endif // _DEBUG }; NS_END diff --git a/Jusin154_Team3D/Editor/Public/MiniMap_Panel.h b/Jusin154_Team3D/Editor/Public/MiniMap_Panel.h index aa783559a..27cba9326 100644 --- a/Jusin154_Team3D/Editor/Public/MiniMap_Panel.h +++ b/Jusin154_Team3D/Editor/Public/MiniMap_Panel.h @@ -31,8 +31,6 @@ class CMiniMap_Panel final : public CPanelObject virtual HRESULT Initialize(void* pArg) override; private: - CTexture* m_pDiffuse_TextureCom = { nullptr }; - CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pMiniMap_TrimBorder = { nullptr }; CGameObject* m_pNoMountIcon = { nullptr }; @@ -42,7 +40,9 @@ class CMiniMap_Panel final : public CPanelObject static CMiniMap_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; virtual void Free() override; +#ifdef _DEBUG void Describe_Entity() override; +#endif // _DEBUG }; NS_END diff --git a/Jusin154_Team3D/Editor/Public/MissionBanner_Key.h b/Jusin154_Team3D/Editor/Public/MissionBanner_Key.h index 0880c295d..b28825909 100644 --- a/Jusin154_Team3D/Editor/Public/MissionBanner_Key.h +++ b/Jusin154_Team3D/Editor/Public/MissionBanner_Key.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Editor_Define.h" #include "ElementObject.h" @@ -26,11 +26,31 @@ class CMissionBanner_Key final : public CElementObject virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; +public: + void QuestType(QUESTYPE eType); + +private: + void Compute_UV(); + void Compute_Alphabat(_tchar Alphabet); + 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 }; + _float m_fPI{}; + _bool m_bisHoldOn = { false }; + _bool m_bKeyHold = { false }; + + _float4 m_vKeyHold{}; + _float4 m_vKey{}; + _float4 m_vUV{}; + _float4 m_vActive_Icon{}; + QUESTYPE m_eType = QUESTYPE::END; + public: static CMissionBanner_Key* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; @@ -38,4 +58,4 @@ class CMissionBanner_Key final : public CElementObject void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Mission_Panel.h b/Jusin154_Team3D/Editor/Public/Mission_Panel.h index aaf1e0291..6f9b23057 100644 --- a/Jusin154_Team3D/Editor/Public/Mission_Panel.h +++ b/Jusin154_Team3D/Editor/Public/Mission_Panel.h @@ -34,9 +34,6 @@ class CMission_Panel final : public CPanelObject CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pMissionBanner_Border = { nullptr }; CGameObject* m_pMissionBanner_Key = { nullptr }; - CGameObject* m_pMission_KeyHold = { nullptr }; - CGameObject* m_pMission_Key = { nullptr }; - CGameObject* m_pActive_Icon = { nullptr }; public: static CMission_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Public/Spell_Canvas.h b/Jusin154_Team3D/Editor/Public/Spell_Canvas.h new file mode 100644 index 000000000..875537885 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Canvas.h @@ -0,0 +1,46 @@ +#pragma once + +#include "Editor_Define.h" +#include "CanvasObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_Canvas final : public CCanvasObject +{ +private: + CSpell_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Canvas(const CSpell_Canvas& rhs); + virtual ~CSpell_Canvas() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Ready_Panel(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + void Clear_Penel(); + +private: + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + CGameObject* m_pSpell_Panel = { nullptr }; +public: + static CSpell_Canvas* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Overlay.h b/Jusin154_Team3D/Editor/Public/Spell_Overlay.h index 9e7a52fb5..ab60ac9ef 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Overlay.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Overlay.h @@ -33,6 +33,7 @@ class CSpell_Overlay final : public CElementObject 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 }; diff --git a/Jusin154_Team3D/Editor/Public/Active_Icon.h b/Jusin154_Team3D/Editor/Public/Spell_Panel.h similarity index 62% rename from Jusin154_Team3D/Editor/Public/Active_Icon.h rename to Jusin154_Team3D/Editor/Public/Spell_Panel.h index b19d0d329..4d7ebe882 100644 --- a/Jusin154_Team3D/Editor/Public/Active_Icon.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Panel.h @@ -1,16 +1,20 @@ #pragma once #include "Editor_Define.h" -#include "ElementObject.h" +#include "PanelObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END NS_BEGIN(Editor) -class CActive_Icon final : public CElementObject +class CSpell_Panel final : public CPanelObject { private: - CActive_Icon(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - CActive_Icon(const CActive_Icon& rhs); - virtual ~CActive_Icon() = default; + CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Panel(const CSpell_Panel& rhs); + virtual ~CSpell_Panel() = default; public: virtual void Priority_Update(_float fTimeDelta); @@ -19,27 +23,25 @@ class CActive_Icon final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Ready_Element(void* pArg) override; virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; -public: - void QuestType(QUESTYPE eType); - private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; - CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; - QUESTYPE m_eType = QUESTYPE::END; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CGameObject* m_pCurrent_Spell_Slot = { nullptr }; public: - static CActive_Icon* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + static CSpell_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; virtual void Free() override; void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp index 103855f9b..71a6eeb00 100644 --- a/Jusin154_Team3D/Engine/Private/Animation.cpp +++ b/Jusin154_Team3D/Engine/Private/Animation.cpp @@ -33,7 +33,7 @@ CAnimation::CAnimation(const CAnimation& rhs) SAFE_ADDREF(pChannel); } } -_bool CAnimation::Update_TransformationMatrices(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta,CTransform*pTransform, _float m_fAmount) +_bool CAnimation::Update_TransformationMatrices(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta,_vector vector[3], _float m_fAmount) { m_fProgress = m_fTickPerSecond * fTimeDelta * m_fAnimSpeed; m_fCurrentTrackPosition += m_fProgress; @@ -48,12 +48,12 @@ _bool CAnimation::Update_TransformationMatrices(const vector& Bone Depart_Animation(); m_fCurrentTrackPosition = m_fProgress; ResetRootMotion(); - ProgressAnimation(Bones, pLocalPosArray, pTransform, m_fAmount); + ProgressAnimation(Bones, pLocalPosArray, vector, m_fAmount); return true; } } - ProgressAnimation(Bones, pLocalPosArray, pTransform, m_fAmount); + ProgressAnimation(Bones, pLocalPosArray, vector, m_fAmount); return false; } @@ -309,14 +309,14 @@ HRESULT CAnimation::Initialize(const vector& Bones, const CModel* pModel return S_OK; } -void CAnimation::ProgressAnimation(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, CTransform* pTransform, _float m_fAmount) +void CAnimation::ProgressAnimation(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray,_vector vector[3], _float m_fAmount) { _uint iIndex = {}; if (m_vBoneTransformationMatrix.size() > 0) { m_vBoneTransformationMatrix.clear(); } for (auto& pChannel : m_Channels) { - pChannel->Update_TransformationMatirx(Bones, pLocalPosArray, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++], pTransform, m_fAmount); + pChannel->Update_TransformationMatirx(Bones, pLocalPosArray, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++], vector, m_fAmount); m_vBoneTransformationMatrix.push_back(pChannel->Get_BoneTransformationMatrix()); } } diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index a35d6cee5..95f1abc94 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -116,7 +116,7 @@ void CChannel::Update_TransformationMatirx( const LOCALPOS_DESC* pLocalPosArray, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex, - CTransform* pTransform,_float m_fAmount) + _vector vector[3],_float m_fAmount) { if (0.f == fCurrentTrackPosition) @@ -160,6 +160,8 @@ void CChannel::Update_TransformationMatirx( vScale = XMVectorLerp(XMLoadFloat3(&vSourScale), XMLoadFloat3(&vDestScale), fRatio); vRotation = XMQuaternionSlerp(XMLoadFloat4(&vSourRotation), XMLoadFloat4(&vDestRotation), fRatio); vTranslation = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&vSourTranslation), XMLoadFloat3(&vDestTranslation), fRatio), 1.f); + + } @@ -173,77 +175,22 @@ void CChannel::Update_TransformationMatirx( // LocalPos.Translation.z, // 1.f); - if (Bones[m_iBoneIndex]->Compare_Name("Reference") && pTransform != nullptr) + if (Bones[m_iBoneIndex]->Compare_Name("Reference")) { - _float3 vCurRootPos; - XMStoreFloat3(&vCurRootPos, vTranslation); - - _matrix pre = XMLoadFloat4x4(&m_PreTransformMatrix); - - _vector vDeltaLocal = XMLoadFloat3(&vCurRootPos) - XMLoadFloat3(&m_vPrevRootPos); - _vector vDeltaAdjusted = XMVector3TransformNormal(vDeltaLocal, pre); - - _vector vRight = pTransform->Get_State(STATE::RIGHT); - _vector vUp = pTransform->Get_State(STATE::UP); - _vector vLook = pTransform->Get_State(STATE::LOOK); - - _float dx = XMVectorGetX(vDeltaAdjusted); - _float dy = XMVectorGetY(vDeltaAdjusted); - _float dz = XMVectorGetZ(vDeltaAdjusted); - - _vector vDeltaWorld = vRight * dx + (vUp * dz) + (-vLook * dy); - vDeltaWorld *= 0.01f; - vDeltaWorld *= m_fAmount; - - vDeltaWorld = XMVectorSetW(vDeltaWorld, 1.f); - //pTransform->Set_State(STATE::POSITION,vDeltaWorld); - pTransform->AccumulateMomentum(vDeltaWorld); - - m_vPrevRootPos = vCurRootPos; - vTranslation = XMVectorZero(); - - _float4 curRotF4; - XMStoreFloat4(&curRotF4, vRotation); - _vector qCur = XMLoadFloat4(&curRotF4); - - if (!m_bInitialRootRotSaved) - { - m_vInitialRootRot = curRotF4; - m_vPrevRootRot = curRotF4; - m_bInitialRootRotSaved = true; - } - else - { - _vector qPrev = XMLoadFloat4(&m_vPrevRootRot); - _vector qInvPrev = XMQuaternionInverse(qPrev); - _vector qDelta = XMQuaternionMultiply(qInvPrev, qCur); - - _vector axisLocal; - _float angle = 0.f; - XMQuaternionToAxisAngle(&axisLocal, &angle, qDelta); - - _vector axisWorld = XMVector3TransformNormal(axisLocal, pre); - axisWorld = XMVector3Normalize(axisWorld); - - _float4 axis; - XMStoreFloat4(&axis, axisWorld); - - swap(axis.z, axis.y); - pTransform->TurnAngle(XMLoadFloat4(&axis), angle); - } - - XMStoreFloat4(&m_vPrevRootRot, qCur); - vRotation = XMLoadFloat4(&m_vInitialRootRot); + vector[0] = vScale; + vector[1] = vRotation; + vector[2] = vTranslation; + vTranslation = XMVectorZero(); } + + m_BoneTransformationMatrix = + XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation); - - - m_BoneTransformationMatrix = - XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation); - - Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix); + Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix); } + + void CChannel::ResetRootMotion() { m_vPrevRootPos = { 0.f, 0.f, 0.f }; diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index cf6a16be5..00b5db128 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -716,37 +716,37 @@ HRESULT CGameInstance::LoadTriMeshes(const _char* pPath, vectorKey_Pressing(_iKey); - } + //} return false; } bool CGameInstance::Key_Up(int _iKey) { - if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { + //if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { return m_pKey_Manager->Key_Up(_iKey); - } + //} return false; } bool CGameInstance::Key_Down(int _iKey) { - if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { + //if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { return m_pKey_Manager->Key_Down(_iKey); - } + //} return false; } _bool CGameInstance::Mouse_Pressing(int _iKey) { - if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { + //if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { return m_pKey_Manager->Mouse_Pressing(_iKey); - } + //} return false; } _bool CGameInstance::Mouse_Up(int _iKey) { - if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { + //if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { return m_pKey_Manager->Mouse_Up(_iKey); - } + //} return false; } _bool CGameInstance::Mouse_Down(int _iKey) diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index b9a2ec292..fbfc535b8 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -118,40 +118,54 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform) if (m_iPreAnimIndex >= 0 && m_iPreAnimIndex != m_iCurrentAnimIndex) { m_fBlendTime += fTimeDelta; - _float fRatio = (m_fBlendTime / m_fBlendDuration); - if (fRatio > 1.f) fRatio = 1.f; + m_fRatio = (m_fBlendTime / m_fBlendDuration); + if (m_fRatio > 1.f) m_fRatio = 1.f; CAnimation* pCurAnim = m_Animations[m_iCurrentAnimIndex]; CAnimation* pPreAnim = m_Animations[m_iPreAnimIndex]; - _bool bCurFinished; + m_bIsFinishedAnim = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, m_vector); + + pCurAnim->InterpAnim(pPreAnim, m_Bones, m_fRatio); - if (m_bRatio) { - bCurFinished = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount * fRatio); - } - else { - bCurFinished = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount); - } - - - pCurAnim->InterpAnim(pPreAnim, m_Bones, fRatio); - - m_bIsFinishedAnim = bCurFinished; - - if (fRatio >= 1.f) + if (m_fRatio >= 1.f) { m_iPreAnimIndex = m_iCurrentAnimIndex; m_fBlendTime = 0.f; - m_bRatio = false; } } else { - m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, pTransform, m_fAmount); + m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, m_vector, m_fAmount); + m_iPreAnimIndex = m_iCurrentAnimIndex; } + if (m_bIsFinishedAnim) + { + if (m_bIsLoop) + { + m_vPrevRootPos = { 0.f, 0.f, 0.f }; + } + else + XMStoreFloat3(&m_vPrevRootPos, m_vector[2]); + } + + if (m_bRatio) { + Update_RootBone(m_fAmount * m_fRatio); + } + else + { + Update_RootBone(); + } + + if (m_bIsFinishedAnim) + { + m_vPrevRootRot = { 0.f,0.f,0.f,0.f }; + m_bInitialRootRotSaved = false; + } + for (auto& pBone : m_Bones) { pBone->Update_CombinedTransformationMatrix(m_Bones, XMLoadFloat4x4(&m_PreTransformMatrix)); @@ -167,18 +181,112 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop,_float fAmount,_bool } if (iIndex >= 0 && iIndex < m_iNumAnimations) { + m_vPrevRootPos = { 0.f, 0.f, 0.f }; + m_vPrevRootRot = { 0.f,0.f,0.f,0.f }; + m_bInitialRootRotSaved = false; + m_bInitialRootPos = false; m_iCurrentAnimIndex = iIndex; m_bIsLoop = isLoop; m_fAmount = fAmount; m_bRatio = bRatio; m_Animations[m_iCurrentAnimIndex]->Depart_Animation(); m_Animations[m_iCurrentAnimIndex]->ResetRootMotion(); + } else { m_iCurrentAnimIndex = -1; } } +void CModel::Update_RootBone(_float Amount) +{ + if (m_Bones[m_iRootBoneIndex]->Compare_Name("Reference") && m_pTransform != nullptr) + { + _float4x4 Root = m_Bones[m_iRootBoneIndex]->Get_TransformationMatrix(); + _matrix local = XMLoadFloat4x4(&Root); + _float3 vCurRootPos; + XMStoreFloat3(&vCurRootPos, m_vector[2]); + + _matrix pre = XMLoadFloat4x4(&m_PreTransformMatrix); + + _vector vDeltaLocal = XMLoadFloat3(&vCurRootPos) - XMLoadFloat3(&m_vPrevRootPos); + _vector vDeltaAdjusted = XMVector3TransformNormal(vDeltaLocal, pre); + + _vector vRight = m_pTransform->Get_State(STATE::RIGHT); + _vector vUp = m_pTransform->Get_State(STATE::UP); + _vector vLook = m_pTransform->Get_State(STATE::LOOK); + + _float dx = XMVectorGetX(vDeltaAdjusted); + _float dy = XMVectorGetY(vDeltaAdjusted); + _float dz = XMVectorGetZ(vDeltaAdjusted); + + _vector vDeltaWorld = vRight * dx + (vUp * dz) + (-vLook * dy); + + vDeltaWorld *= 0.01f; + vDeltaWorld *= Amount; + + vDeltaWorld = XMVectorSetW(vDeltaWorld, 1.f); + m_pTransform->AccumulateMomentum(vDeltaWorld); + + m_vPrevRootPos = vCurRootPos; + + _float4 curRotF4; + XMStoreFloat4(&curRotF4, m_vector[1]); + _vector qCur = XMLoadFloat4(&curRotF4); + + if (!m_bInitialRootRotSaved) + { + m_vInitialRootRot = curRotF4; + //m_vPrevRootRot = curRotF4; + m_bInitialRootRotSaved = true; + } + else + { + _vector qPrev = XMLoadFloat4(&m_vPrevRootRot); + _vector qInvPrev = XMQuaternionInverse(qPrev); + _vector qDelta = XMQuaternionMultiply(qInvPrev, qCur); + + _vector axisLocal; + _float angle = 0.f; + XMQuaternionToAxisAngle(&axisLocal, &angle, qDelta); + + _vector axisWorld = XMVector3TransformNormal(axisLocal, pre); + axisWorld = XMVector3Normalize(axisWorld); + + _float4 axis; + XMStoreFloat4(&axis, axisWorld); + + swap(axis.z, axis.y); + m_pTransform->TurnAngle(XMLoadFloat4(&axis), angle); + + } + XMStoreFloat4(&m_vPrevRootRot, qCur); + + _vector qInit = XMLoadFloat4(&m_vInitialRootRot); + + _vector scale, rot, trans; + XMMatrixDecompose(&scale, &rot, &trans, local); + + rot = qInit; + trans = XMVectorZero(); + + local = XMMatrixAffineTransformation(scale, XMVectorSet(0.f, 0.f, 0.f, 1.f), rot, trans); + + m_Bones[m_iRootBoneIndex]->Set_TransformationMatrix(local); + } +} + +void CModel::Initialize_RootBone() +{ + for (_uint i = 0; i < (_uint)m_Bones.size(); i++) + { + if (m_Bones[i]->Compare_Name("Reference")) + { + m_iRootBoneIndex = i; + } + } +} + const _float4x4* CModel::Get_BoneMatrixPtr(const _char* pBoneName) const { vector::const_iterator iter = find_if(m_Bones.begin(), m_Bones.end(), [&](CBone* pBone)->_bool @@ -1307,6 +1415,7 @@ HRESULT CModel::Initialize(void* pArg) if (m_eType == MODEL::ANIM) { + Initialize_RootBone(); Create_Temp(); m_Parent.resize(m_Bones.size()); for (size_t i = 0; i < (_uint)m_Bones.size(); i++) diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 01ba1a23f..41318b3e6 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -534,22 +534,8 @@ HRESULT CPhysX_Manager::Initialize() m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END)); m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f)); -#ifndef _DEBUG - PlaneData.eKind = PHYSX_KIND::BODY_STATIC; - PlaneData.iSubKind = UINT_MAX; - PlaneData.pOwner = nullptr; - PlaneData.pBody = nullptr; - - PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]); - pGroundPlane->userData = &PlaneData; - pGroundPlane->setName("PHYSX_MANAGER_PLANE"); - m_pScene->addActor(*pGroundPlane);; -#endif // _DEBUG - - // m_pScene->overlap();?????? -#ifdef EDITOR_PROJECT -#ifdef 기무리 + PlaneData.eKind = PHYSX_KIND::BODY_STATIC; PlaneData.iSubKind = UINT_MAX; PlaneData.pOwner = nullptr; @@ -560,115 +546,6 @@ HRESULT CPhysX_Manager::Initialize() pGroundPlane->setName("PHYSX_MANAGER_PLANE"); m_pScene->addActor(*pGroundPlane);; - //{ - // float halfExtent = .5f; - // physx::PxShape* shape = m_pPhysics->createShape(physx::PxSphereGeometry(halfExtent), *pMaterial); - // physx::PxU32 size = 30; - // physx::PxTransform pxTransform(physx::PxVec3(0)); - - // for (physx::PxU32 i = 0; i < size; i++) { - // for (physx::PxU32 j = 0; j < size - i; j++) { - // physx::PxTransform localTm(physx::PxVec3(physx::PxReal(j * 2) - physx::PxReal(size - i) + 100, physx::PxReal(i * 2 + 1), 0) * halfExtent); - // physx::PxRigidDynamic* body = m_pPhysics->createRigidDynamic(pxTransform.transform(localTm)); - // body->attachShape(*shape); - // physx::PxRigidBodyExt::updateMassAndInertia(*body, 10.0f); - // m_pScene->addActor(*body); - // } - // } - //} -#endif // 기무리 - - -#ifdef 진우 - PlaneData.eKind = PHYSX_KIND::BODY_STATIC; - PlaneData.iSubKind = UINT_MAX; - PlaneData.pOwner = nullptr; - PlaneData.pBody = nullptr; - - PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]); - pGroundPlane->userData = &PlaneData; - pGroundPlane->setName("PHYSX_MANAGER_PLANE"); - m_pScene->addActor(*pGroundPlane);; - - //{ - // float halfExtent = .5f; - // physx::PxShape* shape = m_pPhysics->createShape(physx::PxSphereGeometry(halfExtent), *pMaterial); - // physx::PxU32 size = 30; - // physx::PxTransform pxTransform(physx::PxVec3(0)); - - // for (physx::PxU32 i = 0; i < size; i++) { - // for (physx::PxU32 j = 0; j < size - i; j++) { - // physx::PxTransform localTm(physx::PxVec3(physx::PxReal(j * 2) - physx::PxReal(size - i) + 100, physx::PxReal(i * 2 + 1), 0) * halfExtent); - // physx::PxRigidDynamic* body = m_pPhysics->createRigidDynamic(pxTransform.transform(localTm)); - // body->attachShape(*shape); - // physx::PxRigidBodyExt::updateMassAndInertia(*body, 10.0f); - // m_pScene->addActor(*body); - // } - // } - //} -#endif // 진우 -#ifdef gimch - PlaneData.eKind = PHYSX_KIND::BODY_STATIC; - PlaneData.iSubKind = UINT_MAX; - PlaneData.pOwner = nullptr; - PlaneData.pBody = nullptr; - - m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END)); - m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f)); - PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]); - pGroundPlane->userData = &PlaneData; - pGroundPlane->setName("PHYSX_MANAGER_PLANE"); - m_pScene->addActor(*pGroundPlane);; - - //{ - // float halfExtent = .5f; - // physx::PxShape* shape = m_pPhysics->createShape(physx::PxSphereGeometry(halfExtent), *pMaterial); - // physx::PxU32 size = 30; - // physx::PxTransform pxTransform(physx::PxVec3(0)); - - // for (physx::PxU32 i = 0; i < size; i++) { - // for (physx::PxU32 j = 0; j < size - i; j++) { - // physx::PxTransform localTm(physx::PxVec3(physx::PxReal(j * 2) - physx::PxReal(size - i) + 100, physx::PxReal(i * 2 + 1), 0) * halfExtent); - // physx::PxRigidDynamic* body = m_pPhysics->createRigidDynamic(pxTransform.transform(localTm)); - // body->attachShape(*shape); - // physx::PxRigidBodyExt::updateMassAndInertia(*body, 10.0f); - // m_pScene->addActor(*body); - // } - // } - //} -#endif // 진우 -#endif // EDITOR_PROJECT - -#ifdef Bin - PlaneData.eKind = PHYSX_KIND::BODY_STATIC; - PlaneData.iSubKind = UINT_MAX; - PlaneData.pOwner = nullptr; - PlaneData.pBody = nullptr; - - PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]); - pGroundPlane->userData = &PlaneData; - pGroundPlane->setName("PHYSX_MANAGER_PLANE"); - m_pScene->addActor(*pGroundPlane);; - - //{ - // float halfExtent = .5f; - // physx::PxShape* shape = m_pPhysics->createShape(physx::PxSphereGeometry(halfExtent), *pMaterial); - // physx::PxU32 size = 30; - // physx::PxTransform pxTransform(physx::PxVec3(0)); - - // for (physx::PxU32 i = 0; i < size; i++) { - // for (physx::PxU32 j = 0; j < size - i; j++) { - // physx::PxTransform localTm(physx::PxVec3(physx::PxReal(j * 2) - physx::PxReal(size - i) + 100, physx::PxReal(i * 2 + 1), 0) * halfExtent); - // physx::PxRigidDynamic* body = m_pPhysics->createRigidDynamic(pxTransform.transform(localTm)); - // body->attachShape(*shape); - // physx::PxRigidBodyExt::updateMassAndInertia(*body, 10.0f); - // m_pScene->addActor(*body); - // } - // } - //} -#endif // 진우 - - return S_OK; } diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 9593cbaaa..6fd145437 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -11,8 +11,8 @@ class ENGINE_DLL CAnimation : public CBase CAnimation(const CAnimation& rhs); virtual ~CAnimation() = default; public: - _bool Update_TransformationMatrices(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta, class CTransform* pTransform = nullptr, _float m_fAmount = 1.f); - void ProgressAnimation(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, CTransform* pTransform, _float m_fAmount); + _bool Update_TransformationMatrices(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta, _vector vector[3], _float m_fAmount = 1.f); + void ProgressAnimation(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _vector vector[3], _float m_fAmount); void ResetRootMotion(); void Depart_Animation(); void Set_AnimPause(_bool bValue) { m_bPause = bValue; } diff --git a/Jusin154_Team3D/Engine/Public/Bone.h b/Jusin154_Team3D/Engine/Public/Bone.h index 6343c5043..19ebd46c1 100644 --- a/Jusin154_Team3D/Engine/Public/Bone.h +++ b/Jusin154_Team3D/Engine/Public/Bone.h @@ -28,6 +28,7 @@ class ENGINE_DLL CBone final : public CBase _float3 Get_LocalPosition(); void Update_CombinedTransformationMatrix(const vector& Bones, _fmatrix PreTransformMatrix); void Set_TransformationMatrix(_fmatrix TransformationMatrix); // 애니메이션에서 현재 로컬 매트릭스를 변경할 때 사용된다 + _float4x4 Get_TransformationMatrix() { return m_TransformationMatrix; } _int Get_ParentBoneIndex() { return m_iParentBoneIndex; } private: _char m_szName[MAX_PATH] = {}; // 본의 이름 diff --git a/Jusin154_Team3D/Engine/Public/Channel.h b/Jusin154_Team3D/Engine/Public/Channel.h index 872a26721..9a8d20569 100644 --- a/Jusin154_Team3D/Engine/Public/Channel.h +++ b/Jusin154_Team3D/Engine/Public/Channel.h @@ -23,7 +23,7 @@ class ENGINE_DLL CChannel : public CBase CHANNEL_DESC Fill_GPU_ChannelDesc(); public: - void Update_TransformationMatirx(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex,class CTransform* pTransform=nullptr,_float m_fAmount = 1.f); + void Update_TransformationMatirx(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex, _vector vector[3],_float m_fAmount = 1.f); _int Get_BoneIndex() { return { m_iBoneIndex }; } void Set_BoneIndex(_int iBoneIndex) { m_iBoneIndex = iBoneIndex; } void ResetRootMotion(); @@ -41,6 +41,15 @@ class ENGINE_DLL CChannel : public CBase // HRESULT Initialize(const vector& Bones, _uint iIndex); + // 주소 출력 함수 (편하게 쓰려고) + void DebugPrintAddr(const char* name, const void* addr) + { + char buf[256]; + sprintf_s(buf, "%s = %p\n", name, addr); + OutputDebugStringA(buf); + } + + private: _char m_szName[MAX_PATH] = {}; // 영향을 받을 본의 이름 _int m_iBoneIndex = { -1 }; // 본 벡터에서 본의 인덱스 diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 0175e3c39..635d7ce83 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -53,6 +53,8 @@ class ENGINE_DLL CModel final : public CComponent #pragma region Mesh const _char* Get_MeshName(_uint iIndex); _uint Get_NumMeshes() const { return m_iNumMeshes; } + void Update_RootBone(_float Amount =1.f); + void Initialize_RootBone(); #pragma endregion #pragma region Bone HRESULT Bind_BoneMatrices(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName); @@ -115,9 +117,9 @@ void Combined_BoneMatrix(); _bool m_bPlayAnim = { true }; _float m_fAmount = { 1.f }; - _int m_iPreAnimIndex = { 0 }; + _int m_iPreAnimIndex = { -1 }; _float m_fBlendTime = { 0.f }; - _float m_fBlendDuration = { 0.3f }; + _float m_fBlendDuration = { 0.2f }; _float m_fRadius = { 0.f }; // 컬링용 Radius _float3 m_vRadiusOffset = {}; // 컬링용 Radius Offset @@ -131,6 +133,8 @@ void Combined_BoneMatrix(); _matrix m_DeltaAnimationMatrix = {}; // 루트본의 델타애니메이션 class CTransform* m_pTransform = { nullptr }; // 모델 대상의 트랜스폼 + _float m_fRatio = {}; + // 바이너리 SaveModel* m_pSaveModel = { nullptr }; list m_SaveModel; @@ -139,6 +143,14 @@ void Combined_BoneMatrix(); vector<_float4x4> m_BoneMatrix; _bool m_bRatio = { false }; + _float3 m_vPrevRootPos = { 0.f, 0.f, 0.f }; + _float4 m_vPrevRootRot = { 0.f, 0.f, 0.f,0.f }; + _matrix m_BoneTransformationMatrix = {}; + _bool m_bInitialRootPos = { false }; + _bool m_bInitialRootRotSaved = { false }; + _float4 m_vInitialRootRot = {}; + + _vector m_vector[3]; #pragma region Compute