Skip to content

Commit

Permalink
AP Meter now fully functional, fixed toon edge thickness
Browse files Browse the repository at this point in the history
  • Loading branch information
SengokuNadeko committed Feb 21, 2024
1 parent 82cde44 commit f10fc68
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 39 deletions.
40 changes: 18 additions & 22 deletions DboClient/Client/Gui/HpGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -283,7 +282,6 @@ void CHpGui::Destroy(void)
GetNtlGuiManager()->RemoveUpdateFunc( this );

m_surMidAir.UnsetTexture();
m_surRoundAir.UnsetTexture();
CNtlPLGui::DestroyComponents();
CNtlPLGui::Destroy();

Expand Down Expand Up @@ -634,7 +632,7 @@ void CHpGui::HandleEvents(RWS::CMsg &pMsg)
else if (pMsg.Id == g_EventEnableAir)
{
SNtlEventEnableAir* pEvent = reinterpret_cast<SNtlEventEnableAir*>(pMsg.pData);

EnableAir(pEvent->bFlag);
}
else if (pMsg.Id == g_EventSetAp)
Expand Down Expand Up @@ -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)
{
Expand All @@ -795,8 +797,6 @@ void CHpGui::CheckAir()
}

m_surMidAir.Show(bIsWorldAirPossible);
m_surRoundAir.Show(bIsWorldAirPossible);


if (m_bIsWorldAirPossible != bIsWorldAirPossible)
{
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
Expand All @@ -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;
}
}
Expand All @@ -896,7 +894,6 @@ void CHpGui::CalculateAirHeight()
{
m_psttAirHeight->SetText("AP");
}

m_psttAirHeight->SetRenderTop(true);
}

Expand Down Expand Up @@ -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();
}
}

Expand Down
4 changes: 3 additions & 1 deletion DboClient/Client/Gui/HpGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
20 changes: 5 additions & 15 deletions DboClient/Client/ScouterMeasureDlgGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion DboClient/Lib/NtlPresentation/NtlPLEntityRenderHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
typedef std::map<std::string, RwFrame *> FRAME_MAP;
typedef std::map<std::string, RwFrame *>::iterator FRAME_MAP_ITER;

#define DEFAULT_INK_THICKNESS 1.7f
#define DEFAULT_INK_THICKNESS 1.f
struct SToonData
{
RpToonInk *pToonInk;
Expand Down

0 comments on commit f10fc68

Please sign in to comment.