changeset 309:c5e63ca351eb misc

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 29 Dec 2015 07:58:43 +0200
parents 809e2a1c64eb
children b82fc05fbd4a
files materials/info.php
diffstat 1 files changed, 24 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/materials/info.php	Tue Dec 29 06:30:59 2015 +0200
+++ b/materials/info.php	Tue Dec 29 07:58:43 2015 +0200
@@ -76,7 +76,7 @@
    td.hits20, .hits20 { background: #0c0; color: black; }
    td.hits10, .hits10 { background: #080; }
    td.hits5, .hits5  { background: #750; }
-   td.hits0, .hits0  { background: #420; }
+   td.hits0, .hits0  { background: #a00; }
    td.nohits, .nohits { background: black; }
    td.impossible { background: black; color: #f00; text-align: center; }
  </style>
@@ -210,37 +210,44 @@
 
 /*
     $typeMats = array();
-    foreach ($matDataTable as $name => $data) {
+    foreach ($matDataTable as $name => $data)
+    {
       if ($data[14] == $matDataTable[$setShowMat][14] && $name != $setShowMat)
         $typeMats[] = $name;
     }
 
-    echo "Full mix: ";
+    echo "<p>Full mix: ";
     if (list($a, $b) = each($typeMats))
       echo stGetMatLink($b);
         
     while (list($a, $b) = each($typeMats))
       echo " <b>+</b> ".stGetMatLink($b);
-    echo "<br />\n";
+    echo "</p>\n";
 */
 
     echo "<h3>Mixtable</h3>\n";
     if (count($alloyTable[$setShowMat]) > 0)
     {
       echo
-      "<table class=\"matTable\">".
-      " <tr>\n".
-      "  <th>+</th>\n";
+        "<table class=\"matTable\">".
+        " <tr>\n".
+        "  <th>+</th>\n";
+
       foreach ($alloyTable[$setShowMat] as $key => $value)
       {
         echo "<th>".stGetMatLink($key)."</th>\n";
       }
-      echo " </tr>\n".
-      " <tr><th>".chentities($setShowMat)."</th>";
+
+      echo
+        " </tr>\n".
+        " <tr><th>".chentities($setShowMat)."</th>";
+
       foreach ($alloyTable[$setShowMat] as $key => $value)
-      if (list($a, $b) = each($value))
       {
-        echo "<td ".stGetValueStyle($b).">".stGetMatLink($a)."</td>";
+        if (list($a, $b) = each($value))
+        {
+          echo "<td ".stGetValueStyle($b).">".stGetMatLink($a)."</td>";
+        }
       }
       echo "</tr></table>\n";
     }
@@ -278,6 +285,7 @@
       $currTable[$from] = $currTable[$to];
       $currTable[$to] = $tmp;
     }
+    
     if (count($str) > 0)
     {
       echo "<p>Swapped rows: ".implode(", ", $str)."</p>\n";
@@ -343,6 +351,7 @@
         }
         else
           echo "<td class=\"nohits\" title=\"Not researched\">?</td>";
+        
         $total++;
       }
       else
@@ -356,11 +365,12 @@
   //
   // Calculate some statistics
   //
+  $researchValue /= $researched * 15.0;
+  if ($researchValue > 1.0)
+    $researchValue = 1.0;
+
   $total /= 2;
   $researched /= 2;
-  $researchValue /= $total * 12.0;
-  if ($researchValue > 1.0)
-    $researchValue = 1.0;
 
   printf(
     "</table>\n".