Fix some things

Fix some things
This commit is contained in:
novgorodschi catalin
2026-06-22 15:19:05 +03:00
parent 228397d011
commit 4b208dbfd8
5 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
<style>
.dbg-wrap{max-width:100%;margin:12px;font-family:Tahoma,Verdana,Arial,sans-serif;color:#222}
.dbg-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.dbg-head h2{margin:0;font-size:16px}
.dbg-head h2{margin:0;font-size:16px;color:#ffffff}
.dbg-state{font-weight:700;padding:3px 10px;border-radius:14px;color:#fff;font-size:11px}
.dbg-on{background:#16a34a}.dbg-off{background:#dc2626}
.dbg-card{background:#fff;border:1px solid #bbb;border-radius:6px;padding:12px;margin-bottom:12px}
+16 -3
View File
@@ -13,6 +13,19 @@
*/
include('menu.tpl');
function short($n) {
$n = (int)$n;
if ($n >= 1000000) {
return round($n/1000000,1).'M';
}
if ($n >= 100000) {
return floor($n/1000).'k';
}
// sub 100k lași normal, cu punct ca la Travian RO
return $n;
}
?>
<table id="troops" cellpadding="1" cellspacing="1">
@@ -139,7 +152,7 @@ foreach ($varray as $vil) {
$cl = ($val != 0) ? '' : 'none';
echo '<td class="'.$cl.'">'.$val.'</td>';
echo '<td class="'.$cl.'" title="'.$val.'">'.short($val).'</td>';
}
// hero
@@ -167,13 +180,13 @@ for ($i = $unit_start; $i <= $unit_end; $i++) {
$cl = ($val != 0) ? '' : 'none';
echo '<td class="'.$cl.'">'.$val.'</td>';
echo '<td class="'.$cl.'" title="'.$val.'">'.short($val).'</td>';
}
$heroTotal = $unit_total['hero'];
$cl = ($heroTotal != 0) ? '' : 'none';
echo '<td class="'.$cl.'">'.$heroTotal.'</td>';
echo '<td class="'.$cl.'" title="'.$heroVal.'">'.short($heroVal).'</td>';
?>
</tr>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB