diff options
-rw-r--r-- | css/maps.css | 89 | ||||
-rw-r--r-- | includes/maps.php | 55 | ||||
-rw-r--r-- | index.php | 6 | ||||
-rw-r--r-- | pages/challengelist.php | 29 | ||||
-rw-r--r-- | pages/gallery.php | 26 |
5 files changed, 197 insertions, 8 deletions
diff --git a/css/maps.css b/css/maps.css index 48d3ab5..9975fc1 100644 --- a/css/maps.css +++ b/css/maps.css @@ -6,6 +6,95 @@ color:#FF2222;
}
+.map_thumbnail {
+ border: 1px solid #ff5;
+ border-spacing: 1px;
+ background-size: 100%;
+}
+.map_thumbnail td {
+ width:4px;
+ height:4px;
+ border: 0px solid #000;
+ padding: 4px;
+ margin: 0px;
+ background-size: 100%;
+}
+.map_thumbnail .o {
+ background-color:#ccc;
+
+}
+/* CHECKPOINTS */
+.map_thumbnail .c {
+ background-image: url(../images/OverlayA50.png);
+ background-color: #F777FF;
+}
+.map_thumbnail .c2 {
+ background-image: url(../images/OverlayB50.png);
+ background-color: #FFFF11;
+}
+.map_thumbnail .c3 {
+ background-image: url(../images/OverlayC50.png);
+ background-color: #FF4466;
+}
+.map_thumbnail .c4 {
+ background-image: url(../images/OverlayD50.png);
+ background-color: #ff9911;
+}
+.map_thumbnail .c5 {
+ background-image: url(../images/OverlayE50.png);
+ background-color: #00FFFF;
+}
+
+.map_thumbnail .t {
+ background-image: url(../images/TeleportInW.png);
+ background-color: #3377AA;
+}
+.map_thumbnail .t2 {
+ background-image: url(../images/TeleportIn.png);
+ background-color: #44EE66;
+}
+.map_thumbnail .t3 {
+ background-image: url(../images/TeleportInW.png);
+ background-color: #992200;
+}
+.map_thumbnail .t4 {
+ background-image: url(../images/TeleportIn.png);
+ background-color: #55CCFF;
+}
+.map_thumbnail .t5 {
+ background-image: url(../images/TeleportInW.png);
+ background-color: #005533;
+}
+.map_thumbnail .u {
+ background-image: url(../images/TeleportOutW.png);
+ background-color: #3377AA;
+}
+.map_thumbnail .u2 {
+ background-image: url(../images/TeleportOut.png);
+ background-color: #44EE66;
+}
+.map_thumbnail .u3 {
+ background-image: url(../images/TeleportOutW.png);
+ background-color: #992200;
+}
+.map_thumbnail .u4 {
+ background-image: url(../images/TeleportOut.png);
+ background-color: #55CCFF;
+}
+.map_thumbnail .u5 {
+ background-image: url(../images/TeleportOutW.png);
+ background-color: #005533;
+}
+
+
+
+
+/* grid stuff */
+
+
+
+
+
.grid_dsp_data {
padding:1px;
font-weight:bold;
diff --git a/includes/maps.php b/includes/maps.php index 1df258d..6a831c8 100644 --- a/includes/maps.php +++ b/includes/maps.php @@ -285,6 +285,61 @@ function DisplayMap($mapMatrix, $idprefix = 1, $style = 'normal', $speed = NULL) return $output;
}
+
+//This requires the map as an object.
+function DisplayMapThumbnail($map, $link = false) {
+ $r = ''; //Prepare our return value:
+
+ if ($link)
+ $r .= "<table style='cursor:pointer' onclick='document.location.href=\"$link\"' class='map_thumbnail'>";
+ else
+ $r .= "<table class='map_thumbnail'>";
+
+ for ($y = 0; $y < $map->height; $y++) { //Number of Rows
+ $r .= "<tr>";
+ for ($x = 0; $x < $map->width; $x++) { //Number of Columns
+ $value = $map->tiles[$y][$x][TileValue];
+ $type = $map->tiles[$y][$x][TileType];
+ switch($type) {
+ case TileEmpty:
+ $r .= "<td class='o'></td>";
+ //$r .= "<td class='grid_td'></td>";
+ break;
+ case TileCheckpoint:
+ $r .= "<td class='$type$value'></td>";
+ //$r .= "<td class='c'></td>";
+ break;
+ case TileRock:
+ $r .= "<td class='grid_td_rocks'></td>";
+ //$r .= "<td style='background-color:#c33; width:4px; height:4px;'></td>";
+ break;
+ case TileStart:
+ $r .= "<td class='grid_td_start'></td>";
+ //$r .= "<td style='background-color:#2c2; width:4px; height:4px;'></td>";
+ break;
+ case TileFinish:
+ $r .= "<td class='grid_td_finish'></td>";
+ //$r .= "<td style='background-color:#666; width:4px; height:4px;'></td>";
+ break;
+ case TileTeleportIn:
+ $r .= "<td class='$type$value'></td>";
+ //$r .= "<td style='background-color:#666; width:4px; height:4px;'></td>";
+ break;
+ case TileTeleportOut:
+ $r .= "<td class='$type$value'></td>";
+ //$r .= "<td style='background-color:#666; width:4px; height:4px;'></td>";
+ break;
+ }
+ }
+ $r .= "</tr>";
+ }
+ $r .= "</table>";
+
+ return $r;
+}
+
+
+
//Generates map
function GenerateMap($rows, $cols, $rockchance, $numBlocks = -1, $cp = -1, $tp = -1, $mapName = '') {
@@ -50,9 +50,9 @@ $footerLinks['#top'] = "Back to Top"; // if ($accepted) {
// $footerLinks['cp'] = "Settings";
// }
-if (isset($_SESSION['isAdmin']) && $_SESSION['isAdmin'] == true) {
- $footerLinks['admin'] = 'Admin';
-}
+// if (isset($_SESSION['isAdmin']) && $_SESSION['isAdmin'] == true) {
+ // $footerLinks['admin'] = 'Admin';
+// }
//
diff --git a/pages/challengelist.php b/pages/challengelist.php index 03dfdb3..eb9993d 100644 --- a/pages/challengelist.php +++ b/pages/challengelist.php @@ -8,17 +8,20 @@ include_once ('./includes/maps.php'); include_once ('./includes/mapoftheday.php'); include_once ('./includes/db.inc.php'); include_once ('./includes/datas.php'); +include_once ('./includes/mapclass.php'); topbar($Links); ?> + <div id="challengelist_wrapper" class="wrapper"> <? //Check that the user is allowed to do the challenges if (!$accepted) { - echo "<center>Please <a href='login'>login</a> to do the challenges!</div>"; + echo "<center>Please <a href='login'>login</a> to do the challenges!</center>"; + echo "<br /><br /></div>"; htmlFooter(); return; } @@ -42,6 +45,7 @@ $challengeListResultset = loadChallengeListing($userID); displayChallengeList($challengeListResultset); ?> + </div> <?php @@ -57,18 +61,22 @@ function displayChallengeList($challengeListResultset) echo '<div id="challengelist">'; $currentTier = -1; $currentMap = -1; + while($challenge = mysql_fetch_array($challengeListResultset)) { //Each challenge gets its own header/table + // echo "<br>L: $currentTier<br>N: "; + // echo $challenge["challengeTier"]; + // echo "<br>"; if($challenge["challengeTier"] != $currentTier) { if($currentTier >= 0) { - echo '</table>'; + echo '</table>EndTier'; } $currentTier = $challenge["challengeTier"]; echo "<div class='challengelist_tier'>Tier $currentTier</div>"; - echo "<table class='challengelist_table'>"; + echo "<table class='challengelist_table'>\n"; } //Each map gets it own row @@ -79,10 +87,20 @@ function displayChallengeList($challengeListResultset) echo '</td></tr>'; } $currentMap = $challenge["mapID"]; - $mapName = $challenge["name"]; + + $mapCode = getMapCode($currentMap); + $map = new map($mapCode); + $thumbnail = DisplayMapThumbnail($map); + + $mapName = $map->name; if($mapName == NULL || $mapName == "") $mapName = "(unknown)"; - echo "<tr><td class='challengelist_link'><a href='challenge?mapID=$currentMap'>$mapName</a></td>"; + + echo "<tr style='border:2px solid red;'> + <td class='challengelist_link' style='cursor:pointer' onclick='document.location.href=\"challenge?mapID=$currentMap\"'> + $thumbnail + <a href='challenge?mapID=$currentMap'>$mapName</a> + </td>"; echo "<td class='challengelist_stars'>"; } @@ -94,5 +112,6 @@ function displayChallengeList($challengeListResultset) echo "<div class='$cssClass'></div>"; } echo "</td></tr></table>"; + echo "</div>"; } ?>
\ No newline at end of file diff --git a/pages/gallery.php b/pages/gallery.php index 9df059a..f8e1b9d 100644 --- a/pages/gallery.php +++ b/pages/gallery.php @@ -54,6 +54,32 @@ $myparams['name'] = 'Round and Round'; $map = GenerateShapedMap($spin, $myparams); +include('./includes/mapclass.php'); + +$mapCode = GenerateMapCode($map); +echo $mapCode; +echo "<br>"; +echo "<br>"; + +$mapClass = new map($mapCode); +echo DisplayMapThumbnail($mapClass); + +echo "<br>"; +echo "<br>"; +echo $mapClass->width; +echo "<br>"; +echo $mapClass; +echo "<br>"; +echo "<br>"; +var_dump($mapClass); +echo "<br>"; +echo TileStart; +echo TileFinish; +echo "<br>"; + +exit; + + echo DisplayMap($map, 2); //addNewChallengeMap($map, 0, 0, 'Round and Round'); |