Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] StrategicPoint Time on bottom

Newbie Spellweaver
Joined
Oct 21, 2020
Messages
24
Reaction score
16
Hi all,

In this post i'll show you how i show SP Time on bottom,
I know it not good but working , hope it can help you :lol:


zepDerD - [Release] StrategicPoint Time on bottom - RaGEZONE Forums



in SPInfo add new function:

Code:
RenderSPTimeLimit(UINT m_nHour, UINT m_nMin, UINT m_nSec)
{
    SIZE bkSize = { g_pD3dApp->GetBackBufferDesc().Width, g_pD3dApp->GetBackBufferDesc().Height };
    char szHour[32] = { 0, }, szMin[32] = { 0, }, szSec[32] = { 0, };

    if (m_nHour != 0)
        sprintf(szHour, "%02d", m_nHour);

    sprintf(szMin, "%02d", m_nMin);
    sprintf(szSec, "%02d", m_nSec);

    int nHourLen = strlen(szHour);
    int nMinLen = strlen(szMin);
    int nSecLen = strlen(szSec);
    int nLength = nHourLen > 0 ? nHourLen + nMinLen + nSecLen + 2 : nHourLen + nMinLen + nSecLen + 1;
    int nWidth, nHeight, nX, i;
    float fScale;

    if (!g_pShuttleChild->m_bUnitStop)
    {
        nWidth = m_pColonImage->GetImgSize().x;
#ifdef _WARRIOR_CLASS_KILL_BAR
        if (!g_pSOption->sShowWarRank)
#endif 
           nHeight = bkSize.cy - (90);
#ifdef _WARRIOR_CLASS_KILL_BAR
        else
            nHeight = bkSize.cy - (90 + 16);
#endif 
       fScale = 1.0f;
    }
    else
    {
        nWidth = m_pColonImage->GetImgSize().x;
#ifdef _WARRIOR_CLASS_KILL_BAR
        if (!g_pSOption->sShowWarRank)
#endif
            nHeight = bkSize.cy - (90);
#ifdef _WARRIOR_CLASS_KILL_BAR
        else
            nHeight = bkSize.cy - (90 + 16);
#endif
        fScale = 1.0f;
    }
    nX = (bkSize.cx - nWidth * nLength) / 2;

    for (int i = 0; i < nHourLen; ++i)
    {
        int nIdx = szHour[i] - 48;
        if (nIdx < 0)
            return;
        m_pTimeNumImage[nIdx]->SetScale(fScale, fScale);
        m_pTimeNumImage[nIdx]->Move(nX, nHeight);
        m_pTimeNumImage[nIdx]->Render();
        nX += nWidth;
    }

    if (nHourLen > 0)
    {
        m_pColonImage->SetScale(fScale, fScale);
        m_pColonImage->Move(nX, nHeight);
        m_pColonImage->Render();
        nX += nWidth;
    } 

   for (i = 0; i < nMinLen; ++i)
    {
        int nIdx = szMin[i] - 48;
        m_pTimeNumImage[nIdx]->SetScale(fScale, fScale);
        m_pTimeNumImage[nIdx]->Move(nX, nHeight);
        m_pTimeNumImage[nIdx]->Render();
        nX += nWidth;
    }

    m_pColonImage->SetScale(fScale, fScale);
    m_pColonImage->Move(nX, nHeight);
    m_pColonImage->Render();
    nX += nWidth;

    for (i = 0; i < nSecLen; ++i)
    {
        int nIdx = szSec[i] - 48;
        m_pTimeNumImage[nIdx]->SetScale(fScale, fScale);
        m_pTimeNumImage[nIdx]->Move(nX, nHeight); 
       m_pTimeNumImage[nIdx]->Render();
        nX += nWidth;
    }
}

then just need call it:

Code:
RenderSPTimeLimit(nHours, nMinutes, nSecond);
 

Attachments

You must be registered for see attachments list
Back
Top