From 8d04e9f9f8618c33b10228962f27eeccf34c3207 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Wed, 16 May 2012 13:17:48 -0700 Subject: More tweaks to the achievements page --- css/maps.css | 4 +++ pages/achievements.php | 91 ++++++++++++-------------------------------------- 2 files changed, 25 insertions(+), 70 deletions(-) diff --git a/css/maps.css b/css/maps.css index 3032c34..cbc0a3b 100644 --- a/css/maps.css +++ b/css/maps.css @@ -151,6 +151,10 @@ background: url(../images/OverlayTileFaceted30.png); } +.grid_td_active { + background: url(../images/OverlayTileFaceted30.png); +} + .grid_td_start { background: url(../images/OverlayStart50b.png); background-color: #fbfefb; diff --git a/pages/achievements.php b/pages/achievements.php index 191473e..4b508eb 100644 --- a/pages/achievements.php +++ b/pages/achievements.php @@ -370,21 +370,27 @@ function displayUnlockItem($uType, $item) { $unlockTitle = "$item[name]"; $border = 'border: 1px solid #000; border-width: 2px 0px 2px 0px;'; + $border = 'border: 1px solid #000;'; + $class = 'grid_td_walls'; switch ($uType) { case 1: - if ($GLOBALS['wallColor'] == $item[value]) - $border = 'border: 2px solid #26b;'; - $r .= ""; + if ($GLOBALS['wallColor'] == $item[value]) { + $class = 'grid_td_active'; + $border = 'border: 1px solid #26b;'; + } + $r .= ""; break; case 2: - if ($GLOBALS['wallEmblem'] == $item[value]) - $border = 'border: 2px solid #26b;'; + if ($GLOBALS['wallEmblem'] == $item[value]) { + $class = 'grid_td_active'; + $border = 'border: 1px solid #26b;'; + } $r .= " -
"; +
"; break; case 3: if ($GLOBALS['nameColor'] == $item[value]) - $border = 'border: 2px solid #26b;'; + $border = 'border: 1px solid #26b;'; $r .= ""; $r .= " $item[name] "; $r .= ""; @@ -394,10 +400,10 @@ function displayUnlockItem($uType, $item) { } - if (isset($unlocks)) { echo "

Unlocks

"; + //Define some names $uTypeNames[1] = "Wall Colors"; $uTypeNames[2] = "Emblems"; $uTypeNames[3] = "Username Colors"; @@ -408,17 +414,20 @@ if (isset($unlocks)) { $uSubtypeNames[2][0] = "Simple"; $uSubtypeNames[2][1] = "Complicated"; + //For every unlock type that the user has. foreach ($unlocks as $uType => $unlock) { $subtype = array(); echo "

$uTypeNames[$uType] unlocked:

"; foreach ($unlock as $item) { - $subtype[$item['subtype']] .= displayUnlockItem($uType, $item); + $subtype[$item['subtype']][] = displayUnlockItem($uType, $item); + if ((sizeof($subtype[$item['subtype']]) + 1) % 14 == 0) + $subtype[$item['subtype']][] = ''; } - $uSubtypeNames[$uType][0]; - echo "
"; + echo "
"; foreach($subtype as $key => $content) { + $content = implode($content); $tmpName = $uSubtypeNames[$uType][$key]; if (count($subtype) > 1) echo "
$tmpName"; @@ -429,65 +438,7 @@ if (isset($unlocks)) { } -echo "

"; - -//!! Depreciated -//Type 1; wall unlocks: -if (isset($unlocks[1]) AND 1 == 2) { - - echo "

Wall colors unlocked:

-
"; - //Default color: - echo ""; - foreach ($unlocks[1] as $item) { - echo displayUnlockItem(1, $item); - //echo ""; - } - echo "
"; - echo ""; -} -//Type 2; emblem unlocks: -if (isset($unlocks[2]) AND 1 == 2) { - - //Default Emblem - $subtype[0] = " -
"; - foreach ($unlocks[2] as $item) { - $subtype[$item['subtype']] .= " -
"; - } - echo "

Emblems unlocked:

"; - if ($subtype[0] !== '') { - echo "Simple"; - echo "$subtype[0] -
"; - } - if ($subtype[1] !== '') { - echo "Complicated"; - echo "$subtype[1] -
"; - } -} -//Type 3; display-name color unlocks. -if (isset($unlocks[3]) AND 1 == 2) { - echo "

Username colors unlocked:

"; - echo "
"; - - echo ""; - echo "Default"; - echo ""; - - foreach ($unlocks[3] as $item) { - echo ""; - echo " $item[name] "; - echo ""; - } - - echo "
"; - echo "
"; -} +echo "
"; if (!$viewer) { -- cgit v1.2.3