From 04deb45dd873e8be5df4745179671344479b672c Mon Sep 17 00:00:00 2001 From: qordlsgur <127704460+qordlsgur@users.noreply.github.com> Date: Fri, 5 Dec 2025 05:22:59 +0900 Subject: [PATCH] =?UTF-8?q?[Modify]=20=EC=8A=A4=ED=82=AC=20=ED=94=8C?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=96=B4=EC=99=80=20=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Client/Default/Broom_States.cpp | 4 +- .../Client/Private/Action_Panel.cpp | 72 +++++++++++- .../Client/Private/Current_Spell_Slot.cpp | 5 + .../Client/Private/InfoInstance.cpp | 46 ++++++++ Jusin154_Team3D/Client/Private/Player.cpp | 3 + .../Client/Private/Player_States.cpp | 14 +++ Jusin154_Team3D/Client/Private/Skill_Data.cpp | 48 +++++++- .../Client/Private/Spell_Overlay.cpp | 106 +++++++++++++++--- Jusin154_Team3D/Client/Public/Action_Panel.h | 16 ++- Jusin154_Team3D/Client/Public/Client_Enum.h | 4 +- Jusin154_Team3D/Client/Public/Client_Struct.h | 1 + .../Client/Public/Current_Spell_Slot.h | 8 +- Jusin154_Team3D/Client/Public/InfoInstance.h | 10 +- Jusin154_Team3D/Client/Public/Player.h | 4 + Jusin154_Team3D/Client/Public/Skill_Data.h | 7 +- Jusin154_Team3D/Client/Public/Spell_Overlay.h | 22 +++- .../Bin/Resources/Data/UI/Spell/SpellInfo.xml | 70 ++++++------ .../Editor/Private/Action_Panel.cpp | 4 +- .../Editor/Private/Current_Spell_Slot.cpp | 2 +- 19 files changed, 372 insertions(+), 74 deletions(-) diff --git a/Jusin154_Team3D/Client/Default/Broom_States.cpp b/Jusin154_Team3D/Client/Default/Broom_States.cpp index 315aad225..25a45f5b9 100644 --- a/Jusin154_Team3D/Client/Default/Broom_States.cpp +++ b/Jusin154_Team3D/Client/Default/Broom_States.cpp @@ -58,8 +58,8 @@ HRESULT CBroom::InputKeyUpMove() HRESULT CBroom::InputSpell() { if ( - m_pGameInstance->Key_Down(DIK_1) - || m_pGameInstance->Key_Down(DIK_2) +/* m_pGameInstance->Key_Down(DIK_1) + ||*/ m_pGameInstance->Key_Down(DIK_2) || m_pGameInstance->Key_Down(DIK_3) || m_pGameInstance->Key_Down(DIK_4) ) diff --git a/Jusin154_Team3D/Client/Private/Action_Panel.cpp b/Jusin154_Team3D/Client/Private/Action_Panel.cpp index adc0bf6e4..be9576acf 100644 --- a/Jusin154_Team3D/Client/Private/Action_Panel.cpp +++ b/Jusin154_Team3D/Client/Private/Action_Panel.cpp @@ -10,6 +10,7 @@ #include "Spell_UI.h" #include "Potion.h" #include "Magic_Item.h" +#include "InfoInstance.h" CAction_Panel::CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -17,7 +18,8 @@ CAction_Panel::CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContex } CAction_Panel::CAction_Panel(const CAction_Panel& rhs) - :CPanelObject(rhs) + :CPanelObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -56,6 +58,8 @@ HRESULT CAction_Panel::Initialize(void* pArg) Magic_Meter_Visible(5, true); Visible(true); ElementAllVisible(true); + m_pInfoInstance->Add_Event(TEXT("Spell"), [this](void* p) {this->Use_Spell(*reinterpret_cast<_int*>(p)); }); + m_pInfoInstance->Add_Event(TEXT("GetSpell"), [this](void* p) {this->Spell_Setting(p); }); return S_OK; } @@ -176,6 +180,50 @@ void CAction_Panel::Matic_Meter_Move() } +void CAction_Panel::Use_Spell(_int Index) +{ + switch (Index) + { + case 1: + static_cast(m_pSpell_Overlay1)->Use_Spell(); + break; + case 2: + static_cast(m_pSpell_Overlay2)->Use_Spell(); + break; + case 3: + static_cast(m_pSpell_Overlay3)->Use_Spell(); + break; + case 4: + static_cast(m_pSpell_Overlay4)->Use_Spell(); + break; + default: + break; + } +} + +void CAction_Panel::Spell_Setting(void* pArg) +{ + GETSKILLINFO Info = *static_cast(pArg); + + switch (Info.iSlotIndexX + 1) + { + case 1: + static_cast(m_pSpell_Overlay1)->Spell_Setting(Info.iSlotIndexY, Info.iSpellIndex); + break; + case 2: + static_cast(m_pSpell_Overlay2)->Spell_Setting(Info.iSlotIndexY, Info.iSpellIndex); + break; + case 3: + static_cast(m_pSpell_Overlay3)->Spell_Setting(Info.iSlotIndexY, Info.iSpellIndex); + break; + case 4: + static_cast(m_pSpell_Overlay4)->Spell_Setting(Info.iSlotIndexY, Info.iSpellIndex); + break; + default: + break; + } +} + HRESULT CAction_Panel::Bind_ShaderResources() { return S_OK; @@ -193,11 +241,29 @@ HRESULT CAction_Panel::Ready_Element(void* pArg) return E_FAIL; } Add_Element(TEXT("Spell_Slot"), m_pSpell_Slot); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay)))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay1)))) { return E_FAIL; } - Add_Element(TEXT("Spell_Overlay"), m_pSpell_Overlay); + Add_Element(TEXT("Spell_Overlay1"), m_pSpell_Overlay1); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay2)))) + { + return E_FAIL; + } + static_cast(m_pSpell_Overlay2)->MoveX(481.f); + Add_Element(TEXT("Spell_Overlay2"), m_pSpell_Overlay2); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay3)))) + { + return E_FAIL; + } + static_cast(m_pSpell_Overlay3)->MoveX(582.f); + Add_Element(TEXT("Spell_Overlay3"), m_pSpell_Overlay3); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay4)))) + { + return E_FAIL; + } + static_cast(m_pSpell_Overlay4)->MoveX(683.f); + Add_Element(TEXT("Spell_Overlay4"), m_pSpell_Overlay4); if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSlot_Number)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp index d351bebdd..6b28415f3 100644 --- a/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp @@ -246,11 +246,16 @@ void CCurrent_Spell_Slot::Get_Skill(_int SpellIndex, _int SlotIndex) _int x = SlotIndex % iSlotx; _int y = SlotIndex / iSlotx; + m_GetSkillInfo.iSlotIndexX = x; + m_GetSkillInfo.iSlotIndexY = y; + m_GetSkillInfo.iSpellIndex = SpellIndex; + m_iSpell[y][x] = SpellIndex; m_pVIBufferCom->Set_Equip_Index(SlotIndex); m_vUV.fUV = UV(SpellIndex); m_pVIBufferCom->Set_Index_Color(SlotIndex, static_cast<_float>(m_pInfoInstance->Get_Spell_Info(SpellIndex).iSpell_Type)); m_pVIBufferCom->Set_Index_ImageUV(SlotIndex, m_vUV); + m_pInfoInstance->Event_CallBack(TEXT("GetSpell"), &m_GetSkillInfo); } _int CCurrent_Spell_Slot::Chack_Slot(_int Index) const diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index b4ea9fe05..a0cb435ac 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -99,13 +99,59 @@ SPELL_INFO CInfoInstance::Get_Spell_Info(_int Spell_Info) { return m_pSkillInfo->Get_Info(Spell_Info); } + +_int CInfoInstance::Update_Spell(_int SpellIndex) +{ + return m_pSkillInfo->Update_Spell(SpellIndex); +} + +_float CInfoInstance::Get_CoolTime(_int SpellID) +{ + return m_pSkillInfo->Get_CoolTime(SpellID); +} void CInfoInstance::Change_Canvas() { } + void CInfoInstance::Key_Input(_uint Input) { m_eInput = Input; + + switch (m_eInput) + { + case ENUM_CLASS(KEYINPUT::INPUT_1): + case ENUM_CLASS(KEYINPUT::INPUT_2): + case ENUM_CLASS(KEYINPUT::INPUT_3): + case ENUM_CLASS(KEYINPUT::INPUT_4): + Event_CallBack(TEXT("Spell"), &m_eInput); + break; + case ENUM_CLASS(KEYINPUT::INPUT_T): + break; + case ENUM_CLASS(KEYINPUT::INPUT_G): + + break; + case ENUM_CLASS(KEYINPUT::INPUT_TAB): + + break; + + default: + break; + } +} + +void CInfoInstance::Add_Event(_wstring EventName, function Event) +{ + UI_Event.emplace(EventName, Event); +} + +void CInfoInstance::Event_CallBack(_wstring EventName, void* pArg) +{ + auto range = UI_Event.equal_range(EventName); + for (auto it = range.first; it != range.second; ++it) + { + it->second(pArg); + } } #pragma endregion diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 33660074d..7a2ca196f 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -103,6 +103,9 @@ HRESULT CPlayer::Initialize(void* pArg) m_Batch = make_unique>(m_pContext); #endif // _DEBUG + // 추가 + m_pInfoInstance->Add_Event(TEXT("JAP"), [this](void* p) {this->Get_Spell(*reinterpret_cast<_int*>(p)); }); + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 8488e6df4..2e2c12a41 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -30,6 +30,13 @@ #pragma region States +// 추가 +void CPlayer::Get_Spell(_int SkillIndex) +{ + if (SkillIndex == ENUM_CLASS(SKILL_TYPE::DIFFINDO)) + Index = SkillIndex; +} + void CPlayer::TestKeyInput(_float fTimeDelta) { if (m_pGameInstance->Key_Down(DIK_F1)) @@ -735,6 +742,13 @@ void CPlayer::Behavior_CombatEnter() pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::COMBAT); + // 추가 + if (Index == ENUM_CLASS(SKILL_TYPE::DIFFINDO)) + { + Add_Event(pairAnimInfo.first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::DIFFINDO, Get_PartObject()); }, 0.1f); + Index = -1; + } + if (m_pModelCom->Get_SecondAnimIndex() == m_Animation[STATEANIM::LUMOS].first) { m_pModelCom->Set_Second_AnimationIndex(-1, ENUM_CLASS(BLEND_BONE::SHOULDER_R)); diff --git a/Jusin154_Team3D/Client/Private/Skill_Data.cpp b/Jusin154_Team3D/Client/Private/Skill_Data.cpp index 885b8b7bf..a0af7847d 100644 --- a/Jusin154_Team3D/Client/Private/Skill_Data.cpp +++ b/Jusin154_Team3D/Client/Private/Skill_Data.cpp @@ -4,8 +4,6 @@ #include "UIObject.h" #include "tinyxml2.h" -; - CSkill_Data::CSkill_Data() { } @@ -13,7 +11,6 @@ CSkill_Data::CSkill_Data() HRESULT CSkill_Data::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) { - return S_OK; } @@ -22,14 +19,52 @@ const SPELL_INFO& CSkill_Data::Get_Info(_uint SpellID) const return SpellInfo[SpellID]; } +_int CSkill_Data::Update_Spell(_int SpellID) +{ + if (SpellID < 0 || SpellID > m_iSpell_Count) + return ENUM_CLASS(SKILL_TYPE::END); + + if (SpellInfo[SpellID].bUse_Skill == false) + return ENUM_CLASS(SKILL_TYPE::END); + + SpellInfo[SpellID].bUse_Skill = false; + m_iSpell_CoolTime[SpellID] = 0.f; + + return SpellInfo[SpellID].iSkill_Type; +} + void CSkill_Data::Update(_float fTimeDelta) { + for (_int i = 0; i < m_iSpell_Count; ++i) + { + if (SpellInfo[i].bUse_Skill == false) + { + if (m_iSpell_CoolTime[i] <= 1.f) + { + m_iSpell_CoolTime[i] += fTimeDelta * (1.f / SpellInfo[i].fSpell_CoolTime); + } + else + { + SpellInfo[i].bUse_Skill = true; + } + + } + } + } void CSkill_Data::Change_Level() { } +_float CSkill_Data::Get_CoolTime(_int SpellID) +{ + if (SpellID < 0 || SpellID > m_iSpell_Count) + return 0.f; + + return m_iSpell_CoolTime[SpellID]; +} + HRESULT CSkill_Data::Load_SpellInfo(const _char* pFilePath) { tinyxml2::XMLDocument doc; @@ -62,13 +97,16 @@ HRESULT CSkill_Data::Load_SpellInfo(const _char* pFilePath) pSpell->QueryFloatAttribute("Duration", &SpellInfo[id].fDuration); pSpell->QueryIntAttribute("AnimNum", &SpellInfo[id].iAnimNum); SpellInfo[id].pSpellInfo = CMyTools::ToWstring(pSpell->Attribute("SpellInfo")); - int lock = 0, equip = 0; + int lock = 0, equip = 0, use = 0; pSpell->QueryIntAttribute("Spell_Lock", &lock); pSpell->QueryIntAttribute("Equip_Spell", &equip); + pSpell->QueryIntAttribute("Use_Skill", &use); SpellInfo[id].bSpell_Lock = lock != 0; SpellInfo[id].bEquip_Spell = equip != 0; - + SpellInfo[id].bUse_Skill = use != 0; pSpell = pSpell->NextSiblingElement("Spell"); + m_iSpell_Count++; + m_iSpell_CoolTime[id] = 1.2f; } return S_OK; diff --git a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp index d92d40a23..c054ee7e7 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "Spell_Overlay.h" #include "GameInstance.h" +#include "InfoInstance.h" CSpell_Overlay::CSpell_Overlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) @@ -8,7 +9,8 @@ CSpell_Overlay::CSpell_Overlay(ID3D11Device* pDevice, ID3D11DeviceContext* pCont } CSpell_Overlay::CSpell_Overlay(const CSpell_Overlay& rhs) - :CElementObject(rhs) + :CElementObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -48,14 +50,16 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) m_vUVScale.y = 1.f; m_fCoolTime = 5.f; m_fSortZ = 0.01f; - m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); - Compute_UI(5); + m_iSlotCount = 4; + m_iCurrent_Slot = 0; + Array_Clear(-1); + Bool_Array_Clear(false); return S_OK; } -void CSpell_Overlay::Compute_UI(_uint SpellID) +_float4 CSpell_Overlay::Compute_UI(_uint SpellID) { - _float2 fImage_Size = { 1024.f, 1792.f}; + _float2 fImage_Size = { 1024.f, 1792.f }; _uint iCountX = 4; _uint iCountY = 6; @@ -74,8 +78,76 @@ void CSpell_Overlay::Compute_UI(_uint SpellID) UVEnd.x = UVStart.x + (iImageX / fImage_Size.x); UVEnd.y = UVStart.y + (iImageY / fImage_Size.y); - _float4 UV = _float4{UVStart.x, UVStart.y, UVEnd.x, UVEnd.y}; - m_vUV = UV; + _float4 UV = _float4{ UVStart.x, UVStart.y, UVEnd.x, UVEnd.y }; + return UV; +} + +void CSpell_Overlay::Array_Clear(_int Value) +{ + for (_int i = 0; i < m_iSlotCount; ++i) + { + m_Spells[i] = Value; + } + for (_int i = 0; i < m_iSlotCount; ++i) + { + m_iSpellType[i] = Value; + } + for (_int i = 0; i < m_iSlotCount; ++i) + { + m_vUV[i] = _float4(_float(Value), _float(Value), _float(Value), _float(Value)); + } +} + +void CSpell_Overlay::Bool_Array_Clear(_bool Bool) +{ + for (_int i = 0; i < m_iSlotCount; ++i) + { + m_bEquipped[i] = Bool; + } + for (_int i = 0; i < m_iSlotCount; ++i) + { + m_bSpellUsed[i] = Bool; + } +} + +void CSpell_Overlay::Spell_Setting(_int SlotIndex, _int SpellIndex) +{ + if (SlotIndex < 0 || SlotIndex > m_iSlotCount) + { + return; + } + + m_Spells[SlotIndex] = SpellIndex; + m_bEquipped[SlotIndex] = true; + m_bSpellUsed[SlotIndex] = m_pInfoInstance->Get_Spell_Info(SpellIndex).bUse_Skill; + m_vUV[SlotIndex] = Compute_UI(SpellIndex); + m_iSpellType[SlotIndex] = m_pInfoInstance->Get_Spell_Info(SpellIndex).iSpell_Type; +} + +void CSpell_Overlay::Use_Spell() +{ + if (m_bEquipped[m_iCurrent_Slot] == true && m_bSpellUsed[m_iCurrent_Slot] == true) + { + m_pInfoInstance->Update_Spell(m_Spells[m_iCurrent_Slot]); + m_pInfoInstance->Event_CallBack(TEXT("JAP"), &m_Spells[m_iCurrent_Slot]); + } +} + + +void CSpell_Overlay::Set_SpellSlot(_int Index) +{ + if (Index < 0) + { + m_iCurrent_Slot = m_iSlotCount - 1; + } + else if (Index >= m_iSlotCount) + { + m_iCurrent_Slot = 0; + } + else + { + m_iCurrent_Slot = Index; + } } void CSpell_Overlay::Priority_Update(_float fTimeDelta) @@ -118,18 +190,17 @@ void CSpell_Overlay::Update(_float fTimeDelta) } } - if (m_vUVScale.y >= 1.f) + for (_int i = 0; i < m_iSlotCount; ++i) { - if (m_pGameInstance->Key_Down(DIK_1)) + if (m_bEquipped[i] == true) { - m_vUVScale.y = 0.f; + m_bSpellUsed[i] = m_pInfoInstance->Get_Spell_Info(m_Spells[i]).bUse_Skill; + m_fCoolTime = m_pInfoInstance->Get_CoolTime(m_Spells[m_iCurrent_Slot]); } } - if (m_vUVScale.y <= 1) - { - m_vUVScale.y += fTimeDelta * (1.f / m_fCoolTime); - } + + m_vUVScale.y = m_fCoolTime; m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); @@ -143,7 +214,10 @@ void CSpell_Overlay::Late_Update(_float fTimeDelta) return; } if (m_bVisible) { + if (m_bEquipped[m_iCurrent_Slot] == true) + { m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } } __super::Late_Update(fTimeDelta); } @@ -225,7 +299,7 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType[m_iCurrent_Slot], sizeof(_int)))) { return E_FAIL; } @@ -257,7 +331,7 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV[m_iCurrent_Slot], sizeof(_float4)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Public/Action_Panel.h b/Jusin154_Team3D/Client/Public/Action_Panel.h index 60fff67e2..83f93ed83 100644 --- a/Jusin154_Team3D/Client/Public/Action_Panel.h +++ b/Jusin154_Team3D/Client/Public/Action_Panel.h @@ -11,6 +11,12 @@ NS_BEGIN(Client) class CAction_Panel final : public CPanelObject { + typedef struct Get_Skill_Info + { + _int iSlotIndexX{}; + _int iSlotIndexY{}; + _int iSpellIndex{}; + }GETSKILLINFO; private: CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CAction_Panel(const CAction_Panel& rhs); @@ -27,6 +33,9 @@ class CAction_Panel final : public CPanelObject void Magic_Meter_Visible(_uint iIndex, _bool bVisible); void Magic_Meter_UV(); void Matic_Meter_Move(); + + void Use_Spell(_int Index); + void Spell_Setting(void* pArg); private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -35,6 +44,8 @@ class CAction_Panel final : public CPanelObject virtual HRESULT Initialize(void* pArg) override; private: + CInfoInstance* m_pInfoInstance = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; @@ -43,7 +54,10 @@ class CAction_Panel final : public CPanelObject _uint m_iMagic_Meter_Count{}; CGameObject* m_pSpell_Slot = { nullptr }; - CGameObject* m_pSpell_Overlay = { nullptr }; + CGameObject* m_pSpell_Overlay1 = { nullptr }; + CGameObject* m_pSpell_Overlay2 = { nullptr }; + CGameObject* m_pSpell_Overlay3 = { nullptr }; + CGameObject* m_pSpell_Overlay4 = { nullptr }; CGameObject* m_pSlot_Number = { nullptr }; CGameObject* m_pHpBarBG = { nullptr }; CGameObject* m_pMagic_Meter1 = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 3d75f6690..1b7e7cd38 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -35,8 +35,8 @@ namespace Client enum class KEYINPUT { - INPUT_1, INPUT_2, INPUT_3, INPUT_4, - INPUT_T, + INPUT_1 = 1, INPUT_2, INPUT_3, INPUT_4, + INPUT_T, INPUT_G, INPUT_TAB, END }; diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index f865b6be1..3c87189db 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -29,5 +29,6 @@ namespace Client _wstring pSpellInfo; _bool bSpell_Lock = false; _bool bEquip_Spell = false; + _bool bUse_Skill = false; }SPELL_INFO; }; diff --git a/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h b/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h index ed2184fd1..2c563d0e0 100644 --- a/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h +++ b/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h @@ -13,6 +13,12 @@ NS_BEGIN(Client) class CCurrent_Spell_Slot final : public CElementObject { + typedef struct Get_Skill_Info + { + _int iSlotIndexX{}; + _int iSlotIndexY{}; + _int iSpellIndex{}; + }GETSKILLINFO; private: CCurrent_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CCurrent_Spell_Slot(const CCurrent_Spell_Slot& rhs); @@ -65,7 +71,7 @@ class CCurrent_Spell_Slot final : public CElementObject _int m_iSkill_Index{}; _int m_iSpell[4][4]{}; CVIBuffer_UI_Instance::UI_ATLAS_DESC m_vUV{}; - + GETSKILLINFO m_GetSkillInfo = {}; public: static CCurrent_Spell_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index 2274dd466..908273dff 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -45,8 +45,13 @@ DECLARE_SINGLETON(CInfoInstance) #pragma region Spell_INFO HRESULT Load_SpellInfo(const _char* pFilePath); SPELL_INFO Get_Spell_Info(_int Spell_Info); + _int Update_Spell(_int SpellIndex); + _float Get_CoolTime(_int SpellID); void Change_Canvas(); - void Key_Input(_uint Input); + void Key_Input(_uint Input); // 플레이어 키 입력 + + void Add_Event(_wstring EventName, function Event); + void Event_CallBack(_wstring EventName, void* pArg = nullptr); #pragma endregion private: CGameInstance* m_pGameInstance = { nullptr }; @@ -58,7 +63,10 @@ DECLARE_SINGLETON(CInfoInstance) class CMapInfo* m_pMapInfo = { nullptr }; class CSkill_Data* m_pSkillInfo= { nullptr }; _uint m_eInput = ENUM_CLASS(KEYINPUT::END); + _int m_eSpell = ENUM_CLASS(SKILL_TYPE::END); + // 임시로 이벤트 1개 만들어 둠 + multimap<_wstring, function> UI_Event; #ifdef _DEBUG _string m_strLog = {}; #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 7d85ef896..a487ccc1d 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -82,6 +82,10 @@ class CPlayer final : public CUnit private: + // 추가 + void Get_Spell(_int SkillIndex); + _int Index{-1}; + void TestKeyInput(_float fTimeDelta); virtual void Add_FSM(); virtual void Set_Anim(); diff --git a/Jusin154_Team3D/Client/Public/Skill_Data.h b/Jusin154_Team3D/Client/Public/Skill_Data.h index 00b539a71..487764fed 100644 --- a/Jusin154_Team3D/Client/Public/Skill_Data.h +++ b/Jusin154_Team3D/Client/Public/Skill_Data.h @@ -21,16 +21,19 @@ class CSkill_Data final : public CBase public: void Update(_float fTimeDelta); void Change_Level(); - + _float Get_CoolTime(_int SpellID); public: HRESULT Load_SpellInfo(const _char* pFilePath); public: const SPELL_INFO& Get_Info(_uint SpellID) const; + _int Update_Spell(_int SpellID); private: - SPELL_INFO SpellInfo[34] = {}; + _int m_iSpell_Count{}; + SPELL_INFO SpellInfo[34] = {}; + _float m_iSpell_CoolTime[34] = {}; private: HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); diff --git a/Jusin154_Team3D/Client/Public/Spell_Overlay.h b/Jusin154_Team3D/Client/Public/Spell_Overlay.h index 2b889685c..9230c5b49 100644 --- a/Jusin154_Team3D/Client/Public/Spell_Overlay.h +++ b/Jusin154_Team3D/Client/Public/Spell_Overlay.h @@ -25,7 +25,6 @@ class CSpell_Overlay final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -33,9 +32,18 @@ class CSpell_Overlay final : public CElementObject virtual HRESULT Initialize(void* pArg) override; private: - void Compute_UI(_uint SpellID); + _float4 Compute_UI(_uint SpellID); + void Array_Clear(_int Value); + void Bool_Array_Clear(_bool Bool); + +public: + void Spell_Setting(_int SlotIndex, _int SpellIndex); + void Set_SpellSlot(_int Index); + void Use_Spell(); private: + CInfoInstance* m_pInfoInstance = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; CTexture* m_pDiffuse_TextureCom1 = { nullptr }; CTexture* m_pDiffuse_TextureCom2 = { nullptr }; @@ -46,7 +54,15 @@ class CSpell_Overlay final : public CElementObject _int m_iImageFrameX{}; _int m_iImageFrameY{}; _float m_fFrame{}; - _float4 m_vUV{}; + _float4 m_vUV[4] = {}; + + _int m_iSlotCount{}; + _int m_Spells[4] = { 0 }; + _int m_iSpellType[4] = { 0 }; + _int m_iCurrent_Slot{}; + + _bool m_bEquipped[4] = { false }; + _bool m_bSpellUsed[4] = { false }; public: static CSpell_Overlay* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml index e95b0bb5d..8d0130895 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml @@ -1,36 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp index b04ac5e97..c899530b0 100644 --- a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp @@ -88,7 +88,7 @@ void CAction_Panel::Late_Update(_float fTimeDelta) } if (m_bVisible) { - //m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } __super::Late_Update(fTimeDelta); @@ -210,7 +210,7 @@ HRESULT CAction_Panel::Ready_Element(void* pArg) { return E_FAIL; } - Add_Element(TEXT("Spell_Overlay"), m_pSpell_Overlay); + Add_Element(TEXT("Spell_Overlay1"), m_pSpell_Overlay); if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSlot_Number)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp index 06c62b6b0..088ae08ab 100644 --- a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp @@ -252,7 +252,7 @@ void CCurrent_Spell_Slot::Get_Skill(_int SpellIndex, _int SlotIndex) m_vUV.fUV = UV(SpellIndex); m_pVIBufferCom->Set_Index_Color(SlotIndex, static_cast<_float>(static_cast(m_pOwner)->Get_Info(SpellIndex).iSpell_Type)); m_pVIBufferCom->Set_Index_ImageUV(SlotIndex, m_vUV); - m_pManager->Event_Callback(TEXT("Skill_Change")); + //m_pManager->Event_Callback(TEXT("Skill_Change")); } _int CCurrent_Spell_Slot::Chack_Slot(_int Index) const