diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index da3d61395..a9d7fff5f 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -120,6 +120,20 @@ PS_OUT PS_MAIN(PS_IN In) return Out; } +PS_OUT PS_Texture_Color(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float4 Color = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + + tex1.rgb *= Color.rgb; + + tex1.a *= Alpha; + Out.vColor = tex1; + return Out; +} + PS_OUT PS_Logo(PS_IN In) { PS_OUT Out; @@ -517,12 +531,15 @@ PS_OUT PS_Rotation(PS_IN In) float2 center = float2(0.5f, 0.5f); float2 uv = In.vTexcoord - center; - float2 Rotation = In.vTexcoord; + float2 Rotation; Rotation.x = uv.x * cos(g_fMapAngle) - uv.y * sin(g_fMapAngle); Rotation.y = uv.x * sin(g_fMapAngle) + uv.y * cos(g_fMapAngle); Rotation += center; - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex1 = g_Texture.Sample(BorderZeroLinearSampler, Rotation); + + if (tex1.a <= 0.f) + discard; color = tex1; @@ -1988,6 +2005,16 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_MAIN(); } + pass Texture_Color + { + 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_Texture_Color(); + } + pass Logo { SetRasterizerState(RS_Default); diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 60559d5fb..6cab1a64e 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -163,6 +163,12 @@ call Update_Resources.bat + + + + + + @@ -375,6 +381,12 @@ call Update_Resources.bat + + + + + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index eda2de299..2c5421783 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -596,9 +596,6 @@ 04.Mechanic\Quest - - 02.GameObjects\BroomRaceManager - 02.GameObjects\UI\Interaction_Key @@ -656,6 +653,27 @@ 04.Mechanic\State\State_Combat\State_Skill + + 02.GameObjects\BroomRaceManager + + + 04.Mechanic\Skill\SpellLearn_Data + + + 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn + + + 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_MovePointer + + + 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Name + + + 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel + + + 02.GameObjects\UI\SpellLearn_Canvas + @@ -1371,6 +1389,24 @@ {b494a051-9dcc-4739-9048-13fb963c441f} + + {c00fdde9-9768-475d-bde2-d89305b759d9} + + + {1c4d53fe-facb-4a8e-9f4e-c02e3b333d07} + + + {f0015309-1656-42bb-8c06-58660586eeeb} + + + {ec3213cc-8976-4c8b-b317-6155cae388cd} + + + {7d84f56c-9d2f-483e-9ee1-2637d35ccb7d} + + + {69f95207-1e94-42f2-9690-d3e34e4ff5a9} + @@ -1914,9 +1950,6 @@ 04.Mechanic\Quest - - 02.GameObjects\BroomRaceManager - 02.GameObjects\UI\Interaction_Key @@ -1974,6 +2007,27 @@ 02.GameObjects\Effect\Effects\Lightning\LightningSide + + 02.GameObjects\BroomRaceManager + + + 04.Mechanic\Skill\SpellLearn_Data + + + 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn + + + 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_MovePointer + + + 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Name + + + 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel + + + 02.GameObjects\UI\SpellLearn_Canvas + diff --git a/Jusin154_Team3D/Client/Private/Broom_States.cpp b/Jusin154_Team3D/Client/Private/Broom_States.cpp index 264784bc6..a27fbba8e 100644 --- a/Jusin154_Team3D/Client/Private/Broom_States.cpp +++ b/Jusin154_Team3D/Client/Private/Broom_States.cpp @@ -76,7 +76,7 @@ void CBroom::Behavior_IdleEnter() pair<_uint, _bool> pairAnimInfo; pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_IDLE_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } HRESULT CBroom::Behavior_IdleExitCheck(_float fTimeDelta) @@ -85,7 +85,7 @@ HRESULT CBroom::Behavior_IdleExitCheck(_float fTimeDelta) pair<_uint, _bool> pairAnimInfo; if (m_bRide && !m_pFSM->IsEnable(FSMSTATE::MOUNT_B)) { pairAnimInfo = m_Animation[STATEANIM::BROOM_MOUNT_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); m_pFSM->Enable_State(FSMSTATE::MOUNT_B); } @@ -103,7 +103,7 @@ HRESULT CBroom::Behavior_IdleExitCheck(_float fTimeDelta) if (m_pModelCom->IsFinishedAnim()) { pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_IDLE_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } } @@ -273,7 +273,7 @@ HRESULT CBroom::Behavior_Broom_HoverExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_UP_B]; else pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_DOWN_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } else if (ax >= az) { @@ -293,7 +293,7 @@ HRESULT CBroom::Behavior_Broom_HoverExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_IDLE_B]; } } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } else { @@ -304,7 +304,7 @@ HRESULT CBroom::Behavior_Broom_HoverExitCheck(_float fTimeDelta) else { pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_IDLE_B]; } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } } else { @@ -326,7 +326,7 @@ HRESULT CBroom::Behavior_Broom_HoverExitCheck(_float fTimeDelta) m_bTurbo = true; } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } if (!m_bHoverToggle) @@ -355,7 +355,7 @@ void CBroom::Behavior_Broom_FlyEnter() m_pFSM->Enable_State(FSMSTATE::FLY); m_bHoverToggle = false; pairAnimInfo = pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } HRESULT CBroom::Behavior_Broom_FlyExitCheck(_float fTimeDelta) @@ -455,7 +455,7 @@ HRESULT CBroom::Behavior_Broom_FlyExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_UP_B]; else pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_DOWN_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } else if (ax >= az) { @@ -475,7 +475,7 @@ HRESULT CBroom::Behavior_Broom_FlyExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; } } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } else { @@ -486,12 +486,12 @@ HRESULT CBroom::Behavior_Broom_FlyExitCheck(_float fTimeDelta) else { pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } } else { pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } } @@ -513,7 +513,7 @@ HRESULT CBroom::Behavior_Broom_FlyExitCheck(_float fTimeDelta) m_pTransformCom->Go_LerpStraight(m_fSpeed, fTimeDelta); pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_STOP_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); if (bShift && iCurrentAnimIndex == m_Animation[STATEANIM::BROOM_HOVER_STOP_B].first) { @@ -556,7 +556,7 @@ void CBroom::Behavior_Broom_TurboFlyEnter() m_bTurbo = true; m_bHoverToggle = false; pairAnimInfo = pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } HRESULT CBroom::Behavior_Broom_TurboFlyExitCheck(_float fTimeDelta) @@ -673,7 +673,7 @@ HRESULT CBroom::Behavior_Broom_TurboFlyExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_UP_B]; else pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_DOWN_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } else if (ax >= az) { @@ -693,7 +693,7 @@ HRESULT CBroom::Behavior_Broom_TurboFlyExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; } } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } else { @@ -704,12 +704,12 @@ HRESULT CBroom::Behavior_Broom_TurboFlyExitCheck(_float fTimeDelta) else { pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } } else { pairAnimInfo = m_Animation[STATEANIM::BROOM_FLY_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } } @@ -722,7 +722,7 @@ HRESULT CBroom::Behavior_Broom_TurboFlyExitCheck(_float fTimeDelta) m_pTransformCom->Go_LerpStraight(m_fSpeed, fTimeDelta); pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_STOP_B]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); if (bShift && iCurrentAnimIndex == m_Animation[STATEANIM::BROOM_HOVER_STOP_B].first) { diff --git a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp index 9d0d18c6c..72dacdf64 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp @@ -86,7 +86,9 @@ void CCamera_Debug::Priority_Update(_float fTimeDelta) void CCamera_Debug::Update(_float fTimeDelta) { +#ifdef _DEBUG Describe_Entity(); +#endif // _DEBUG } void CCamera_Debug::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index 4a27dbefb..cc0220270 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -132,6 +132,7 @@ HRESULT CGoblin::Behavior_MoveExitCheck(_float fTimeDelta) _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + if (m_fTargetDistance >= 6.f) { pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; @@ -182,7 +183,8 @@ HRESULT CGoblin::Behavior_MoveExitCheck(_float fTimeDelta) } } - if (m_fTargetDistance <= 15.f && m_fTargetDistance >= 5.f && m_fTargetDistance != 0.f) + + if (m_fTargetDistance <= 15.f && m_fTargetDistance >= 4.f && m_fTargetDistance != 0.f) { m_pFSM->Change_State(FSMSTATE::COMBAT); return E_FAIL; @@ -614,8 +616,7 @@ void CGoblin::Behavior_DeadEnter() PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition(); PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z); m_pCharacter_Controller->Set_Position(XMLoadFloat3((_float3*)&pxTransform.p)); - m_pRigidBody->SetActive(false); - m_pCharacter_Controller->SetActive(false); + m_pCharacter_Controller->SetGravity(true); _bool bStrongerKnockDown = { false }; @@ -650,9 +651,6 @@ void CGoblin::Behavior_DeadEnter() } pairAnimInfo = m_Animation[iState + bStrongerKnockDown]; - //Get_PartObject("Goblin_Particle")->Set_Visible(false); - //Get_PartObject("Goblin_Particle2")->Set_Visible(false); - //Get_PartObject("Goblin_Smoke")->Set_Visible(false); m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } @@ -666,6 +664,8 @@ HRESULT CGoblin::Behavior_DeadExitCheck(_float fTimeDelta) void CGoblin::Behavior_DeadExit() { + m_pRigidBody->SetActive(false); + m_pCharacter_Controller->SetActive(false); m_bDead = true; } diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index 38ff9bf1a..9c0112c37 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -8,6 +8,7 @@ #include "Skill_Data.h" #include "Quest_Data.h" #include "Damage_Font.h" +#include "SpellLearn_Data.h" #include "Player.h" IMPLEMENT_SINGLETON(CInfoInstance) @@ -206,6 +207,18 @@ void CInfoInstance::Key_Input(_uint Input) Event_CallBack(TEXT("Canvas_Change"), &m_eUI_State); } break; + case ENUM_CLASS(KEYINPUT::INPUT_ESPACE): + if (m_eUI_State == UI_STATE::GAMEPLAYER) + { + m_eUI_State = UI_STATE::SPELLNEARN; + Event_CallBack(TEXT("Canvas_Change"), &m_eUI_State); + } + else if (m_eUI_State == UI_STATE::SPELLNEARN) + { + m_eUI_State = UI_STATE::GAMEPLAYER; + Event_CallBack(TEXT("Canvas_Change"), &m_eUI_State); + } + break; default: break; @@ -292,6 +305,16 @@ HRESULT CInfoInstance::Set_AcceptQuest(_int Index) return m_pQuestInfo->Set_AcceptQuest(Index); } +const SPELLLEARNINFO& CInfoInstance::Get_SpellLearn(_int Index) const +{ + return m_pSpellLearn_Data->Get_SpellLearn(Index); +} + +_int CInfoInstance::Get_SpellLearnIndex() +{ + return m_pSpellLearn_Data->Get_Index(); +} + HRESULT CInfoInstance::Regist_ActiveInteractive(CMapElement_Interactable* pInteractive) { if (nullptr == s_pInstance || nullptr == m_pInteractiveInfo) { @@ -355,6 +378,10 @@ HRESULT CInfoInstance::Initialize_Information(ID3D11Device* pDevice, ID3D11Devic if (nullptr == m_pInteractiveInfo) { return E_FAIL; } + m_pSpellLearn_Data = CSpellLearn_Data::Create(pDevice, pContext); + if (nullptr == m_pSpellLearn_Data) { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 0a0c0d30c..2d1352524 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -249,7 +249,7 @@ HRESULT CLevel_GamePlay::Ready_Background() isReady_Background = true; #endif // gimch #ifdef Bin - isReady_Background = false; + isReady_Background = true; #endif // #ifdef 진우 isReady_Background = false; diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 6700c2ca5..6fac4fd4c 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -113,6 +113,12 @@ #include "QuestInstance.h" +#include "SpellLearn_Canvas.h" +#include "SpellLearn_Panel.h" +#include "SpellLearn_Name.h" +#include "SpellLearn.h" +#include "SpellLearn_MovePointer.h" + #include "Interaction_Key.h" #pragma endregion @@ -331,7 +337,7 @@ HRESULT CLoader::Loading_For_GamePlay() isLoad_Background = true; #endif // gimch #ifdef Bin - isLoad_Background = false; + isLoad_Background = true; #endif // #ifdef 진우 isLoad_Background = false; @@ -340,7 +346,7 @@ HRESULT CLoader::Loading_For_GamePlay() isLoad_Background = true; #endif // #ifdef 인혁 - isLoad_Background = true; + isLoad_Background = false; #endif // #pragma region MAP_MODELS @@ -734,6 +740,22 @@ HRESULT CLoader::Loading_For_GamePlay() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/SpellUnlock", 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; @@ -2074,13 +2096,39 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CQuest_Status::Create(m_pDevice, m_pContext)))) { return E_FAIL; - /* For.Prototype_GameObject_Quest_Slot*/ } + /* For.Prototype_GameObject_Quest_Slot*/ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CQuest_Slot::Create(m_pDevice, m_pContext)))) { return E_FAIL; } + /* For.Prototype_GameObject_SpellLearn_Canvas*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Canvas::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_SpellLearn_Panel*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Panel::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_SpellLearn_Name*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Name::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_SpellLearn*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_SpellLearn_MovePointer*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_MovePointer::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_Interaction_Key*/ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CInteraction_Key::Create(m_pDevice, m_pContext)))) { diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index 09702f732..21ca68f0c 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -116,6 +116,12 @@ HRESULT CMainApp::Ready_Default_Setting() if (FAILED(m_pGameInstance->Add_Font(TEXT("Font_size21"), TEXT("../Bin/Resources/Fonts/Font_size21.spritefont")))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_Font(TEXT("Font_size22"), TEXT("../Bin/Resources/Fonts/Font_size22.spritefont")))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Font(TEXT("Font_size23"), TEXT("../Bin/Resources/Fonts/Font_size23.spritefont")))) + return E_FAIL; + if (FAILED(m_pGameInstance->Add_Font(TEXT("Font_size30"), TEXT("../Bin/Resources/Fonts/Font_size30.spritefont")))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index 87f1a465a..6b0559e62 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -55,6 +55,19 @@ void CMonster::Update(_float fTimeDelta) void CMonster::Late_Update(_float fTimeDelta) { __super::Late_Update(fTimeDelta); + + + _vector vDir = XMLoadFloat4(&m_vTargetPos) - Get_WorldPostion(); + vDir = XMVector4Normalize(vDir); + _vector vLook = XMVector3Normalize( + XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); + _float dot = XMVectorGetX(XMVector3Dot(vLook, vDir)); + dot = max(-1.f, min(1.f, dot)); + + _float angle = acosf(dot); + m_fDegree = XMConvertToDegrees(angle); + + m_fCross = XMVectorGetY(XMVector3Cross(vLook, vDir)); } HRESULT CMonster::Render_DeadDisolve() diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index b8b0f4be9..706d75052 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -114,6 +114,9 @@ HRESULT CPlayer::Initialize(void* pArg) m_pInfoInstance->Add_Event(TEXT("Canvas_Change"), [this](void* p) {this->Get_UIState(*reinterpret_cast<_int*>(p)); }); m_bAI = false; + + XMLoadFloat4x4(m_pBroomModel->Get_BoneMatrixPtr("broomSocket")); + return S_OK; } @@ -521,6 +524,8 @@ HRESULT CPlayer::Ready_Parts() return E_FAIL; } + + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 34d67ceb9..8233d1197 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -19,6 +19,7 @@ #pragma region STATE #include "State_Idle.h" #include "State_Dodge.h" +#include "State_Blink.h" #include "State_Jump.h" #include "State_Land.h" #include "State_Slide.h" @@ -73,6 +74,7 @@ HRESULT CPlayer::InputAction() || m_pGameInstance->Key_Down(DIK_B) || m_pGameInstance->Key_Down(DIK_T) || m_pGameInstance->Key_Down(DIK_TAB) + || m_pGameInstance->Key_Down(DIK_ESCAPE) ) { if (m_pGameInstance->Key_Down(DIK_T)) m_pInfoInstance->Key_Input(ENUM_CLASS(KEYINPUT::INPUT_T)); @@ -80,6 +82,7 @@ HRESULT CPlayer::InputAction() if (m_pGameInstance->Key_Down(DIK_X)) m_pInfoInstance->Key_Input(ENUM_CLASS(KEYINPUT::INPUT_X)); if (m_pGameInstance->Key_Down(DIK_G)) m_pInfoInstance->Key_Input(ENUM_CLASS(KEYINPUT::INPUT_G)); if (m_pGameInstance->Key_Down(DIK_Z)) m_pInfoInstance->Key_Input(ENUM_CLASS(KEYINPUT::INPUT_Z)); + if (m_pGameInstance->Key_Down(DIK_ESCAPE)) m_pInfoInstance->Key_Input(ENUM_CLASS(KEYINPUT::INPUT_ESPACE)); return S_OK; } } @@ -242,6 +245,9 @@ HRESULT CPlayer::Behavior_IdleExitCheck(_float fTimeDelta) else if (m_pGameInstance->Key_Down(DIK_Z)) { m_pFSM->Change_State(FSMSTATE::COMBAT); } + else if (m_pGameInstance->Key_Down(DIK_N)) { + m_pInfoInstance->Change_Canvas(); + } return E_FAIL; } @@ -829,6 +835,16 @@ void CPlayer::Behavior_DodgeEnter() HRESULT CPlayer::Behavior_DodgeExitCheck(_float fTimeDelta) { _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + + if (fRatio >= 0.08f) + { + if (m_pGameInstance->Key_Pressing(DIK_LCONTROL)) + { + m_pFSM->Change_State(FSMSTATE::BLINK); + return E_FAIL; + } + } + if (m_pModelCom->IsFinishedAnim()) { m_pFSM->Change_State(FSMSTATE::IDLE); return E_FAIL; @@ -846,6 +862,57 @@ void CPlayer::Behavior_DodgeExit() m_pFSM->Disable_State(FSMSTATE::DODGE); } +void CPlayer::Behavior_BlinkEnter() +{ + m_pFSM->Enable_State(FSMSTATE::BLINK); + +} + +HRESULT CPlayer::Behavior_BlinkExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo; + _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + m_fBlinkTime += fTimeDelta; + + if (m_fBlinkTime >= 0.5f && iCurrAnimIndex != m_Animation[STATEANIM::DODGE_BLINK].first) + { + m_bVisible = true; + pairAnimInfo = m_Animation[STATEANIM::DODGE_BLINK]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.8f,false,1.5f); + m_BroomScale = { 1.f,1.f,1.f }; + } + else if(iCurrAnimIndex != m_Animation[STATEANIM::DODGE_BLINK].first) { + _vector vLook = m_pTransformCom->Get_State(STATE::LOOK); + vLook = XMVectorSetY(vLook, 0.f); + vLook = XMVector3Normalize(vLook); + _vector vPos = m_pCharacter_Controller->Get_Position(); + _vector vNextPos = vPos + vLook * 7.f * fTimeDelta; + m_pCharacter_Controller->Set_Position(vNextPos); + } + + if (iCurrAnimIndex == m_Animation[STATEANIM::DODGE_BLINK].first) + { + if (SUCCEEDED(InputMove()) && fRatio >= 0.2f) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + + if (fRatio>=0.2f) { + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } + } + + return S_OK; +} + +void CPlayer::Behavior_BlinkExit() +{ + m_pFSM->Disable_State(FSMSTATE::BLINK); + m_fBlinkTime = 0.f; +} + void CPlayer::Behavior_SlideEnter() { pair<_uint, _bool> pairAnimInfo; @@ -863,6 +930,17 @@ HRESULT CPlayer::Behavior_SlideExitCheck(_float fTimeDelta) pair<_uint, _bool> pairAnimInfo; _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + if (iCurrAnimIndex == m_Animation[STATEANIM::SLIDE_LOOP_R].first || + iCurrAnimIndex == m_Animation[STATEANIM::SLIDE_START_R].first) + { + m_fSlideSpeed += (m_fTargetSpeed - m_fSlideSpeed) * fTimeDelta * m_fAccel; + _vector vLook = m_pTransformCom->Get_State(STATE::LOOK); + vLook = XMVectorSetY(vLook, 0.f); + vLook = XMVector3Normalize(vLook); + _vector vPos = m_pCharacter_Controller->Get_Position(); + _vector vNextPos = vPos + vLook * m_fSlideSpeed * fTimeDelta; + m_pCharacter_Controller->Set_Position(vNextPos); + } if (m_pGameInstance->Key_Up(DIK_E)) { pairAnimInfo = m_Animation[STATEANIM::SLIDE_STOP_R]; @@ -884,6 +962,7 @@ HRESULT CPlayer::Behavior_SlideExitCheck(_float fTimeDelta) void CPlayer::Behavior_SlideExit() { m_pFSM->Disable_State(FSMSTATE::SLIDE); + m_fSlideSpeed = 0.f; } void CPlayer::Behavior_CombatEnter() @@ -1592,17 +1671,13 @@ void CPlayer::Behavior_ShieldEnter() { pair<_uint, _bool> pairAnimInfo; - if (!m_bShield) - { - m_pFSM->Enable_State(FSMSTATE::SHIELD); - pairAnimInfo = m_Animation[STATEANIM::SKILL2]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f); + m_pFSM->Enable_State(FSMSTATE::SHIELD); + pairAnimInfo = m_Animation[STATEANIM::SKILL2]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f); - Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::PROTEGO, this); }, - 0.1f); - - } + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::PROTEGO, this); }, + 0.1f); } HRESULT CPlayer::Behavior_ShieldExitCheck() @@ -1613,7 +1688,6 @@ HRESULT CPlayer::Behavior_ShieldExitCheck() if (m_bShield) { - if (m_pGameInstance->Key_Pressing(DIK_Q)) { m_pFSM->Enable_State(FSMSTATE::PARRY); @@ -2521,13 +2595,94 @@ void CPlayer::Add_FSM() m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc)); } + { + CState_Blink::STATE_BLINK_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_BlinkEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_BlinkExitCheck(fTimeDelta); }; + Desc.funcExitEvent = [this]() { Behavior_BlinkExit(); }; + Desc.funcPriorityUpdate = [this](_float fTimeDelta) { + if (SUCCEEDED(InputMove())) + { + _vector xmvInputDir = XMVectorZero(); + + _vector xmvCamLook = XMVector4Normalize(XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f)); + _vector xmvCamRight = XMVector4Normalize(XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f)); + + if (m_pGameInstance->Key_Pressing(DIK_W)) + xmvInputDir += xmvCamLook; + if (m_pGameInstance->Key_Pressing(DIK_S)) + xmvInputDir -= xmvCamLook; + if (m_pGameInstance->Key_Pressing(DIK_A)) + xmvInputDir -= xmvCamRight; + if (m_pGameInstance->Key_Pressing(DIK_D)) + xmvInputDir += xmvCamRight; + + xmvInputDir = XMVector3Normalize(xmvInputDir); + + _float2 vInputDir = { XMVectorGetX(xmvInputDir),XMVectorGetZ(xmvInputDir) }; + _vector xmvCurLook = XMVector4Normalize( + XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); + _float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) }; + + _float vDir = CMyTools::Get_Direction2D(vCurLook, vInputDir); + _float absDir = fabsf(vDir); + _float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x; + if (cross > 0.f) + { + m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + } + else { + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + } + } + }; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::BLINK, CState_Blink::Create(&Desc)); + } + { CState_Slide::STATE_SLIDE_DESC Desc{}; Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_SlideEnter(); }; Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_SlideExitCheck(fTimedelta); }; Desc.funcExitEvent = [this]() { Behavior_SlideExit(); }; - Desc.funcPriorityUpdate = nullptr; + Desc.funcPriorityUpdate = [this](_float fTimeDelta) { + if (SUCCEEDED(InputMove())) + { + _vector xmvInputDir = XMVectorZero(); + + _vector xmvCamLook = XMVector4Normalize(XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f)); + _vector xmvCamRight = XMVector4Normalize(XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f)); + + if (m_pGameInstance->Key_Pressing(DIK_W)) + xmvInputDir += xmvCamLook; + if (m_pGameInstance->Key_Pressing(DIK_S)) + xmvInputDir -= xmvCamLook; + if (m_pGameInstance->Key_Pressing(DIK_A)) + xmvInputDir -= xmvCamRight; + if (m_pGameInstance->Key_Pressing(DIK_D)) + xmvInputDir += xmvCamRight; + + xmvInputDir = XMVector3Normalize(xmvInputDir); + + _float2 vInputDir = { XMVectorGetX(xmvInputDir),XMVectorGetZ(xmvInputDir) }; + _vector xmvCurLook = XMVector4Normalize( + XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); + _float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) }; + + _float vDir = CMyTools::Get_Direction2D(vCurLook, vInputDir); + _float absDir = fabsf(vDir); + _float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x; + if (cross > 0.f) + { + m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + } + else { + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); + } + } + }; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::SLIDE, CState_Slide::Create(&Desc)); } @@ -2622,7 +2777,6 @@ void CPlayer::Add_FSM() m_pBroomTransform->Set_Scale(vScale); m_bOnce = true; } - m_BroomScale.x += (m_TargetScale.x - m_BroomScale.x) * fTimeDelta * m_fScaleSmoothSpeed; m_BroomScale.y += (m_TargetScale.y - m_BroomScale.y) * fTimeDelta * m_fScaleSmoothSpeed; m_BroomScale.z += (m_TargetScale.z - m_BroomScale.z) * fTimeDelta * m_fScaleSmoothSpeed; @@ -2630,29 +2784,7 @@ void CPlayer::Add_FSM() { m_pBroomTransform->Set_Scale(m_BroomScale); } - _matrix BroomWorld = XMLoadFloat4x4(m_pBroomTransform->Get_WorldMatrixPtr()); - _matrix BoneLocal = XMLoadFloat4x4(m_pBroomModel->Get_BoneMatrixPtr("broomSocket")); - - _vector Scale, Rot, Trans; - - XMMatrixDecompose(&Scale, &Rot, &Trans, BoneLocal); - - _matrix BoneNoScale = XMMatrixRotationQuaternion(Rot) * XMMatrixTranslationFromVector(Trans); - - m_OffsetPos = { 0.f,0.9f,0.f }; - - _matrix Offset = XMMatrixTranslation(m_OffsetPos.x, - m_OffsetPos.y, m_OffsetPos.z); - - _matrix SocketWorld = BoneNoScale * Offset * BroomWorld; - - _matrix FixRot = XMMatrixRotationY(XMConvertToRadians(180.f)); - - _matrix FinalWorld = FixRot * SocketWorld; - - m_pTransformCom->Set_WorldMatrix(FinalWorld); - m_pCharacter_Controller->Set_Position(FinalWorld.r[3]); - + Attach_Broom(); }; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::BROOM_RIDE, CState_Broom_Ride::Create(&Desc)); @@ -2767,7 +2899,7 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::SLIDE_LOOP_R] = { 564,true }; m_Animation[STATEANIM::DODGE] = { 878,false }; - m_Animation[STATEANIM::DODGE_BLINK] = { 876,true }; + m_Animation[STATEANIM::DODGE_BLINK] = { 874,false }; m_Animation[STATEANIM::SKILL] = { 593,false }; m_Animation[STATEANIM::SKILL2] = { 991,false }; @@ -2876,6 +3008,8 @@ void CPlayer::Set_Anim() // 755 기모으기 859 //568 566 564 슬라이드 스탑/스타트/루프 + + //874 } diff --git a/Jusin154_Team3D/Client/Private/Protego.cpp b/Jusin154_Team3D/Client/Private/Protego.cpp index 6558e1c7b..f71361785 100644 --- a/Jusin154_Team3D/Client/Private/Protego.cpp +++ b/Jusin154_Team3D/Client/Private/Protego.cpp @@ -129,14 +129,14 @@ HRESULT CProtego::Ready_Components(void* pArg) } - { // DO - CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(PXOBJECT::SKILL_PROTEGO); - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_SHIELD"), (CComponent**)&m_pRigidBody, &Desc))) { - return E_FAIL; - } - m_pGameInstance->Attach_Actor(*m_pRigidBody->Get_Actor()); - } + //{ // DO + // CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + // Desc.iSubKind = ENUM_CLASS(PXOBJECT::SKILL_PROTEGO); + // if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_SHIELD"), (CComponent**)&m_pRigidBody, &Desc))) { + // return E_FAIL; + // } + // m_pGameInstance->Attach_Actor(*m_pRigidBody->Get_Actor()); + //} return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Quest_Info.cpp b/Jusin154_Team3D/Client/Private/Quest_Info.cpp index d15c82661..c929b94de 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Info.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Info.cpp @@ -129,7 +129,11 @@ HRESULT CQuest_Info::Render() return E_FAIL; } - m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iCurrentQuest ,m_iQuest_Index).pQuestInfo.c_str(), _float2(m_fFontX + m_fX, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + if (m_iQuest_Index != 0) + { + m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iCurrentQuest, m_iQuest_Index).pQuestInfo.c_str(), _float2(m_fFontX + m_fX, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + } + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Quest_Info_Header.cpp b/Jusin154_Team3D/Client/Private/Quest_Info_Header.cpp index 4d80896d8..b2c7954ea 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Info_Header.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Info_Header.cpp @@ -129,8 +129,11 @@ HRESULT CQuest_Info_Header::Render() return E_FAIL; } - _float OffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iCurrentQuest, m_iQuest_Index).pQuestName.c_str()) - 30) * 0.5f; - m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iCurrentQuest, m_iQuest_Index).pQuestName.c_str(), _float2((m_fFontX + m_fX) - OffSet, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + if (m_iQuest_Index != 0) + { + _float OffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iCurrentQuest, m_iQuest_Index).pQuestName.c_str()) - 30) * 0.5f; + m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pInfoInstance->Get_Quest(m_iCurrentQuest, m_iQuest_Index).pQuestName.c_str(), _float2((m_fFontX + m_fX) - OffSet, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Quest_Slot.cpp b/Jusin154_Team3D/Client/Private/Quest_Slot.cpp index f927a1486..11eba6548 100644 --- a/Jusin154_Team3D/Client/Private/Quest_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Quest_Slot.cpp @@ -102,6 +102,7 @@ void CQuest_Slot::Update(_float fTimeDelta) } } Hover(); + static_cast(m_pOwner)->Function_Callback(TEXT("QuestListHover"), &m_Info); @@ -117,6 +118,7 @@ void CQuest_Slot::Late_Update(_float fTimeDelta) } if (m_bVisible) { + m_pVIBufferCom->Set_Hover(m_iIndex); m_pGameInstance->Add_RenderGroup(RENDER::UI, this); } __super::Late_Update(fTimeDelta); @@ -153,14 +155,14 @@ void CQuest_Slot::Font_Size() for (_int i = 0; i < m_iQuestCount; ++i) { m_fFontY = 190 + i * 85.f; - if (m_Index == -1) + if (m_iIndex == -1) { m_Fonts[i].pFontSizeName = TEXT("Font_size20"); m_Fonts[i].m_fFontSize = _float2(m_fFontX + m_fX, m_fFontY - m_fY); } else { - if (i == m_Index) + if (i == m_iIndex) { m_Fonts[i].pFontSizeName = TEXT("Font_size30"); m_Fonts[i].m_fFontSize = _float2(m_fFontX - 10.f + m_fX, m_fFontY - 10.f - m_fY); @@ -194,7 +196,7 @@ _int CQuest_Slot::Mousechack(POINT Mouse) { for (_int i = 0; i < m_iQuestCount; ++i) { - RECT Box = { + RECT Box = { long(m_fPositionX - m_fSizeX * 0.5f), long((m_fPositionY - (i * m_fOffSetY)) - m_fSizeY * 0.5f), long(m_fPositionX + m_fSizeX * 0.5f), @@ -202,11 +204,11 @@ _int CQuest_Slot::Mousechack(POINT Mouse) if (PtInRect(&Box, Mouse)) { + return i; } } - return -1; } @@ -317,19 +319,15 @@ void CQuest_Slot::Hover() POINT Mouse{}; Mouse.x = _long(fMouse.x); Mouse.y = _long(fMouse.y); - - m_Index = Mousechack(Mouse); - m_pVIBufferCom->Set_Hover(m_Index); - if (m_Index != -1) + m_iIndex = Mousechack(Mouse); + + if (m_iIndex != m_iPrevIndex) { - m_bHover = true; + m_pVIBufferCom->Set_Hover(m_iIndex); + Font_Size(); + m_iPrevIndex = m_iIndex; } - else - { - m_bHover = false; - } - Font_Size(); } diff --git a/Jusin154_Team3D/Client/Private/Ranrak.cpp b/Jusin154_Team3D/Client/Private/Ranrak.cpp index 0a84f3bf9..0b05022f3 100644 --- a/Jusin154_Team3D/Client/Private/Ranrak.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrak.cpp @@ -62,8 +62,8 @@ HRESULT CRanrak::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(-52.f, 0.f, 4.f, 1.f)); - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-52.f, 0.f, 4.f, 1.f)); + m_pCharacter_Controller->Set_Position(XMVectorSet(-52.f, 3.f, 4.f, 1.f)); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-52.f, 3.f, 4.f, 1.f)); return S_OK; } @@ -144,19 +144,6 @@ void CRanrak::Late_Update(_float fTimeDelta) m_pTransformCom->LookAt_Lerp(XMLoadFloat4(&m_vTargetPos), fTimeDelta, 3.f); } - - _vector vDir = XMLoadFloat4(&m_vTargetPos) - Get_WorldPostion(); - vDir = XMVector4Normalize(vDir); - _vector vLook = XMVector3Normalize( - XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); - float dot = XMVectorGetX(XMVector3Dot(vLook, vDir)); - dot = max(-1.f, min(1.f, dot)); - - float angle = acosf(dot); - m_fDegree = XMConvertToDegrees(angle); - - m_fCross = XMVectorGetY(XMVector3Cross(vLook, vDir)); - m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); } @@ -368,8 +355,8 @@ HRESULT CRanrak::Ready_Components() Desc.fMaterial = { 1.2f, 1.0f, 0.0f }; Desc.bAutoStepping = { false }; Desc.fStepOffset = { 0.12f }; - Desc.fRadius = 1.2f; - Desc.fHeight = 1.5f; + Desc.fRadius = 2.f; + Desc.fHeight = 2.f; Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Monster_HitReport::Create(); Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Monster_Behavior::Create(); Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; @@ -377,6 +364,8 @@ HRESULT CRanrak::Ready_Components() if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { return E_FAIL; } + + m_pCharacter_Controller->SetGravity(false); } m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION)); { // DO @@ -388,7 +377,7 @@ HRESULT CRanrak::Ready_Components() m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor()); } - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_TROLL"), (CComponent**)&m_pStat))) { + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_RANRAK"), (CComponent**)&m_pStat))) { return E_FAIL; } @@ -475,6 +464,7 @@ void CRanrak::Describe_Entity() if (GUI::CollapsingHeader("Ranrak")) { __super::Describe_Entity(); + m_pTransformCom->Describe_Entity(); } GUI::End(); diff --git a/Jusin154_Team3D/Client/Private/Ranrak_States.cpp b/Jusin154_Team3D/Client/Private/Ranrak_States.cpp index 678b38f83..f45f52a2e 100644 --- a/Jusin154_Team3D/Client/Private/Ranrak_States.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrak_States.cpp @@ -30,7 +30,7 @@ void CRanrak::Behavior_IdleEnter() m_pFSM->Enable_State(FSMSTATE::IDLE); pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::HOVER_LOOP]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.f,true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CRanrak::Behavior_IdleExitCheck() @@ -204,7 +204,6 @@ void CRanrak::Behavior_HoverEnter() switch (iRand) { case 0: - pairAnimInfo = m_Animation[STATEANIM::HOVER_DASH_LEFT]; break; case 1: pairAnimInfo = m_Animation[STATEANIM::HOVER_DASH_RIGHT]; @@ -215,6 +214,7 @@ void CRanrak::Behavior_HoverEnter() HRESULT CRanrak::Behavior_HoverExitCheck(_float fTimeDelta) { + _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); if (m_pModelCom->IsFinishedAnim()) { m_pFSM->Change_State(FSMSTATE::IDLE); @@ -252,21 +252,21 @@ void CRanrak::Behavior_FireBreathEnter() Add_Event(pairAnimInfo.first, [&]() { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_A]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)]; }, - 0.9f); + 0.95f); Add_Event(m_Animation[STATEANIM::FIREBREATH_A].first, [&]() { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_COOLDOWN_A]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); }, - 0.9f); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); }, + 0.95f); } else if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_GROUND)) { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_G]; m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBREATH)]; } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CRanrak::Behavior_FireBreathExitCheck(_float fTimeDelta) @@ -298,13 +298,13 @@ void CRanrak::Behavior_FireSweepEnter() Add_Event(pairAnimInfo.first, [&]() { pairAnimInfo = m_Animation[STATEANIM::FIRESWEEP_A]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIRESWEEP)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIRESWEEP)]; }, 0.95f); Add_Event(m_Animation[STATEANIM::FIRESWEEP_A].first, [&]() { pairAnimInfo = m_Animation[STATEANIM::FIRESWEEP_COOLDOWN_A]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); }, + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); }, 0.95f); } else if (m_ePhase == ENUM_CLASS(RANRAK_PHASE::PHASE_GROUND)) @@ -312,7 +312,7 @@ void CRanrak::Behavior_FireSweepEnter() pairAnimInfo = m_Animation[STATEANIM::FIRESWEEP_G]; m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIRESWEEP)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIRESWEEP)]; } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CRanrak::Behavior_FireSweepExitCheck(_float fTimeDelta) @@ -368,7 +368,7 @@ void CRanrak::Behavior_FireBallEnter() } m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBALL)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::FIREBALL)]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CRanrak::Behavior_FireBallExitCheck(_float fTimeDelta) @@ -410,7 +410,7 @@ void CRanrak::Behavior_SwipeEnter() } m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::SWIPE)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::SWIPE)]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CRanrak::Behavior_SwipeExitCheck(_float fTimeDelta) @@ -462,7 +462,7 @@ void CRanrak::Behavior_PulseEnter() pairAnimInfo = m_Animation[STATEANIM::PULSE]; m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::PULSE)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::PULSE)]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CRanrak::Behavior_PulseExitCheck(_float fTimeDelta) @@ -503,7 +503,7 @@ HRESULT CRanrak::Behavior_TuckedExitCheck(_float fTimeDelta) { m_fTuckedTime = 0.f; pairAnimInfo = m_Animation[STATEANIM::FLY_TO_HOVER]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); return S_OK; } @@ -524,9 +524,19 @@ void CRanrak::Behavior_LandEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::LAND); + m_pCharacter_Controller->SetGravity(true); pairAnimInfo = m_Animation[STATEANIM::LAND]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + + Add_Event(pairAnimInfo.first, + [this]() { CPlayer* pPlayer = static_cast(m_pInfoInstance->Get_NearestPlayerAlly(Get_WorldPostion()).first); + if (pPlayer == nullptr) + return; + _float fDistance = XMVectorGetX(XMVector4Length(pPlayer->Get_WorldPostion() - Get_WorldPostion())); + _float fShakeValue = clamp(30.f / fDistance, 5.f, 10.f); + pPlayer->Start_CameraShake(1.2f, fShakeValue); }, + 0.57f); } HRESULT CRanrak::Behavior_LandExitCheck(_float fTimeDelta) @@ -903,7 +913,7 @@ void CRanrak::Add_FSM() void CRanrak::Set_Anim() { - m_Animation[STATEANIM::IDLE_G] = { 52,true }; + m_Animation[STATEANIM::IDLE_G] = { 100,true }; m_Animation[STATEANIM::IDLE_BREAK1] = { 27,false }; m_Animation[STATEANIM::IDLE_BREAK2] = { 28,false }; diff --git a/Jusin154_Team3D/Client/Private/SpellLearn.cpp b/Jusin154_Team3D/Client/Private/SpellLearn.cpp new file mode 100644 index 000000000..884254d57 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/SpellLearn.cpp @@ -0,0 +1,252 @@ +#include "pch.h" +#include "SpellLearn.h" +#include "GameInstance.h" +#include "InfoInstance.h" + +CSpellLearn::CSpellLearn(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpellLearn::CSpellLearn(const CSpellLearn& rhs) + :CElementObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) +{ +} + +HRESULT CSpellLearn::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 600.f; + Desc.fY = 0.f; + Desc.fSizeX = 550.f; + Desc.fSizeY = 550.f; + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 5.f; + Change_Image(0); + Visible(false); + return S_OK; +} + +void CSpellLearn::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + { + m_fAlpha += fTimeDelta * m_fAlphaTime; + } + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpellLearn::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::COLOR)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpellLearn::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_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_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpellLearn::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Levioso"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_Goldleaf_Large"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpellLearn::Change_Image(_int SpellID) +{ + _wstring pName = TEXT("Prototype_Texture_"); + _wstring pImageName = pName + m_pInfoInstance->Get_SpellLearn(SpellID).pImageName; + + if (m_pDiffuse_TextureCom) + { + Remove_Component(); + SAFE_RELEASE(m_pDiffuse_TextureCom); + } + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, pImageName, reinterpret_cast(&m_pDiffuse_TextureCom)))) + return E_FAIL; + + return S_OK; +} + +CSpellLearn* CSpellLearn::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn* pInstance = new CSpellLearn(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn* pInstance = new CSpellLearn(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpellLearn::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/SpellLearn_Canvas.cpp b/Jusin154_Team3D/Client/Private/SpellLearn_Canvas.cpp new file mode 100644 index 000000000..36d8e4dd0 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/SpellLearn_Canvas.cpp @@ -0,0 +1,140 @@ +#include "pch.h" +#include "UI_Manager.h" +#include "SpellLearn_Canvas.h" +#include "GameInstance.h" +#include "SpellLearn_Panel.h" + +CSpellLearn_Canvas::CSpellLearn_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CCanvasObject(pDevice, pContext) +{ +} + +CSpellLearn_Canvas::CSpellLearn_Canvas(const CSpellLearn_Canvas& rhs) + :CCanvasObject(rhs) +{ +} + +HRESULT CSpellLearn_Canvas::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_Canvas::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 1920.f; + Desc.fSizeY = 1080.f; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Panel(pArg))) + { + return E_FAIL; + } + Visible(false); + return S_OK; +} + +void CSpellLearn_Canvas::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_Canvas::Update(_float fTimeDelta) +{ + __super::Update(fTimeDelta); +} + +void CSpellLearn_Canvas::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpellLearn_Canvas::Render() +{ + return S_OK; +} + +_vector CSpellLearn_Canvas::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_Canvas::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CSpellLearn_Canvas::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpellLearn_Canvas::Ready_Panel(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast (&m_pSpellLearn_Panel)))) + { + return E_FAIL; + } + Add_Panel(TEXT("SpellLearn_Panel"), m_pSpellLearn_Panel); + + return S_OK; +} + +void CSpellLearn_Canvas::Clear_Penel() +{ +} + +CSpellLearn_Canvas* CSpellLearn_Canvas::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Canvas* pInstance = new CSpellLearn_Canvas(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_Canvas"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_Canvas::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_Canvas* pInstance = new CSpellLearn_Canvas(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Canvas"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Canvas::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpellLearn_Canvas::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/SpellLearn_Data.cpp b/Jusin154_Team3D/Client/Private/SpellLearn_Data.cpp new file mode 100644 index 000000000..f343c4a8e --- /dev/null +++ b/Jusin154_Team3D/Client/Private/SpellLearn_Data.cpp @@ -0,0 +1,104 @@ +#include "pch.h" +#include "SpellLearn_Data.h" +#include "UIObject.h" +#include "InfoInstance.h" + +CSpellLearn_Data::CSpellLearn_Data() + :m_pInfoInstance(CInfoInstance::GetInstance()) +{ +} + +HRESULT CSpellLearn_Data::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + Load_SpellInfo("../Bin/Resources/Data/UI/SpellLearn.xml"); + + return S_OK; +} + +const SPELLLEARNINFO& CSpellLearn_Data::Get_SpellLearn(_int Index) const +{ + return m_SpellLearnInfos[Index]; +} + +_int CSpellLearn_Data::Get_Index() +{ + return m_iSpellLearn_Count; +} + +void CSpellLearn_Data::Update(_float fTimeDelta) +{ +} + +HRESULT CSpellLearn_Data::Load_SpellInfo(const _char* pFilePath) +{ + tinyxml2::XMLDocument doc; + if (doc.LoadFile(pFilePath) != tinyxml2::XML_SUCCESS) + return E_FAIL; + + tinyxml2::XMLElement* pSpellLearnInfo = doc.FirstChildElement("SpellLearnInfo"); + if (!pSpellLearnInfo) return E_FAIL; + + tinyxml2::XMLElement* pSpellLearnData = pSpellLearnInfo->FirstChildElement("SpellLearnData"); + if (!pSpellLearnData) return E_FAIL; + + // 모든 Name 요소 반복 + tinyxml2::XMLElement* pName = pSpellLearnData->FirstChildElement("Name"); + while (pName) + { + SPELLLEARNINFO Info{}; + + // 속성 읽기 + Info.pSpellName = CMyTools::ToWstring(pName->Attribute("SpellName")); + Info.pImageName = CMyTools::ToWstring(pName->Attribute("ImageName")); + pName->QueryFloatAttribute("Size", &Info.fSpellSize); + + _float fX{}, fY{}; + pName->QueryFloatAttribute("x", &fX); + pName->QueryFloatAttribute("y", &fY); + Info.fStartPosition = _float2(fX, fY); + + // Position 요소 반복 + tinyxml2::XMLElement* pPosition = pName->FirstChildElement("Position"); + while (pPosition) + { + tinyxml2::XMLElement* pPos = pPosition->FirstChildElement("Pos"); + if (pPos) + { + _float px{}, py{}; + pPos->QueryFloatAttribute("x", &px); + pPos->QueryFloatAttribute("y", &py); + Info.Lines.push_back(XMVectorSet(px, py, 0.f, 1.f)); + } + + // 다음 Position으로 이동 + pPosition = pPosition->NextSiblingElement("Position"); + } + + // 벡터에 추가 + m_SpellLearnInfos.push_back(Info); + m_iSpellLearn_Count++; + + // 다음 Name으로 이동 + pName = pName->NextSiblingElement("Name"); + } + + return S_OK; +} + +CSpellLearn_Data* CSpellLearn_Data::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Data* pInstance = new CSpellLearn_Data(); + + if (FAILED(pInstance->Initialize(pDevice, pContext))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Data"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Data::Free() +{ + __super::Free(); +} diff --git a/Jusin154_Team3D/Client/Private/SpellLearn_MovePointer.cpp b/Jusin154_Team3D/Client/Private/SpellLearn_MovePointer.cpp new file mode 100644 index 000000000..85ca12265 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/SpellLearn_MovePointer.cpp @@ -0,0 +1,284 @@ +#include "pch.h" +#include "SpellLearn_MovePointer.h" +#include "GameInstance.h" +#include "InfoInstance.h" + +CSpellLearn_MovePointer::CSpellLearn_MovePointer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpellLearn_MovePointer::CSpellLearn_MovePointer(const CSpellLearn_MovePointer& rhs) + :CElementObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) +{ +} + +HRESULT CSpellLearn_MovePointer::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_MovePointer::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 476.f; + Desc.fY = -253.f; + Desc.fSizeX = 32.f; + Desc.fSizeY = 32.f; + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 5.f; + m_fMoveSpeed = 15.f; + Set_SpellLearn(0); + m_fAngle = XMConvertToRadians(0); + Visible(false); + return S_OK; +} + +void CSpellLearn_MovePointer::Set_SpellLearn(_int Index) +{ + m_iLineIndex = _int(m_pInfoInstance->Get_SpellLearn(Index).Lines.size()); + m_MoveLine = m_pInfoInstance->Get_SpellLearn(Index).Lines; + m_iCurrentLine = 0; + m_fX = m_pInfoInstance->Get_SpellLearn(Index).fStartPosition.x; + m_fY = m_pInfoInstance->Get_SpellLearn(Index).fStartPosition.y; +} + +void CSpellLearn_MovePointer::Line(_float fTime) +{ + m_vLerp_Position = m_MoveLine[m_iCurrentLine]; + + if (Start_Lerp(m_fMoveSpeed * fTime) == true) + { + if (m_iCurrentLine < m_iLineIndex - 1) + { + ++m_iCurrentLine; + } + else + { + m_bMoveStart = false; + } + } + +} + +void CSpellLearn_MovePointer::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_MovePointer::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + { + m_fAlpha += fTimeDelta * m_fAlphaTime; + } + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + if (m_pGameInstance->Key_Down(DIK_L)) + { + m_bMoveStart = true; + } + + if (m_bMoveStart == true) + { + Line(fTimeDelta); + } + + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -ptMouse.y + (g_iWinSizeY * 0.5f); + + fMouse.x = fMouse.x - m_fX; + fMouse.y = fMouse.y - m_fY; + + + m_fAngle = atan2(-fMouse.x, fMouse.y); + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpellLearn_MovePointer::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn_MovePointer::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ROTATION)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpellLearn_MovePointer::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_MovePointer::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fMapAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpellLearn_MovePointer::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_SU_Cursor"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpellLearn_MovePointer* CSpellLearn_MovePointer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_MovePointer* pInstance = new CSpellLearn_MovePointer(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_MovePointer"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_MovePointer::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_MovePointer* pInstance = new CSpellLearn_MovePointer(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_MovePointer"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_MovePointer::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpellLearn_MovePointer::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/SpellLearn_Name.cpp b/Jusin154_Team3D/Client/Private/SpellLearn_Name.cpp new file mode 100644 index 000000000..ad96fa494 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/SpellLearn_Name.cpp @@ -0,0 +1,255 @@ +#include "pch.h" +#include "SpellLearn_Name.h" +#include "GameInstance.h" +#include "InfoInstance.h" + +CSpellLearn_Name::CSpellLearn_Name(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpellLearn_Name::CSpellLearn_Name(const CSpellLearn_Name& rhs) + :CElementObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) + +{ +} + +HRESULT CSpellLearn_Name::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_Name::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 600.f; + Desc.fY = 420.f; + Desc.fSizeX = 432.f; + Desc.fSizeY = 27.f; + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 5.f; + m_vNine_Slice = _float4(216.f, 216.f, 0.f, 27.f); + m_fFontX = 944.f; + m_fFontY = 520.f; + SizeUpX(550.f); + SizeUpY(27.f); + Set_Name(0); + Visible(false); + return S_OK; +} + +void CSpellLearn_Name::Set_Name(_int Index) +{ + SizeUpX(m_pInfoInstance->Get_SpellLearn(Index).fSpellSize); + m_pSpell_Name = m_pInfoInstance->Get_SpellLearn(Index).pSpellName; +} + +void CSpellLearn_Name::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_Name::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + { + m_fAlpha += fTimeDelta * m_fAlphaTime; + } + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpellLearn_Name::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn_Name::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::QUEST_BORDER)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + _float OffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), m_pSpell_Name.c_str()) - 30) * 0.5f; + m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pSpell_Name.c_str(), _float2((m_fFontX + m_fX) - OffSet, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + + return S_OK; +} + +_vector CSpellLearn_Name::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_Name::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fNine_Slice", &m_vNine_Slice, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_fOrigin_Size, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpellLearn_Name::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_Spell_Name"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpellLearn_Name* CSpellLearn_Name::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Name* pInstance = new CSpellLearn_Name(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_Name"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_Name::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_Name* pInstance = new CSpellLearn_Name(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Name"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Name::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpellLearn_Name::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/SpellLearn_Panel.cpp b/Jusin154_Team3D/Client/Private/SpellLearn_Panel.cpp new file mode 100644 index 000000000..ff5a40be3 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/SpellLearn_Panel.cpp @@ -0,0 +1,250 @@ +#include "pch.h" +#include "SpellLearn_Panel.h" +#include "GameInstance.h" +#include "SpellLearn_Name.h" +#include "SpellLearn.h" +#include "SpellLearn_MovePointer.h" +#include "SpellLearn_Data.h" +#include "InfoInstance.h" + +CSpellLearn_Panel::CSpellLearn_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPanelObject(pDevice, pContext) +{ +} + +CSpellLearn_Panel::CSpellLearn_Panel(const CSpellLearn_Panel& rhs) + :CPanelObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) +{ +} + +HRESULT CSpellLearn_Panel::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_Panel::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 960.f; + Desc.fY = -540.f; + Desc.fSizeX = g_iWinSizeX; + Desc.fSizeY = g_iWinSizeY; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Element(pArg))) + { + return E_FAIL; + } + m_fCanvasAlpha = 1.f; + m_fSortZ = 0.05f; + m_fDelayTime = 1.f; + Visible(true); + ElementAllVisible(true); + return S_OK; +} + +void CSpellLearn_Panel::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpellLearn_Panel::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_pGameInstance->Key_Down(DIK_M)) + { + if (Index >= m_pInfoInstance->Get_SpellLearnIndex() - 1) + { + Index = 0; + } + else + { + Index++; + } + static_cast(m_pSpellLearn)->Change_Image(Index); + static_cast(m_pSpellLearn_MovePointer)->Set_SpellLearn(Index); + static_cast(m_pSpellLearn_Name)->Set_Name(Index); + } + + __super::Update(fTimeDelta); +} + +void CSpellLearn_Panel::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + __super::Late_Update(fTimeDelta); + } +} + +HRESULT CSpellLearn_Panel::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_LEARN)))) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpellLearn_Panel::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpellLearn_Panel::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpellLearn_Panel::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_SpellLearn"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_SpellLinkDivide"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpellLearn_Panel::Ready_Element(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn_Name)))) + { + return E_FAIL; + } + Add_Element(TEXT("SpellLearn_Name"), m_pSpellLearn_Name); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn)))) + { + return E_FAIL; + } + Add_Element(TEXT("SpellLearn"), m_pSpellLearn); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn_MovePointer)))) + { + return E_FAIL; + } + Add_Element(TEXT("SpellLearn_MovePointer"), m_pSpellLearn_MovePointer); + + return S_OK; +} + +CSpellLearn_Panel* CSpellLearn_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Panel* pInstance = new CSpellLearn_Panel(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_Panel::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_Panel* pInstance = new CSpellLearn_Panel(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Panel::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpellLearn_Panel::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index 0bf500331..2834b4935 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -168,19 +168,6 @@ void CTroll::Late_Update(_float fTimeDelta) m_pTransformCom->LookAt_Lerp(XMLoadFloat4(&m_vTargetPos), fTimeDelta, 3.f); } - - _vector vDir = XMLoadFloat4(&m_vTargetPos) - Get_WorldPostion(); - vDir = XMVector4Normalize(vDir); - _vector vLook = XMVector3Normalize( - XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); - float dot = XMVectorGetX(XMVector3Dot(vLook, vDir)); - dot = max(-1.f, min(1.f, dot)); - - float angle = acosf(dot); - m_fDegree = XMConvertToDegrees(angle); - - m_fCross = XMVectorGetY(XMVector3Cross(vLook, vDir)); - m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); } diff --git a/Jusin154_Team3D/Client/Private/Troll_States.cpp b/Jusin154_Team3D/Client/Private/Troll_States.cpp index 6fbeae1c0..0dc446337 100644 --- a/Jusin154_Team3D/Client/Private/Troll_States.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_States.cpp @@ -36,7 +36,7 @@ void CTroll::Behavior_IdleEnter() HRESULT CTroll::Behavior_IdleExitCheck() { if (m_fTargetDistance <= 18.f && m_fTargetDistance != 0) - m_pFSM->Change_State(FSMSTATE::MOVE); + m_pFSM->Change_State(FSMSTATE::IDLEBREAK); return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/UI_Manager.cpp b/Jusin154_Team3D/Client/Private/UI_Manager.cpp index 16f414456..d77ff84e9 100644 --- a/Jusin154_Team3D/Client/Private/UI_Manager.cpp +++ b/Jusin154_Team3D/Client/Private/UI_Manager.cpp @@ -8,6 +8,7 @@ #include "Mouse_Cursor.h" #include "CameraLockOn.h" #include "Damage_Font.h" +#include "SpellLearn_Canvas.h" #include "Interaction_Key.h" CUI_Manager::CUI_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -53,6 +54,7 @@ void CUI_Manager::Canvas_Change(UI_STATE eType) static_cast(m_pGamePlay_Canves)->Visible(true); static_cast(m_pSpell_Canvas)->Visible(false); static_cast(m_pQuest_Canvas)->Visible(false); + static_cast(m_pSpellLearn_Canvas)->Visible(false); break; case UI_STATE::SPELL: @@ -72,6 +74,13 @@ void CUI_Manager::Canvas_Change(UI_STATE eType) case UI_STATE::INVENTORY: break; + case UI_STATE::SPELLNEARN: + m_pMouse_Cursor->Set_Visible(true); + m_pCamera_LockOn->Set_Visible(false); + static_cast(m_pSpellLearn_Canvas)->Visible(true); + static_cast(m_pGamePlay_Canves)->Visible(false); + break; + default: return; } @@ -172,6 +181,11 @@ HRESULT CUI_Manager::Ready_Components(void* pArg) } Add_Canvas(TEXT("Interaction_Key"), m_pInteraction_Key); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn_Canvas)))) { + return E_FAIL; + } + Add_Canvas(TEXT("SpellLearn_Canvas"), m_pSpellLearn_Canvas); + return S_OK; } diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 23eb41d79..6e2141e7b 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -13,13 +13,14 @@ namespace Client enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLEND, TRAILWB_FOR_BLEND, TRAIL_BLUR, TRAIL_BLOOM, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, BLUR_NO_EMMISVE, BLUR_NO_WORLD_NO_EMISSIVE, WEIGHTBLEND_FOR_BLEND, DEPTH_STOP, WB_CULLING, SCREEN_FX, DISTORTION,END }; enum class SHADER_PASS_UIEDITOR { - DEFAULT, LOGO, LOGO_TEXT, LOGO_GLOW, ALPHABLEND, CLAMP, CURSOR, + DEFAULT, COLOR, LOGO, LOGO_TEXT, LOGO_GLOW, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, SPELL_DRAG, CAMERA_LOCKON, LODING_SCREEN, ENEMY_HPBAR, BOSS_HPBAR, QUEST_BORDER, QUEST_INFO, QUEST_STATUS, BROOMSTICK, - ENEMY_DETECTION, INTERACTION_OBJECT, END}; + SPELL_LEARN, + ENEMY_DETECTION, INTERACTION_OBJECT, END }; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, UVALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, SPELL_SLOT, SPELL_LOCK, QUEST_SLOT, END }; enum class SHADER_PASS_NPC_PBR_ANIM { @@ -27,7 +28,7 @@ namespace Client , OUTLINE_READ, TEETH_SRXO_ToSRO__OUTLINE_WRITE, EYE_DN_ToSRO__OUTLINE_WRITE, HEADwtHAND_DSRXON_ToSRO__OUTLINE_WRITE, UPPER_DMRON_ToMRO__OUTLINE_WRITE, EmissiveMetalness_DENMRO_ToMRO__OUTLINE_WRITE, MI_ClothSim_DSEN_ToSRO__OUTLINE_WRITE , END }; - enum class UI_STATE { GAMEPLAYER, SPELL, QUEST_CANVES, INVENTORY, END }; + enum class UI_STATE { GAMEPLAYER, SPELL, QUEST_CANVES, INVENTORY, SPELLNEARN, END }; enum class QUESTTYPE { MAIN, SUB, END }; enum class QUESTSTATE {NONE, ACCEPTED, CLEARED, END }; @@ -76,7 +77,7 @@ namespace Client enum class KEYINPUT { INPUT_1 = 1, INPUT_2, INPUT_3, INPUT_4, - INPUT_T, INPUT_G, INPUT_X, INPUT_Z, + INPUT_T, INPUT_G, INPUT_X, INPUT_Z, INPUT_ESPACE, INPUT_TAB, DIM_RBUTTON_UP, DIM_RBUTTON_DOWN, END diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index b3a9bda8d..b610406bc 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -91,6 +91,15 @@ namespace Client _int iAcceptState; }QUESTINFO; + typedef struct tagSpellLearnInfo + { + _wstring pSpellName{}; + _wstring pImageName{}; + _float fSpellSize{}; + _float2 fStartPosition{}; + vector<_vector> Lines; + }SPELLLEARNINFO; + typedef struct tagEffectInfo { _float4 vColor = { 0.f ,0.f ,0.f ,1.f }; diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index cce173060..526f60054 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -9,6 +9,7 @@ class CTransform; class CUnit; class CState; class CStat; +class CUIObject; NS_END NS_BEGIN(Client) @@ -75,6 +76,10 @@ DECLARE_SINGLETON(CInfoInstance) HRESULT Set_AcceptQuest(_int Index); #pragma endregion #pragma region Interactive_INFO +#pragma region SpellLearn_Data + const SPELLLEARNINFO& Get_SpellLearn(_int Index) const; + _int Get_SpellLearnIndex(); +#pragma endregion HRESULT Regist_ActiveInteractive(class CMapElement_Interactable* pInteractive); HRESULT Deregist_ActiveInteractive(class CMapElement_Interactable* pInteractive); #pragma endregion @@ -90,6 +95,7 @@ DECLARE_SINGLETON(CInfoInstance) class CQuest_Data* m_pQuestInfo= { nullptr }; class CInteractiveInfo* m_pInteractiveInfo = { nullptr }; class CDamage_Font* m_pDamage_Font = { nullptr }; + class CSpellLearn_Data* m_pSpellLearn_Data = { nullptr }; _uint m_eInput = ENUM_CLASS(KEYINPUT::END); _int m_eSpell = ENUM_CLASS(SKILL_TYPE::END); diff --git a/Jusin154_Team3D/Client/Public/Monster.h b/Jusin154_Team3D/Client/Public/Monster.h index f58172a4e..5f90e5aff 100644 --- a/Jusin154_Team3D/Client/Public/Monster.h +++ b/Jusin154_Team3D/Client/Public/Monster.h @@ -40,6 +40,8 @@ class CMonster abstract : public CUnit _float m_fOutLinePower = { 1.f }; _float m_fDisolveTime = { 0.f }; _bool m_bDisolve = { false }; + _float m_fDegree = {}; + _float m_fCross = {}; protected: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 0fdb84a3e..481ede14d 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -121,13 +121,17 @@ class CPlayer final : public CUnit _bool m_bLookAt = {false}; _bool m_bSpellHit = {}; _float3 m_BroomScale = { 0.f, 0.f, 0.f }; + _float3 m_vScale = { 0.f, 0.f, 0.f }; _float3 m_TargetScale = { 1.f, 1.f, 1.f }; _float m_fScaleSmoothSpeed = 2.5f; _bool m_bLumos = {}; _bool m_bShield = {false}; _float m_fAnimTime = {}; _bool m_bTurbo = {}; - + _float m_fBlinkTime = { }; + _float m_fAccel = { 1.f }; + _float m_fSlideSpeed = {}; + _float m_fTargetSpeed = { 7.f }; /* 무적 불 변수*/ #ifdef _DEBUG _bool m_isDebugMode = { false }; @@ -160,6 +164,10 @@ class CPlayer final : public CUnit HRESULT Behavior_DodgeExitCheck(_float fTimeDelta); void Behavior_DodgeExit(); + void Behavior_BlinkEnter(); + HRESULT Behavior_BlinkExitCheck(_float fTimeDelta); + void Behavior_BlinkExit(); + void Behavior_SlideEnter(); HRESULT Behavior_SlideExitCheck(_float fTimeDelta); void Behavior_SlideExit(); diff --git a/Jusin154_Team3D/Client/Public/Quest_Slot.h b/Jusin154_Team3D/Client/Public/Quest_Slot.h index 5a51a0bcf..812531768 100644 --- a/Jusin154_Team3D/Client/Public/Quest_Slot.h +++ b/Jusin154_Team3D/Client/Public/Quest_Slot.h @@ -68,7 +68,8 @@ class CQuest_Slot final : public CElementObject _float m_fPositionX{}; _float m_fPositionY{}; - _int m_Index{}; + _int m_iIndex{}; + _int m_iPrevIndex{}; vector m_Fonts; public: static CQuest_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/Ranrak.h b/Jusin154_Team3D/Client/Public/Ranrak.h index ef4a46fcb..41700366f 100644 --- a/Jusin154_Team3D/Client/Public/Ranrak.h +++ b/Jusin154_Team3D/Client/Public/Ranrak.h @@ -78,8 +78,6 @@ class CRanrak final : public CMonster _float m_fSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::END)] = {}; _float m_fMaxSkillCoolTime[ENUM_CLASS(RANRAK_SKILL::END)] = { 40.f,40.f ,15.f,40.f,40.f,40.f }; - _float m_fDegree = {}; - _float m_fCross = {}; _float m_fTuckedTime = {}; void Behavior_IdleEnter(); diff --git a/Jusin154_Team3D/Client/Public/SpellLearn.h b/Jusin154_Team3D/Client/Public/SpellLearn.h new file mode 100644 index 000000000..2e8e8f361 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/SpellLearn.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 CSpellLearn final : public CElementObject +{ +private: + CSpellLearn(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn(const CSpellLearn& rhs); + virtual ~CSpellLearn() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + HRESULT Change_Image(_int SpellID); + +private: + CInfoInstance* m_pInfoInstance = { nullptr }; + + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpellLearn* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/SpellLearn_Canvas.h b/Jusin154_Team3D/Client/Public/SpellLearn_Canvas.h new file mode 100644 index 000000000..34719df3f --- /dev/null +++ b/Jusin154_Team3D/Client/Public/SpellLearn_Canvas.h @@ -0,0 +1,50 @@ +#pragma once + +#include "Client_Define.h" +#include "CanvasObject.h" + +NS_BEGIN(Engine) +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpellLearn_Canvas final : public CCanvasObject +{ +private: + CSpellLearn_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_Canvas(const CSpellLearn_Canvas& rhs); + virtual ~CSpellLearn_Canvas() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Ready_Panel(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + void Clear_Penel(); + +private: + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CGameObject* m_pSpellLearn_Panel = { nullptr }; + +public: + static CSpellLearn_Canvas* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/SpellLearn_Data.h b/Jusin154_Team3D/Client/Public/SpellLearn_Data.h new file mode 100644 index 000000000..fa1942bee --- /dev/null +++ b/Jusin154_Team3D/Client/Public/SpellLearn_Data.h @@ -0,0 +1,44 @@ +#pragma once + +#include "Client_Define.h" +#include "Base.h" +#include "UIObject.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CUIObject; +NS_END + +NS_BEGIN(Client) + +class CSpellLearn_Data final : public CBase +{ +private: + CSpellLearn_Data(); + ~CSpellLearn_Data() = default; + +public: + void Update(_float fTimeDelta); +public: + HRESULT Load_SpellInfo(const _char* pFilePath);\ + + +public: + const SPELLLEARNINFO& Get_SpellLearn(_int Index) const; + _int Get_Index(); + +private: + CInfoInstance* m_pInfoInstance = { nullptr }; + + _int m_iSpellLearn_Count{}; + vector m_SpellLearnInfos; + +private: + HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + +public: + static CSpellLearn_Data* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/SpellLearn_MovePointer.h b/Jusin154_Team3D/Client/Public/SpellLearn_MovePointer.h new file mode 100644 index 000000000..a467bb9b9 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/SpellLearn_MovePointer.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 CSpellLearn_MovePointer final : public CElementObject +{ +private: + CSpellLearn_MovePointer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_MovePointer(const CSpellLearn_MovePointer& rhs); + virtual ~CSpellLearn_MovePointer() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + void Set_SpellLearn(_int Index); +private: + void Line(_float fTime); + + +private: + CInfoInstance* m_pInfoInstance = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _bool m_bMoveStart = { false }; + + _int m_iLineIndex{}; + _int m_iCurrentLine{}; + vector<_vector> m_MoveLine; + +public: + static CSpellLearn_MovePointer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/SpellLearn_Name.h b/Jusin154_Team3D/Client/Public/SpellLearn_Name.h new file mode 100644 index 000000000..5e06df1dd --- /dev/null +++ b/Jusin154_Team3D/Client/Public/SpellLearn_Name.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 CSpellLearn_Name final : public CElementObject +{ +private: + CSpellLearn_Name(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_Name(const CSpellLearn_Name& rhs); + virtual ~CSpellLearn_Name() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + void Set_Name(_int Index); + +private: + CInfoInstance* m_pInfoInstance = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _wstring m_pSpell_Name; + +public: + static CSpellLearn_Name* 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/SpellLearn_Panel.h b/Jusin154_Team3D/Client/Public/SpellLearn_Panel.h new file mode 100644 index 000000000..4d6a891bf --- /dev/null +++ b/Jusin154_Team3D/Client/Public/SpellLearn_Panel.h @@ -0,0 +1,62 @@ +#pragma once + +#include "Client_Define.h" +#include "PanelObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpellLearn_Panel final : public CPanelObject +{ + +private: + CSpellLearn_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_Panel(const CSpellLearn_Panel& rhs); + virtual ~CSpellLearn_Panel() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Ready_Element(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CInfoInstance* m_pInfoInstance = { nullptr }; + + vector m_Info = {}; + + CGameObject* m_pSpellLearn_Name = { nullptr }; + CGameObject* m_pSpellLearn = { nullptr }; + CGameObject* m_pSpellLearn_MovePointer = { nullptr }; + CGameObject* m_pSpellLearn_Data = { nullptr }; + + _int Index{}; + +public: + static CSpellLearn_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/Troll.h b/Jusin154_Team3D/Client/Public/Troll.h index a1f6835ca..d3b0a661a 100644 --- a/Jusin154_Team3D/Client/Public/Troll.h +++ b/Jusin154_Team3D/Client/Public/Troll.h @@ -97,9 +97,6 @@ class CTroll final : public CMonster _float m_fRushTime = {}; _float m_fAttackDelay = {}; - _float m_fDegree = {}; - _float m_fCross = {}; - void Behavior_IdleEnter(); HRESULT Behavior_IdleExitCheck(); void Behavior_IdleExit(); diff --git a/Jusin154_Team3D/Client/Public/UI_Manager.h b/Jusin154_Team3D/Client/Public/UI_Manager.h index afacb5176..8025623e5 100644 --- a/Jusin154_Team3D/Client/Public/UI_Manager.h +++ b/Jusin154_Team3D/Client/Public/UI_Manager.h @@ -54,6 +54,7 @@ class CUI_Manager final : public CUIObject CGameObject* m_pSpell_Canvas = { nullptr }; CGameObject* m_pMouse_Cursor = { nullptr }; CGameObject* m_pQuest_Canvas = { nullptr }; + CGameObject* m_pSpellLearn_Canvas = { nullptr }; CGameObject* m_pCamera_LockOn = { nullptr }; CGameObject* m_pDamage_Font = { nullptr }; CGameObject* m_pInteraction_Key = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml index 06c4d8874..4f369b4a4 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml @@ -3,4 +3,5 @@ + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml deleted file mode 100644 index 34ec5ed9b..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/SpellLearn.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/SpellLearn.xml new file mode 100644 index 000000000..a5a168e36 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/SpellLearn.xml @@ -0,0 +1,340 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl index da220009a..0f5360124 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl @@ -3,10 +3,9 @@ struct BoneOut { - row_major float4x4 Local; row_major float4x4 Combined; + row_major float4x4 Local; row_major float4x4 LocalCombined; - }; float4x4 g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; float4x4 g_PrevWorldMatrix, g_PrevViewMatrix, g_PrevProjMatrix; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index da3d61395..a9d7fff5f 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -120,6 +120,20 @@ PS_OUT PS_MAIN(PS_IN In) return Out; } +PS_OUT PS_Texture_Color(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); + float4 Color = g_Texture1.Sample(DefaultSampler, In.vTexcoord); + + tex1.rgb *= Color.rgb; + + tex1.a *= Alpha; + Out.vColor = tex1; + return Out; +} + PS_OUT PS_Logo(PS_IN In) { PS_OUT Out; @@ -517,12 +531,15 @@ PS_OUT PS_Rotation(PS_IN In) float2 center = float2(0.5f, 0.5f); float2 uv = In.vTexcoord - center; - float2 Rotation = In.vTexcoord; + float2 Rotation; Rotation.x = uv.x * cos(g_fMapAngle) - uv.y * sin(g_fMapAngle); Rotation.y = uv.x * sin(g_fMapAngle) + uv.y * cos(g_fMapAngle); Rotation += center; - float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + float4 tex1 = g_Texture.Sample(BorderZeroLinearSampler, Rotation); + + if (tex1.a <= 0.f) + discard; color = tex1; @@ -1988,6 +2005,16 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_MAIN(); } + pass Texture_Color + { + 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_Texture_Color(); + } + pass Logo { SetRasterizerState(RS_Default); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Accio_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Accio.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Accio_Path.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Accio.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Bombarda_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Bombarda.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Bombarda_Path.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Bombarda.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Descendo_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Descendo.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Descendo_Path.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Descendo.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Levioso_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Levioso.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Levioso_Path.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Levioso.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Lumos_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Lumos.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Lumos_Path.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Lumos.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Revelio_Path.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Revelio.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Revelio_Path.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/Revelio.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Cursor.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Cursor.png index 25f79bf8d..3398d2963 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Cursor.png and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellUnlock/UI_T_SU_Cursor.png differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 39ddab3ef..1980633a3 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -197,8 +197,10 @@ call Update_Shaders.bat + + @@ -420,8 +422,10 @@ call Update_Shaders.bat + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 5efb931c5..3eb9266b7 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -627,6 +627,12 @@ {eef1db06-8a9f-42b4-93e2-cc29de2b275d} + + + {6e769435-83c4-4f64-b306-1b8c5f2d228d} + + + {54a92f0d-26f1-49bf-a13b-ab11995968c7} @@ -1251,6 +1257,12 @@ 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_MovePointer + + 50.UI\SpellLearn_Data + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SPellLeam_SpeedPointer + @@ -1876,6 +1888,12 @@ 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_MovePointer + + 50.UI\SpellLearn_Data + + + 50.UI\SpellLearn_Canvas\SpellLearn_Panel\SPellLeam_SpeedPointer + diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 05c32c8f4..879703ab6 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -111,6 +111,8 @@ #include "QuestInstance.h" +#include "SpellLearn_Data.h" + #include "SpellLearn_Canvas.h" #include "SpellLearn_Panel.h" #include "SpellLearn_Name.h" @@ -1207,6 +1209,10 @@ HRESULT CLoader::Loading_For_UI() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Data::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpellLearn_Canvas::Create(m_pDevice, m_pContext)))) { return E_FAIL; @@ -2375,11 +2381,6 @@ HRESULT CLoader::Loading_For_ObjectViewer() TEXT("Prototype_Component_Dragon_Model") )); - futures.emplace_back(Deferred_ModelLoad( - MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/Dragon_Anim.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), - TEXT("Prototype_Component_Dragon_Model") - )); - #pragma endregion futures.emplace_back(Deferred_ModelLoad( @@ -2407,12 +2408,6 @@ HRESULT CLoader::Loading_For_ObjectViewer() TEXT("Prototype_Component_Npc_Model") )); - - //futures.emplace_back(Deferred_ModelLoad( - // MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/SK_ConjuredDragon_Anim.fbx", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(), - // TEXT("Prototype_Component_Npc_Model") - //)); - futures.emplace_back(Deferred_ModelLoad( MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin",XMMatrixIdentity(), TEXT("Prototype_Component_Wand_Model") diff --git a/Jusin154_Team3D/Editor/Private/Quest_Data.cpp b/Jusin154_Team3D/Editor/Private/Quest_Data.cpp index 87145ea6f..398972733 100644 --- a/Jusin154_Team3D/Editor/Private/Quest_Data.cpp +++ b/Jusin154_Team3D/Editor/Private/Quest_Data.cpp @@ -242,6 +242,7 @@ void CQuest_Data::Free() { __super::Free(); + SAFE_RELEASE(m_pVIBufferCom); } void CQuest_Data::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/SPellLeam_SpeedPointer.cpp b/Jusin154_Team3D/Editor/Private/SPellLeam_SpeedPointer.cpp new file mode 100644 index 000000000..de1ee7712 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SPellLeam_SpeedPointer.cpp @@ -0,0 +1,96 @@ +#include "pch.h" +#include "SPellLeam_SpeedPointer.h" +#include "GameInstance.h" + +CSPellLeam_SpeedPointer::CSPellLeam_SpeedPointer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSPellLeam_SpeedPointer::CSPellLeam_SpeedPointer(const CSPellLeam_SpeedPointer& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSPellLeam_SpeedPointer::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSPellLeam_SpeedPointer::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 476.f; + Desc.fY = -253.f; + Desc.fSizeX = 32.f; + Desc.fSizeY = 32.f; + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 5.f; + m_fMoveSpeed = 15.f; + m_fAngle = XMConvertToRadians(0); + Visible(false); + return S_OK; +} + +void CSPellLeam_SpeedPointer::Priority_Update(_float fTimeDelta) +{ +} + +void CSPellLeam_SpeedPointer::Update(_float fTimeDelta) +{ +} + +void CSPellLeam_SpeedPointer::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CSPellLeam_SpeedPointer::Render() +{ + return S_OK; +} + +_vector CSPellLeam_SpeedPointer::Get_WorldPostion() +{ + return _vector(); +} + +HRESULT CSPellLeam_SpeedPointer::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CSPellLeam_SpeedPointer::Ready_Components(void* pArg) +{ + return S_OK; +} + +CSPellLeam_SpeedPointer* CSPellLeam_SpeedPointer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + return nullptr; +} + +CGameObject* CSPellLeam_SpeedPointer::Clone(void* pArg, CGameObject* pOwner) +{ + return nullptr; +} + +void CSPellLeam_SpeedPointer::Free() +{ +} + +void CSPellLeam_SpeedPointer::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn.cpp index 947fe07b2..406e63368 100644 --- a/Jusin154_Team3D/Editor/Private/SpellLearn.cpp +++ b/Jusin154_Team3D/Editor/Private/SpellLearn.cpp @@ -39,6 +39,7 @@ HRESULT CSpellLearn::Initialize(void* pArg) m_fTimeMult = 3.f; m_fAlpha = 1.f; m_fAlphaTime = 5.f; + Change_Image(0); Visible(false); return S_OK; } @@ -105,7 +106,7 @@ HRESULT CSpellLearn::Render() if (FAILED(Bind_ShaderResources())) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::COLOR)))) { return E_FAIL; } if (FAILED(m_pVIBufferCom->Bind_Resources())) { @@ -133,7 +134,6 @@ HRESULT CSpellLearn::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) { return E_FAIL; @@ -142,6 +142,10 @@ HRESULT CSpellLearn::Bind_ShaderResources() { 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; @@ -171,7 +175,11 @@ HRESULT CSpellLearn::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SU_Levioso_Path"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Levioso"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_Goldleaf_Large"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) { return E_FAIL; } @@ -183,6 +191,22 @@ HRESULT CSpellLearn::Ready_Components(void* pArg) return S_OK; } +HRESULT CSpellLearn::Change_Image(_int SpellID) +{ + _wstring pName = TEXT("Prototype_Texture_"); + _wstring pImageName = pName + static_cast(m_pOwner)->Get_Learninfo(SpellID).pImageName; + + if (m_pDiffuse_TextureCom) + { + Remove_Component(); + SAFE_RELEASE(m_pDiffuse_TextureCom); + } + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(LEVEL::UI), pImageName, reinterpret_cast(&m_pDiffuse_TextureCom)))) + return E_FAIL; + + return S_OK; +} + CSpellLearn* CSpellLearn::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CSpellLearn* pInstance = new CSpellLearn(pDevice, pContext); @@ -202,7 +226,7 @@ CGameObject* CSpellLearn::Clone(void* pArg, CGameObject* pOwner) pInstance->m_pOwner = pOwner; if (FAILED(pInstance->Initialize(pArg))) { - MSG_BOX("Failed to Cloned : CSpell_Header"); + MSG_BOX("Failed to Cloned : CSpellLearn"); SAFE_RELEASE(pInstance); } @@ -214,6 +238,7 @@ void CSpellLearn::Free() __super::Free(); SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Data.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Data.cpp new file mode 100644 index 000000000..da293f8fe --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Data.cpp @@ -0,0 +1,153 @@ +#include "pch.h" +#include "SpellLearn_Data.h" +#include "GameObject.h" +#include "UIObject.h" + +CSpellLearn_Data::CSpellLearn_Data(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CGameObject(pDevice, pContext) +{ +} + +CSpellLearn_Data::CSpellLearn_Data(const CSpellLearn_Data& rhs) + :CGameObject(rhs) +{ +} + +HRESULT CSpellLearn_Data::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpellLearn_Data::Initialize(void* pArg) +{ + auto* pInfo = static_cast*>(pArg); + + tinyxml2::XMLDocument doc; + if (doc.LoadFile("../Bin/Resources/Data/UI/SpellLearn.xml") != tinyxml2::XML_SUCCESS) + return E_FAIL; + + tinyxml2::XMLElement* pSpellLearnInfo = doc.FirstChildElement("SpellLearnInfo"); + if (!pSpellLearnInfo) return E_FAIL; + + tinyxml2::XMLElement* pSpellLearnData = pSpellLearnInfo->FirstChildElement("SpellLearnData"); + if (!pSpellLearnData) return E_FAIL; + + // 모든 Name 요소 반복 + tinyxml2::XMLElement* pName = pSpellLearnData->FirstChildElement("Name"); + while (pName) + { + CUIObject::SPELLLEARNINFO Info{}; + + // 속성 읽기 + Info.pSpellName = CMyTools::ToWstring(pName->Attribute("SpellName")); + Info.pImageName = CMyTools::ToWstring(pName->Attribute("ImageName")); + pName->QueryFloatAttribute("Size", &Info.fSpellSize); + + _float fX{}, fY{}; + pName->QueryFloatAttribute("x", &fX); + pName->QueryFloatAttribute("y", &fY); + Info.fStartPosition = _float2(fX, fY); + + // Position 요소 반복 + tinyxml2::XMLElement* pPosition = pName->FirstChildElement("Position"); + while (pPosition) + { + tinyxml2::XMLElement* pPos = pPosition->FirstChildElement("Pos"); + if (pPos) + { + _float px{}, py{}; + pPos->QueryFloatAttribute("x", &px); + pPos->QueryFloatAttribute("y", &py); + Info.Lines.push_back(XMVectorSet(px, py, 0.f, 1.f)); + } + + // 다음 Position으로 이동 + pPosition = pPosition->NextSiblingElement("Position"); + } + + // 벡터에 추가 + m_SpellLearnInfos.push_back(Info); + m_iSpellLearn_Count++; + + // 다음 Name으로 이동 + pName = pName->NextSiblingElement("Name"); + } + + *pInfo = m_SpellLearnInfos; + + return S_OK; +} + +const CUIObject::SPELLLEARNINFO& CSpellLearn_Data::Get_SpellLearn(_int Index) const +{ + return m_SpellLearnInfos[Index]; +} + +void CSpellLearn_Data::Priority_Update(_float fTimeDelta) +{ +} + +void CSpellLearn_Data::Update(_float fTimeDelta) +{ +} + +void CSpellLearn_Data::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CSpellLearn_Data::Render() +{ + return S_OK; +} + +_vector CSpellLearn_Data::Get_WorldPostion() +{ + return _vector(); +} + +HRESULT CSpellLearn_Data::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CSpellLearn_Data::Ready_Components(void* pArg) +{ + return S_OK; +} + +CSpellLearn_Data* CSpellLearn_Data::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpellLearn_Data* pInstance = new CSpellLearn_Data(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpellLearn_Data"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpellLearn_Data::Clone(void* pArg, CGameObject* pOwner) +{ + CSpellLearn_Data* pInstance = new CSpellLearn_Data(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpellLearn_Data"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpellLearn_Data::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpellLearn_Data::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_MovePointer.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_MovePointer.cpp index 86b1ccd78..2c9c95b4c 100644 --- a/Jusin154_Team3D/Editor/Private/SpellLearn_MovePointer.cpp +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_MovePointer.cpp @@ -21,8 +21,8 @@ HRESULT CSpellLearn_MovePointer::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 454.f; - Desc.fY = -240.f; + Desc.fX = 476.f; + Desc.fY = -253.f; Desc.fSizeX = 32.f; Desc.fSizeY = 32.f; m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; @@ -40,32 +40,30 @@ HRESULT CSpellLearn_MovePointer::Initialize(void* pArg) m_fAlpha = 1.f; m_fAlphaTime = 5.f; m_fMoveSpeed = 15.f; - m_MoveLine.push_back(XMVectorSet(454.f, -240.f, 0.f, 1.f)); - m_MoveLine.push_back(XMVectorSet(454.f, 90.f, 0.f, 1.f)); - - - - Index = 0; - + Set_SpellLearn(0); + m_fAngle = XMConvertToRadians(0); Visible(false); return S_OK; } -void CSpellLearn_MovePointer::SpellLearn(_int Index) +void CSpellLearn_MovePointer::Set_SpellLearn(_int Index) { - m_iSpell = Index; - m_bMoveStart = true; + m_iLineIndex = _int(static_cast(m_pOwner)->Get_Learninfo(Index).Lines.size()); + m_MoveLine = static_cast(m_pOwner)->Get_Learninfo(Index).Lines; + m_iCurrentLine = 0; + m_fX = static_cast(m_pOwner)->Get_Learninfo(Index).fStartPosition.x; + m_fY = static_cast(m_pOwner)->Get_Learninfo(Index).fStartPosition.y; } void CSpellLearn_MovePointer::Line(_float fTime) { - m_vLerp_Position = m_MoveLine[Index]; + m_vLerp_Position = m_MoveLine[m_iCurrentLine]; if (Start_Lerp(m_fMoveSpeed * fTime) == true) { - if (Index < m_MoveLine.size() -1) + if (m_iCurrentLine < m_iLineIndex - 1) { - ++Index; + ++m_iCurrentLine; } else { @@ -123,16 +121,22 @@ void CSpellLearn_MovePointer::Update(_float fTimeDelta) if (m_bMoveStart == true) { - if (m_iSpell == ENUM_CLASS(SPELL_LINE::LINE)) - { - Line(fTimeDelta); - } - else if (m_iSpell == ENUM_CLASS(SPELL_LINE::CURVE)) - { - //Curve(); - } + Line(fTimeDelta); } + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -ptMouse.y + (g_iWinSizeY * 0.5f); + + fMouse.x = fMouse.x - m_fX; + fMouse.y = fMouse.y - m_fY; + + + m_fAngle = atan2(-fMouse.x, fMouse.y); + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } @@ -154,7 +158,7 @@ HRESULT CSpellLearn_MovePointer::Render() if (FAILED(Bind_ShaderResources())) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ROTATION)))) { return E_FAIL; } if (FAILED(m_pVIBufferCom->Bind_Resources())) { @@ -211,6 +215,10 @@ HRESULT CSpellLearn_MovePointer::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fMapAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Name.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Name.cpp index ed9106018..ec41f369f 100644 --- a/Jusin154_Team3D/Editor/Private/SpellLearn_Name.cpp +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Name.cpp @@ -43,10 +43,16 @@ HRESULT CSpellLearn_Name::Initialize(void* pArg) m_fFontY = 520.f; SizeUpX(550.f); SizeUpY(27.f); + Set_Name(0); Visible(false); return S_OK; } +void CSpellLearn_Name::Set_Name(_int Index) +{ + SizeUpX(static_cast(m_pOwner)->Get_Learninfo(Index).fSpellSize); + m_pSpell_Name = static_cast(m_pOwner)->Get_Learninfo(Index).pSpellName; +} void CSpellLearn_Name::Priority_Update(_float fTimeDelta) { @@ -120,8 +126,8 @@ HRESULT CSpellLearn_Name::Render() return E_FAIL; } - _float OffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), TEXT("봄바르다")) - 30) * 0.5f; - m_pGameInstance->Render_Text(TEXT("Font_size20"), TEXT("봄바르다"), _float2((m_fFontX + m_fX) - OffSet, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + _float OffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), m_pSpell_Name.c_str()) - 30) * 0.5f; + m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pSpell_Name.c_str(), _float2((m_fFontX + m_fX) - OffSet, m_fFontY - m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp index fc448de6a..62eba1f91 100644 --- a/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Panel.cpp @@ -4,6 +4,7 @@ #include "SpellLearn_Name.h" #include "SpellLearn.h" #include "SpellLearn_MovePointer.h" +#include "SpellLearn_Data.h" CSpellLearn_Panel::CSpellLearn_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -49,6 +50,11 @@ HRESULT CSpellLearn_Panel::Initialize(void* pArg) return S_OK; } +const CUIObject::SPELLLEARNINFO CSpellLearn_Panel::Get_Learninfo(_int Index) +{ + return static_cast(m_pSpellLearn_Data)->Get_SpellLearn(Index); +} + void CSpellLearn_Panel::Priority_Update(_float fTimeDelta) { if (!__super::Chack_Visible()) @@ -64,6 +70,22 @@ void CSpellLearn_Panel::Update(_float fTimeDelta) { return; } + + if (m_pGameInstance->Key_Down(DIK_M)) + { + if (Index >= m_Info.size() - 1) + { + Index = 0; + } + else + { + Index++; + } + static_cast(m_pSpellLearn)->Change_Image(Index); + static_cast(m_pSpellLearn_MovePointer)->Set_SpellLearn(Index); + static_cast(m_pSpellLearn_Name)->Set_Name(Index); + } + __super::Update(fTimeDelta); } @@ -167,6 +189,11 @@ HRESULT CSpellLearn_Panel::Ready_Components(void* pArg) HRESULT CSpellLearn_Panel::Ready_Element(void* pArg) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, &m_Info, this, reinterpret_cast(&m_pSpellLearn_Data)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpellLearn_Name)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 35c5b4156..d74bf1448 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -28,7 +28,7 @@ namespace Editor enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLEND, TRAILWB_FOR_BLEND, TRAIL_BLUR, TRAIL_BLOOM, END }; - enum class SHADER_PASS_UIEDITOR { DEFAULT, LOGO, LOGO_TEXT, LOGO_GLOW, ALPHABLEND, CLAMP, CURSOR, + enum class SHADER_PASS_UIEDITOR { DEFAULT, COLOR, LOGO, LOGO_TEXT, LOGO_GLOW, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, diff --git a/Jusin154_Team3D/Editor/Public/SPellLeam_SpeedPointer.h b/Jusin154_Team3D/Editor/Public/SPellLeam_SpeedPointer.h new file mode 100644 index 000000000..a2c881d6d --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SPellLeam_SpeedPointer.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CSPellLeam_SpeedPointer final : public CElementObject +{ +private: + CSPellLeam_SpeedPointer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSPellLeam_SpeedPointer(const CSPellLeam_SpeedPointer& rhs); + virtual ~CSPellLeam_SpeedPointer() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSPellLeam_SpeedPointer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn.h b/Jusin154_Team3D/Editor/Public/SpellLearn.h index e5dcfcd5b..e5e54bade 100644 --- a/Jusin154_Team3D/Editor/Public/SpellLearn.h +++ b/Jusin154_Team3D/Editor/Public/SpellLearn.h @@ -25,8 +25,12 @@ class CSpellLearn final : public CElementObject virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; +public: + HRESULT Change_Image(_int SpellID); + private: CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn_Data.h b/Jusin154_Team3D/Editor/Public/SpellLearn_Data.h new file mode 100644 index 000000000..b3c9f6f4e --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_Data.h @@ -0,0 +1,57 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" +#include "UIObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpellLearn_Data final : public CGameObject +{ +private: + //typedef struct tagSpellLearnInfo + //{ + // _wstring pSpellName; + // _wstring pImageName; + // _float fSpellSize{}; + // _float2 fStartPosition{}; + // vector<_float2> Lines; + //}SPELLLEARNINFO; +private: + CSpellLearn_Data(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpellLearn_Data(const CSpellLearn_Data& rhs); + virtual ~CSpellLearn_Data() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + const CUIObject::SPELLLEARNINFO& Get_SpellLearn(_int Index) const; + +private: + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _int m_iSpellLearn_Count{}; + vector m_SpellLearnInfos; +public: + static CSpellLearn_Data* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h b/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h index 1cbad5c47..9adb87aaf 100644 --- a/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_MovePointer.h @@ -26,7 +26,7 @@ class CSpellLearn_MovePointer final : public CElementObject virtual HRESULT Initialize(void* pArg) override; public: - void SpellLearn(_int Index); + void Set_SpellLearn(_int Index); private: void Line(_float fTime); @@ -37,9 +37,9 @@ class CSpellLearn_MovePointer final : public CElementObject CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; _bool m_bMoveStart = { false }; - _int m_iSpell{}; - _int Index{}; + _int m_iLineIndex{}; + _int m_iCurrentLine{}; vector<_vector> m_MoveLine; public: diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn_Name.h b/Jusin154_Team3D/Editor/Public/SpellLearn_Name.h index 6449ec521..c97d6dcd5 100644 --- a/Jusin154_Team3D/Editor/Public/SpellLearn_Name.h +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_Name.h @@ -25,11 +25,16 @@ class CSpellLearn_Name final : public CElementObject virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; +public: + void Set_Name(_int Index); + private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + _wstring m_pSpell_Name; + public: static CSpellLearn_Name* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/SpellLearn_Panel.h b/Jusin154_Team3D/Editor/Public/SpellLearn_Panel.h index 8cb5c3066..5405b5c18 100644 --- a/Jusin154_Team3D/Editor/Public/SpellLearn_Panel.h +++ b/Jusin154_Team3D/Editor/Public/SpellLearn_Panel.h @@ -31,15 +31,23 @@ class CSpellLearn_Panel final : public CPanelObject virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; +public: + virtual const SPELLLEARNINFO Get_Learninfo(_int Index) override; + private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CTexture* m_pDiffuse_TextureCom1 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + vector m_Info = {}; + CGameObject* m_pSpellLearn_Name = { nullptr }; CGameObject* m_pSpellLearn = { nullptr }; CGameObject* m_pSpellLearn_MovePointer = { nullptr }; + CGameObject* m_pSpellLearn_Data = { nullptr }; + + _int Index{}; public: static CSpellLearn_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index d1ab424f7..89a3cb2f2 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -629,12 +629,18 @@ call Update_Lib.bat - + + Effect + 5.0 + Effect 5.0 - + + Effect + 5.0 + Effect 5.0 diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index c811d2423..f06d02f4e 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -188,8 +188,6 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) ComputeAnimation(m_iCurrentAnimIndex, 0); - - if (m_bRatio) { Update_RootBone(m_fAmount * m_fRatio); } @@ -1621,7 +1619,6 @@ HRESULT CModel::Create_Local() void CModel::ComputeAnimation(_uint AnimIndex,_uint MeshIndex) { - ComputeLocal(AnimIndex,MeshIndex); if (m_pComputeShader == nullptr) @@ -1660,17 +1657,26 @@ void CModel::ComputeAnimation(_uint AnimIndex,_uint MeshIndex) 1, m_pConstantBuffer ); + + ID3D11UnorderedAccessView* nullUAV[1] = { nullptr }; + UINT counts[1] = { 0 }; + m_pContext->CSSetUnorderedAccessViews(0, 1, nullUAV, counts); + + ID3D11ShaderResourceView* nullSRV[3] = { nullptr }; + m_pContext->CSSetShaderResources(0, 3, nullSRV); + } void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) { D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {}; + auto* anim = m_Animations[AnimIndex]; + if (SUCCEEDED(m_pContext->Map(m_pConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &ConstantSubResource))) { ANIMSTATE_DESC* pDesc = static_cast(ConstantSubResource.pData); - auto* anim = m_Animations[AnimIndex]; pDesc->CurrentTime = anim->Get_CurrentTrackPosition(); pDesc->Duration = anim->Get_Duration(); pDesc->MeshBoneCount = m_Meshes[MeshIndex]->Get_NumBone(); @@ -1702,7 +1708,6 @@ void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) m_Meshes[MeshIndex]->Get_BoneRemapBuffer() }; - auto* anim = m_Animations[AnimIndex]; ID3D11ShaderResourceView* srvs[] = { anim->Get_KeyFrameSrv(), @@ -1734,6 +1739,11 @@ void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) UINT counts[1] = { 0 }; m_pContext->CSSetUnorderedAccessViews(0, 1, nullUAV, counts); + ID3D11ShaderResourceView* nullSRV[7] = { nullptr }; + + m_pContext->CSSetShaderResources(0, 7, nullSRV); + + } @@ -1811,7 +1821,7 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _ #ifndef _DEBUG -HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) +HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix, _uint iLevel) { m_eType = eType; @@ -1829,7 +1839,7 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _ return E_FAIL; } - if (FAILED(Ready_Materials(pModelFilePath))) { + if (FAILED(Ready_Materials(pModelFilePath, iLevel))) { return E_FAIL; } if (MODEL::PBR_ANIM == m_eType || MODEL::PBR_NONANIM == m_eType) { diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index cdbec8ce2..a627e723b 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -496,15 +496,6 @@ HRESULT CRenderTarget_Manager::Finish_RenderTarget(CVIBuffer_Rect* pVIBuffer, CS return S_OK; } -_float2 CRenderTarget_Manager::Get_RenderTargetSize(const _wstring& wstrTargetKey) -{ - CRenderTarget* pRenderTarget = Find_RenderTarget(wstrTargetKey); - if (nullptr == pRenderTarget) { - return _float2(); - } - - return pRenderTarget->Get_TargetSize(); -} HRESULT CRenderTarget_Manager::End_MRT() { diff --git a/Jusin154_Team3D/Engine/Private/Transform.cpp b/Jusin154_Team3D/Engine/Private/Transform.cpp index 068c00e44..ad2244a41 100644 --- a/Jusin154_Team3D/Engine/Private/Transform.cpp +++ b/Jusin154_Team3D/Engine/Private/Transform.cpp @@ -212,6 +212,26 @@ _vector CTransform::Go_LerpStraight(_float fSpeed, _float fTimeDelta) return +vMomentum; } +_vector CTransform::Go_LerpLeft(_float fSpeed, _float fTimeDelta) +{ + _vector vPos = Get_State(STATE::POSITION); + _vector vRight = Get_State(STATE::RIGHT); + _vector vMomentum = XMVector3Normalize(vRight) * fSpeed * fTimeDelta; + vPos -= vMomentum; + Set_State(STATE::POSITION, vPos); + return -vMomentum; +} + +_vector CTransform::Go_LerpRight(_float fSpeed, _float fTimeDelta) +{ + _vector vPos = Get_State(STATE::POSITION); + _vector vRight = Get_State(STATE::RIGHT); + _vector vMomentum = XMVector3Normalize(vRight) * fSpeed * fTimeDelta; + vPos += vMomentum; + Set_State(STATE::POSITION, vPos); + return +vMomentum; +} + _vector CTransform::Go_LerpUp(_float fSpeed, _float fTimeDelta) { _vector vPos = Get_State(STATE::POSITION); diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index d88e3d418..eab58ba82 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -513,6 +513,11 @@ const CUIObject::QUESTINFO CUIObject::Get_QuestInfo(_int Index) return QUESTINFO(); } +const CUIObject::SPELLLEARNINFO CUIObject::Get_Learninfo(_int Index) +{ + return SPELLLEARNINFO(); +} + void CUIObject::Set_FontX(_float fFontX) { m_fFontX = fFontX; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Macro.h b/Jusin154_Team3D/Engine/Public/Engine_Macro.h index 8a05494c6..523d96f33 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Macro.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Macro.h @@ -47,7 +47,7 @@ #undef ASSERT_INHYUK #define ASSERT_INHYUK(expression) assert(expression) //#undef OPTIONAL_TRUE_KEYINPUTGUICHECK -#define OPTIONAL_TRUE_KEYINPUTGUICHECK ||true +//#define OPTIONAL_TRUE_KEYINPUTGUICHECK || true #endif diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget.h b/Jusin154_Team3D/Engine/Public/RenderTarget.h index 00abc3ec4..9ffa13a59 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget.h @@ -22,7 +22,6 @@ class CRenderTarget final : public CBase void Copy_ResourceFrom(ID3D11Texture2D* pTexture2D); void Copy_ResourceFrom(const CRenderTarget& Target); void Get_TextureDesc(D3D11_TEXTURE2D_DESC& Desc); - _float2 Get_TargetSize() { return m_vTargetSize; }; #ifdef _DEBUG public: diff --git a/Jusin154_Team3D/Engine/Public/Transform.h b/Jusin154_Team3D/Engine/Public/Transform.h index c876d9e03..4e81f7b3a 100644 --- a/Jusin154_Team3D/Engine/Public/Transform.h +++ b/Jusin154_Team3D/Engine/Public/Transform.h @@ -53,6 +53,8 @@ class ENGINE_DLL CTransform final : void Move_Right(_float fScala); /////////////////////////////////// _vector Go_LerpStraight(_float fSpeed, _float fTimeDelta); + _vector Go_LerpLeft(_float fSpeed, _float fTimeDelta); + _vector Go_LerpRight(_float fSpeed, _float fTimeDelta); _vector Go_LerpUp(_float fSpeed, _float fTimeDelta); _vector Go_LerpDown(_float fSpeed, _float fTimeDelta); diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index cbd2bff11..c37bd7ca5 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -74,6 +74,15 @@ typedef struct tagCurrentQeustSerectInfo _int iQuestIndex{}; }CURRENTQUESTSECETINFO; +typedef struct tagSpellLearnInfo +{ + _wstring pSpellName{}; + _wstring pImageName{}; + _float fSpellSize{}; + _float2 fStartPosition{}; + vector<_vector> Lines; +}SPELLLEARNINFO; + protected: CUIObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CUIObject(const CUIObject& rhs); @@ -175,6 +184,7 @@ typedef struct tagCurrentQeustSerectInfo virtual const SPELLINFO Get_Info(_int Index); virtual const QUESTINFO Get_QuestInfo(_int Index); + virtual const SPELLLEARNINFO Get_Learninfo(_int Index); virtual void Set_FontX(_float fFontX); virtual void Set_FontY(_float fFontY);