diff --git a/public/css/dk.css b/public/css/dk.css index 8fe8704..297dce3 100644 --- a/public/css/dk.css +++ b/public/css/dk.css @@ -117,3 +117,49 @@ a:hover { background-color: #eeeeee; font: 10px verdana; } + +.move-compass { + width: 128px; + height: 128px; + display: flex; + flex-direction: column; + background-image: url('/img/compass.webp'); + margin: 0.5rem auto; +} + +.move-compass div.mid { + display: flex; +} + +.move-compass button { + background-color: transparent; + border: none; + color: transparent; /* Hide the text */ + background-size: cover; /* Ensure the background image fills the button */ + cursor: pointer; +} + +.move-compass button:hover { + background-color: rgba(225, 16, 16, 0.5); +} + +.move-compass button.north { + width: 128px; + height: 40px; +} + +.move-compass button.west { + width: 63px; + height: 50px; +} + +.move-compass button.east { + width: 63px; + height: 50px; +} + +.move-compass button.south { + width: 128px; + height: 38px; +} + diff --git a/public/img/compass.webp b/public/img/compass.webp new file mode 100644 index 0000000..7a51782 Binary files /dev/null and b/public/img/compass.webp differ diff --git a/public/img/compass_01.gif b/public/img/compass_01.gif deleted file mode 100644 index b10ff4d..0000000 Binary files a/public/img/compass_01.gif and /dev/null differ diff --git a/public/img/compass_02.gif b/public/img/compass_02.gif deleted file mode 100644 index 27eb65f..0000000 Binary files a/public/img/compass_02.gif and /dev/null differ diff --git a/public/img/compass_03.gif b/public/img/compass_03.gif deleted file mode 100644 index 5bec95f..0000000 Binary files a/public/img/compass_03.gif and /dev/null differ diff --git a/public/img/compass_04.gif b/public/img/compass_04.gif deleted file mode 100644 index 0bcc342..0000000 Binary files a/public/img/compass_04.gif and /dev/null differ diff --git a/src/explore.php b/src/explore.php index 9264d7b..a39b67c 100644 --- a/src/explore.php +++ b/src/explore.php @@ -10,10 +10,17 @@ function move() $latitude = $userrow["latitude"]; $longitude = $userrow["longitude"]; - if (isset($_POST["north"])) { $latitude++; if ($latitude > $controlrow["gamesize"]) { $latitude = $controlrow["gamesize"]; } } - if (isset($_POST["south"])) { $latitude--; if ($latitude < ($controlrow["gamesize"]*-1)) { $latitude = ($controlrow["gamesize"]*-1); } } - if (isset($_POST["east"])) { $longitude++; if ($longitude > $controlrow["gamesize"]) { $longitude = $controlrow["gamesize"]; } } - if (isset($_POST["west"])) { $longitude--; if ($longitude < ($controlrow["gamesize"]*-1)) { $longitude = ($controlrow["gamesize"]*-1); } } + + $form = validate($_POST, [ + 'direction' => ['in:north,west,east,south'] + ]); + if (!$form['valid']) display(ul_from_validate_errors($form['errors']), 'Move Error'); + $d = $form['data']['direction']; + + if ($d === 'north') { $latitude++; if ($latitude > $controlrow["gamesize"]) { $latitude = $controlrow["gamesize"]; } } + if ($d === 'south') { $latitude--; if ($latitude < ($controlrow["gamesize"]*-1)) { $latitude = ($controlrow["gamesize"]*-1); } } + if ($d === 'east') { $longitude++; if ($longitude > $controlrow["gamesize"]) { $longitude = $controlrow["gamesize"]; } } + if ($d === 'west') { $longitude--; if ($longitude < ($controlrow["gamesize"]*-1)) { $longitude = ($controlrow["gamesize"]*-1); } } $town = get_town_by_xy($longitude, $latitude); if ($town !== false) { diff --git a/src/lib.php b/src/lib.php index bd5183f..85b4b3a 100644 --- a/src/lib.php +++ b/src/lib.php @@ -2,8 +2,8 @@ require_once __DIR__ . '/database.php'; -define('VERSION', '1.1.11'); -define('BUILD', ''); +define('VERSION', '1.2.3'); +define('BUILD', 'Reawaken'); define('START', microtime(true)); /** diff --git a/templates/leftnav.php b/templates/leftnav.php index 6097ad8..4637711 100644 --- a/templates/leftnav.php +++ b/templates/leftnav.php @@ -1,23 +1,20 @@ -