ServersMU - Comunidad

Zona Programadores => Sources => Mensaje iniciado por: Applayo en Abril 22, 2021, 12:10:49 am

Título: TimeBar [F4] e MiniMap [F5]
Publicado por: Applayo en Abril 22, 2021, 12:10:49 am
Demo: vou postar breve

[b]Interface.h[/b]

[code]void SwitchMiniMap();
void SwitchTime();[/code]

[b]Interface.cpp[/b]

[code]void Interface::Work()
{
if( GetForegroundWindow() == pGameWindow )
{
if (GetKeyState(VK_F4) & 0x4000)
{
gInterface.SwitchTime();
}
if (GetKeyState(VK_F5) & 0x4000)
{
gInterface.SwitchMiniMap();
}
}
}

void Interface::SwitchMiniMap(){
if((GetTickCount() - gInterface.Data[eNULL_MAP].EventTick) < 1000 )
    {
        return;
    }

gInterface.Data[eNULL_MAP].EventTick = GetTickCount();

if (MiniMap!=0)
    {
        gInterface.DrawMessage(1, "MiniMap Window [OFF]");
        MiniMap = 0;
    }
    else
    {
        gInterface.DrawMessage(1, "MiniMap Window [ON]");
        MiniMap = 1;
    }
}

void Interface::SwitchTime()
{
    if((GetTickCount() - gInterface.Data[eTIME].EventTick) < 1000 )
    {
        return;
    }
    gInterface.Data[eTIME].EventTick = GetTickCount();

    if (this->Data[eTIME].OnShow)
    {
        gInterface.DrawMessage(1, "Time Window [OFF]");
        this->Data[eTIME].OnShow = false;
    }
    else
    {
        gInterface.DrawMessage(1, "Time Window [ON]");
        this->Data[eTIME].OnShow = true;
    }
}[/code]

MiniMap [F5] + TimeBar [F4]

Creditos: Applayo
Título: Re: TimeBar [F4] e MiniMap [F5]
Publicado por: robins1998 en Mayo 27, 2021, 02:29:59 am
Very helpful, thanks for sharing.