Noticias:

SMF - Just Installed!

Menú principal

Source [Main 5.2] Shorten Buff Icon

Publicado por Dakosmu, Abr 15, 2025, 09:42 PM

Tema anterior - Siguiente tema

Dakosmu

Source [Main 5.2] Shorten Buff Icon

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión


1. stdafx.h
extern float g_fScreenRate_x;
extern float g_fScreenRate_y;
#define GetWindowsX() (WindowWidth / g_fScreenRate_x)
#define GetWindowsY() (WindowHeight / g_fScreenRate_y)

2. Find
void SEASON3B::CNewUIBuffWindow::RenderBuffStatus(BUFF_RENDER renderstate)

3. Replace
bool gBuffCollapsed = false;
DWORD LastToggleTime = 0;

bool IsMousePressed()
{
    static bool previousLButtonState = false;
    bool currentLButtonState = (GetAsyncKeyState(VK_LBUTTON) & 0x8000) != 0;
    bool result = currentLButtonState && !previousLButtonState;
    previousLButtonState = currentLButtonState;
    return result;
}

void SEASON3B::CNewUIBuffWindow::RenderBuffStatus(BUFF_RENDER renderstate)
{
    OBJECT* pHeroObject = &Hero->Object;

    float frameX = GetCenterX(640) - 120;
    float frameY = GetWindowsY(640) - 110;

    float x = 0.0f, y = 0.0f;

    int buffwidthcount = 0;

    std::list<eBuffState> buffstate;
    BuffSort(buffstate);

    int totalBuffs = buffstate.size();
    int visibleBuffs = totalBuffs;

    std::list<eBuffState>::iterator iter;
    int IndexTime = 0;

    float spacingX = gBuffCollapsed ? 10.0f : (BUFF_IMG_WIDTH + BUFF_IMG_SPACE);

    for (iter = buffstate.begin(); iter != buffstate.end(); )
    {
        if (IndexTime >= visibleBuffs)
            break;

        std::list<eBuffState>::iterator tempiter = iter;
        ++iter;
        eBuffState buff = (*tempiter);

        x = m_Pos.x + (buffwidthcount * spacingX) + frameX;
        y = m_Pos.y + frameY;

        if (renderstate == BUFF_RENDER_ICON)
        {
            RenderBuffIcon(buff, x, y, BUFF_IMG_WIDTH, BUFF_IMG_HEIGHT);

            if (gIconBuff.UserBuff[IndexTime].Index != NULL)
            {
                if (gIconBuff.UserBuff[IndexTime].Index != 28)
                {
                    int pBuffHp = 100;

                    if (gIconBuff.UserBuff[IndexTime].MaxTime > 0 && gIconBuff.UserBuff[IndexTime].Time > 0)
                    {
                        pBuffHp = (gIconBuff.UserBuff[IndexTime].Time * 100) / gIconBuff.UserBuff[IndexTime].MaxTime;
                    }

                    EnableAlphaTest();
                    glColor4f(0.0, 1.0, 0.0, 1.0);
                    RenderColor(x, (y + BUFF_IMG_HEIGHT), (BUFF_IMG_WIDTH * pBuffHp / 100.0f), 2.0f, 0.0f, 0);
                    ::EnableAlphaTest();
                    ::glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
                }
            }
        }
        else if (renderstate == BUFF_RENDER_TOOLTIP)
        {
            if (!gBuffCollapsed && SEASON3B::CheckMouseIn(x, y, BUFF_IMG_WIDTH, BUFF_IMG_HEIGHT))
            {
                float fTooltip_x = x + (BUFF_IMG_WIDTH / 2);
                float fTooltip_y = y + (BUFF_IMG_HEIGHT / 2) - 80;
                eBuffClass buffclass = g_IsBuffClass(buff);
                RenderBuffTooltip(buffclass, buff, fTooltip_x, fTooltip_y, IndexTime);
            }
        }

        IndexTime++;
        ++buffwidthcount;
    }

    if (totalBuffs > 1)
    {
        float arrowX = x + 7;
        float arrowY = y - 5;

        if (gBuffCollapsed)
        {
            RenderImage(IMAGE_ICON->, arrowX, arrowY, 10, 10);
        }
        else
        {
            RenderImage(IMAGE_ICON <-, arrowX, arrowY, 10, 10);
        }

        if (SEASON3B::CheckMouseIn(arrowX, arrowY, 10, 10))
        {
            if (GetTickCount() - LastToggleTime > 500)
            {
                gBuffCollapsed = !gBuffCollapsed;
                LastToggleTime = GetTickCount();
            }
        }
    }
}


de descargas

**Créditos**
Bé Phanh
````

Ahora incluye las secciones de "Find" y "Replace" para que quede más claro cómo colocar el código. Si necesitas más ajustes, ¡avísame!
Bon Dia

🡱 🡳