This commit is contained in:
Igor Barkov [iwork] 2018-12-27 14:59:45 +02:00
parent c0405e0aa3
commit 18a4833aa3

View File

@ -701,6 +701,19 @@ function setHP($hp, $maxhp)
return $rr; return $rr;
} }
function setHP2($hp, $maxhp)
{
$bar = round($hp/$maxhp*100);
?>
<div style="width: 100%; height: 10px; background: #800; overflow: hidden;">
<div style="height: 10px; background: #f00; border-radius: 3px; width: <?= $bar ?>%;"></div>
</div>
<div style="width: 100%; height: 10px; font-size: 9px; text-align: center; margin-top: -10px;">
<?= $hp ?> / <?= $maxhp ?>
</div>
<?php
}
function echoscroll($slot) function echoscroll($slot)
{ {
global $user; global $user;
@ -944,7 +957,7 @@ function showinf_pers($id, $pas = 0, $battle = 0, $me = 0, $main = false) //FIXM
} }
$r .= "<table cellspacing=0 cellpadding=0><tr><td colspan=3 width=100%>"; $r .= "<table cellspacing=0 cellpadding=0><tr><td colspan=3 width=100%>";
$r .= setHP($user['hp'], $user['maxhp']); $r .= setHP2($user['hp'], $user['maxhp']);
$r .= '</td></tr>'; $r .= '</td></tr>';