Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: [Main 5.2] Shorten Buff Icon  (Visto 2512 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline Bé Phanh Posteado: April 15, 2025, 10:09:45 AM | Modificado: April 15, 2025, 11:06:20 PM by Bé Phanh

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 4
  • Gracias recibida: 128
  • vn
stdafx.h
Code: [Select]
extern float g_fScreenRate_x;
extern float g_fScreenRate_y;
#define GetCenterX()         (WindowWidth  / g_fScreenRate_x)
#define GetWindowsY() (WindowHeight / g_fScreenRate_y)
Find
Code: [Select]
void SEASON3B::CNewUIBuffWindow::RenderBuffStatus(BUFF_RENDER renderstate)
Replace
Code: [Select]
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();
}
}
}
}

Code: [Select]
https://mega.nz/file/NNg3zToT#g27A6IOQ2TJKWyz8Nhc61WbYVtFpxsOQoEu7xr7Z91w



🌸 𝓓𝓲𝓼𝓬𝓸𝓻𝓭 : 𝐩𝐡𝐚𝐧𝐡𝐱𝐢𝐧𝐡_𝟗𝟕 🌸

Gracias:


Offline erickmalfoy #1 Posteado: April 15, 2025, 02:05:53 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 669
  • Gracias recibida: 709
  • ar

Gracias:


Offline xlockee #2 Posteado: April 15, 2025, 08:26:34 PM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 12
  • Gracias recibida: 8
  • br
POR ALGUM MOTIVO ESTA FALTANDO ARQUIVOS


Offline JuniorInc #3 Posteado: April 20, 2025, 08:17:00 PM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 4
  • Gracias recibida: 0
  • br
Está faltando codigo ou não é para main 5.2 MudinhoX


Offline zhangjianle865 #4 Posteado: April 22, 2025, 05:43:45 AM

  • 0 puntos por ventas
  • *
  • Rank: Experto
  • Posts: 152
  • Gracias recibida: 141
  • ca

Offline zhangjianle865 #5 Posteado: April 22, 2025, 07:44:07 AM

  • 0 puntos por ventas
  • *
  • Rank: Experto
  • Posts: 152
  • Gracias recibida: 141
  • ca
There is a lot of code missing, could you please complete it?  @Bé Phanh


Offline xsojomx #6 Posteado: June 17, 2025, 07:06:02 AM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 1
  • Gracias recibida: 1
  • hu
Complate code, by myself.
Code: [Select]
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 = 0.0f;
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);
const BuffInfo& bi = TheBuffInfo().GetBuffinfo(buff);
if (bi.s_BuffIndex != 0)
{
if (buff != static_cast<eBuffState>(81))
{
DWORD curTime = TheBuffTimeControl().GetBuffTime(static_cast<DWORD>(buff));
DWORD maxTime = TheBuffTimeControl().GetBuffMaxTime(buff, curTime);

int pBuffHp = 100;
if (maxTime > 0 && curTime > 0) {
pBuffHp = (curTime * 100) / maxTime;
}

EnableAlphaTest();
glColor4f(0.0f, 1.0f, 0.0f, 1.0f);
RenderColor(
x,
y + BUFF_IMG_HEIGHT,
(BUFF_IMG_WIDTH * pBuffHp / 100.0f),
2.0f, 0.0f, 0);
::EnableAlphaTest();
::glColor4f(1, 1, 1, 1);
}
}
}

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) - 50;
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)
{
SEASON3B::RenderImage(IMAGE_BUFF_arrow_1, arrowX, arrowY, 10, 10, 0.0f, 0.0f, 0.6f, 0.6f);
}
else
{
SEASON3B::RenderImage(IMAGE_BUFF_arrow, arrowX, arrowY, 10, 10, 0.0f, 0.0f, 0.6f, 0.6f);
}
if (SEASON3B::CheckMouseIn(arrowX, arrowY, 10, 10))
{
if (GetTickCount() - LastToggleTime > 500)
{
gBuffCollapsed = !gBuffCollapsed;
LastToggleTime = GetTickCount();
}
}
}
}
void SEASON3B::CNewUIBuffWindow::LoadImages()
{
   LoadBitmap("Interface\\newui_statusicon.jpg", IMAGE_BUFF_STATUS, GL_LINEAR);
   LoadBitmap("Interface\\newui_statusicon2.jpg", IMAGE_BUFF_STATUS2, GL_LINEAR);
   LoadBitmap("Interface\\Custom\\Pegasus_BUFFICON.tga", IMAGE_BUFF_arrow, GL_LINEAR);
   LoadBitmap("Interface\\Custom\\Pegasus_BUFFICON_01.tga", IMAGE_BUFF_arrow_1, GL_LINEAR);
}

void SEASON3B::CNewUIBuffWindow::UnloadImages()
{
   DeleteBitmap(IMAGE_BUFF_STATUS2);
   DeleteBitmap(IMAGE_BUFF_STATUS);   
   DeleteBitmap(IMAGE_BUFF_arrow);
   DeleteBitmap(IMAGE_BUFF_arrow_1);
}
Code: [Select]

Gracias:


Offline zHammer #7 Posteado: June 25, 2025, 09:05:15 AM

  • 0 puntos por ventas
  • *
  • Rank: Destacado
  • Posts: 80
  • Gracias recibida: 74
  • es
Complate code, by myself.
Code: [Select]
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 = 0.0f;
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);
const BuffInfo& bi = TheBuffInfo().GetBuffinfo(buff);
if (bi.s_BuffIndex != 0)
{
if (buff != static_cast<eBuffState>(81))
{
DWORD curTime = TheBuffTimeControl().GetBuffTime(static_cast<DWORD>(buff));
DWORD maxTime = TheBuffTimeControl().GetBuffMaxTime(buff, curTime);

int pBuffHp = 100;
if (maxTime > 0 && curTime > 0) {
pBuffHp = (curTime * 100) / maxTime;
}

EnableAlphaTest();
glColor4f(0.0f, 1.0f, 0.0f, 1.0f);
RenderColor(
x,
y + BUFF_IMG_HEIGHT,
(BUFF_IMG_WIDTH * pBuffHp / 100.0f),
2.0f, 0.0f, 0);
::EnableAlphaTest();
::glColor4f(1, 1, 1, 1);
}
}
}

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) - 50;
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)
{
SEASON3B::RenderImage(IMAGE_BUFF_arrow_1, arrowX, arrowY, 10, 10, 0.0f, 0.0f, 0.6f, 0.6f);
}
else
{
SEASON3B::RenderImage(IMAGE_BUFF_arrow, arrowX, arrowY, 10, 10, 0.0f, 0.0f, 0.6f, 0.6f);
}
if (SEASON3B::CheckMouseIn(arrowX, arrowY, 10, 10))
{
if (GetTickCount() - LastToggleTime > 500)
{
gBuffCollapsed = !gBuffCollapsed;
LastToggleTime = GetTickCount();
}
}
}
}
void SEASON3B::CNewUIBuffWindow::LoadImages()
{
   LoadBitmap("Interface\\newui_statusicon.jpg", IMAGE_BUFF_STATUS, GL_LINEAR);
   LoadBitmap("Interface\\newui_statusicon2.jpg", IMAGE_BUFF_STATUS2, GL_LINEAR);
   LoadBitmap("Interface\\Custom\\Pegasus_BUFFICON.tga", IMAGE_BUFF_arrow, GL_LINEAR);
   LoadBitmap("Interface\\Custom\\Pegasus_BUFFICON_01.tga", IMAGE_BUFF_arrow_1, GL_LINEAR);
}

void SEASON3B::CNewUIBuffWindow::UnloadImages()
{
   DeleteBitmap(IMAGE_BUFF_STATUS2);
   DeleteBitmap(IMAGE_BUFF_STATUS);   
   DeleteBitmap(IMAGE_BUFF_arrow);
   DeleteBitmap(IMAGE_BUFF_arrow_1);
}
Code: [Select]

Some sources are still missing, please help me.
 please please please please please


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
5 Replies
3942 Views
Last post February 27, 2023, 02:32:58 PM
by cobyzero
3 Replies
1594 Views
Last post September 27, 2023, 03:52:39 AM
by hieuvt
1 Replies
2296 Views
Last post August 14, 2022, 01:40:11 AM
by zerg24
0 Replies
380 Views
Last post March 11, 2024, 07:34:54 PM
by Pokeystabber
0 Replies
122 Views
Last post July 27, 2025, 11:23:40 AM
by Swagod