changeset 35:d4fef95c2f3e misc

Misc. improvements.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 18 Apr 2009 06:25:13 +0000
parents 6be1a542ade0
children e12b34c8fde2
files materials/alloy.php materials/index.php
diffstat 2 files changed, 36 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/materials/alloy.php	Sat Apr 18 06:24:32 2009 +0000
+++ b/materials/alloy.php	Sat Apr 18 06:25:13 2009 +0000
@@ -24,29 +24,40 @@
   <td rowspan="3" style="background: black; border: 1px solid white; color: red; padding: 8px;">
    Only 2-material alloys are supported by this browser. It is known, that there are
    at least SOME 3-material alloys, and naturally the "all but one" of given
-   material class combination.
-   There may be bugs and lots of combinations are not researched yet.
-   If you notice any inaccuracies, contact <b>Ggr</b>@Bat.
+   material class combination. There may be bugs and lots of combinations are not researched yet.
+   <br />
+   <b>You can now help! We have a <a href="submit.php">submission form</a>.</b>
   </td>
  </tr>
  <tr>
   <td class="icenter">
    <select name="o">
 <?
-$typeTable = $transTable[14];
-ksort($typeTable);
-reset($typeTable);
-$showOnlySet = FALSE;
-while (list($key, $value) = each($typeTable)) {
+$typeTable = array(
+  0  => array("Organic + cloth (sewing)",      0, 1),
+  1  => array("Wood + bone (carpentry)",       5, 3),
+  2  => array("Metal + alloy (blacksmithing)", 4, 7),
+  3  => array("Stone (masonry)",               6, -1),
+  4  => array("Gem (gemcutting)",              10, -1),
+  5  => array("Inorganic (sculpture)",         8, -1),
+  6  => array("Glass (glassblowing)",          9, -1),
+
+  7  => array("Organic",                       0, -1),
+  8  => array("Wood",                          5, -1),
+  9  => array("Metal",                         4, -1),
+
+  10 => array("Cloth",                         -1, 1),
+  11 => array("Bone",                          -1, 3),
+  12 => array("Alloy",                         -1, 7),
+);
+
+foreach ($typeTable as $key => $value) {
   echo "    <option value=\"$key\"";
-  if ($showOnly == $key) {
+  if ($showOnly == $key)
     echo " selected=\"selected\"";
-    $showOnlySet = TRUE;
-  }
-  echo ">".htmlentities($value)."</option>\n";
+  echo ">".htmlentities($value[0])."</option>\n";
 }
 
-
 ?>
    </select>
   </td>
@@ -121,7 +132,7 @@
 } else {
   $currTable = array();
   foreach ($matTable as $key => $value) {
-    if ($value[14] == $showOnly)
+    if ($value[14] == $typeTable[$showOnly][1] || $value[14] == $typeTable[$showOnly][2])
       $currTable[$key] = $value;
   }
 
@@ -137,7 +148,11 @@
   foreach ($currTable as $mat1 => $value) {
     echo " <tr><th>".matLink($mat1)."</th>\n";
     foreach ($currTable as $mat2 => $v) {
-      echo "<td>";
+      if ($mat1 == $mat2)
+        echo "<th>";
+      else
+        echo "<td>";
+      
       if (isset($alloyTable[$mat1][$mat2])) {
         echo matLink($alloyTable[$mat1][$mat2]);
       } else if (isset($alloyTable[$mat2][$mat1])) {
@@ -145,7 +160,10 @@
       } else {
         echo "-";
       }
-      echo "</td>";
+      if ($mat1 == $mat2)
+        echo "</th>";
+      else
+        echo "</td>";
     }  
     echo "</tr>\n";
   }
--- a/materials/index.php	Sat Apr 18 06:24:32 2009 +0000
+++ b/materials/index.php	Sat Apr 18 06:25:13 2009 +0000
@@ -78,7 +78,7 @@
  <tr>
   <th>Hide columns</th>
   <th>Show only type</th>
-  <td rowspan="3" style="background: black; border: 1px solid white; color: red;">
+  <td rowspan="3" style="background: black; border: 1px solid white; color: red; padding: 8px;">
    There may be bugs. If you notice any inaccuracies, contact <b>Ggr</b>@Bat.
    <ul>
     <li>You can sort by any column by clicking on the column name. Clicking again will change
@@ -86,6 +86,7 @@
     <li>Filtering to show only certain type of materials is possible.</li>
     <li>Columns can be disabled from the filtering list (shift or ctrl with mouse click to select several)</li>
    </ul>
+   There's also a very preliminary alpha version of <a href="alloy.php">alloy browser</a> available.
   </td>
  </tr>
  <tr>