Affiche les techno dans l'arbre des technos (la disruption) #6
@ -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])) {
|
||||
|
@ -18,15 +18,20 @@
|
||||
</tbody></table></div>
|
||||
</div>
|
||||
|
||||
{*} <div{if $defaut == 'technologies'} class="hightlight"{/if}><a href="{$menu.arbre}&q=technologies&r={$raceAff}">Technologies</a>
|
||||
<div{if $defaut == 'technologies'} class="hightlight"{/if}><a href="{$menu.arbre}&q=technologies&r={$raceAff}">Technologies</a>
|
||||
<div><table><thead>
|
||||
<tr><th>Technologies (niveau)</th><th>Technologies nécessaires (niveau actuel)</th></tr>
|
||||
</thead><tbody>
|
||||
<tr><th>Branche</th><th>Technologies (niveau)</th><th>Technologies nécessaires (niveau actuel)</th></tr>
|
||||
</thead><tbody>
|
||||
{counter start=0 assign=branche print=false}
|
||||
{foreach from=$technologies item=technologie}
|
||||
<tr><td><a href="?p=description&t={$technologie.id}&r={$raceAff}#menu">{$technologie.nom}</a> ({$technologie.niveau}) :</td><td>{$technologie.etat}</td></tr>
|
||||
{foreach from=$technologies[$branche] item=technologie}
|
||||
{assign var="id" value=$technologie.id}
|
||||
<tr><td>{$LANG[$raceAff].technologies.branches.$branche|ucfirst}</td><td><a href="?p=description&b={$branche}&t={$id}&r={$raceAff}#menu">{$LANG[$raceAff].technologies.noms_sing.$branche.$id|ucfirst}</a> ({$technologie.niveau}/{$technologie.niveau_max}) :</td><td>{$technologie.etat}</td></tr>
|
||||
{/foreach}
|
||||
{counter}
|
||||
{/foreach}
|
||||
</tbody></table></div>
|
||||
</div>{/*}
|
||||
</div>
|
||||
|
||||
<div{if $defaut == 'caserne'} class="hightlight"{/if}><a href="{$menu.arbre}&q=caserne&r={$raceAff}">{$LANG[$raceAff].batiments.noms_sing.9|ucfirst}</a>
|
||||
<div><table><thead>
|
||||
@ -58,4 +63,4 @@
|
||||
</tbody></table></div>
|
||||
</div>
|
||||
</div>
|
||||
{include file='game/footer.tpl'}
|
||||
{include file='game/footer.tpl'}
|
||||
|
Loading…
Reference in New Issue
Block a user