[Snippet]Draw Battery Box
Code:
void cDraw::Battery(int x, int y,LPDIRECT3DDEVICE9 pDevice)
{
SYSTEM_POWER_STATUS Bat;
GetSystemPowerStatus( &Bat );
D3D.Draw.Box(x,y,115,28,1,0x8F000000,0xFFFF00FF,pDevice,true,false);
if(Bat.BatteryLifeTime > -1)
D3D.Draw.GameTextPixel(x+3,y+1,0xFF8F8F00,"Remain: %i / Full: %i",Bat.BatteryLifeTime*60,Bat.BatteryFullLifeTime*60);
else
D3D.Draw.GameTextPixel(x+3,y+1,0xFF8F8F00,/*Kotentopf*/"No Battery! No Laptop?");
if(Bat.BatteryLifePercent != 255){
D3D.Draw.Healthbar(x+6,y+13,103,13,1,0xFF0FFF00,0xFFFFFFFF,Bat.BatteryLifePercent,100,pDevice,false);
D3D.Draw.GameTextPixel(x+30,y+13,0xFF8F8F00,"%i Percent",Bat.BatteryLifePercent);
}
else{
D3D.Draw.Healthbar(x+6,y+13,103,13,1,0xFF0FFF00,0xFFFFFFFF,100,100,pDevice,false);
D3D.Draw.GameTextPixel(x+30,y+13,0xFF8F8F00,"100 Percent");
}
}
Creditz: Me and MSDN
Oh and before a Minion cry, use the Snippet-Tag: Its not available for me, idk why.

