Mercurial > hg > batmud > materials
comparison info.php @ 5:a2cb596c8332
Clean up the full alloy mix computation a bit.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 03 Jan 2016 03:47:03 +0200 |
parents | 11e9da68c9c4 |
children | 1c3060b27133 |
comparison
equal
deleted
inserted
replaced
4:11e9da68c9c4 | 5:a2cb596c8332 |
---|---|
280 // | 280 // |
281 // No alloy combos known, show "generic" formula | 281 // No alloy combos known, show "generic" formula |
282 // | 282 // |
283 echo "<p>No known alloy combinations.</p>\n"; | 283 echo "<p>No known alloy combinations.</p>\n"; |
284 | 284 |
285 $typeMats = []; | 285 // Make a list of materials that match the desired material type |
286 $mats = []; | |
286 foreach ($matDataTable as $name => $data) | 287 foreach ($matDataTable as $name => $data) |
287 { | 288 { |
288 if ($data[14] == $matDataTable[$setShowMat][14] && $name != $setShowMat) | 289 if ($data[14] == $matDataTable[$setShowMat][14] && $name != $setShowMat) |
289 $typeMats[] = $name; | 290 $mats[] = stGetMatLink($name); |
290 } | 291 } |
291 | 292 |
292 echo "<p>Full mix: "; | 293 echo "<p>Full mix: ".implode(" <b>+</b> ", $mats)." = ".stGetMatLink($setShowMat)."</p>\n"; |
293 if (list($a, $b) = each($typeMats)) | |
294 echo stGetMatLink($b); | |
295 | |
296 while (list($a, $b) = each($typeMats)) | |
297 echo " <b>+</b> ".stGetMatLink($b); | |
298 echo "</p>\n"; | |
299 } | 294 } |
300 | 295 |
301 // | 296 // |
302 // Show mix table for this material | 297 // Show mix table for this material |
303 // | 298 // |