Skip to content

Updates #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion DboClient/Client/Client.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<ProjectGuid>{8E1E45F4-1BCF-412A-A5E7-79EA79233C4F}</ProjectGuid>
<RootNamespace>Client</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand Down
70 changes: 45 additions & 25 deletions DboClient/Client/Gui/HpGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ RwBool CHpGui::Create(void)

// disable air default
m_ppnlAirPoint->Show(false);

m_surMidAir.Show(false);

// Event link
LinkMsg(g_EventSobInfoUpdate, 0);
Expand Down Expand Up @@ -281,6 +281,7 @@ void CHpGui::Destroy(void)
GetNtlGuiManager()->RemoveUpdateBeforeFunc( this );
GetNtlGuiManager()->RemoveUpdateFunc( this );

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

Expand Down Expand Up @@ -631,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 @@ -760,12 +761,34 @@ VOID CHpGui::SetMaxRPBall( RwInt32 nMaxRPBall )

void CHpGui::UpdateAir()
{
CNtlSobAvatar* pSobAvatar = GetNtlSLGlobal()->GetSobAvatar();
CNtlSobAvatarAttr* pSobAvatarAttr = reinterpret_cast<CNtlSobAvatarAttr*>(pSobAvatar->GetSobAttr());

CheckAir();

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)
{
int nMaxAP = pSobAvatarAttr->GetMaxAp();
if (nMaxAP == 0)
nMaxAP = DBO_CHAR_DEFAULT_AP;

SetAP(pSobAvatarAttr->GetAp() / 1000, nMaxAP / 1000);
CalculateAirHeight();
}
if(!m_bIsWorldAirPossible)
{
m_rRoundAir.EndProc();
}
}

void CHpGui::CheckAir()
Expand All @@ -777,12 +800,15 @@ void CHpGui::CheckAir()
bIsWorldAirPossible = true;
}

m_surMidAir.Show(bIsWorldAirPossible);

if (m_bIsWorldAirPossible != bIsWorldAirPossible)
{
if (bIsWorldAirPossible == false)
{
m_ppnlAirPoint->SetToolTip(GetDisplayStringManager()->GetString("DST_AIR_CAN_NOT_FLY"));
m_eAirColor = TYPE_DISABLE;
m_rRoundAir.EndProc();
}
else
{
Expand All @@ -807,57 +833,50 @@ 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);
}

void CHpGui::SetAP(int nAP, int nMaxAP)
{
int nPercent = nAP * 100 / nMaxAP;

bool bChange = false;

CRectangle rec = m_psttAirPoint->GetScreenRect();;
if (nPercent >= 0 && nPercent < 33) // RED
{
if (m_eAirColor != TYPE_RED)
{
// m_surMidAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeMiddleRed"));
// m_surRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundRed"));
m_surMidAir.UnsetTexture();
m_surMidAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeMiddleRed"));
m_rRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundRed"));
m_eAirColor = TYPE_RED;
bChange = true;
}
}
else if (nPercent > 33 && nPercent < 66) // YELLOW
{
if (m_eAirColor != TYPE_YELLOW)
{
// m_surMidAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeMiddleYellow"));
// m_surRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundYellow"));
m_surMidAir.UnsetTexture();
m_surMidAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeMiddleYellow"));
m_rRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundYellow"));
m_eAirColor = TYPE_YELLOW;
bChange = true;
}
}
else if (nPercent > 66) // BLUE
{
if (m_eAirColor != TYPE_BLUE)
{
// m_surMidAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeMiddleBlue"));
// m_surRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundBlue"));
m_surMidAir.UnsetTexture();
m_surMidAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeMiddleBlue"));
m_rRoundAir.SetSurface(GetNtlGuiManager()->GetSurfaceManager()->GetSurface("AirPoint.srf", "srfTimeRoundBlue"));
m_eAirColor = TYPE_BLUE;
bChange = true;
}
}

/*if (bChange)
{
CRectangle rec = m_psttAirPoint->GetScreenRect();

m_surMidAir.SetPosition(rec.left - 3, rec.top - 44);
m_surRoundAir.SetPosition(rec.left - 6, rec.top - 44);
}*/

m_psttAirPoint->Format("%u/%u", nAP, nMaxAP);
}

Expand All @@ -873,13 +892,14 @@ void CHpGui::CalculateAirHeight()
Logic_GetWorldHeight(pPos, sHStuff);

int nHeight = (int)(pPos->y - sHStuff.fFinialHeight);

m_psttAirHeight->Format("%uM", nHeight);
}
else
{
m_psttAirHeight->SetText("AP");
}
m_psttAirHeight->SetRenderTop(true);
}

VOID CHpGui::OnPaint(VOID)
Expand Down Expand Up @@ -939,8 +959,8 @@ VOID CHpGui::OnPaintPost()

if (m_eAirColor != TYPE_DISABLE)
{
//m_surMidAir.Render();
//m_surRoundAir.Render();
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/Discord/Discord.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ProjectGuid>{1F437F8E-D07B-4A71-858C-318DDF7FF968}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Discord</RootNamespace>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
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
Loading