From f10fc681513d7622ff2b3fad1139e307d2064efe Mon Sep 17 00:00:00 2001 From: JihadBeydoun Date: Wed, 21 Feb 2024 18:20:48 -0500 Subject: [PATCH] AP Meter now fully functional, fixed toon edge thickness --- DboClient/Client/Gui/HpGui.cpp | 40 +++++++++---------- DboClient/Client/Gui/HpGui.h | 4 +- DboClient/Client/ScouterMeasureDlgGui.cpp | 20 +++------- .../NtlPLEntityRenderHelpers.h | 2 +- 4 files changed, 27 insertions(+), 39 deletions(-) diff --git a/DboClient/Client/Gui/HpGui.cpp b/DboClient/Client/Gui/HpGui.cpp index 1a2c2e1d..9255882d 100644 --- a/DboClient/Client/Gui/HpGui.cpp +++ b/DboClient/Client/Gui/HpGui.cpp @@ -225,7 +225,6 @@ RwBool CHpGui::Create(void) // disable air default m_ppnlAirPoint->Show(false); m_surMidAir.Show(false); - m_surRoundAir.Show(false); // Event link LinkMsg(g_EventSobInfoUpdate, 0); @@ -283,7 +282,6 @@ void CHpGui::Destroy(void) GetNtlGuiManager()->RemoveUpdateFunc( this ); m_surMidAir.UnsetTexture(); - m_surRoundAir.UnsetTexture(); CNtlPLGui::DestroyComponents(); CNtlPLGui::Destroy(); @@ -634,7 +632,7 @@ void CHpGui::HandleEvents(RWS::CMsg &pMsg) else if (pMsg.Id == g_EventEnableAir) { SNtlEventEnableAir* pEvent = reinterpret_cast(pMsg.pData); - + EnableAir(pEvent->bFlag); } else if (pMsg.Id == g_EventSetAp) @@ -768,11 +766,15 @@ void CHpGui::UpdateAir() CheckAir(); - CRectangle rec = m_psttAirPoint->GetScreenRect(); - m_surMidAir.SetPosition(rec.left + 8.5, (rec.bottom / 2) - 7); // rec.left + 8.5, (rec.bottom / 2) - 7 - m_surMidAir.SetAlpha(255); - m_surRoundAir.SetPosition(rec.left - 2, (rec.bottom / 2) - 17); - m_surRoundAir.SetAlpha(255); + m_rRoundAir.StartProc(pSobAvatarAttr->GetMaxAp(), false, true); + + if(pSobAvatarAttr->GetAp() > 0) + { + m_rRoundAir.Update(pSobAvatarAttr->GetAp()); + } + + m_surMidAir.SetPosition(m_psttAirPoint->GetScreenRect().left + 8.5, (m_psttAirPoint->GetScreenRect().bottom / 2) - 7); + m_rRoundAir.SetPosition(m_ppnlAirPoint->GetScreenRect().left + 3, m_ppnlAirPoint->GetScreenRect().top + 4); if (m_bIsWorldAirPossible) { @@ -795,8 +797,6 @@ void CHpGui::CheckAir() } m_surMidAir.Show(bIsWorldAirPossible); - m_surRoundAir.Show(bIsWorldAirPossible); - if (m_bIsWorldAirPossible != bIsWorldAirPossible) { @@ -828,26 +828,26 @@ void CHpGui::EnableAir(bool bFlag) nMaxAP = DBO_CHAR_DEFAULT_AP; SetAP(pSobAvatarAttr->GetAp() / 1000, nMaxAP / 1000); + m_rRoundAir.SetClippingRect(*m_ppnlAirPoint->GetClippingRect()); CalculateAirHeight(); } m_ppnlAirPoint->Show(bFlag); + m_ppnlAirPoint->SetPriority(0); m_surMidAir.Show(bFlag); - m_surRoundAir.Show(bFlag); } void CHpGui::SetAP(int nAP, int nMaxAP) { int nPercent = nAP * 100 / nMaxAP; - + CRectangle rec = m_psttAirPoint->GetScreenRect();; if (nPercent >= 0 && nPercent < 33) // RED { if (m_eAirColor != TYPE_RED) { m_surMidAir.UnsetTexture(); - m_surRoundAir.UnsetTexture(); m_surMidAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeMiddleRed")); - m_surRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundRed")); + m_rRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundRed")); m_eAirColor = TYPE_RED; } } @@ -856,9 +856,8 @@ void CHpGui::SetAP(int nAP, int nMaxAP) if (m_eAirColor != TYPE_YELLOW) { m_surMidAir.UnsetTexture(); - m_surRoundAir.UnsetTexture(); m_surMidAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeMiddleYellow")); - m_surRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundYellow")); + m_rRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundYellow")); m_eAirColor = TYPE_YELLOW; } } @@ -867,9 +866,8 @@ void CHpGui::SetAP(int nAP, int nMaxAP) if (m_eAirColor != TYPE_BLUE) { m_surMidAir.UnsetTexture(); - m_surRoundAir.UnsetTexture(); m_surMidAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeMiddleBlue")); - m_surRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundBlue")); + m_rRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundBlue")); m_eAirColor = TYPE_BLUE; } } @@ -896,7 +894,6 @@ void CHpGui::CalculateAirHeight() { m_psttAirHeight->SetText("AP"); } - m_psttAirHeight->SetRenderTop(true); } @@ -957,9 +954,8 @@ VOID CHpGui::OnPaintPost() if (m_eAirColor != TYPE_DISABLE) { - m_surMidAir.Render( true ); - m_surRoundAir.Render( true ); - //m_surRoundAir.Render( true ); + m_rRoundAir.Render(); + m_surMidAir.Render(); } } diff --git a/DboClient/Client/Gui/HpGui.h b/DboClient/Client/Gui/HpGui.h index 87418838..e993faa7 100644 --- a/DboClient/Client/Gui/HpGui.h +++ b/DboClient/Client/Gui/HpGui.h @@ -96,7 +96,9 @@ class CHpGui : public CNtlPLGui, public RWS::CEventHandler TYPE_AIR_COLOR m_eAirColor; CSurfaceGui m_surMidAir; - CSurfaceGui m_surRoundAir; + //CSurfaceGui m_surRoundAir; + + gui::CRadarEffect m_rRoundAir; public: diff --git a/DboClient/Client/ScouterMeasureDlgGui.cpp b/DboClient/Client/ScouterMeasureDlgGui.cpp index aaa64cf6..52cdf5be 100644 --- a/DboClient/Client/ScouterMeasureDlgGui.cpp +++ b/DboClient/Client/ScouterMeasureDlgGui.cpp @@ -49,7 +49,7 @@ // Edge effect #define dTARGET_EDGE_THICKNESS_ORIGINAL 1.f -#define dTARGET_EDGE_THICKNESS_EFFECT 2.5f +#define dTARGET_EDGE_THICKNESS_EFFECT 1.f #define dTARGET_EDGE_THICKNESS_ORIGINAL_RED 0 #define dTARGET_EDGE_THICKNESS_ORIGINAL_GREEN 0 #define dTARGET_EDGE_THICKNESS_ORIGINAL_BLUE 0 @@ -479,20 +479,10 @@ VOID CScouterMeasureDlgGui::TargetEdgeEffect(bool bActive) CNtlSobProxy* pSobProxy = m_scouterData.pSobTarget->GetSobProxy(); NTL_ASSERT(pSobProxy, "CScouterMeasureDlgGui::TargetEdgeEffect, Not exist sob proxy of handle : " << m_scouterData.pSobTarget->GetSerialID()); - if (bActive) - { - pSobProxy->SetInkColor(dTARGET_EDGE_THICKNESS_EFFECT_RED, - dTARGET_EDGE_THICKNESS_EFFECT_GREEN, - dTARGET_EDGE_THICKNESS_EFFECT_BLUE); - pSobProxy->SetInkThicknessWeight(dTARGET_EDGE_THICKNESS_EFFECT); - } - else - { - pSobProxy->SetInkColor(dTARGET_EDGE_THICKNESS_ORIGINAL_RED, - dTARGET_EDGE_THICKNESS_ORIGINAL_GREEN, - dTARGET_EDGE_THICKNESS_ORIGINAL_BLUE); - pSobProxy->SetInkThicknessWeight(dTARGET_EDGE_THICKNESS_ORIGINAL); - } + pSobProxy->SetInkColor(dTARGET_EDGE_THICKNESS_ORIGINAL_RED, + dTARGET_EDGE_THICKNESS_ORIGINAL_GREEN, + dTARGET_EDGE_THICKNESS_ORIGINAL_BLUE); + pSobProxy->SetInkThicknessWeight(dTARGET_EDGE_THICKNESS_ORIGINAL); } VOID CScouterMeasureDlgGui::OnPaint() diff --git a/DboClient/Lib/NtlPresentation/NtlPLEntityRenderHelpers.h b/DboClient/Lib/NtlPresentation/NtlPLEntityRenderHelpers.h index 21a3d077..f71a77ab 100644 --- a/DboClient/Lib/NtlPresentation/NtlPLEntityRenderHelpers.h +++ b/DboClient/Lib/NtlPresentation/NtlPLEntityRenderHelpers.h @@ -8,7 +8,7 @@ typedef std::map FRAME_MAP; typedef std::map::iterator FRAME_MAP_ITER; -#define DEFAULT_INK_THICKNESS 1.7f +#define DEFAULT_INK_THICKNESS 1.f struct SToonData { RpToonInk *pToonInk;