forked from halo-battle/game
Affiche les techno dans l'arbre technologique (ce qui n'était pas le cas, rigolo vu son nom)
This commit is contained in:
parent
977a27f991
commit
6112a55cc0
2 changed files with 45 additions and 19 deletions
|
|
@ -43,19 +43,40 @@ if (SURFACE == "asteroide") {
|
|||
$template->assign('batiments', $TEMP_liste);
|
||||
}
|
||||
|
||||
/*
|
||||
$TEMP_technologies = array();
|
||||
$nb = count($technolo);
|
||||
for ($id=0 ; $id<$nb ; $id++) {
|
||||
if (!empty($technolo[$id])) $TEMP_technologies[] = array(
|
||||
'id' => $id,
|
||||
'nom' => $technolo[$id],
|
||||
'niveau' => $planete->technologies[$id],
|
||||
'etat' => readDeblok($technoloTECH[$id], $planete)
|
||||
);
|
||||
}
|
||||
$template->assign('technologies',$TEMP_technologies);
|
||||
*/
|
||||
|
||||
function traiterBrancheTechnologie($TEMP_liste, $branche, $i)
|
||||
{
|
||||
global $LANG, $planete;
|
||||
|
||||
foreach ($i as $key => $id) {
|
||||
if (is_array($id)) {
|
||||
$TEMP_liste = traiterBrancheTechnologie($TEMP_liste, $branche, $id);
|
||||
} else {
|
||||
$niveau = dTechnologies::niveau_du_joueur($branche, $id, $planete);
|
||||
$niveau_max = dTechnologies::niveau_max($branche, $id, $planete, $LANG);
|
||||
|
||||
$object = array($branche, $id);
|
||||
$TEMP_liste[$branche][$id] = array(
|
||||
'id' => $id,
|
||||
'branche' => $branche,
|
||||
'niveau' => $niveau,
|
||||
'niveau_max' => $niveau_max,
|
||||
'etat' => dTechnologies::needed($object, $planete, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
return $TEMP_liste;
|
||||
}
|
||||
|
||||
$TEMP_liste = array();
|
||||
$branche = 0;
|
||||
while ($branche < 9) {
|
||||
$TEMP_liste[$branche] = array();
|
||||
$TEMP_liste = traiterBrancheTechnologie($TEMP_liste, $branche, dTechnologies::type($branche, $planete->race));
|
||||
$branche++;
|
||||
}
|
||||
$template->assign('technologies', $TEMP_liste);
|
||||
|
||||
$TEMP_liste = array();
|
||||
foreach ($planete->casernes as $id => $unite) {
|
||||
if (!empty($LANG[$race]["caserne"]["noms_sing"][$id])) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue